summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/include/fdrm/fx_crypt.h4
-rw-r--r--core/include/fpdfapi/fpdf_module.h6
-rw-r--r--core/include/fpdfapi/fpdf_objects.h72
-rw-r--r--core/include/fpdfapi/fpdf_page.h26
-rw-r--r--core/include/fpdfapi/fpdf_pageobj.h28
-rw-r--r--core/include/fpdfapi/fpdf_parser.h200
-rw-r--r--core/include/fpdfapi/fpdf_render.h28
-rw-r--r--core/include/fpdfapi/fpdf_resource.h142
-rw-r--r--core/include/fpdfapi/fpdf_serial.h28
-rw-r--r--core/include/fpdfdoc/fpdf_ap.h12
-rw-r--r--core/include/fpdfdoc/fpdf_doc.h170
-rw-r--r--core/include/fpdfdoc/fpdf_tagged.h10
-rw-r--r--core/include/fpdfdoc/fpdf_vt.h48
-rw-r--r--core/include/fpdftext/fpdf_text.h26
-rw-r--r--core/include/fxcodec/fx_codec.h40
-rw-r--r--core/include/fxcodec/fx_codec_provider.h12
-rw-r--r--core/include/fxcrt/fx_arb.h6
-rw-r--r--core/include/fxcrt/fx_basic.h118
-rw-r--r--core/include/fxcrt/fx_coordinates.h70
-rw-r--r--core/include/fxcrt/fx_ext.h8
-rw-r--r--core/include/fxcrt/fx_stream.h66
-rw-r--r--core/include/fxcrt/fx_string.h4
-rw-r--r--core/include/fxcrt/fx_system.h9
-rw-r--r--core/include/fxcrt/fx_ucd.h12
-rw-r--r--core/include/fxcrt/fx_xml.h30
-rw-r--r--core/include/fxge/fpf.h4
-rw-r--r--core/include/fxge/fx_dib.h118
-rw-r--r--core/include/fxge/fx_font.h78
-rw-r--r--core/include/fxge/fx_ge.h138
-rw-r--r--core/include/fxge/fx_ge_apple.h8
-rw-r--r--core/include/fxge/fx_ge_win32.h6
-rw-r--r--core/include/thirdparties/libjpeg/jmorecfg.h10
-rw-r--r--core/include/thirdparties/libjpeg/jpegint.h6
-rw-r--r--core/include/thirdparties/libjpeg/jpeglib.h52
-rw-r--r--core/src/fdrm/crypto/fx_crypt.cpp4
-rw-r--r--core/src/fdrm/crypto/fx_crypt_aes.cpp2
-rw-r--r--core/src/fdrm/crypto/fx_crypt_sha.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_basic_module.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_edit/editint.h14
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp8
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp244
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp38
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp24
-rw-r--r--core/src/fpdfapi/fpdf_font/font_int.h34
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp152
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp138
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.h10
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp30
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp316
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp28
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp138
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp44
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp8
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp98
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp78
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp50
-rw-r--r--core/src/fpdfapi/fpdf_page/pageint.h70
-rw-r--r--core/src/fpdfapi/fpdf_parser/filters_int.h14
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp50
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp30
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp210
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp16
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp60
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp112
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp1056
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp38
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp164
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp38
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp186
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp180
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp64
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp110
-rw-r--r--core/src/fpdfapi/fpdf_render/render_int.h162
-rw-r--r--core/src/fpdfdoc/doc_action.cpp4
-rw-r--r--core/src/fpdfdoc/doc_annot.cpp32
-rw-r--r--core/src/fpdfdoc/doc_ap.cpp96
-rw-r--r--core/src/fpdfdoc/doc_basic.cpp20
-rw-r--r--core/src/fpdfdoc/doc_form.cpp164
-rw-r--r--core/src/fpdfdoc/doc_formcontrol.cpp36
-rw-r--r--core/src/fpdfdoc/doc_formfield.cpp200
-rw-r--r--core/src/fpdfdoc/doc_metadata.cpp2
-rw-r--r--core/src/fpdfdoc/doc_ocg.cpp72
-rw-r--r--core/src/fpdfdoc/doc_tagged.cpp36
-rw-r--r--core/src/fpdfdoc/doc_utils.cpp54
-rw-r--r--core/src/fpdfdoc/doc_utils.h8
-rw-r--r--core/src/fpdfdoc/doc_viewerPreferences.cpp8
-rw-r--r--core/src/fpdfdoc/doc_vt.cpp290
-rw-r--r--core/src/fpdfdoc/pdf_vt.h72
-rw-r--r--core/src/fpdfdoc/tagged_int.h14
-rw-r--r--core/src/fpdftext/fpdf_text.cpp50
-rw-r--r--core/src/fpdftext/fpdf_text_int.cpp352
-rw-r--r--core/src/fpdftext/fpdf_text_search.cpp46
-rw-r--r--core/src/fpdftext/text_int.h60
-rw-r--r--core/src/fpdftext/txtproc.h10
-rw-r--r--core/src/fxcodec/codec/codec_int.h42
-rw-r--r--core/src/fxcodec/codec/fx_codec.cpp58
-rw-r--r--core/src/fxcodec/codec/fx_codec_fax.cpp86
-rw-r--r--core/src/fxcodec/codec/fx_codec_flate.cpp54
-rw-r--r--core/src/fxcodec/codec/fx_codec_icc.cpp30
-rw-r--r--core/src/fxcodec/codec/fx_codec_jbig.cpp24
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpeg.cpp108
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpx_opj.cpp44
-rw-r--r--core/src/fxcodec/jbig2/JBig2_BitStream.h4
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Context.cpp30
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Context.h4
-rw-r--r--core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp114
-rw-r--r--core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h40
-rw-r--r--core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp10
-rw-r--r--core/src/fxcodec/jbig2/JBig2_HuffmanTable.h10
-rw-r--r--core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h30
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Image.cpp60
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Image.h26
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Page.h2
-rw-r--r--core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp2
-rw-r--r--core/src/fxcodec/jbig2/JBig2_SymbolDict.h2
-rw-r--r--core/src/fxcrt/extension.h112
-rw-r--r--core/src/fxcrt/fx_arabic.cpp12
-rw-r--r--core/src/fxcrt/fx_arabic.h8
-rw-r--r--core/src/fxcrt/fx_basic_array.cpp44
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp4
-rw-r--r--core/src/fxcrt/fx_basic_buffer.cpp48
-rw-r--r--core/src/fxcrt/fx_basic_coords.cpp36
-rw-r--r--core/src/fxcrt/fx_basic_gcc.cpp4
-rw-r--r--core/src/fxcrt/fx_basic_maps.cpp52
-rw-r--r--core/src/fxcrt/fx_basic_util.cpp80
-rw-r--r--core/src/fxcrt/fx_basic_wstring.cpp4
-rw-r--r--core/src/fxcrt/fx_extension.cpp28
-rw-r--r--core/src/fxcrt/fx_unicode.cpp12
-rw-r--r--core/src/fxcrt/fx_xml_parser.cpp102
-rw-r--r--core/src/fxcrt/fxcrt_platforms.cpp40
-rw-r--r--core/src/fxcrt/fxcrt_platforms.h8
-rw-r--r--core/src/fxcrt/fxcrt_posix.cpp38
-rw-r--r--core/src/fxcrt/fxcrt_posix.h8
-rw-r--r--core/src/fxcrt/fxcrt_windows.cpp40
-rw-r--r--core/src/fxcrt/fxcrt_windows.h8
-rw-r--r--core/src/fxcrt/xml_int.h38
-rw-r--r--core/src/fxge/agg/include/fx_agg_driver.h38
-rw-r--r--core/src/fxge/agg/src/fx_agg_driver.cpp164
-rw-r--r--core/src/fxge/android/fpf_skiafont.cpp30
-rw-r--r--core/src/fxge/android/fpf_skiafont.h6
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.cpp28
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.h4
-rw-r--r--core/src/fxge/android/fx_android_font.cpp24
-rw-r--r--core/src/fxge/android/fx_android_font.h10
-rw-r--r--core/src/fxge/apple/apple_int.h50
-rw-r--r--core/src/fxge/apple/fx_apple_platform.cpp26
-rw-r--r--core/src/fxge/apple/fx_mac_imp.cpp6
-rw-r--r--core/src/fxge/apple/fx_quartz_device.cpp146
-rw-r--r--core/src/fxge/dib/dib_int.h6
-rw-r--r--core/src/fxge/dib/fx_dib_composite.cpp142
-rw-r--r--core/src/fxge/dib/fx_dib_convert.cpp116
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp72
-rw-r--r--core/src/fxge/dib/fx_dib_main.cpp246
-rw-r--r--core/src/fxge/dib/fx_dib_transform.cpp32
-rw-r--r--core/src/fxge/ge/fx_ge_device.cpp94
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp72
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp120
-rw-r--r--core/src/fxge/ge/fx_ge_linux.cpp20
-rw-r--r--core/src/fxge/ge/fx_ge_path.cpp68
-rw-r--r--core/src/fxge/ge/fx_ge_ps.cpp64
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp94
-rw-r--r--core/src/fxge/ge/text_int.h12
-rw-r--r--core/src/fxge/skia/fx_skia_blitter_new.cpp18
-rw-r--r--core/src/fxge/skia/fx_skia_blitter_new.h8
-rw-r--r--core/src/fxge/skia/fx_skia_device.cpp102
-rw-r--r--core/src/fxge/skia/fx_skia_device.h38
-rw-r--r--core/src/fxge/win32/dwrite_int.h6
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp198
-rw-r--r--core/src/fxge/win32/fx_win32_dib.cpp12
-rw-r--r--core/src/fxge/win32/fx_win32_dwrite.cpp18
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp90
-rw-r--r--core/src/fxge/win32/fx_win32_print.cpp86
-rw-r--r--core/src/fxge/win32/win32_int.h94
-rw-r--r--fpdfsdk/include/formfiller/FFL_CheckBox.h8
-rw-r--r--fpdfsdk/include/formfiller/FFL_ComboBox.h16
-rw-r--r--fpdfsdk/include/formfiller/FFL_FormFiller.h56
-rw-r--r--fpdfsdk/include/formfiller/FFL_IFormFiller.h52
-rw-r--r--fpdfsdk/include/formfiller/FFL_ListBox.h8
-rw-r--r--fpdfsdk/include/formfiller/FFL_Notify.h46
-rw-r--r--fpdfsdk/include/formfiller/FFL_PushButton.h2
-rw-r--r--fpdfsdk/include/formfiller/FFL_RadioButton.h8
-rw-r--r--fpdfsdk/include/formfiller/FFL_TextField.h14
-rw-r--r--fpdfsdk/include/formfiller/FFL_Utils.h2
-rw-r--r--fpdfsdk/include/fsdk_actionhandler.h48
-rw-r--r--fpdfsdk/include/fsdk_annothandler.h100
-rw-r--r--fpdfsdk/include/fsdk_baseannot.h28
-rw-r--r--fpdfsdk/include/fsdk_baseform.h106
-rw-r--r--fpdfsdk/include/fsdk_define.h4
-rw-r--r--fpdfsdk/include/fsdk_mgr.h88
-rw-r--r--fpdfsdk/include/fsdk_rendercontext.h2
-rw-r--r--fpdfsdk/include/fx_systemhandler.h18
-rw-r--r--fpdfsdk/include/fxedit/fx_edit.h164
-rw-r--r--fpdfsdk/include/fxedit/fxet_edit.h224
-rw-r--r--fpdfsdk/include/fxedit/fxet_list.h64
-rw-r--r--fpdfsdk/include/javascript/Document.h162
-rw-r--r--fpdfsdk/include/javascript/Field.h172
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h58
-rw-r--r--fpdfsdk/include/javascript/Icon.h2
-rw-r--r--fpdfsdk/include/javascript/JS_Context.h62
-rw-r--r--fpdfsdk/include/javascript/JS_Define.h10
-rw-r--r--fpdfsdk/include/javascript/JS_EventHandler.h80
-rw-r--r--fpdfsdk/include/javascript/JS_GlobalData.h6
-rw-r--r--fpdfsdk/include/javascript/JS_Object.h14
-rw-r--r--fpdfsdk/include/javascript/JS_Runtime.h12
-rw-r--r--fpdfsdk/include/javascript/JS_Value.h18
-rw-r--r--fpdfsdk/include/javascript/PublicMethods.h68
-rw-r--r--fpdfsdk/include/javascript/app.h70
-rw-r--r--fpdfsdk/include/javascript/color.h28
-rw-r--r--fpdfsdk/include/javascript/console.h8
-rw-r--r--fpdfsdk/include/javascript/event.h40
-rw-r--r--fpdfsdk/include/javascript/global.h18
-rw-r--r--fpdfsdk/include/javascript/report.h4
-rw-r--r--fpdfsdk/include/javascript/util.h10
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Button.h6
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Caret.h10
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ComboBox.h22
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Edit.h52
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_EditCtrl.h30
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_FontMap.h6
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Icon.h4
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_IconList.h28
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ListBox.h26
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ListCtrl.h2
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Note.h64
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ScrollBar.h26
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Signature.h12
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_SpecialButton.h20
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Utils.h14
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Wnd.h82
-rw-r--r--fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp2
-rw-r--r--fpdfsdk/src/formfiller/FFL_CheckBox.cpp38
-rw-r--r--fpdfsdk/src/formfiller/FFL_ComboBox.cpp66
-rw-r--r--fpdfsdk/src/formfiller/FFL_FormFiller.cpp190
-rw-r--r--fpdfsdk/src/formfiller/FFL_IFormFiller.cpp248
-rw-r--r--fpdfsdk/src/formfiller/FFL_ListBox.cpp40
-rw-r--r--fpdfsdk/src/formfiller/FFL_Notify.cpp90
-rw-r--r--fpdfsdk/src/formfiller/FFL_PushButton.cpp2
-rw-r--r--fpdfsdk/src/formfiller/FFL_RadioButton.cpp42
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp58
-rw-r--r--fpdfsdk/src/formfiller/FFL_Utils.cpp10
-rw-r--r--fpdfsdk/src/fpdf_dataavail.cpp4
-rw-r--r--fpdfsdk/src/fpdf_ext.cpp20
-rw-r--r--fpdfsdk/src/fpdf_flatten.cpp24
-rw-r--r--fpdfsdk/src/fpdf_progressive.cpp6
-rw-r--r--fpdfsdk/src/fpdf_sysfontinfo.cpp22
-rw-r--r--fpdfsdk/src/fpdf_transformpage.cpp28
-rw-r--r--fpdfsdk/src/fpdfdoc.cpp22
-rw-r--r--fpdfsdk/src/fpdfeditimg.cpp14
-rw-r--r--fpdfsdk/src/fpdfeditpage.cpp22
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp30
-rw-r--r--fpdfsdk/src/fpdfppo.cpp64
-rw-r--r--fpdfsdk/src/fpdfsave.cpp22
-rw-r--r--fpdfsdk/src/fpdftext.cpp4
-rw-r--r--fpdfsdk/src/fpdfview.cpp54
-rw-r--r--fpdfsdk/src/fsdk_actionhandler.cpp136
-rw-r--r--fpdfsdk/src/fsdk_annothandler.cpp138
-rw-r--r--fpdfsdk/src/fsdk_baseannot.cpp76
-rw-r--r--fpdfsdk/src/fsdk_baseform.cpp248
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp166
-rw-r--r--fpdfsdk/src/fsdk_rendercontext.cpp4
-rw-r--r--fpdfsdk/src/fxedit/fxet_ap.cpp2
-rw-r--r--fpdfsdk/src/fxedit/fxet_edit.cpp468
-rw-r--r--fpdfsdk/src/fxedit/fxet_list.cpp106
-rw-r--r--fpdfsdk/src/fxedit/fxet_pageobjs.cpp10
-rw-r--r--fpdfsdk/src/javascript/Document.cpp474
-rw-r--r--fpdfsdk/src/javascript/Field.cpp880
-rw-r--r--fpdfsdk/src/javascript/Icon.cpp6
-rw-r--r--fpdfsdk/src/javascript/JS_Context.cpp64
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp102
-rw-r--r--fpdfsdk/src/javascript/JS_GlobalData.cpp24
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp68
-rw-r--r--fpdfsdk/src/javascript/JS_Value.cpp34
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp376
-rw-r--r--fpdfsdk/src/javascript/app.cpp178
-rw-r--r--fpdfsdk/src/javascript/color.cpp24
-rw-r--r--fpdfsdk/src/javascript/console.cpp18
-rw-r--r--fpdfsdk/src/javascript/event.cpp140
-rw-r--r--fpdfsdk/src/javascript/global.cpp68
-rw-r--r--fpdfsdk/src/javascript/report.cpp8
-rw-r--r--fpdfsdk/src/javascript/util.cpp46
-rw-r--r--fpdfsdk/src/jsapi/fxjs_v8.cpp6
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Button.cpp14
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Caret.cpp22
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp100
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Edit.cpp228
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp108
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_FontMap.cpp18
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Icon.cpp8
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_IconList.cpp60
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Label.cpp2
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListBox.cpp80
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp8
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Note.cpp194
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp94
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Signature.cpp20
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp36
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Utils.cpp104
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Wnd.cpp94
299 files changed, 9809 insertions, 9800 deletions
diff --git a/core/include/fdrm/fx_crypt.h b/core/include/fdrm/fx_crypt.h
index f4f9b9e8c7..f820999b28 100644
--- a/core/include/fdrm/fx_crypt.h
+++ b/core/include/fdrm/fx_crypt.h
@@ -16,7 +16,7 @@ extern "C" {
void CRYPT_ArcFourCryptBlock(uint8_t* data, FX_DWORD size, const uint8_t* key, FX_DWORD keylen);
void CRYPT_ArcFourSetup(void* context, const uint8_t* key, FX_DWORD length);
void CRYPT_ArcFourCrypt(void* context, uint8_t* data, FX_DWORD size);
-void CRYPT_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DWORD keylen, bool bEncrypt);
+void CRYPT_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DWORD keylen, FX_BOOL bEncrypt);
void CRYPT_AESSetIV(void* context, const uint8_t* iv);
void CRYPT_AESDecrypt(void* context, uint8_t* dest, const uint8_t* src, FX_DWORD size);
void CRYPT_AESEncrypt(void* context, uint8_t* dest, const uint8_t* src, FX_DWORD size);
@@ -40,7 +40,7 @@ void CRYPT_SHA512Start(void* context);
void CRYPT_SHA512Update(void* context, const uint8_t* data, FX_DWORD size);
void CRYPT_SHA512Finish(void* context, uint8_t digest[64]);
void CRYPT_SHA512Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[64]);
-void CRYPT_SetPubKeyDecryptor(bool (*func)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len));
+void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len));
#ifdef __cplusplus
};
diff --git a/core/include/fpdfapi/fpdf_module.h b/core/include/fpdfapi/fpdf_module.h
index b6f8de0c9f..5877e11372 100644
--- a/core/include/fpdfapi/fpdf_module.h
+++ b/core/include/fpdfapi/fpdf_module.h
@@ -60,9 +60,9 @@ public:
void InitRenderModule();
- void SetDownloadCallback(bool (*callback)(const FX_CHAR* module_name));
+ void SetDownloadCallback(FX_BOOL (*callback)(const FX_CHAR* module_name));
- bool DownloadModule(const FX_CHAR* module_name);
+ FX_BOOL DownloadModule(const FX_CHAR* module_name);
void NotifyModuleAvailable(const FX_CHAR* module_name);
@@ -110,7 +110,7 @@ private:
nonstd::unique_ptr<IPDF_RenderModule> m_pRenderModule;
nonstd::unique_ptr<IPDF_PageModule> m_pPageModule;
- bool (*m_pDownloadCallback)(const FX_CHAR* module_name);
+ FX_BOOL (*m_pDownloadCallback)(const FX_CHAR* module_name);
CFX_MapByteStringToPtr m_SecurityHandlerMap;
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h
index 8d954ff719..45b7cc63cb 100644
--- a/core/include/fpdfapi/fpdf_objects.h
+++ b/core/include/fpdfapi/fpdf_objects.h
@@ -57,9 +57,9 @@ public:
return m_GenNum;
}
- bool IsIdentical(CPDF_Object* pObj) const;
+ FX_BOOL IsIdentical(CPDF_Object* pObj) const;
- CPDF_Object* Clone(bool bDirect = false) const;
+ CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const;
CPDF_Object* CloneRef(CPDF_IndirectObjects* pObjs) const;
@@ -88,9 +88,9 @@ public:
int GetDirectType() const;
- bool IsModified() const
+ FX_BOOL IsModified() const
{
- return false;
+ return FALSE;
}
protected:
CPDF_Object(FX_DWORD type) : m_Type(type), m_ObjNum(0), m_GenNum(0) { }
@@ -108,27 +108,27 @@ protected:
friend class CPDF_SyntaxParser;
private:
CPDF_Object(const CPDF_Object& src) {}
- CPDF_Object* CloneInternal(bool bDirect, CFX_MapPtrToPtr* visited) const;
+ CPDF_Object* CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const;
};
class CPDF_Boolean : public CPDF_Object
{
public:
- static CPDF_Boolean* Create(bool value)
+ static CPDF_Boolean* Create(FX_BOOL value)
{
return new CPDF_Boolean(value);
}
CPDF_Boolean() : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(false) { }
- CPDF_Boolean(bool value) : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(value) { }
+ CPDF_Boolean(FX_BOOL value) : CPDF_Object(PDFOBJ_BOOLEAN), m_bValue(value) { }
- bool Identical(CPDF_Boolean* pOther) const
+ FX_BOOL Identical(CPDF_Boolean* pOther) const
{
return m_bValue == pOther->m_bValue;
}
protected:
- bool m_bValue;
+ FX_BOOL m_bValue;
friend class CPDF_Object;
};
class CPDF_Number : public CPDF_Object
@@ -150,14 +150,14 @@ public:
return new CPDF_Number(str);
}
- static CPDF_Number* Create(bool bInteger, void* pData)
+ static CPDF_Number* Create(FX_BOOL bInteger, void* pData)
{
return new CPDF_Number(bInteger, pData);
}
CPDF_Number() : CPDF_Object(PDFOBJ_NUMBER), m_bInteger(false), m_Integer(0) { }
- CPDF_Number(bool bInteger, void* pData);
+ CPDF_Number(FX_BOOL bInteger, void* pData);
CPDF_Number(int value);
@@ -165,13 +165,13 @@ public:
CPDF_Number(const CFX_ByteStringC& str);
- bool Identical(CPDF_Number* pOther) const;
+ FX_BOOL Identical(CPDF_Number* pOther) const;
CFX_ByteString GetString() const;
void SetString(const CFX_ByteStringC& str);
- bool IsInteger() const
+ FX_BOOL IsInteger() const
{
return m_bInteger;
}
@@ -199,7 +199,7 @@ public:
}
protected:
- bool m_bInteger;
+ FX_BOOL m_bInteger;
union {
@@ -213,7 +213,7 @@ class CPDF_String : public CPDF_Object
{
public:
- static CPDF_String* Create(const CFX_ByteString& str, bool bHex = false)
+ static CPDF_String* Create(const CFX_ByteString& str, FX_BOOL bHex = FALSE)
{
return new CPDF_String(str, bHex);
}
@@ -223,9 +223,9 @@ public:
return new CPDF_String(str);
}
- CPDF_String() : CPDF_Object(PDFOBJ_STRING), m_bHex(false) { }
+ CPDF_String() : CPDF_Object(PDFOBJ_STRING), m_bHex(FALSE) { }
- CPDF_String(const CFX_ByteString& str, bool bHex = false)
+ CPDF_String(const CFX_ByteString& str, FX_BOOL bHex = FALSE)
: CPDF_Object(PDFOBJ_STRING), m_String(str), m_bHex(bHex) {
}
@@ -236,12 +236,12 @@ public:
return m_String;
}
- bool Identical(CPDF_String* pOther) const
+ FX_BOOL Identical(CPDF_String* pOther) const
{
return m_String == pOther->m_String;
}
- bool IsHex() const
+ FX_BOOL IsHex() const
{
return m_bHex;
}
@@ -249,7 +249,7 @@ protected:
CFX_ByteString m_String;
- bool m_bHex;
+ FX_BOOL m_bHex;
friend class CPDF_Object;
};
class CPDF_Name : public CPDF_Object
@@ -280,7 +280,7 @@ public:
return m_Name;
}
- bool Identical(CPDF_Name* pOther) const
+ FX_BOOL Identical(CPDF_Name* pOther) const
{
return m_Name == pOther->m_Name;
}
@@ -378,7 +378,7 @@ public:
AddNumber(value);
}
- bool Identical(CPDF_Array* pOther) const;
+ FX_BOOL Identical(CPDF_Array* pOther) const;
protected:
~CPDF_Array();
@@ -419,7 +419,7 @@ public:
int GetInteger(const CFX_ByteStringC& key, int default_int) const;
- bool GetBoolean(const CFX_ByteStringC& key, bool bDefault = false) const;
+ FX_BOOL GetBoolean(const CFX_ByteStringC& key, FX_BOOL bDefault = FALSE) const;
FX_FLOAT GetNumber(const CFX_ByteStringC& key) const;
@@ -439,7 +439,7 @@ public:
}
- bool KeyExist(const CFX_ByteStringC& key) const;
+ FX_BOOL KeyExist(const CFX_ByteStringC& key) const;
FX_POSITION GetStartPos() const;
@@ -478,7 +478,7 @@ public:
void SetAtMatrix(const CFX_ByteStringC& key, const CFX_AffineMatrix& matrix);
- void SetAtBoolean(const CFX_ByteStringC& key, bool bValue);
+ void SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue);
@@ -487,7 +487,7 @@ public:
void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey);
- bool Identical(CPDF_Dictionary* pDict) const;
+ FX_BOOL Identical(CPDF_Dictionary* pDict) const;
int GetCount() const
{
@@ -519,15 +519,15 @@ public:
return m_pDict;
}
- void SetData(const uint8_t* pData, FX_DWORD size, bool bCompressed, bool bKeepBuf);
+ void SetData(const uint8_t* pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf);
void InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict);
void InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict);
- bool Identical(CPDF_Stream* pOther) const;
+ FX_BOOL Identical(CPDF_Stream* pOther) const;
- CPDF_StreamFilter* GetStreamFilter(bool bRaw = false) const;
+ CPDF_StreamFilter* GetStreamFilter(FX_BOOL bRaw = FALSE) const;
@@ -536,15 +536,15 @@ public:
return m_dwSize;
}
- bool ReadRawData(FX_FILESIZE start_pos, uint8_t* pBuf, FX_DWORD buf_size) const;
+ FX_BOOL ReadRawData(FX_FILESIZE start_pos, uint8_t* pBuf, FX_DWORD buf_size) const;
- bool IsMemoryBased() const
+ FX_BOOL IsMemoryBased() const
{
return m_GenNum == (FX_DWORD) - 1;
}
- CPDF_Stream* Clone(bool bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const;
+ CPDF_Stream* Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const;
protected:
~CPDF_Stream();
@@ -579,8 +579,8 @@ public:
~CPDF_StreamAcc();
- void LoadAllData(const CPDF_Stream* pStream, bool bRawAccess = false,
- FX_DWORD estimated_size = 0, bool bImageAcc = false);
+ void LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess = FALSE,
+ FX_DWORD estimated_size = 0, FX_BOOL bImageAcc = FALSE);
const CPDF_Stream* GetStream() const
{
@@ -613,7 +613,7 @@ protected:
FX_DWORD m_dwSize;
- bool m_bNewBuf;
+ FX_BOOL m_bNewBuf;
CFX_ByteString m_ImageDecoder;
@@ -691,7 +691,7 @@ public:
void SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
- bool Identical(CPDF_Reference* pOther) const
+ FX_BOOL Identical(CPDF_Reference* pOther) const
{
return m_RefObjNum == pOther->m_RefObjNum;
}
diff --git a/core/include/fpdfapi/fpdf_page.h b/core/include/fpdfapi/fpdf_page.h
index 2fc9de8566..bd8b5c9878 100644
--- a/core/include/fpdfapi/fpdf_page.h
+++ b/core/include/fpdfapi/fpdf_page.h
@@ -28,12 +28,12 @@ class CPDF_StreamContentParser;
class CPDF_PageObjects
{
public:
- CPDF_PageObjects(bool bReleaseMembers = true);
+ CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE);
~CPDF_PageObjects();
void ContinueParse(IFX_Pause* pPause);
- bool IsParsed() const
+ FX_BOOL IsParsed() const
{
return m_ParseState == CONTENT_PARSED;
}
@@ -76,7 +76,7 @@ public:
void Transform(const CFX_AffineMatrix& matrix);
- bool BackgroundAlphaNeeded() const
+ FX_BOOL BackgroundAlphaNeeded() const
{
return m_bBackgroundAlphaNeeded;
}
@@ -106,8 +106,8 @@ protected:
void ClearCacheObjects();
CFX_PtrList m_ObjectList;
- bool m_bBackgroundAlphaNeeded;
- bool m_bReleaseMembers;
+ FX_BOOL m_bBackgroundAlphaNeeded;
+ FX_BOOL m_bReleaseMembers;
CPDF_ContentParser* m_pParser;
ParseState m_ParseState;
};
@@ -120,11 +120,11 @@ public:
~CPDF_Page();
- void Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, bool bPageCache = true);
+ void Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache = TRUE);
- void StartParse(CPDF_ParseOptions* pOptions = NULL, bool bReParse = false);
+ void StartParse(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);
- void ParseContent(CPDF_ParseOptions* pOptions = NULL, bool bReParse = false);
+ void ParseContent(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);
void GetDisplayMatrix(CFX_AffineMatrix& matrix, int xPos, int yPos,
int xSize, int ySize, int iRotate) const;
@@ -177,13 +177,13 @@ public:
CPDF_ParseOptions();
- bool m_bTextOnly;
+ FX_BOOL m_bTextOnly;
- bool m_bMarkedContent;
+ FX_BOOL m_bMarkedContent;
- bool m_bSeparateForm;
+ FX_BOOL m_bSeparateForm;
- bool m_bDecodeInlineImage;
+ FX_BOOL m_bDecodeInlineImage;
};
class CPDF_Form : public CPDF_PageObjects
{
@@ -206,7 +206,7 @@ class CPDF_PageContentGenerate
public:
CPDF_PageContentGenerate(CPDF_Page* pPage);
~CPDF_PageContentGenerate();
- bool InsertPageObject(CPDF_PageObject* pPageObject);
+ FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject);
void GenerateContent();
void TransformContent(CFX_Matrix& matrix);
protected:
diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h
index c140de6c82..73540a3eb3 100644
--- a/core/include/fpdfapi/fpdf_pageobj.h
+++ b/core/include/fpdfapi/fpdf_pageobj.h
@@ -88,7 +88,7 @@ public:
m_pObject->AppendRect(left, bottom, right, top);
}
- bool IsRect() const
+ FX_BOOL IsRect() const
{
return m_pObject->IsRect();
}
@@ -147,7 +147,7 @@ public:
CFX_FloatRect GetClipBox() const;
- void AppendPath(CPDF_Path path, int type, bool bAutoMerge);
+ void AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);
void DeletePath(int layer_index);
@@ -292,15 +292,15 @@ public:
int m_RenderIntent;
- bool m_StrokeAdjust;
+ FX_BOOL m_StrokeAdjust;
- bool m_AlphaSource;
+ FX_BOOL m_AlphaSource;
- bool m_TextKnockout;
+ FX_BOOL m_TextKnockout;
- bool m_StrokeOP;
+ FX_BOOL m_StrokeOP;
- bool m_FillOP;
+ FX_BOOL m_FillOP;
int m_OPMode;
@@ -325,7 +325,7 @@ public:
return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL;
}
- int GetAlpha(bool bStroke) const
+ int GetAlpha(FX_BOOL bStroke) const
{
return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255) : 255;
}
@@ -362,7 +362,7 @@ public:
return m_pParam;
}
- inline bool HasMCID() const;
+ inline FX_BOOL HasMCID() const;
inline void SetName(const CFX_ByteString& name)
{
@@ -402,7 +402,7 @@ public:
int GetMCID() const;
- void AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, bool bDictNeedClone);
+ void AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDictNeedClone);
void DeleteLastMark();
private:
@@ -418,9 +418,9 @@ public:
return m_pObject ? m_pObject->GetMCID() : -1;
}
- bool HasMark(const CFX_ByteStringC& mark) const;
+ FX_BOOL HasMark(const CFX_ByteStringC& mark) const;
- bool LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const;
+ FX_BOOL LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const;
};
#define PDFPAGE_TEXT 1
@@ -461,7 +461,7 @@ public:
void RemoveClipPath();
- void AppendClipPath(CPDF_Path path, int type, bool bAutoMerge);
+ void AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);
void CopyClipPath(CPDF_PageObject* pObj);
@@ -629,7 +629,7 @@ public:
int m_FillType;
- bool m_bStroke;
+ FX_BOOL m_bStroke;
CFX_AffineMatrix m_Matrix;
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index 7a43947384..a856433a08 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -86,9 +86,9 @@ public:
int GetPageIndex(FX_DWORD objnum);
- FX_DWORD GetUserPermissions(bool bCheckRevision = false) const;
+ FX_DWORD GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const;
- bool IsOwner() const;
+ FX_BOOL IsOwner() const;
@@ -112,14 +112,14 @@ public:
void ClearRenderFont();
- bool IsFormStream(FX_DWORD objnum, bool& bForm) const;
+ FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const;
// |pFontDict| must not be null.
CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict);
CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources = NULL);
- CPDF_Pattern* LoadPattern(CPDF_Object* pObj, bool bShading, const CFX_AffineMatrix* matrix = NULL);
+ CPDF_Pattern* LoadPattern(CPDF_Object* pObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix = NULL);
CPDF_Image* LoadImageF(CPDF_Object* pObj);
@@ -129,17 +129,17 @@ public:
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, bool bVert, bool bTranslateName = false);
- CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, bool bVert, bool bTranslateName = false);
+ CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
+ CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
#endif
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- CPDF_Font* AddMacFont(CTFontRef pFont, bool bVert, bool bTranslateName = false);
+ CPDF_Font* AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
#endif
CPDF_Font* AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding);
- CPDF_Font* AddFont(CFX_Font* pFont, int charset, bool bVert);
+ CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert);
void CreateNewDoc();
@@ -161,7 +161,7 @@ protected:
CFX_ByteString m_ID2;
- bool m_bLinearized;
+ FX_BOOL m_bLinearized;
FX_DWORD m_dwFirstPageNo;
@@ -172,8 +172,8 @@ protected:
int _GetPageCount() const;
CPDF_Dictionary* _FindPDFPage(CPDF_Dictionary* pPages, int iPage, int nPagesToGo, int level);
int _FindPageIndex(CPDF_Dictionary* pNode, FX_DWORD& skip_count, FX_DWORD objnum, int& index, int level = 0);
- bool IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict);
- bool CheckOCGVisible(CPDF_Dictionary* pOCG, bool bPrinting);
+ FX_BOOL IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict);
+ FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting);
CPDF_DocPageData* GetValidatePageData();
CPDF_DocRenderData* GetValidateRenderData();
friend class CPDF_Creator;
@@ -204,14 +204,14 @@ public:
CFX_ByteStringC GetWord();
- bool SearchToken(const CFX_ByteStringC& token);
+ FX_BOOL SearchToken(const CFX_ByteStringC& token);
- bool SkipWord(const CFX_ByteStringC& token);
+ FX_BOOL SkipWord(const CFX_ByteStringC& token);
- bool FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token,
+ FX_BOOL FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token,
FX_DWORD& start_pos, FX_DWORD& end_pos);
- bool FindTagParam(const CFX_ByteStringC& token, int nParams);
+ FX_BOOL FindTagParam(const CFX_ByteStringC& token, int nParams);
FX_DWORD GetPos()
{
@@ -252,7 +252,7 @@ public:
m_Pos = pos;
}
- CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL, bool bDecrypt = true);
+ CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL, FX_BOOL bDecrypt = TRUE);
CPDF_Object* GetObjectByStrict(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, struct PARSE_CONTEXT* pContext = NULL);
@@ -271,9 +271,9 @@ public:
void ToNextWord();
- bool SearchWord(const CFX_ByteStringC& word, bool bWholeWord, bool bForward, FX_FILESIZE limit);
+ FX_BOOL SearchWord(const CFX_ByteStringC& word, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit);
- int SearchMultiWord(const CFX_ByteStringC& words, bool bWholeWord, FX_FILESIZE limit);
+ int SearchMultiWord(const CFX_ByteStringC& words, FX_BOOL bWholeWord, FX_FILESIZE limit);
FX_FILESIZE FindTag(const CFX_ByteStringC& tag, FX_FILESIZE limit);
@@ -282,27 +282,27 @@ public:
m_pCryptoHandler = pCryptoHandler;
}
- bool IsEncrypted()
+ FX_BOOL IsEncrypted()
{
return m_pCryptoHandler != NULL;
}
- bool GetCharAt(FX_FILESIZE pos, uint8_t& ch);
+ FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch);
- bool ReadBlock(uint8_t* pBuf, FX_DWORD size);
+ FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size);
- CFX_ByteString GetNextWord(bool& bIsNumber);
+ CFX_ByteString GetNextWord(FX_BOOL& bIsNumber);
protected:
static const int kParserMaxRecursionDepth = 64;
static int s_CurrentRecursionDepth;
- virtual bool GetNextChar(uint8_t& ch);
+ virtual FX_BOOL GetNextChar(uint8_t& ch);
- bool GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch);
+ FX_BOOL GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch);
void GetNextWord();
- bool IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, const uint8_t* tag, FX_DWORD taglen);
+ FX_BOOL IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, const uint8_t* tag, FX_DWORD taglen);
CFX_ByteString ReadString();
@@ -312,7 +312,7 @@ protected:
FX_FILESIZE m_Pos;
- bool m_bFileStream;
+ FX_BOOL m_bFileStream;
int m_MetadataObjnum;
@@ -334,7 +334,7 @@ protected:
FX_DWORD m_WordSize;
- bool m_bIsNumber;
+ FX_BOOL m_bIsNumber;
FX_FILESIZE m_dwWordPos;
friend class CPDF_Parser;
@@ -345,7 +345,7 @@ protected:
#define PDFPARSE_NOSTREAM 2
struct PARSE_CONTEXT {
- bool m_Flags;
+ FX_BOOL m_Flags;
FX_FILESIZE m_DictStart;
@@ -369,15 +369,15 @@ public:
CPDF_Parser();
~CPDF_Parser();
- FX_DWORD StartParse(const FX_CHAR* filename, bool bReParse = false);
- FX_DWORD StartParse(const FX_WCHAR* filename, bool bReParse = false);
- FX_DWORD StartParse(IFX_FileRead* pFile, bool bReParse = false, bool bOwnFileRead = true);
+ FX_DWORD StartParse(const FX_CHAR* filename, FX_BOOL bReParse = FALSE);
+ FX_DWORD StartParse(const FX_WCHAR* filename, FX_BOOL bReParse = FALSE);
+ FX_DWORD StartParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE);
- void CloseParser(bool bReParse = false);
+ void CloseParser(FX_BOOL bReParse = FALSE);
- FX_DWORD GetPermissions(bool bCheckRevision = false);
+ FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE);
- bool IsOwner();
+ FX_BOOL IsOwner();
void SetPassword(const FX_CHAR* password)
{
@@ -399,7 +399,7 @@ public:
return m_Syntax.m_pCryptoHandler;
}
- void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, bool bForced = false);
+ void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, FX_BOOL bForced = FALSE);
CFX_ByteString GetRecipient()
{
@@ -435,7 +435,7 @@ public:
return m_pEncryptDict;
}
- bool IsEncrypted()
+ FX_BOOL IsEncrypted()
{
return GetEncryptDict() != NULL;
}
@@ -443,7 +443,7 @@ public:
CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL) ;
FX_DWORD GetLastObjNum();
- bool IsFormStream(FX_DWORD objnum, bool& bForm);
+ FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm);
FX_FILESIZE GetObjectOffset(FX_DWORD objnum);
@@ -456,12 +456,12 @@ public:
void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size);
- bool GetFileStreamOption()
+ FX_BOOL GetFileStreamOption()
{
return m_Syntax.m_bFileStream;
}
- void SetFileStreamOption(bool b)
+ void SetFileStreamOption(FX_BOOL b)
{
m_Syntax.m_bFileStream = b;
}
@@ -476,7 +476,7 @@ public:
return m_FileVersion;
}
- bool IsXRefStream() const
+ FX_BOOL IsXRefStream() const
{
return m_bXRefStream;
}
@@ -486,7 +486,7 @@ public:
CPDF_Object* ParseIndirectObjectAtByStrict(CPDF_IndirectObjects* pObjList, FX_FILESIZE pos, FX_DWORD objnum,
struct PARSE_CONTEXT* pContext, FX_FILESIZE *pResultPos);
- FX_DWORD StartAsynParse(IFX_FileRead* pFile, bool bReParse = false, bool bOwnFileRead = true);
+ FX_DWORD StartAsynParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE);
FX_DWORD GetFirstPageNo()
{
@@ -496,30 +496,30 @@ protected:
CPDF_Document* m_pDocument;
CPDF_SyntaxParser m_Syntax;
- bool m_bOwnFileRead;
+ FX_BOOL m_bOwnFileRead;
CPDF_Object* ParseDirect(CPDF_Object* pObj);
- bool LoadAllCrossRefV4(FX_FILESIZE pos);
+ FX_BOOL LoadAllCrossRefV4(FX_FILESIZE pos);
- bool LoadAllCrossRefV5(FX_FILESIZE pos);
+ FX_BOOL LoadAllCrossRefV5(FX_FILESIZE pos);
- bool LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bSkip, bool bFirst);
+ FX_BOOL LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip, FX_BOOL bFirst);
- bool LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainXRef);
+ FX_BOOL LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef);
CPDF_Dictionary* LoadTrailerV4();
- bool RebuildCrossRef();
+ FX_BOOL RebuildCrossRef();
FX_DWORD SetEncryptHandler();
void ReleaseEncryptHandler();
- bool LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
+ FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
- bool LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
+ FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
- bool LoadLinearizedAllCrossRefV5(FX_FILESIZE pos);
+ FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos);
FX_DWORD LoadLinearizedMainXRefTable();
@@ -527,7 +527,7 @@ protected:
CPDF_StreamAcc* GetObjectStream(FX_DWORD number);
- bool IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset);
+ FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset);
@@ -540,12 +540,12 @@ protected:
FX_FILESIZE m_LastXRefOffset;
- bool m_bXRefStream;
+ FX_BOOL m_bXRefStream;
CPDF_SecurityHandler* m_pSecurityHandler;
- bool m_bForceUseSecurityHandler;
+ FX_BOOL m_bForceUseSecurityHandler;
CFX_ByteString m_bsRecipient;
@@ -562,7 +562,7 @@ protected:
CFX_WordArray m_ObjVersion;
CFX_ArrayTemplate<CPDF_Dictionary *> m_Trailers;
- bool m_bVersionUpdated;
+ FX_BOOL m_bVersionUpdated;
CPDF_Object* m_pLinearized;
@@ -582,17 +582,17 @@ public:
virtual ~CPDF_SecurityHandler() {}
- virtual bool OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0;
+ virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0;
virtual FX_DWORD GetPermissions() = 0;
- virtual bool IsOwner() = 0;
+ virtual FX_BOOL IsOwner() = 0;
- virtual bool GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen) = 0;
+ virtual FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen) = 0;
- virtual bool IsMetadataEncrypted()
+ virtual FX_BOOL IsMetadataEncrypted()
{
- return true;
+ return TRUE;
}
virtual CPDF_CryptoHandler* CreateCryptoHandler() = 0;
@@ -609,14 +609,14 @@ public:
CPDF_StandardSecurityHandler();
virtual ~CPDF_StandardSecurityHandler();
- virtual bool OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict);
+ virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict);
virtual FX_DWORD GetPermissions();
- virtual bool IsOwner()
+ virtual FX_BOOL IsOwner()
{
return m_bOwner;
}
- virtual bool GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen);
- virtual bool IsMetadataEncrypted();
+ virtual FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen);
+ virtual FX_BOOL IsMetadataEncrypted();
virtual CPDF_CryptoHandler* CreateCryptoHandler();
virtual CPDF_StandardSecurityHandler* GetStandardHandler()
{
@@ -641,8 +641,8 @@ public:
return m_Revision;
}
- int CheckPassword(const uint8_t* password, FX_DWORD pass_size, bool bOwner, uint8_t* key);
- int CheckPassword(const uint8_t* password, FX_DWORD pass_size, bool bOwner, uint8_t* key, int key_len);
+ int CheckPassword(const uint8_t* password, FX_DWORD pass_size, FX_BOOL bOwner, uint8_t* key);
+ int CheckPassword(const uint8_t* password, FX_DWORD pass_size, FX_BOOL bOwner, uint8_t* key, int key_len);
private:
int m_Version;
@@ -653,22 +653,22 @@ private:
CPDF_Dictionary* m_pEncryptDict;
- bool LoadDict(CPDF_Dictionary* pEncryptDict);
- bool LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len);
+ FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict);
+ FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len);
- bool CheckUserPassword(const uint8_t* password, FX_DWORD pass_size,
- bool bIgnoreEncryptMeta, uint8_t* key, int32_t key_len);
+ FX_BOOL CheckUserPassword(const uint8_t* password, FX_DWORD pass_size,
+ FX_BOOL bIgnoreEncryptMeta, uint8_t* key, int32_t key_len);
- bool CheckOwnerPassword(const uint8_t* password, FX_DWORD pass_size, uint8_t* key, int32_t key_len);
- bool AES256_CheckPassword(const uint8_t* password, FX_DWORD size, bool bOwner, uint8_t* key);
- void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, const uint8_t* password, FX_DWORD size, bool bOwner, const uint8_t* key);
- void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, bool bEncryptMetadata, const uint8_t* key);
+ FX_BOOL CheckOwnerPassword(const uint8_t* password, FX_DWORD pass_size, uint8_t* key, int32_t key_len);
+ FX_BOOL AES256_CheckPassword(const uint8_t* password, FX_DWORD size, FX_BOOL bOwner, uint8_t* key);
+ void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, const uint8_t* password, FX_DWORD size, FX_BOOL bOwner, const uint8_t* key);
+ void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, FX_BOOL bEncryptMetadata, const uint8_t* key);
void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
const uint8_t* user_pass, FX_DWORD user_size,
- const uint8_t* owner_pass, FX_DWORD owner_size, bool bDefault, FX_DWORD type);
- bool CheckSecurity(int32_t key_len);
+ const uint8_t* owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type);
+ FX_BOOL CheckSecurity(int32_t key_len);
- bool m_bOwner;
+ FX_BOOL m_bOwner;
FX_DWORD m_Permissions;
@@ -684,20 +684,20 @@ public:
virtual ~CPDF_CryptoHandler() {}
- virtual bool Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler) = 0;
+ virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler) = 0;
virtual FX_DWORD DecryptGetSize(FX_DWORD src_size) = 0;
virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0;
- virtual bool DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;
+ virtual FX_BOOL DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;
- virtual bool DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0;
+ virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0;
virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size) = 0;
- virtual bool EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size,
+ virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size,
uint8_t* dest_buf, FX_DWORD& dest_size) = 0;
void Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str);
@@ -710,22 +710,22 @@ public:
virtual ~CPDF_StandardCryptoHandler();
- bool Init(int cipher, const uint8_t* key, int keylen);
- virtual bool Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler);
+ FX_BOOL Init(int cipher, const uint8_t* key, int keylen);
+ virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler);
virtual FX_DWORD DecryptGetSize(FX_DWORD src_size);
virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum);
- virtual bool DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual bool DecryptFinish(void* context, CFX_BinaryBuf& dest_buf);
+ virtual FX_BOOL DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf);
virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size);
- virtual bool EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size,
+ virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size,
uint8_t* dest_buf, FX_DWORD& dest_size);
protected:
- virtual void CryptBlock(bool bEncrypt, FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size,
+ virtual void CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size,
uint8_t* dest_buf, FX_DWORD& dest_size);
- virtual void* CryptStart(FX_DWORD objnum, FX_DWORD gennum, bool bEncrypt);
- virtual bool CryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, bool bEncrypt);
- virtual bool CryptFinish(void* context, CFX_BinaryBuf& dest_buf, bool bEncrypt);
+ virtual void* CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt);
+ virtual FX_BOOL CryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt);
+ virtual FX_BOOL CryptFinish(void* context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt);
uint8_t m_EncryptKey[32];
@@ -755,7 +755,7 @@ public:
CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig);
CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig);
CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig);
-CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, bool bHex = false);
+CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex = FALSE);
CFX_WideString PDF_DecodeText(const uint8_t* pData, FX_DWORD size, CFX_CharMap* pCharMap = NULL);
inline CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr, CFX_CharMap* pCharMap = NULL) {
return PDF_DecodeText((const uint8_t*)bstr.c_str(), bstr.GetLength(), pCharMap);
@@ -769,12 +769,12 @@ class CFDF_Document : public CPDF_IndirectObjects
{
public:
static CFDF_Document* CreateNewDoc();
- static CFDF_Document* ParseFile(IFX_FileRead *pFile, bool bOwnFile = false);
+ static CFDF_Document* ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile = FALSE);
static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size);
~CFDF_Document();
- bool WriteBuf(CFX_ByteTextBuf& buf) const;
+ FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const;
CPDF_Dictionary* GetRoot() const
{
@@ -785,10 +785,10 @@ public:
protected:
CFDF_Document();
- void ParseStream(IFX_FileRead *pFile, bool bOwnFile);
+ void ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile);
CPDF_Dictionary* m_pRootDict;
IFX_FileRead* m_pFile;
- bool m_bOwnFile;
+ FX_BOOL m_bOwnFile;
};
CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec);
@@ -816,7 +816,7 @@ class IFX_FileAvail
{
public:
virtual ~IFX_FileAvail() { }
- virtual bool IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0;
+ virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0;
};
class IFX_DownloadHints
{
@@ -839,10 +839,10 @@ public:
IFX_FileAvail* GetFileAvail() const { return m_pFileAvail; }
IFX_FileRead* GetFileRead() const { return m_pFileRead; }
- virtual bool IsDocAvail(IFX_DownloadHints* pHints) = 0;
+ virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) = 0;
virtual void SetDocument(CPDF_Document* pDoc) = 0;
- virtual bool IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;
- virtual bool IsLinearized() = 0;
+ virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;
+ virtual FX_BOOL IsLinearized() = 0;
virtual int32_t IsFormAvail(IFX_DownloadHints *pHints) = 0;
virtual int32_t IsLinearizedPDF() = 0;
virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize) = 0;
@@ -859,7 +859,7 @@ public:
void AddObjNum(FX_DWORD dwObjNum);
- bool Find(FX_DWORD dwObjNum);
+ FX_BOOL Find(FX_DWORD dwObjNum);
void RemoveAll()
{
@@ -867,7 +867,7 @@ public:
}
protected:
- bool BinarySearch(FX_DWORD value, int &iNext);
+ FX_BOOL BinarySearch(FX_DWORD value, int &iNext);
protected:
CFX_DWordArray m_number_array;
diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h
index 37e8a540c1..f3590095ad 100644
--- a/core/include/fpdfapi/fpdf_render.h
+++ b/core/include/fpdfapi/fpdf_render.h
@@ -33,9 +33,9 @@ public:
virtual ~IPDF_OCContext() {}
- virtual bool CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0;
+ virtual FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0;
- bool CheckObjectVisible(const CPDF_PageObject* pObj);
+ FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj);
};
#define RENDER_COLOR_NORMAL 0
#define RENDER_COLOR_GRAY 1
@@ -89,10 +89,10 @@ public:
CPDF_RenderContext();
- void Create(CPDF_Page* pPage, bool bFirstLayer = true);
+ void Create(CPDF_Page* pPage, FX_BOOL bFirstLayer = TRUE);
void Create(CPDF_Document* pDoc = NULL, CPDF_PageRenderCache* pPageCache = NULL,
- CPDF_Dictionary* pPageResources = NULL, bool bFirstLayer = true);
+ CPDF_Dictionary* pPageResources = NULL, FX_BOOL bFirstLayer = TRUE);
~CPDF_RenderContext();
@@ -126,7 +126,7 @@ protected:
CFX_ArrayTemplate<struct _PDF_RenderItem> m_ContentList;
- bool m_bFirstLayer;
+ FX_BOOL m_bFirstLayer;
void Render(CFX_RenderDevice* pDevice, const CPDF_PageObject* pStopObj,
const CPDF_RenderOptions* pOptions, const CFX_AffineMatrix* pFinalMatrix);
@@ -192,17 +192,17 @@ public:
const CPDF_RenderOptions* pOptions = NULL
);
- static bool DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+ static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
CPDF_Font* pFont, FX_FLOAT font_size,
const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device,
const CFX_GraphStateData* pGraphState,
FX_ARGB fill_argb, FX_ARGB stroke_argb, CFX_PathData* pClippingPath, int nFlag = 0);
- static bool DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+ static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions);
- static bool DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+ static FX_BOOL DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
FX_ARGB fill_argb);
};
@@ -215,7 +215,7 @@ public:
m_nTimeCount = 0;
m_nCacheSize = 0;
m_pCurImageCache = NULL;
- m_bCurFindCache = false;
+ m_bCurFindCache = FALSE;
m_pCurImageCaches = NULL;
}
~CPDF_PageRenderCache()
@@ -238,7 +238,7 @@ public:
}
void GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor,
- bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false,
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE,
CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0);
void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap);
@@ -249,11 +249,11 @@ public:
}
CFX_MapPtrToPtr m_ImageCaches;
public:
- bool StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdCS = false, FX_DWORD GroupFamily = 0,
- bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL,
+ FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0,
+ FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL,
int32_t downsampleWidth = 0, int32_t downsampleHeight = 0);
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Continue(IFX_Pause* pPause);
CPDF_ImageCache* m_pCurImageCache;
CFX_PtrArray* m_pCurImageCaches;
protected:
@@ -262,7 +262,7 @@ protected:
FX_DWORD m_nTimeCount;
FX_DWORD m_nCacheSize;
- bool m_bCurFindCache;
+ FX_BOOL m_bCurFindCache;
};
class CPDF_RenderConfig
{
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index c60737d36e..5c8cc85217 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -116,7 +116,7 @@ public:
return m_Flags;
}
- virtual bool IsVertWriting()const;
+ virtual FX_BOOL IsVertWriting()const;
@@ -142,14 +142,14 @@ public:
}
- bool IsEmbedded() const
+ FX_BOOL IsEmbedded() const
{
return m_FontType == PDFFONT_TYPE3 || m_pFontFile != NULL;
}
- virtual bool IsUnicodeCompatible() const
+ virtual FX_BOOL IsUnicodeCompatible() const
{
- return false;
+ return FALSE;
}
CPDF_StreamAcc* GetFontFile() const
@@ -162,7 +162,7 @@ public:
return m_pFontDict;
}
- bool IsStandardFont() const;
+ FX_BOOL IsStandardFont() const;
FXFT_Face GetFace() const
{
@@ -199,7 +199,7 @@ public:
- virtual int GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph = NULL) = 0;
+ virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) = 0;
virtual int GlyphFromCharCodeExt(FX_DWORD charcode)
{
return GlyphFromCharCode(charcode);
@@ -265,11 +265,11 @@ public:
protected:
explicit CPDF_Font(int fonttype);
- bool Initialize();
+ FX_BOOL Initialize();
- bool Load();
+ FX_BOOL Load();
- virtual bool _Load() = 0;
+ virtual FX_BOOL _Load() = 0;
virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const = 0;
@@ -278,7 +278,7 @@ protected:
void LoadUnicodeMap();
void LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding,
- CFX_ByteString*& pCharNames, bool bEmbedded, bool bTrueType);
+ CFX_ByteString*& pCharNames, FX_BOOL bEmbedded, FX_BOOL bTrueType);
void LoadFontDescriptor(CPDF_Dictionary*);
@@ -298,7 +298,7 @@ protected:
CPDF_ToUnicodeMap* m_pToUnicodeMap;
- bool m_bToUnicodeLoaded;
+ FX_BOOL m_bToUnicodeLoaded;
@@ -338,7 +338,7 @@ public:
void LoadEncoding(CPDF_Object* pEncoding);
- bool IsIdentical(CPDF_FontEncoding* pAnother) const;
+ FX_BOOL IsIdentical(CPDF_FontEncoding* pAnother) const;
FX_WCHAR UnicodeFromCharCode(uint8_t charcode) const
{
@@ -370,11 +370,11 @@ public:
}
int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override;
- int GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph = NULL) override;
- bool IsUnicodeCompatible() const override;
+ int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) override;
+ FX_BOOL IsUnicodeCompatible() const override;
protected:
- bool LoadCommon();
+ FX_BOOL LoadCommon();
void LoadSubstFont();
@@ -401,7 +401,7 @@ protected:
int m_BaseEncoding;
FX_WORD m_CharWidth[256];
FX_SMALL_RECT m_CharBBox[256];
- bool m_bUseFontWidth;
+ FX_BOOL m_bUseFontWidth;
};
class CPDF_Type1Font : public CPDF_SimpleFont
@@ -416,7 +416,7 @@ public:
}
virtual int GlyphFromCharCodeExt(FX_DWORD charcode);
protected:
- virtual bool _Load();
+ virtual FX_BOOL _Load();
int m_Base14Font;
virtual void LoadGlyphMap();
@@ -427,7 +427,7 @@ public:
CPDF_TrueTypeFont();
protected:
- virtual bool _Load();
+ virtual FX_BOOL _Load();
virtual void LoadGlyphMap();
};
class CPDF_Type3Char
@@ -438,11 +438,11 @@ public:
~CPDF_Type3Char();
- bool LoadBitmap(CPDF_RenderContext* pContext);
+ FX_BOOL LoadBitmap(CPDF_RenderContext* pContext);
- bool m_bColored;
+ FX_BOOL m_bColored;
- bool m_bPageRequired;
+ FX_BOOL m_bPageRequired;
@@ -484,7 +484,7 @@ protected:
CFX_AffineMatrix m_FontMatrix;
private:
- bool _Load() override;
+ FX_BOOL _Load() override;
void LoadGlyphMap() override {}
int m_CharWidthL[256];
@@ -511,13 +511,13 @@ public:
~CPDF_CIDFont() override;
- bool LoadGB2312();
- int GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph = NULL) override;
+ FX_BOOL LoadGB2312();
+ int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) override;
int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) override;
FX_WORD CIDFromCharCode(FX_DWORD charcode) const;
- bool IsTrueType() const
+ FX_BOOL IsTrueType() const
{
return !m_bType1;
}
@@ -533,19 +533,19 @@ public:
}
const uint8_t* GetCIDTransform(FX_WORD CID) const;
- bool IsVertWriting() const override;
+ FX_BOOL IsVertWriting() const override;
short GetVertWidth(FX_WORD CID) const;
void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const;
- bool IsUnicodeCompatible() const override;
- virtual bool IsFontStyleFromCharCode(FX_DWORD charcode) const;
+ FX_BOOL IsUnicodeCompatible() const override;
+ virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const;
protected:
friend class CPDF_Font;
- bool _Load() override;
+ FX_BOOL _Load() override;
FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const override;
FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const override;
- int GetGlyphIndex(FX_DWORD unicodeb, bool *pVertGlyph);
+ int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL *pVertGlyph);
void LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result, int nElements);
void LoadSubstFont();
@@ -553,9 +553,9 @@ protected:
CPDF_CMap* m_pAllocatedCMap;
CPDF_CID2UnicodeMap* m_pCID2UnicodeMap;
int m_Charset;
- bool m_bType1;
+ FX_BOOL m_bType1;
CPDF_StreamAcc* m_pCIDToGIDMap;
- bool m_bCIDIsGID;
+ FX_BOOL m_bCIDIsGID;
FX_WORD m_DefaultWidth;
FX_WORD* m_pAnsiWidths;
FX_SMALL_RECT m_CharBBox[256];
@@ -563,7 +563,7 @@ protected:
short m_DefaultVY;
short m_DefaultW1;
CFX_DWordArray m_VertMetrics;
- bool m_bAdobeCourierStd;
+ FX_BOOL m_bAdobeCourierStd;
CFX_CTTGSUBTable* m_pTTGSUBTable;
};
@@ -612,27 +612,27 @@ public:
max = 1.0f;
}
- bool sRGB() const;
+ FX_BOOL sRGB() const;
- virtual bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const = 0;
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const = 0;
- virtual bool SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+ virtual FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
{
- return false;
+ return FALSE;
}
- bool GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
+ FX_BOOL GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
- bool SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const;
+ FX_BOOL SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const;
virtual void TranslateImageLine(uint8_t* dest_buf, const uint8_t* src_buf, int pixels,
- int image_width, int image_height, bool bTransMask = false) const;
+ int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
CPDF_Array*& GetArray()
{
@@ -646,7 +646,7 @@ public:
return NULL;
}
- virtual void EnableStdConversion(bool bEnabled);
+ virtual void EnableStdConversion(FX_BOOL bEnabled);
CPDF_Document* const m_pDocument;
@@ -659,17 +659,17 @@ protected:
m_dwStdConversion(0) {
}
virtual ~CPDF_ColorSpace() {}
- virtual bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
- return true;
+ return TRUE;
}
- virtual bool v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
+ virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
{
- return false;
+ return FALSE;
}
- virtual bool v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
+ virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
{
- return false;
+ return FALSE;
}
int m_Family;
@@ -692,14 +692,14 @@ public:
~CPDF_Color();
- bool IsNull() const
+ FX_BOOL IsNull() const
{
return m_pBuffer == NULL;
}
- bool IsEqual(const CPDF_Color& other) const;
+ FX_BOOL IsEqual(const CPDF_Color& other) const;
- bool IsPattern() const
+ FX_BOOL IsPattern() const
{
return m_pCS && m_pCS->GetFamily() == PDFCS_PATTERN;
}
@@ -712,7 +712,7 @@ public:
void SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comp, int ncomps);
- bool GetRGB(int& R, int& G, int& B) const;
+ FX_BOOL GetRGB(int& R, int& G, int& B) const;
CPDF_Pattern* GetPattern() const;
@@ -734,7 +734,7 @@ class CPDF_Pattern
public:
virtual ~CPDF_Pattern();
- void SetForceClear(bool bForceClear) { m_bForceClear = bForceClear; }
+ void SetForceClear(FX_BOOL bForceClear) { m_bForceClear = bForceClear; }
CPDF_Object* m_pPatternObj;
@@ -747,7 +747,7 @@ public:
protected:
CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix);
- bool m_bForceClear;
+ FX_BOOL m_bForceClear;
};
class CPDF_TilingPattern : public CPDF_Pattern
@@ -758,11 +758,11 @@ public:
virtual ~CPDF_TilingPattern();
- bool Load();
+ FX_BOOL Load();
- bool m_bColored;
+ FX_BOOL m_bColored;
CFX_FloatRect m_BBox;
@@ -778,17 +778,17 @@ class CPDF_ShadingPattern : public CPDF_Pattern
{
public:
- CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, bool bShading, const CFX_AffineMatrix* parentMatrix);
+ CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix);
virtual ~CPDF_ShadingPattern();
CPDF_Object* m_pShadingObj;
- bool m_bShadingObj;
+ FX_BOOL m_bShadingObj;
- bool Load();
+ FX_BOOL Load();
- bool Reload();
+ FX_BOOL Reload();
int m_ShadingType;
@@ -810,7 +810,7 @@ class CPDF_MeshStream
{
public:
- bool Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS);
+ FX_BOOL Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS);
FX_DWORD GetFlag();
@@ -820,7 +820,7 @@ public:
FX_DWORD GetVertex(CPDF_MeshVertex& vertex, CFX_AffineMatrix* pObject2Bitmap);
- bool GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap);
+ FX_BOOL GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap);
CPDF_Function** m_pFuncs;
CPDF_ColorSpace* m_pCS;
FX_DWORD m_nFuncs, m_nCoordBits, m_nCompBits, m_nFlagBits, m_nComps;
@@ -854,13 +854,13 @@ public:
~CPDF_Image();
- bool LoadImageF(CPDF_Stream* pImageStream, bool bInline);
+ FX_BOOL LoadImageF(CPDF_Stream* pImageStream, FX_BOOL bInline);
void Release();
CPDF_Image* Clone();
- bool IsInline()
+ FX_BOOL IsInline()
{
return m_bInline;
}
@@ -908,17 +908,17 @@ public:
}
- bool IsMask() const
+ FX_BOOL IsMask() const
{
return m_bIsMask;
}
- bool IsInterpol() const
+ FX_BOOL IsInterpol() const
{
return m_bInterpolate;
}
- CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL, FX_DWORD* pMatteColor = NULL, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false) const;
+ CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL, FX_DWORD* pMatteColor = NULL, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE) const;
@@ -931,8 +931,8 @@ public:
void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap);
public:
- bool StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false);
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
+ FX_BOOL Continue(IFX_Pause* pPause);
CFX_DIBSource* DetachBitmap();
CFX_DIBSource* DetachMask();
CFX_DIBSource* m_pDIBSource;
@@ -941,16 +941,16 @@ public:
private:
CPDF_Stream* m_pStream;
- bool m_bInline;
+ FX_BOOL m_bInline;
CPDF_Dictionary* m_pInlineDict;
int32_t m_Height;
int32_t m_Width;
- bool m_bIsMask;
+ FX_BOOL m_bIsMask;
- bool m_bInterpolate;
+ FX_BOOL m_bInterpolate;
CPDF_Document* m_pDocument;
diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/include/fpdfapi/fpdf_serial.h
index 06cf213d99..1877ef8866 100644
--- a/core/include/fpdfapi/fpdf_serial.h
+++ b/core/include/fpdfapi/fpdf_serial.h
@@ -117,35 +117,35 @@ public:
void RemoveSecurity();
- bool Create(const FX_WCHAR* filename, FX_DWORD flags = 0);
+ FX_BOOL Create(const FX_WCHAR* filename, FX_DWORD flags = 0);
- bool Create(const FX_CHAR* filename, FX_DWORD flags = 0);
+ FX_BOOL Create(const FX_CHAR* filename, FX_DWORD flags = 0);
- bool Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
+ FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
int32_t Continue(IFX_Pause *pPause = NULL);
- bool SetFileVersion(int32_t fileVersion = 17);
+ FX_BOOL SetFileVersion(int32_t fileVersion = 17);
protected:
CPDF_Document* m_pDocument;
CPDF_Parser* m_pParser;
- bool m_bCompress;
+ FX_BOOL m_bCompress;
- bool m_bSecurityChanged;
+ FX_BOOL m_bSecurityChanged;
CPDF_Dictionary* m_pEncryptDict;
FX_DWORD m_dwEnryptObjNum;
- bool m_bEncryptCloned;
+ FX_BOOL m_bEncryptCloned;
- bool m_bStandardSecurity;
+ FX_BOOL m_bStandardSecurity;
CPDF_CryptoHandler* m_pCryptoHandler;
- bool m_bNewCrypto;
+ FX_BOOL m_bNewCrypto;
- bool m_bEncryptMetadata;
+ FX_BOOL m_bEncryptMetadata;
CPDF_Object* m_pMetadata;
@@ -154,7 +154,7 @@ protected:
int32_t m_ObjectStreamSize;
FX_DWORD m_dwLastObjNum;
- bool Create(FX_DWORD flags);
+ FX_BOOL Create(FX_DWORD flags);
void ResetStandardSecurity();
void Clear();
int32_t WriteDoc_Stage1(IFX_Pause *pPause);
@@ -170,14 +170,14 @@ protected:
void AppendNewObjNum(FX_DWORD objbum);
int32_t WriteOldIndirectObject(FX_DWORD objnum);
int32_t WriteOldObjs(IFX_Pause *pPause);
- int32_t WriteNewObjs(bool bIncremental, IFX_Pause *pPause);
+ int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause);
int32_t WriteIndirectObj(const CPDF_Object* pObj);
- int32_t WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, bool bEncrypt = true);
+ int32_t WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE);
int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj);
int32_t WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj);
int32_t WriteIndirectObjectToStream(FX_DWORD objnum, const uint8_t* pBuffer, FX_DWORD dwSize);
int32_t AppendObjectNumberToXRef(FX_DWORD objnum);
- void InitID(bool bDefault = true);
+ void InitID(FX_BOOL bDefault = TRUE);
int32_t WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto);
int32_t m_iStage;
diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h
index eb0ca44b64..7cfaed4685 100644
--- a/core/include/fpdfdoc/fpdf_ap.h
+++ b/core/include/fpdfdoc/fpdf_ap.h
@@ -60,7 +60,7 @@ public:
int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex);
- bool IsLatinWord(FX_WORD word);
+ FX_BOOL IsLatinWord(FX_WORD word);
int32_t GetDefaultFontIndex();
private:
@@ -76,20 +76,20 @@ class CPVT_GenerateAP
{
public:
- static bool GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+ static FX_BOOL GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
- static bool GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+ static FX_BOOL GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
- static bool GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+ static FX_BOOL GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
static CFX_ByteString GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator * pIterator,
- const CPDF_Point & ptOffset, bool bContinuous, FX_WORD SubWord = 0, const CPVT_WordRange * pVisible = NULL);
+ const CPDF_Point & ptOffset, FX_BOOL bContinuous, FX_WORD SubWord = 0, const CPVT_WordRange * pVisible = NULL);
static CFX_ByteString GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth,
const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom,
int32_t nStyle, const CPVT_Dash & dash);
- static CFX_ByteString GenerateColorAP(const CPVT_Color & color, const bool & bFillOrStroke);
+ static CFX_ByteString GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke);
};
#endif // CORE_INCLUDE_FPDFDOC_FPDF_AP_H_
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index 36d9d2935a..fc9d3bce87 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -164,26 +164,26 @@ public:
return m_eUsageType;
}
- bool CheckOCGVisible(const CPDF_Dictionary *pOCGDict);
+ FX_BOOL CheckOCGVisible(const CPDF_Dictionary *pOCGDict);
void ResetOCContext();
protected:
- bool LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, bool &bValidConfig) const;
+ FX_BOOL LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, FX_BOOL &bValidConfig) const;
- bool LoadOCGState(const CPDF_Dictionary *pOCGDict) const;
+ FX_BOOL LoadOCGState(const CPDF_Dictionary *pOCGDict) const;
- bool GetOCGVisible(const CPDF_Dictionary *pOCGDict);
+ FX_BOOL GetOCGVisible(const CPDF_Dictionary *pOCGDict);
- bool GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLevel = 0);
+ FX_BOOL GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel = 0);
- bool LoadOCMDState(const CPDF_Dictionary *pOCMDDict, bool bFromConfig);
+ FX_BOOL LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig);
CPDF_Document *m_pDocument;
UsageType m_eUsageType;
- std::map<const CPDF_Dictionary*, bool> m_OCGStates;
+ std::map<const CPDF_Dictionary*, FX_BOOL> m_OCGStates;
};
class CPDF_LWinParam
{
@@ -295,7 +295,7 @@ public:
CFX_WideString GetFilePath() const;
- bool GetNewWindow() const
+ FX_BOOL GetNewWindow() const
{
return m_pDict->GetBoolean("NewWindow");
}
@@ -304,7 +304,7 @@ public:
CFX_ByteString GetURI(CPDF_Document* pDoc) const;
- bool GetMouseMap() const
+ FX_BOOL GetMouseMap() const
{
return m_pDict->GetBoolean("IsMap");
}
@@ -314,9 +314,9 @@ public:
return this;
}
- bool GetHideStatus() const
+ FX_BOOL GetHideStatus() const
{
- return m_pDict->GetBoolean("H", true);
+ return m_pDict->GetBoolean("H", TRUE);
}
CFX_ByteString GetNamedAction() const
@@ -345,17 +345,17 @@ public:
return m_pDict->GetNumber("Volume");
}
- bool IsSynchronous() const
+ FX_BOOL IsSynchronous() const
{
return m_pDict->GetBoolean("Synchronous");
}
- bool IsRepeat() const
+ FX_BOOL IsRepeat() const
{
return m_pDict->GetBoolean("Repeat");
}
- bool IsMixPlay() const
+ FX_BOOL IsMixPlay() const
{
return m_pDict->GetBoolean("Mix");
}
@@ -405,7 +405,7 @@ public:
DocumentPrinted
};
- bool ActionExist(AActionType eType) const;
+ FX_BOOL ActionExist(AActionType eType) const;
CPDF_Action GetAction(AActionType eType) const;
@@ -455,13 +455,13 @@ public:
return m_pObj;
}
- bool IsURL() const;
+ FX_BOOL IsURL() const;
- bool GetFileName(CFX_WideString &wsFileName) const;
+ FX_BOOL GetFileName(CFX_WideString &wsFileName) const;
CPDF_Stream* GetFileStream() const;
- void SetFileName(const CFX_WideStringC& wsFileName, bool bURL = false);
+ void SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL = FALSE);
protected:
CPDF_Object *m_pObj;
@@ -543,13 +543,13 @@ class CPDF_Annot : public CFX_PrivateData
CPDF_Dictionary* GetAnnotDict();
- bool DrawAppearance(const CPDF_Page* pPage,
+ FX_BOOL DrawAppearance(const CPDF_Page* pPage,
CFX_RenderDevice* pDevice,
const CFX_AffineMatrix* pUser2Device,
AppearanceMode mode,
const CPDF_RenderOptions* pOptions);
- bool DrawInContext(const CPDF_Page* pPage,
+ FX_BOOL DrawInContext(const CPDF_Page* pPage,
const CPDF_RenderContext* pContext,
const CFX_AffineMatrix* pUser2Device,
AppearanceMode mode);
@@ -585,25 +585,25 @@ public:
void GetAnnotRect(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix* pUser2Device, CPDF_Rect &rtAnnot) const;
void DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
- CFX_AffineMatrix* pMatrix, bool bShowWidget,
+ CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
CPDF_RenderOptions* pOptions);
void DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext,
- bool bPrinting, CFX_AffineMatrix* pMatrix, bool bShowWidget,
+ FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
CPDF_RenderOptions* pOptions)
{
DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, NULL);
}
void DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext,
- bool bPrinting, CFX_AffineMatrix* pMatrix, bool bShowWidget,
+ FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
CPDF_RenderOptions* pOptions, FX_RECT *pClipRect)
{
DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, pClipRect);
}
void DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext,
- bool bPrinting, CFX_AffineMatrix* pMatrix, FX_DWORD dwAnnotFlags,
+ FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_DWORD dwAnnotFlags,
CPDF_RenderOptions* pOptions, FX_RECT* pClipRect);
@@ -636,8 +636,8 @@ protected:
CFX_PtrArray m_Borders;
void DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
- CPDF_RenderContext* pContext, bool bPrinting, CFX_AffineMatrix* pMatrix,
- bool bWidget, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect);
+ CPDF_RenderContext* pContext, FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix,
+ FX_BOOL bWidget, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect);
friend class CPDF_Annot;
};
#define COLORTYPE_TRANSPARENT 0
@@ -678,7 +678,7 @@ public:
- bool HasFont();
+ FX_BOOL HasFont();
CFX_ByteString GetFontString();
@@ -687,18 +687,18 @@ public:
- bool HasColor(bool bStrokingOperation = false);
+ FX_BOOL HasColor(FX_BOOL bStrokingOperation = FALSE);
- CFX_ByteString GetColorString(bool bStrokingOperation = false);
+ CFX_ByteString GetColorString(FX_BOOL bStrokingOperation = FALSE);
- void GetColor(int& iColorType, FX_FLOAT fc[4], bool bStrokingOperation = false);
+ void GetColor(int& iColorType, FX_FLOAT fc[4], FX_BOOL bStrokingOperation = FALSE);
- void GetColor(FX_ARGB& color, int& iColorType, bool bStrokingOperation = false);
+ void GetColor(FX_ARGB& color, int& iColorType, FX_BOOL bStrokingOperation = FALSE);
- bool HasTextMatrix();
+ FX_BOOL HasTextMatrix();
CFX_ByteString GetTextMatrixString();
@@ -720,15 +720,15 @@ class CPDF_InterForm : public CFX_PrivateData
{
public:
- CPDF_InterForm(CPDF_Document* pDocument, bool bUpdateAP);
+ CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bUpdateAP);
~CPDF_InterForm();
- static void EnableUpdateAP(bool bUpdateAP);
+ static void EnableUpdateAP(FX_BOOL bUpdateAP);
- static bool UpdatingAPEnabled();
+ static FX_BOOL UpdatingAPEnabled();
static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, const FX_CHAR* csType, int iMinLen = 2, const FX_CHAR* csPrefix = "");
@@ -756,11 +756,11 @@ public:
- bool ValidateFieldName(CFX_WideString& csNewFieldName, int iType);
+ FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType);
- bool ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName);
+ FX_BOOL ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName);
- bool ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName);
+ FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName);
@@ -771,7 +771,7 @@ public:
void GetAllFieldNames(CFX_WideStringArray& allFieldNames);
- bool IsValidFormField(const void* pField);
+ FX_BOOL IsValidFormField(const void* pField);
CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const;
@@ -782,7 +782,7 @@ public:
CPDF_FormControl* GetControl(FX_DWORD index, CFX_WideString csFieldName = L"");
- bool IsValidFormControl(const void* pControl);
+ FX_BOOL IsValidFormControl(const void* pControl);
int CountPageControls(CPDF_Page* pPage) const;
@@ -817,9 +817,9 @@ public:
- bool NeedConstructAP();
+ FX_BOOL NeedConstructAP();
- void NeedConstructAP(bool bNeedAP);
+ void NeedConstructAP(FX_BOOL bNeedAP);
@@ -845,11 +845,11 @@ public:
CPDF_Font* GetNativeFormFont(CFX_ByteString& csNameTag);
- bool FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag);
+ FX_BOOL FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag);
- bool FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
+ FX_BOOL FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
- inline bool FindFormFont(CFX_WideString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
+ inline FX_BOOL FindFormFont(CFX_WideString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
{
return FindFormFont(PDF_EncodeText(csFontName), pFont, csNameTag);
}
@@ -882,20 +882,20 @@ public:
- CPDF_FormField* CheckRequiredFields(const CFX_PtrArray *fields = NULL, bool bIncludeOrExclude = true) const;
+ CPDF_FormField* CheckRequiredFields(const CFX_PtrArray *fields = NULL, FX_BOOL bIncludeOrExclude = TRUE) const;
- CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, bool bSimpleFileSpec = false) const;
+ CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, FX_BOOL bSimpleFileSpec = FALSE) const;
- CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, bool bIncludeOrExclude = true, bool bSimpleFileSpec = false) const;
+ CFDF_Document* ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude = TRUE, FX_BOOL bSimpleFileSpec = FALSE) const;
- bool ImportFromFDF(const CFDF_Document* pFDFDoc, bool bNotify = false);
+ FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE);
- bool ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclude = true, bool bNotify = false);
+ FX_BOOL ResetForm(const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude = TRUE, FX_BOOL bNotify = FALSE);
- bool ResetForm(bool bNotify = false);
+ FX_BOOL ResetForm(FX_BOOL bNotify = FALSE);
void ReloadForm();
@@ -907,27 +907,27 @@ public:
void SetFormNotify(const CPDF_FormNotify* pNotify);
- int GetPageWithWidget(int iCurPage, bool bNext);
+ int GetPageWithWidget(int iCurPage, FX_BOOL bNext);
- bool IsUpdated()
+ FX_BOOL IsUpdated()
{
return m_bUpdated;
}
void ClearUpdatedFlag()
{
- m_bUpdated = false;
+ m_bUpdated = FALSE;
}
- bool HasXFAForm() const;
+ FX_BOOL HasXFAForm() const;
void FixPageFields(const CPDF_Page* pPage);
protected:
- static bool m_bUpdateAP;
+ static FX_BOOL m_bUpdateAP;
void LoadField(CPDF_Dictionary* pFieldDict, int nLevel = 0);
@@ -937,9 +937,9 @@ protected:
CPDF_FormControl* AddControl(const CPDF_FormField* pField, const CPDF_Dictionary* pWidgetDict);
- void FDF_ImportField(CPDF_Dictionary* pField, const CFX_WideString& parent_name, bool bNotify = false, int nLevel = 0);
+ void FDF_ImportField(CPDF_Dictionary* pField, const CFX_WideString& parent_name, FX_BOOL bNotify = FALSE, int nLevel = 0);
- bool ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl);
+ FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl);
int CompareFieldName(const CFX_WideString& name1, const CFX_WideString& name2);
@@ -947,7 +947,7 @@ protected:
CPDF_Document* m_pDocument;
- bool m_bGenerateAP;
+ FX_BOOL m_bGenerateAP;
CPDF_Dictionary* m_pFormDict;
@@ -959,7 +959,7 @@ protected:
CPDF_FormNotify* m_pFormNotify;
- bool m_bUpdated;
+ FX_BOOL m_bUpdated;
friend class CPDF_FormControl;
friend class CPDF_FormField;
};
@@ -1018,7 +1018,7 @@ public:
m_pDict = pDict;
}
- bool ResetField(bool bNotify = false);
+ FX_BOOL ResetField(FX_BOOL bNotify = FALSE);
@@ -1075,7 +1075,7 @@ public:
CFX_WideString GetDefaultValue();
- bool SetValue(const CFX_WideString& value, bool bNotify = false);
+ FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bNotify = FALSE);
@@ -1090,13 +1090,13 @@ public:
int GetSelectedIndex(int index);
- bool ClearSelection(bool bNotify = false);
+ FX_BOOL ClearSelection(FX_BOOL bNotify = FALSE);
- bool IsItemSelected(int index);
+ FX_BOOL IsItemSelected(int index);
- bool SetItemSelection(int index, bool bSelected, bool bNotify = false);
+ FX_BOOL SetItemSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify = FALSE);
- bool IsItemDefaultSelected(int index);
+ FX_BOOL IsItemDefaultSelected(int index);
int GetDefaultSelectedItem();
@@ -1116,7 +1116,7 @@ public:
- bool CheckControl(int iControlIndex, bool bChecked, bool bNotify = false);
+ FX_BOOL CheckControl(int iControlIndex, FX_BOOL bChecked, FX_BOOL bNotify = FALSE);
@@ -1130,11 +1130,11 @@ public:
int GetSelectedOptionIndex(int index);
- bool IsOptionSelected(int iOptIndex);
+ FX_BOOL IsOptionSelected(int iOptIndex);
- bool SelectOption(int iOptIndex, bool bSelected, bool bNotify = false);
+ FX_BOOL SelectOption(int iOptIndex, FX_BOOL bSelected, FX_BOOL bNotify = FALSE);
- bool ClearSelectedOptions(bool bNotify = false);
+ FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE);
@@ -1169,9 +1169,9 @@ protected:
- CFX_WideString GetValue(bool bDefault);
+ CFX_WideString GetValue(FX_BOOL bDefault);
- bool SetValue(const CFX_WideString& value, bool bDefault, bool bNotify);
+ FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify);
void SyncFieldFlags();
@@ -1186,9 +1186,9 @@ protected:
- CFX_WideString GetCheckValue(bool bDefault);
+ CFX_WideString GetCheckValue(FX_BOOL bDefault);
- bool SetCheckValue(const CFX_WideString& value, bool bDefault, bool bNotify);
+ FX_BOOL SetCheckValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify);
FX_FLOAT m_FontSize;
@@ -1225,7 +1225,7 @@ public:
- bool IsProportionalScale();
+ FX_BOOL IsProportionalScale();
@@ -1235,7 +1235,7 @@ public:
- bool GetFittingBounds();
+ FX_BOOL GetFittingBounds();
CPDF_Dictionary* m_pDict;
@@ -1283,9 +1283,9 @@ public:
CFX_WideString GetExportValue();
- bool IsChecked();
+ FX_BOOL IsChecked();
- bool IsDefaultChecked();
+ FX_BOOL IsDefaultChecked();
@@ -1303,7 +1303,7 @@ public:
- bool HasMKEntry(CFX_ByteString csEntry);
+ FX_BOOL HasMKEntry(CFX_ByteString csEntry);
@@ -1434,7 +1434,7 @@ protected:
void SetOnStateName(const CFX_ByteString& csOn);
- void CheckControl(bool bChecked);
+ void CheckControl(FX_BOOL bChecked);
FX_ARGB GetColor(int& iColorType, CFX_ByteString csEntry);
@@ -1446,7 +1446,7 @@ protected:
CPDF_Stream* GetIcon(CFX_ByteString csEntry);
- CPDF_ApSettings GetMK(bool bCreate);
+ CPDF_ApSettings GetMK(FX_BOOL bCreate);
CPDF_InterForm* m_pForm;
@@ -1507,7 +1507,7 @@ public:
return 0;
}
};
-bool FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
class CPDF_PageLabel
{
public:
@@ -1559,9 +1559,9 @@ public:
~CPDF_ViewerPreferences();
- bool IsDirectionR2L() const;
+ FX_BOOL IsDirectionR2L() const;
- bool PrintScaling() const;
+ FX_BOOL PrintScaling() const;
int32_t NumCopies() const;
@@ -1586,7 +1586,7 @@ public:
return m_pDict;
}
- bool HasMKEntry(const CFX_ByteStringC& csEntry);
+ FX_BOOL HasMKEntry(const CFX_ByteStringC& csEntry);
diff --git a/core/include/fpdfdoc/fpdf_tagged.h b/core/include/fpdfdoc/fpdf_tagged.h
index 9761e01c60..706f5c04d7 100644
--- a/core/include/fpdfdoc/fpdf_tagged.h
+++ b/core/include/fpdfdoc/fpdf_tagged.h
@@ -85,17 +85,17 @@ public:
virtual CFX_PtrArray* GetObjectArray() = 0;
- virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable = false, FX_FLOAT fLevel = 0.0F) = 0;
+ virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F) = 0;
- virtual CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, bool bInheritable = false, int subindex = -1) = 0;
+ virtual CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
- virtual FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, bool bInheritable = false, int subindex = -1) = 0;
+ virtual FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
- virtual FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, bool bInheritable = false, int subindex = -1) = 0;
+ virtual FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
- virtual int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, bool bInheritable = false, int subindex = -1) = 0;
+ virtual int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
};
diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h
index 7f89e8d31e..4baba41348 100644
--- a/core/include/fpdfdoc/fpdf_vt.h
+++ b/core/include/fpdfdoc/fpdf_vt.h
@@ -39,12 +39,12 @@ struct CPVT_WordPlace {
nSecIndex = nLineIndex = nWordIndex = -1;
}
- bool operator == (const CPVT_WordPlace & wp) const
+ FX_BOOL operator == (const CPVT_WordPlace & wp) const
{
return wp.nSecIndex == nSecIndex && wp.nLineIndex == nLineIndex && wp.nWordIndex == nWordIndex;
}
- bool operator != (const CPVT_WordPlace & wp) const
+ FX_BOOL operator != (const CPVT_WordPlace & wp) const
{
return wp.nSecIndex != nSecIndex || wp.nLineIndex != nLineIndex || wp.nWordIndex != nWordIndex;
}
@@ -142,12 +142,12 @@ struct CPVT_WordRange {
SwapWordPlace();
}
- bool IsExist() const
+ FX_BOOL IsExist() const
{
return BeginPos != EndPos;
}
- bool operator != (const CPVT_WordRange & wr) const
+ FX_BOOL operator != (const CPVT_WordRange & wr) const
{
return wr.BeginPos != BeginPos || wr.EndPos != EndPos;
}
@@ -290,7 +290,7 @@ public:
virtual int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex) = 0;
- virtual bool IsLatinWord(FX_WORD word) = 0;
+ virtual FX_BOOL IsLatinWord(FX_WORD word) = 0;
virtual int32_t GetDefaultFontIndex() = 0;
};
@@ -299,27 +299,27 @@ class IPDF_VariableText_Iterator
public:
virtual ~IPDF_VariableText_Iterator() { }
- virtual bool NextWord() = 0;
+ virtual FX_BOOL NextWord() = 0;
- virtual bool PrevWord() = 0;
+ virtual FX_BOOL PrevWord() = 0;
- virtual bool NextLine() = 0;
+ virtual FX_BOOL NextLine() = 0;
- virtual bool PrevLine() = 0;
+ virtual FX_BOOL PrevLine() = 0;
- virtual bool NextSection() = 0;
+ virtual FX_BOOL NextSection() = 0;
- virtual bool PrevSection() = 0;
+ virtual FX_BOOL PrevSection() = 0;
- virtual bool GetWord(CPVT_Word & word) const = 0;
+ virtual FX_BOOL GetWord(CPVT_Word & word) const = 0;
- virtual bool SetWord(const CPVT_Word & word) = 0;
+ virtual FX_BOOL SetWord(const CPVT_Word & word) = 0;
- virtual bool GetLine(CPVT_Line & line) const = 0;
+ virtual FX_BOOL GetLine(CPVT_Line & line) const = 0;
- virtual bool GetSection(CPVT_Section & section) const = 0;
+ virtual FX_BOOL GetSection(CPVT_Section & section) const = 0;
- virtual bool SetSection(const CPVT_Section & section) = 0;
+ virtual FX_BOOL SetSection(const CPVT_Section & section) = 0;
virtual void SetAt(int32_t nWordIndex) = 0;
@@ -352,23 +352,23 @@ public:
virtual void SetHorzScale(int32_t nHorzScale = 100) = 0;
- virtual void SetMultiLine(bool bMultiLine = true) = 0;
+ virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE) = 0;
- virtual void SetAutoReturn(bool bAuto = true) = 0;
+ virtual void SetAutoReturn(FX_BOOL bAuto = TRUE) = 0;
- virtual void SetAutoFontSize(bool bAuto = true) = 0;
+ virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE) = 0;
virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
virtual void SetLineLeading(FX_FLOAT fLineLeading) = 0;
- virtual void SetRichText(bool bRichText) = 0;
+ virtual void SetRichText(FX_BOOL bRichText) = 0;
virtual void Initialize() = 0;
- virtual bool IsValid() const = 0;
+ virtual FX_BOOL IsValid() const = 0;
- virtual bool IsRichText() const = 0;
+ virtual FX_BOOL IsRichText() const = 0;
virtual void RearrangeAll() = 0;
@@ -410,7 +410,7 @@ public:
virtual int32_t GetLimitChar() const = 0;
- virtual bool IsMultiLine() const = 0;
+ virtual FX_BOOL IsMultiLine() const = 0;
virtual int32_t GetHorzScale() const = 0;
@@ -440,7 +440,7 @@ public:
virtual void UpdateWordPlace(CPVT_WordPlace & place) const = 0;
- virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, bool bPrevOrNext) const = 0;
+ virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const = 0;
virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
diff --git a/core/include/fpdftext/fpdf_text.h b/core/include/fpdftext/fpdf_text.h
index 8b54f2d325..04922c4b7f 100644
--- a/core/include/fpdftext/fpdf_text.h
+++ b/core/include/fpdftext/fpdf_text.h
@@ -61,9 +61,9 @@ class CPDFText_ParseOptions
public:
CPDFText_ParseOptions();
- bool m_bGetCharCodeOnly;
- bool m_bNormalizeObjs;
- bool m_bOutputHyphen;
+ FX_BOOL m_bGetCharCodeOnly;
+ FX_BOOL m_bNormalizeObjs;
+ FX_BOOL m_bOutputHyphen;
};
class IPDF_TextPage
{
@@ -75,12 +75,12 @@ public:
static IPDF_TextPage* CreateTextPage(const CPDF_PageObjects* pObjs, int flags = 0);
static IPDF_TextPage* CreateReflowTextPage(IPDF_ReflowedPage* pRefPage);
- virtual void NormalizeObjects(bool bNormalize) = 0;
+ virtual void NormalizeObjects(FX_BOOL bNormalize) = 0;
- virtual bool ParseTextPage() = 0;
+ virtual FX_BOOL ParseTextPage() = 0;
- virtual bool IsParsered() const = 0;
+ virtual FX_BOOL IsParsered() const = 0;
public:
virtual int CharIndexFromTextIndex(int TextIndex) const = 0;
@@ -109,11 +109,11 @@ public:
virtual void GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const = 0;
- virtual bool GetBaselineRotate(int rectIndex, int& Rotate) = 0;
+ virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate) = 0;
- virtual bool GetBaselineRotate(const CFX_FloatRect& rect, int& Rotate) = 0;
+ virtual FX_BOOL GetBaselineRotate(const CFX_FloatRect& rect, int& Rotate) = 0;
- virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, bool bContains = false) = 0;
+ virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE) = 0;
virtual void GetBoundedSegment(int index, int& start, int& count) const = 0;
@@ -134,11 +134,11 @@ public:
static IPDF_TextPageFind* CreatePageFind(const IPDF_TextPage* pTextPage);
public:
- virtual bool FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0) = 0;
+ virtual FX_BOOL FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0) = 0;
- virtual bool FindNext() = 0;
+ virtual FX_BOOL FindNext() = 0;
- virtual bool FindPrev() = 0;
+ virtual FX_BOOL FindPrev() = 0;
virtual void GetRectArray(CFX_RectArray& rects) const = 0;
@@ -154,7 +154,7 @@ public:
static IPDF_LinkExtract* CreateLinkExtract();
- virtual bool ExtractLinks(const IPDF_TextPage* pTextPage) = 0;
+ virtual FX_BOOL ExtractLinks(const IPDF_TextPage* pTextPage) = 0;
public:
virtual int CountLinks() const = 0;
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index 553900870c..e3d69e5dc9 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -51,9 +51,9 @@ class ICodec_BasicModule
public:
virtual ~ICodec_BasicModule() {}
- virtual bool RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
+ virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size) = 0;
- virtual bool A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
+ virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size) = 0;
virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc) = 0;
@@ -70,7 +70,7 @@ public:
virtual uint8_t* GetScanline(int line) = 0;
- virtual bool SkipToScanline(int line, IFX_Pause* pPause) = 0;
+ virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) = 0;
virtual int GetWidth() = 0;
@@ -80,7 +80,7 @@ public:
virtual int GetBPC() = 0;
- virtual bool IsColorTransformed() = 0;
+ virtual FX_BOOL IsColorTransformed() = 0;
virtual void ClearImageData() = 0;
};
@@ -91,13 +91,13 @@ public:
virtual ~ICodec_FlateModule() {}
virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns) = 0;
- virtual FX_DWORD FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf, FX_DWORD src_size, bool bEarlyChange,
+ virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
int predictor, int Colors, int BitsPerComponent, int Columns,
FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
- virtual bool Encode(const uint8_t* src_buf, FX_DWORD src_size,
+ virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size,
int predictor, int Colors, int BitsPerComponent, int Columns,
uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
- virtual bool Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
+ virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
};
class ICodec_FaxModule
{
@@ -106,10 +106,10 @@ public:
virtual ~ICodec_FaxModule() {}
virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
- int K, bool EndOfLine, bool EncodedByteAlign, bool BlackIs1, int Columns, int Rows) = 0;
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows) = 0;
- virtual bool Encode(const uint8_t* src_buf, int width, int height, int pitch,
+ virtual FX_BOOL Encode(const uint8_t* src_buf, int width, int height, int pitch,
uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
};
class ICodec_JpegModule
@@ -121,13 +121,13 @@ public:
virtual void SetPovider(IFX_JpegProvider* pJP) = 0;
virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size,
- int width, int height, int nComps, bool ColorTransform) = 0;
+ int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
- virtual bool LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, bool& color_transform,
+ virtual FX_BOOL LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
uint8_t** icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
- virtual bool Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
+ virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
const uint8_t* icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
virtual void* Start() = 0;
@@ -142,7 +142,7 @@ public:
virtual int StartScanline(void* pContext, int down_scale) = 0;
- virtual bool ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
+ virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0;
@@ -153,13 +153,13 @@ public:
virtual ~ICodec_JpxModule() {}
- virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, bool useColorSpace = false) = 0;
+ virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE) = 0;
virtual void GetImageInfo(void* ctx, FX_DWORD& width, FX_DWORD& height,
FX_DWORD& codestream_nComps, FX_DWORD& output_nComps) = 0;
- virtual bool Decode(void* ctx, uint8_t* dest_data, int pitch,
- bool bTranslateColor, uint8_t* offsets) = 0;
+ virtual FX_BOOL Decode(void* ctx, uint8_t* dest_data, int pitch,
+ FX_BOOL bTranslateColor, uint8_t* offsets) = 0;
virtual void DestroyDecoder(void* ctx) = 0;
};
@@ -169,10 +169,10 @@ public:
virtual ~ICodec_Jbig2Module() {}
- virtual bool Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
+ virtual FX_BOOL Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
const uint8_t* global_data, FX_DWORD global_size, uint8_t* dest_buf, FX_DWORD dest_pitch) = 0;
- virtual bool Decode(IFX_FileRead* file_ptr, FX_DWORD& width, FX_DWORD& height,
+ virtual FX_BOOL Decode(IFX_FileRead* file_ptr, FX_DWORD& width, FX_DWORD& height,
FX_DWORD& pitch, uint8_t*& dest_buf) = 0;
virtual void* CreateJbig2Context() = 0;
@@ -251,6 +251,6 @@ public:
};
void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B);
void AdobeCMYK_to_sRGB1(uint8_t c, uint8_t m, uint8_t y, uint8_t k, uint8_t& R, uint8_t& G, uint8_t& B);
-bool MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]);
+FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]);
#endif // CORE_INCLUDE_FXCODEC_FX_CODEC_H_
diff --git a/core/include/fxcodec/fx_codec_provider.h b/core/include/fxcodec/fx_codec_provider.h
index ac69f9a7fe..0b238b780e 100644
--- a/core/include/fxcodec/fx_codec_provider.h
+++ b/core/include/fxcodec/fx_codec_provider.h
@@ -14,25 +14,25 @@ class IFX_JpegProvider
public:
virtual void Release() = 0;
- virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, bool ColorTransform) = 0;
+ virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
virtual void DestroyDecoder(void* pDecoder) = 0;
virtual void DownScale(void* pDecoder, int dest_width, int dest_height) = 0;
- virtual bool Rewind(void* pDecoder) = 0;
+ virtual FX_BOOL Rewind(void* pDecoder) = 0;
virtual uint8_t* GetNextLine(void* pDecoder) = 0;
virtual FX_DWORD GetSrcOffset(void* pDecoder) = 0;
- virtual bool LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, bool& color_transform,
+ virtual FX_BOOL LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
uint8_t** icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
- virtual bool Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
+ virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
const uint8_t* icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
virtual void* Start() = 0;
@@ -47,7 +47,7 @@ public:
virtual int StartScanline(void* pContext, int down_scale) = 0;
- virtual bool ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
+ virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0;
diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h
index 5c4173822e..7ce21e5086 100644
--- a/core/include/fxcrt/fx_arb.h
+++ b/core/include/fxcrt/fx_arb.h
@@ -15,9 +15,9 @@ public:
static IFX_BidiChar* Create();
virtual ~IFX_BidiChar() {}
- virtual void SetPolicy(bool bSeparateNeutral = true) = 0;
- virtual bool AppendChar(FX_WCHAR wch) = 0;
- virtual bool EndChar() = 0;
+ virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0;
+ virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0;
+ virtual FX_BOOL EndChar() = 0;
virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) = 0;
virtual void Reset() = 0;
};
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index c272eb54ec..d575df6e67 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -218,9 +218,9 @@ public:
CFX_ArchiveLoader& operator >> (CFX_WideString& wstr);
- bool IsEOF();
+ FX_BOOL IsEOF();
- bool Read(void* pBuf, FX_DWORD dwSize);
+ FX_BOOL Read(void* pBuf, FX_DWORD dwSize);
protected:
FX_DWORD m_LoadingPos;
@@ -239,7 +239,7 @@ public:
virtual void Clear();
- bool Flush();
+ FX_BOOL Flush();
int32_t AppendBlock(const void* pBuf, size_t size);
@@ -252,7 +252,7 @@ public:
protected:
- virtual bool DoWork(const void* pBuf, size_t size) = 0;
+ virtual FX_BOOL DoWork(const void* pBuf, size_t size) = 0;
FX_STRSIZE m_BufSize;
@@ -269,18 +269,18 @@ public:
void Clear() override;
- bool AttachFile(IFX_StreamWrite *pFile, bool bTakeover = false);
+ FX_BOOL AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE);
- bool AttachFile(const FX_WCHAR* filename);
+ FX_BOOL AttachFile(const FX_WCHAR* filename);
- bool AttachFile(const FX_CHAR* filename);
+ FX_BOOL AttachFile(const FX_CHAR* filename);
private:
- bool DoWork(const void* pBuf, size_t size) override;
+ FX_BOOL DoWork(const void* pBuf, size_t size) override;
IFX_StreamWrite* m_pFile;
- bool m_bTakeover;
+ FX_BOOL m_bTakeover;
};
struct CFX_CharMap {
@@ -362,17 +362,17 @@ protected:
~CFX_BasicArray();
- bool SetSize(int nNewSize);
+ FX_BOOL SetSize(int nNewSize);
- bool Append(const CFX_BasicArray& src);
+ FX_BOOL Append(const CFX_BasicArray& src);
- bool Copy(const CFX_BasicArray& src);
+ FX_BOOL Copy(const CFX_BasicArray& src);
uint8_t* InsertSpaceAt(int nIndex, int nCount);
- bool RemoveAt(int nIndex, int nCount);
+ FX_BOOL RemoveAt(int nIndex, int nCount);
- bool InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray);
+ FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray);
const void* GetDataPtr(int index) const;
protected:
@@ -401,7 +401,7 @@ public:
return m_nSize - 1;
}
- bool SetSize(int nNewSize)
+ FX_BOOL SetSize(int nNewSize)
{
return CFX_BasicArray::SetSize(nNewSize);
}
@@ -419,13 +419,13 @@ public:
return ((const TYPE*)m_pData)[nIndex];
}
- bool SetAt(int nIndex, TYPE newElement)
+ FX_BOOL SetAt(int nIndex, TYPE newElement)
{
if (nIndex < 0 || nIndex >= m_nSize) {
- return false;
+ return FALSE;
}
((TYPE*)m_pData)[nIndex] = newElement;
- return true;
+ return TRUE;
}
TYPE& ElementAt(int nIndex)
@@ -446,36 +446,36 @@ public:
return (TYPE*)m_pData;
}
- bool SetAtGrow(int nIndex, TYPE newElement)
+ FX_BOOL SetAtGrow(int nIndex, TYPE newElement)
{
if (nIndex < 0) {
- return false;
+ return FALSE;
}
if (nIndex >= m_nSize)
if (!SetSize(nIndex + 1)) {
- return false;
+ return FALSE;
}
((TYPE*)m_pData)[nIndex] = newElement;
- return true;
+ return TRUE;
}
- bool Add(TYPE newElement)
+ FX_BOOL Add(TYPE newElement)
{
if (m_nSize < m_nMaxSize) {
m_nSize ++;
} else if (!SetSize(m_nSize + 1)) {
- return false;
+ return FALSE;
}
((TYPE*)m_pData)[m_nSize - 1] = newElement;
- return true;
+ return TRUE;
}
- bool Append(const CFX_ArrayTemplate& src)
+ FX_BOOL Append(const CFX_ArrayTemplate& src)
{
return CFX_BasicArray::Append(src);
}
- bool Copy(const CFX_ArrayTemplate& src)
+ FX_BOOL Copy(const CFX_ArrayTemplate& src)
{
return CFX_BasicArray::Copy(src);
}
@@ -511,23 +511,23 @@ public:
return ((TYPE*)m_pData)[nIndex];
}
- bool InsertAt(int nIndex, TYPE newElement, int nCount = 1)
+ FX_BOOL InsertAt(int nIndex, TYPE newElement, int nCount = 1)
{
if (!InsertSpaceAt(nIndex, nCount)) {
- return false;
+ return FALSE;
}
while (nCount--) {
((TYPE*)m_pData)[nIndex++] = newElement;
}
- return true;
+ return TRUE;
}
- bool RemoveAt(int nIndex, int nCount = 1)
+ FX_BOOL RemoveAt(int nIndex, int nCount = 1)
{
return CFX_BasicArray::RemoveAt(nIndex, nCount);
}
- bool InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray)
+ FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray)
{
return CFX_BasicArray::InsertAt(nStartIndex, pNewArray);
}
@@ -700,7 +700,7 @@ public:
return m_UnitSize;
}
- void* Iterate(bool (*callback)(void* param, void* pData), void* param) const;
+ void* Iterate(FX_BOOL (*callback)(void* param, void* pData), void* param) const;
private:
int m_UnitSize;
@@ -715,8 +715,8 @@ private:
void* m_pIndex;
void** GetIndex(int seg_index) const;
- void* IterateIndex(int level, int& start, void** pIndex, bool (*callback)(void* param, void* pData), void* param) const;
- void* IterateSegment(const uint8_t* pSegment, int count, bool (*callback)(void* param, void* pData), void* param) const;
+ void* IterateIndex(int level, int& start, void** pIndex, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
+ void* IterateSegment(const uint8_t* pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
};
template <class ElementType>
class CFX_SegmentedArray : public CFX_BaseSegmentedArray
@@ -798,12 +798,12 @@ public:
return m_nCount;
}
- bool IsEmpty() const
+ FX_BOOL IsEmpty() const
{
return m_nCount == 0;
}
- bool Lookup(void* key, void*& rValue) const;
+ FX_BOOL Lookup(void* key, void*& rValue) const;
void* GetValueAt(void* key) const;
@@ -814,7 +814,7 @@ public:
(*this)[key] = newValue;
}
- bool RemoveKey(void* key);
+ FX_BOOL RemoveKey(void* key);
void RemoveAll();
@@ -830,7 +830,7 @@ public:
return m_nHashTableSize;
}
- void InitHashTable(FX_DWORD hashSize, bool bAllocNow = true);
+ void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE);
protected:
CAssoc** m_pHashTable;
@@ -858,7 +858,7 @@ class CFX_CMapDWordToDWord
{
public:
- bool Lookup(FX_DWORD key, FX_DWORD& value) const;
+ FX_BOOL Lookup(FX_DWORD key, FX_DWORD& value) const;
void SetAt(FX_DWORD key, FX_DWORD value);
@@ -893,12 +893,12 @@ public:
return m_nCount;
}
- bool IsEmpty() const
+ FX_BOOL IsEmpty() const
{
return m_nCount == 0;
}
- bool Lookup(const CFX_ByteStringC& key, void*& rValue) const;
+ FX_BOOL Lookup(const CFX_ByteStringC& key, void*& rValue) const;
void*& operator[](const CFX_ByteStringC& key);
@@ -907,7 +907,7 @@ public:
(*this)[key] = newValue;
}
- bool RemoveKey(const CFX_ByteStringC& key);
+ FX_BOOL RemoveKey(const CFX_ByteStringC& key);
void RemoveAll();
@@ -925,7 +925,7 @@ public:
return m_nHashTableSize;
}
- void InitHashTable(FX_DWORD hashSize, bool bAllocNow = true);
+ void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE);
FX_DWORD HashKey(const CFX_ByteStringC& key) const;
protected:
@@ -966,7 +966,7 @@ public:
void* GetNextValue(FX_POSITION& rNextPosition) const;
- bool Lookup(const CFX_ByteStringC& key, void*& rValue) const;
+ FX_BOOL Lookup(const CFX_ByteStringC& key, void*& rValue) const;
void SetAt(const CFX_ByteStringC& key, void* value);
@@ -1090,7 +1090,7 @@ struct FX_PRIVATEDATA {
PD_CALLBACK_FREEDATA m_pCallback;
- bool m_bSelfDestruct;
+ FX_BOOL m_bSelfDestruct;
};
class CFX_PrivateData
{
@@ -1106,27 +1106,27 @@ public:
void* GetPrivateData(void* module_id);
- bool LookupPrivateData(void* module_id, void* &pData) const
+ FX_BOOL LookupPrivateData(void* module_id, void* &pData) const
{
if (!module_id) {
- return false;
+ return FALSE;
}
FX_DWORD nCount = m_DataList.GetSize();
for (FX_DWORD n = 0; n < nCount; n ++) {
if (m_DataList[n].m_pModuleId == module_id) {
pData = m_DataList[n].m_pData;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
- bool RemovePrivateData(void* module_id);
+ FX_BOOL RemovePrivateData(void* module_id);
protected:
CFX_ArrayTemplate<FX_PRIVATEDATA> m_DataList;
- void AddData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback, bool bSelfDestruct);
+ void AddData(void* module_id, void* pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct);
};
class CFX_BitStream
{
@@ -1139,7 +1139,7 @@ public:
void ByteAlign();
- bool IsEOF()
+ FX_BOOL IsEOF()
{
return m_BitPos >= m_BitSize;
}
@@ -1252,12 +1252,12 @@ public:
return m_pObject;
}
- bool IsNull() const
+ FX_BOOL IsNull() const
{
return m_pObject == NULL;
}
- bool NotNull() const
+ FX_BOOL NotNull() const
{
return m_pObject != NULL;
}
@@ -1288,7 +1288,7 @@ public:
m_pObject = NULL;
}
- bool operator == (const Ref& ref) const
+ FX_BOOL operator == (const Ref& ref) const
{
return m_pObject == ref.m_pObject;
}
@@ -1300,7 +1300,7 @@ class IFX_Pause
{
public:
virtual ~IFX_Pause() { }
- virtual bool NeedToPauseNow() = 0;
+ virtual FX_BOOL NeedToPauseNow() = 0;
};
class CFX_DataFilter
{
@@ -1310,7 +1310,7 @@ public:
void SetDestFilter(CFX_DataFilter* pFilter);
- bool IsEOF() const
+ FX_BOOL IsEOF() const
{
return m_bEOF;
}
@@ -1330,7 +1330,7 @@ protected:
virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) = 0;
void ReportEOF(FX_DWORD left_input);
- bool m_bEOF;
+ FX_BOOL m_bEOF;
FX_DWORD m_SrcPos;
diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h
index 6edaf53f0b..3689a4b270 100644
--- a/core/include/fxcrt/fx_coordinates.h
+++ b/core/include/fxcrt/fx_coordinates.h
@@ -68,11 +68,11 @@ public:
y /= lamda;
return *this;
}
- friend bool operator == (const FXT_PSV &obj1, const FXT_PSV &obj2)
+ friend FX_BOOL operator == (const FXT_PSV &obj1, const FXT_PSV &obj2)
{
return obj1.x == obj2.x && obj1.y == obj2.y;
}
- friend bool operator != (const FXT_PSV &obj1, const FXT_PSV &obj2)
+ friend FX_BOOL operator != (const FXT_PSV &obj1, const FXT_PSV &obj2)
{
return obj1.x != obj2.x || obj1.y != obj2.y;
}
@@ -174,21 +174,21 @@ public:
{
return FXT_PSV::x * v.x + FXT_PSV::y * v.y;
}
- bool IsParallel(baseType otherx, baseType othery) const
+ FX_BOOL IsParallel(baseType otherx, baseType othery) const
{
baseType t = FXT_PSV::x * othery - FXT_PSV::y * otherx;
return FXSYS_fabs(t) < 0x0001f;
}
- bool IsParallel(const FXT_VECTOR &v) const
+ FX_BOOL IsParallel(const FXT_VECTOR &v) const
{
return IsParallel(v.x, v.y);
}
- bool IsPerpendicular(baseType otherx, baseType othery) const
+ FX_BOOL IsPerpendicular(baseType otherx, baseType othery) const
{
baseType t = DotProduct(otherx, othery);
return FXSYS_fabs(t) < 0x0001f;
}
- bool IsPerpendicular(const FXT_VECTOR &v) const
+ FX_BOOL IsPerpendicular(const FXT_VECTOR &v) const
{
return IsPerpendicular(v.x, v.y);
}
@@ -340,11 +340,11 @@ public:
{
Deflate(rt.left, rt.top, rt.top + rt.width, rt.top + rt.height);
}
- bool IsEmpty() const
+ FX_BOOL IsEmpty() const
{
return width <= 0 || height <= 0;
}
- bool IsEmpty(FX_FLOAT fEpsilon) const
+ FX_BOOL IsEmpty(FX_FLOAT fEpsilon) const
{
return width <= fEpsilon || height <= fEpsilon;
}
@@ -352,15 +352,15 @@ public:
{
width = height = 0;
}
- bool Contains(baseType x, baseType y) const
+ FX_BOOL Contains(baseType x, baseType y) const
{
return x >= left && x < left + width && y >= top && y < top + height;
}
- bool Contains(const FXT_POINT &p) const
+ FX_BOOL Contains(const FXT_POINT &p) const
{
return Contains(p.x, p.y);
}
- bool Contains(const FXT_RECT &rt) const
+ FX_BOOL Contains(const FXT_RECT &rt) const
{
return rt.left >= left && rt.right() <= right() && rt.top >= top && rt.bottom() <= bottom();
}
@@ -501,23 +501,23 @@ public:
width = r - left;
height = b - top;
}
- bool IntersectWith(const FXT_RECT &rt) const
+ FX_BOOL IntersectWith(const FXT_RECT &rt) const
{
FXT_RECT rect = rt;
rect.Intersect(*this);
return !rect.IsEmpty();
}
- bool IntersectWith(const FXT_RECT &rt, FX_FLOAT fEpsilon) const
+ FX_BOOL IntersectWith(const FXT_RECT &rt, FX_FLOAT fEpsilon) const
{
FXT_RECT rect = rt;
rect.Intersect(*this);
return !rect.IsEmpty(fEpsilon);
}
- friend bool operator == (const FXT_RECT &rc1, const FXT_RECT &rc2)
+ friend FX_BOOL operator == (const FXT_RECT &rc1, const FXT_RECT &rc2)
{
return rc1.left == rc2.left && rc1.top == rc2.top && rc1.width == rc2.width && rc1.height == rc2.height;
}
- friend bool operator != (const FXT_RECT &rc1, const FXT_RECT &rc2)
+ friend FX_BOOL operator != (const FXT_RECT &rc1, const FXT_RECT &rc2)
{
return rc1.left != rc2.left || rc1.top != rc2.top || rc1.width != rc2.width || rc1.height != rc2.height;
}
@@ -561,7 +561,7 @@ struct FX_RECT {
return bottom - top;
}
- bool IsEmpty() const
+ FX_BOOL IsEmpty() const
{
return right <= left || bottom <= top;
}
@@ -577,7 +577,7 @@ struct FX_RECT {
void Union(const FX_RECT& other_rect);
- bool operator == (const FX_RECT& src) const
+ FX_BOOL operator == (const FX_RECT& src) const
{
return left == src.left && right == src.right && top == src.top && bottom == src.bottom;
}
@@ -590,12 +590,12 @@ struct FX_RECT {
bottom += dy;
}
- bool Contains(const FX_RECT& other_rect) const
+ FX_BOOL Contains(const FX_RECT& other_rect) const
{
return other_rect.left >= left && other_rect.right <= right && other_rect.top >= top && other_rect.bottom <= bottom;
}
- bool Contains(int x, int y) const
+ FX_BOOL Contains(int x, int y) const
{
return x >= left && x < right && y >= top && y < bottom;
}
@@ -637,7 +637,7 @@ public:
CFX_FloatRect(const FX_RECT& rect);
- bool IsEmpty() const
+ FX_BOOL IsEmpty() const
{
return left >= right || bottom >= top;
}
@@ -649,9 +649,9 @@ public:
left = right = bottom = top = 0;
}
- bool Contains(const CFX_FloatRect& other_rect) const;
+ FX_BOOL Contains(const CFX_FloatRect& other_rect) const;
- bool Contains(FX_FLOAT x, FX_FLOAT y) const;
+ FX_BOOL Contains(FX_FLOAT x, FX_FLOAT y) const;
void Transform(const CFX_Matrix* pMatrix);
@@ -786,11 +786,11 @@ public:
void SetReverse(const CFX_Matrix &m);
- void Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, bool bPrepended = false);
+ void Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended = FALSE);
- void Concat(const CFX_Matrix &m, bool bPrepended = false);
+ void Concat(const CFX_Matrix &m, FX_BOOL bPrepended = FALSE);
- void ConcatInverse(const CFX_Matrix& m, bool bPrepended = false);
+ void ConcatInverse(const CFX_Matrix& m, FX_BOOL bPrepended = FALSE);
void Reset()
{
SetIdentity();
@@ -801,30 +801,30 @@ public:
*this = m;
}
- bool IsIdentity() const
+ FX_BOOL IsIdentity() const
{
return a == 1 && b == 0 && c == 0 && d == 1 && e == 0 && f == 0;
}
- bool IsInvertible() const;
+ FX_BOOL IsInvertible() const;
- bool Is90Rotated() const;
+ FX_BOOL Is90Rotated() const;
- bool IsScaled() const;
+ FX_BOOL IsScaled() const;
- void Translate(FX_FLOAT x, FX_FLOAT y, bool bPrepended = false);
+ void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE);
- void TranslateI(int32_t x, int32_t y, bool bPrepended = false)
+ void TranslateI(int32_t x, int32_t y, FX_BOOL bPrepended = FALSE)
{
Translate((FX_FLOAT)x, (FX_FLOAT)y, bPrepended);
}
- void Scale(FX_FLOAT sx, FX_FLOAT sy, bool bPrepended = false);
+ void Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended = FALSE);
- void Rotate(FX_FLOAT fRadian, bool bPrepended = false);
+ void Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended = FALSE);
- void RotateAt(FX_FLOAT fRadian, FX_FLOAT x, FX_FLOAT y, bool bPrepended = false);
+ void RotateAt(FX_FLOAT fRadian, FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE);
- void Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, bool bPrepended = false);
+ void Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended = FALSE);
void MatchRect(const CFX_FloatRect &dest, const CFX_FloatRect &src);
diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h
index a04fc529be..f24f4549a3 100644
--- a/core/include/fxcrt/fx_ext.h
+++ b/core/include/fxcrt/fx_ext.h
@@ -21,11 +21,11 @@ FX_WCHAR* FXSYS_wcsncpy(FX_WCHAR* dstStr, const FX_WCHAR* srcStr, size_t count)
int32_t FXSYS_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count);
int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count);
-inline bool FXSYS_islower(int32_t ch)
+inline FX_BOOL FXSYS_islower(int32_t ch)
{
return ch >= 'a' && ch <= 'z';
}
-inline bool FXSYS_isupper(int32_t ch)
+inline FX_BOOL FXSYS_isupper(int32_t ch)
{
return ch >= 'A' && ch <= 'Z';
}
@@ -38,8 +38,8 @@ inline int32_t FXSYS_toupper(int32_t ch)
return ch < 'a' || ch > 'z' ? ch : (ch - 0x20);
}
-FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, bool bIgnoreCase = false);
-FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, bool bIgnoreCase = false);
+FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE);
+FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE);
#ifdef __cplusplus
}
diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h
index b05e84d83c..fdd7b11fee 100644
--- a/core/include/fxcrt/fx_stream.h
+++ b/core/include/fxcrt/fx_stream.h
@@ -11,8 +11,8 @@
void* FX_OpenFolder(const FX_CHAR* path);
void* FX_OpenFolder(const FX_WCHAR* path);
-bool FX_GetNextFile(void* handle, CFX_ByteString& filename, bool& bFolder);
-bool FX_GetNextFile(void* handle, CFX_WideString& filename, bool& bFolder);
+FX_BOOL FX_GetNextFile(void* handle, CFX_ByteString& filename, FX_BOOL& bFolder);
+FX_BOOL FX_GetNextFile(void* handle, CFX_WideString& filename, FX_BOOL& bFolder);
void FX_CloseFolder(void* handle);
FX_WCHAR FX_GetFolderSeparator();
typedef struct FX_HFILE_ {
@@ -53,23 +53,23 @@ size_t FX_File_Read(FX_HFILE hFile, void* pBuffer, size_t szBuffer);
size_t FX_File_ReadPos(FX_HFILE hFile, void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
size_t FX_File_Write(FX_HFILE hFile, const void* pBuffer, size_t szBuffer);
size_t FX_File_WritePos(FX_HFILE hFile, const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
-bool FX_File_Flush(FX_HFILE hFile);
-bool FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile);
-bool FX_File_Exist(const CFX_ByteStringC& fileName);
-bool FX_File_Exist(const CFX_WideStringC& fileName);
-bool FX_File_Delete(const CFX_ByteStringC& fileName);
-bool FX_File_Delete(const CFX_WideStringC& fileName);
-bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst);
-bool FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst);
-bool FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst);
-bool FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst);
+FX_BOOL FX_File_Flush(FX_HFILE hFile);
+FX_BOOL FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile);
+FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName);
+FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName);
+FX_BOOL FX_File_Delete(const CFX_ByteStringC& fileName);
+FX_BOOL FX_File_Delete(const CFX_WideStringC& fileName);
+FX_BOOL FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst);
+FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst);
+FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst);
+FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst);
class IFX_StreamWrite
{
public:
virtual ~IFX_StreamWrite() { }
virtual void Release() = 0;
- virtual bool WriteBlock(const void* pData, size_t size) = 0;
+ virtual FX_BOOL WriteBlock(const void* pData, size_t size) = 0;
};
class IFX_FileWrite : public IFX_StreamWrite
{
@@ -79,10 +79,10 @@ public:
virtual FX_FILESIZE GetSize() = 0;
- virtual bool Flush() = 0;
+ virtual FX_BOOL Flush() = 0;
- virtual bool WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) = 0;
- virtual bool WriteBlock(const void* pData, size_t size)
+ virtual FX_BOOL WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) = 0;
+ virtual FX_BOOL WriteBlock(const void* pData, size_t size)
{
return WriteBlock(pData, GetSize(), size);
}
@@ -96,7 +96,7 @@ public:
virtual void Release() = 0;
- virtual bool IsEOF() = 0;
+ virtual FX_BOOL IsEOF() = 0;
virtual FX_FILESIZE GetPosition() = 0;
@@ -109,9 +109,9 @@ public:
virtual FX_FILESIZE GetSize() = 0;
- virtual bool IsEOF()
+ virtual FX_BOOL IsEOF()
{
- return false;
+ return FALSE;
}
virtual FX_FILESIZE GetPosition()
@@ -119,14 +119,14 @@ public:
return 0;
}
- virtual bool SetRange(FX_FILESIZE offset, FX_FILESIZE size)
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
{
- return false;
+ return FALSE;
}
virtual void ClearRange() {}
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0;
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0;
virtual size_t ReadBlock(void* buffer, size_t size)
{
@@ -145,21 +145,21 @@ public:
virtual FX_FILESIZE GetSize() = 0;
- virtual bool IsEOF() = 0;
+ virtual FX_BOOL IsEOF() = 0;
virtual FX_FILESIZE GetPosition() = 0;
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0;
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0;
virtual size_t ReadBlock(void* buffer, size_t size) = 0;
- virtual bool WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) = 0;
- virtual bool WriteBlock(const void* buffer, size_t size)
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) = 0;
+ virtual FX_BOOL WriteBlock(const void* buffer, size_t size)
{
return WriteBlock(buffer, GetSize(), size);
}
- virtual bool Flush() = 0;
+ virtual FX_BOOL Flush() = 0;
};
IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes);
IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes);
@@ -167,31 +167,31 @@ class IFX_MemoryStream : public IFX_FileStream
{
public:
- virtual bool IsConsecutive() const = 0;
+ virtual FX_BOOL IsConsecutive() const = 0;
virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0;
virtual uint8_t* GetBuffer() const = 0;
- virtual void AttachBuffer(uint8_t* pBuffer, size_t nSize, bool bTakeOver = false) = 0;
+ virtual void AttachBuffer(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) = 0;
virtual void DetachBuffer() = 0;
};
-IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, size_t nSize, bool bTakeOver = false);
-IFX_MemoryStream* FX_CreateMemoryStream(bool bConsecutive = false);
+IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE);
+IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive = FALSE);
class IFX_BufferRead : public IFX_StreamRead
{
public:
virtual void Release() = 0;
- virtual bool IsEOF() = 0;
+ virtual FX_BOOL IsEOF() = 0;
virtual FX_FILESIZE GetPosition() = 0;
virtual size_t ReadBlock(void* buffer, size_t size) = 0;
- virtual bool ReadNextBlock(bool bRestart = false) = 0;
+ virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0;
virtual const uint8_t* GetBlockBuffer() = 0;
diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h
index 736aa32239..8d73555814 100644
--- a/core/include/fxcrt/fx_string.h
+++ b/core/include/fxcrt/fx_string.h
@@ -670,7 +670,7 @@ public:
void Empty();
- bool IsEmpty() const
+ FX_BOOL IsEmpty() const
{
return !GetLength();
}
@@ -895,7 +895,7 @@ inline bool operator!= (const CFX_WideStringC& lhs, const CFX_WideString& rhs) {
return rhs != lhs;
}
FX_FLOAT FX_atof(const CFX_ByteStringC& str);
-void FX_atonum(const CFX_ByteStringC& str, bool& bInteger, void* pData);
+void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData);
FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf);
CFX_ByteString FX_UTF8Encode(const FX_WCHAR* pwsStr, FX_STRSIZE len);
inline CFX_ByteString FX_UTF8Encode(const CFX_WideStringC& wsStr)
diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h
index 9fcaf171bc..8bc2b4ab2a 100644
--- a/core/include/fxcrt/fx_system.h
+++ b/core/include/fxcrt/fx_system.h
@@ -71,6 +71,7 @@ typedef void* FX_POSITION; // Keep until fxcrt containers gone
typedef unsigned short FX_WORD; // Keep - "an efficient small type"
typedef unsigned int FX_DWORD; // Keep - "an efficient type"
typedef float FX_FLOAT; // Keep, allow upgrade to doubles.
+typedef int FX_BOOL; // Keep, sadly not always 0 or 1.
typedef char FX_CHAR; // Keep, questionable signedness.
typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars.
@@ -83,6 +84,14 @@ typedef int FX_STRSIZE;
#define _DEBUG
#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
#ifndef NULL
#define NULL 0
#endif
diff --git a/core/include/fxcrt/fx_ucd.h b/core/include/fxcrt/fx_ucd.h
index d9b57811c6..7b730bb81a 100644
--- a/core/include/fxcrt/fx_ucd.h
+++ b/core/include/fxcrt/fx_ucd.h
@@ -92,11 +92,11 @@ enum FX_CHARTYPE {
FX_CHARTYPE_Arabic = (12 << FX_CHARTYPEBITS),
};
FX_DWORD FX_GetUnicodeProperties(FX_WCHAR wch);
-bool FX_IsCtrlCode(FX_WCHAR ch);
-bool FX_IsRotationCode(FX_WCHAR ch);
-bool FX_IsCombinationChar(FX_WCHAR wch);
-bool FX_IsBidiChar(FX_WCHAR wch);
-FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, bool bRTL, bool bVertical);
-FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, bool bRTL, bool bVertical);
+FX_BOOL FX_IsCtrlCode(FX_WCHAR ch);
+FX_BOOL FX_IsRotationCode(FX_WCHAR ch);
+FX_BOOL FX_IsCombinationChar(FX_WCHAR wch);
+FX_BOOL FX_IsBidiChar(FX_WCHAR wch);
+FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical);
+FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, FX_BOOL bRTL, FX_BOOL bVertical);
#endif // CORE_INCLUDE_FXCRT_FX_UCD_H_
diff --git a/core/include/fxcrt/fx_xml.h b/core/include/fxcrt/fx_xml.h
index 233a8f9bb6..ba33b2083a 100644
--- a/core/include/fxcrt/fx_xml.h
+++ b/core/include/fxcrt/fx_xml.h
@@ -38,21 +38,21 @@ public:
class CXML_Content
{
public:
- CXML_Content() : m_bCDATA(false), m_Content() {}
- void Set(bool bCDATA, const CFX_WideStringC& content)
+ CXML_Content() : m_bCDATA(FALSE), m_Content() {}
+ void Set(FX_BOOL bCDATA, const CFX_WideStringC& content)
{
m_bCDATA = bCDATA;
m_Content = content;
}
- bool m_bCDATA;
+ FX_BOOL m_bCDATA;
CFX_WideString m_Content;
};
class CXML_Element
{
public:
- static CXML_Element* Parse(const void* pBuffer, size_t size, bool bSaveSpaceChars = false, FX_FILESIZE* pParsedSize = NULL);
- static CXML_Element* Parse(IFX_FileRead *pFile, bool bSaveSpaceChars = false, FX_FILESIZE* pParsedSize = NULL);
- static CXML_Element* Parse(IFX_BufferRead *pBuffer, bool bSaveSpaceChars = false, FX_FILESIZE* pParsedSize = NULL);
+ static CXML_Element* Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL);
+ static CXML_Element* Parse(IFX_FileRead *pFile, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL);
+ static CXML_Element* Parse(IFX_BufferRead *pBuffer, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL);
CXML_Element(const CFX_ByteStringC& qSpace, const CFX_ByteStringC& tagName);
CXML_Element(const CFX_ByteStringC& qTagName);
CXML_Element();
@@ -63,9 +63,9 @@ public:
- CFX_ByteString GetTagName(bool bQualified = false) const;
+ CFX_ByteString GetTagName(FX_BOOL bQualified = FALSE) const;
- CFX_ByteString GetNamespace(bool bQualified = false) const;
+ CFX_ByteString GetNamespace(FX_BOOL bQualified = FALSE) const;
CFX_ByteString GetNamespaceURI(const CFX_ByteStringC& qName) const;
@@ -81,9 +81,9 @@ public:
void GetAttrByIndex(int index, CFX_ByteString &space, CFX_ByteString &name, CFX_WideString &value) const;
- bool HasAttr(const CFX_ByteStringC& qName) const;
+ FX_BOOL HasAttr(const CFX_ByteStringC& qName) const;
- bool GetAttrValue(const CFX_ByteStringC& name, CFX_WideString& attribute) const;
+ FX_BOOL GetAttrValue(const CFX_ByteStringC& name, CFX_WideString& attribute) const;
CFX_WideString GetAttrValue(const CFX_ByteStringC& name) const
{
CFX_WideString attr;
@@ -91,7 +91,7 @@ public:
return attr;
}
- bool GetAttrValue(const CFX_ByteStringC& space, const CFX_ByteStringC& name, CFX_WideString& attribute) const;
+ FX_BOOL GetAttrValue(const CFX_ByteStringC& space, const CFX_ByteStringC& name, CFX_WideString& attribute) const;
CFX_WideString GetAttrValue(const CFX_ByteStringC& space, const CFX_ByteStringC& name) const
{
CFX_WideString attr;
@@ -99,7 +99,7 @@ public:
return attr;
}
- bool GetAttrInteger(const CFX_ByteStringC& name, int& attribute) const;
+ FX_BOOL GetAttrInteger(const CFX_ByteStringC& name, int& attribute) const;
int GetAttrInteger(const CFX_ByteStringC& name) const
{
int attr = 0;
@@ -107,7 +107,7 @@ public:
return attr;
}
- bool GetAttrInteger(const CFX_ByteStringC& space, const CFX_ByteStringC& name, int& attribute) const;
+ FX_BOOL GetAttrInteger(const CFX_ByteStringC& space, const CFX_ByteStringC& name, int& attribute) const;
int GetAttrInteger(const CFX_ByteStringC& space, const CFX_ByteStringC& name) const
{
int attr = 0;
@@ -115,7 +115,7 @@ public:
return attr;
}
- bool GetAttrFloat(const CFX_ByteStringC& name, FX_FLOAT& attribute) const;
+ FX_BOOL GetAttrFloat(const CFX_ByteStringC& name, FX_FLOAT& attribute) const;
FX_FLOAT GetAttrFloat(const CFX_ByteStringC& name) const
{
FX_FLOAT attr = 0;
@@ -123,7 +123,7 @@ public:
return attr;
}
- bool GetAttrFloat(const CFX_ByteStringC& space, const CFX_ByteStringC& name, FX_FLOAT& attribute) const;
+ FX_BOOL GetAttrFloat(const CFX_ByteStringC& space, const CFX_ByteStringC& name, FX_FLOAT& attribute) const;
FX_FLOAT GetAttrFloat(const CFX_ByteStringC& space, const CFX_ByteStringC& name) const
{
FX_FLOAT attr = 0;
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h
index 115ef55c49..fb9bf4d111 100644
--- a/core/include/fxge/fpf.h
+++ b/core/include/fxge/fpf.h
@@ -41,8 +41,8 @@ public:
virtual int32_t GetAscent() const = 0;
virtual int32_t GetDescent() const = 0;
- virtual bool GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) = 0;
- virtual bool GetBBox(FX_RECT &rtBBox) = 0;
+ virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox) = 0;
+ virtual FX_BOOL GetBBox(FX_RECT &rtBBox) = 0;
virtual int32_t GetHeight() const = 0;
virtual int32_t GetItalicAngle() const = 0;
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index 554fe30602..27fc2f987d 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -179,13 +179,13 @@ public:
virtual const uint8_t* GetScanline(int line) const = 0;
- virtual bool SkipToScanline(int line, IFX_Pause* pPause) const
+ virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const
{
- return false;
+ return FALSE;
}
virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const = 0;
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const = 0;
virtual void SetDownSampleSize(int width, int height) const {}
@@ -194,24 +194,24 @@ public:
return m_bpp;
}
- bool IsAlphaMask() const
+ FX_BOOL IsAlphaMask() const
{
return m_AlphaFlag == 1;
}
- bool HasAlpha() const
+ FX_BOOL HasAlpha() const
{
- return m_AlphaFlag & 2 ? true : false;
+ return m_AlphaFlag & 2 ? TRUE : FALSE;
}
- bool IsOpaqueImage() const
+ FX_BOOL IsOpaqueImage() const
{
return !(m_AlphaFlag & 3);
}
- bool IsCmykImage() const
+ FX_BOOL IsCmykImage() const
{
- return m_AlphaFlag & 4 ? true : false;
+ return m_AlphaFlag & 4 ? TRUE : FALSE;
}
@@ -248,11 +248,11 @@ public:
CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = NULL) const;
- bool CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip = NULL);
+ FX_BOOL CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip = NULL);
- CFX_DIBitmap* SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pClip = NULL) const;
+ CFX_DIBitmap* SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pClip = NULL) const;
- CFX_DIBitmap* FlipImage(bool bXFlip, bool bYFlip) const;
+ CFX_DIBitmap* FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const;
void GetOverlapRect(int& dest_left, int& dest_top, int& width, int& height, int src_width,
int src_height, int& src_left, int& src_top, const CFX_ClipRgn* pClipRgn);
@@ -276,7 +276,7 @@ protected:
void BuildPalette();
- bool BuildAlphaMask();
+ FX_BOOL BuildAlphaMask();
int FindPalette(FX_DWORD color) const;
@@ -292,9 +292,9 @@ public:
CFX_DIBitmap(const CFX_DIBitmap& src);
- bool Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer = NULL, int pitch = 0);
+ FX_BOOL Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer = NULL, int pitch = 0);
- bool Copy(const CFX_DIBSource* pSrc);
+ FX_BOOL Copy(const CFX_DIBSource* pSrc);
virtual uint8_t* GetBuffer() const
{
@@ -307,11 +307,11 @@ public:
}
virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const;
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
void TakeOver(CFX_DIBitmap* pSrcBitmap);
- bool ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL);
+ FX_BOOL ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL);
void Clear(FX_DWORD color);
@@ -319,40 +319,40 @@ public:
void SetPixel(int x, int y, FX_DWORD color);
- bool LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel);
+ FX_BOOL LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel);
- bool LoadChannel(FXDIB_Channel destChannel, int value);
+ FX_BOOL LoadChannel(FXDIB_Channel destChannel, int value);
- bool MultiplyAlpha(int alpha);
+ FX_BOOL MultiplyAlpha(int alpha);
- bool MultiplyAlpha(const CFX_DIBSource* pAlphaMask);
+ FX_BOOL MultiplyAlpha(const CFX_DIBSource* pAlphaMask);
- bool TransferBitmap(int dest_left, int dest_top, int width, int height,
+ FX_BOOL TransferBitmap(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform = NULL);
- bool CompositeBitmap(int dest_left, int dest_top, int width, int height,
+ FX_BOOL CompositeBitmap(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top,
- int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, bool bRgbByteOrder = false, void* pIccTransform = NULL);
+ int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, void* pIccTransform = NULL);
- bool TransferMask(int dest_left, int dest_top, int width, int height,
+ FX_BOOL TransferMask(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag = 0, void* pIccTransform = NULL);
- bool CompositeMask(int dest_left, int dest_top, int width, int height,
+ FX_BOOL CompositeMask(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top,
- int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL);
+ int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL);
- bool CompositeRect(int dest_left, int dest_top, int width, int height, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL);
+ FX_BOOL CompositeRect(int dest_left, int dest_top, int width, int height, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL);
- bool ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor);
+ FX_BOOL ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor);
- bool DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL);
+ FX_BOOL DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL);
protected:
uint8_t* m_pBuffer;
- bool m_bExtBuf;
+ FX_BOOL m_bExtBuf;
- bool GetGrayData(void* pIccTransform = NULL);
+ FX_BOOL GetGrayData(void* pIccTransform = NULL);
};
class CFX_DIBExtractor
{
@@ -379,7 +379,7 @@ public:
~CFX_FilteredDIB();
- void LoadSrc(const CFX_DIBSource* pSrc, bool bAutoDropSrc = false);
+ void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE);
virtual FXDIB_Format GetDestFormat() = 0;
@@ -392,11 +392,11 @@ public:
protected:
virtual const uint8_t* GetScanline(int line) const;
virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const;
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
const CFX_DIBSource* m_pSrc;
- bool m_bAutoDropSrc;
+ FX_BOOL m_bAutoDropSrc;
uint8_t* m_pScanline;
};
@@ -407,7 +407,7 @@ public:
virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha = NULL) = 0;
- virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0;
+ virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0;
};
class CFX_ScanlineCompositor
{
@@ -416,8 +416,8 @@ public:
~CFX_ScanlineCompositor();
- bool Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette,
- FX_DWORD mask_color, int blend_type, bool bClip, bool bRgbByteOrder = false, int alpha_flag = 0, void* pIccTransform = NULL);
+ FX_BOOL Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette,
+ FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL);
void CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan,
@@ -449,7 +449,7 @@ protected:
void* m_pIccTransform;
uint8_t* m_pCacheScanline;
int m_CacheSize;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bRgbByteOrder;
};
class CFX_BitmapComposer : public IFX_ScanlineComposer
{
@@ -461,11 +461,11 @@ public:
void Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha,
- FX_DWORD mask_color, FX_RECT& dest_rect, bool bVertical,
- bool bFlipX, bool bFlipY, bool bRgbByteOrder = false,
+ FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical,
+ FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder = FALSE,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
+ virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha);
@@ -480,10 +480,10 @@ protected:
FX_DWORD m_MaskColor;
const CFX_DIBitmap* m_pClipMask;
CFX_ScanlineCompositor m_Compositor;
- bool m_bVertical, m_bFlipX, m_bFlipY;
+ FX_BOOL m_bVertical, m_bFlipX, m_bFlipY;
int m_AlphaFlag;
void* m_pIccTransform;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bRgbByteOrder;
int m_BlendType;
void ComposeScanlineV(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha = NULL);
uint8_t* m_pScanlineV;
@@ -501,7 +501,7 @@ public:
virtual void ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha);
- virtual bool SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
+ virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
CFX_DIBitmap* GetBitmap()
{
@@ -521,22 +521,22 @@ public:
CFX_ImageStretcher();
~CFX_ImageStretcher();
- bool Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap,
+ FX_BOOL Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap,
int dest_width, int dest_height, const FX_RECT& bitmap_rect,
FX_DWORD flags);
- bool Continue(IFX_Pause* pPause);
- bool StartQuickStretch();
- bool StartStretch();
- bool ContinueQuickStretch(IFX_Pause* pPause);
- bool ContinueStretch(IFX_Pause* pPause);
+ FX_BOOL Continue(IFX_Pause* pPause);
+ FX_BOOL StartQuickStretch();
+ FX_BOOL StartStretch();
+ FX_BOOL ContinueQuickStretch(IFX_Pause* pPause);
+ FX_BOOL ContinueStretch(IFX_Pause* pPause);
IFX_ScanlineComposer* m_pDest;
const CFX_DIBSource* m_pSource;
CStretchEngine* m_pStretchEngine;
FX_DWORD m_Flags;
- bool m_bFlipX;
- bool m_bFlipY;
+ FX_BOOL m_bFlipX;
+ FX_BOOL m_bFlipY;
int m_DestWidth;
int m_DestHeight;
FX_RECT m_ClipRect;
@@ -552,10 +552,10 @@ public:
CFX_ImageTransformer();
~CFX_ImageTransformer();
- bool Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix,
+ FX_BOOL Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix,
int flags, const FX_RECT* pClip);
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Continue(IFX_Pause* pPause);
CFX_AffineMatrix* m_pMatrix;
FX_RECT m_StretchClip;
@@ -575,14 +575,14 @@ public:
CFX_ImageRenderer();
~CFX_ImageRenderer();
- bool Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
+ FX_BOOL Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
const CFX_DIBSource* pSource, int bitmap_alpha,
FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix,
- FX_DWORD dib_flags, bool bRgbByteOrder = false,
+ FX_DWORD dib_flags, FX_BOOL bRgbByteOrder = FALSE,
int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL);
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Continue(IFX_Pause* pPause);
protected:
CFX_DIBitmap* m_pDevice;
@@ -598,7 +598,7 @@ protected:
FX_DWORD m_Flags;
int m_AlphaFlag;
void* m_pIccTransform;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bRgbByteOrder;
int m_BlendType;
};
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 20ef5d42c2..2832fbfcbc 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -56,12 +56,12 @@ public:
CFX_Font();
~CFX_Font();
- bool LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, bool bVertical = false);
+ FX_BOOL LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical = FALSE);
- bool LoadEmbedded(const uint8_t* data, FX_DWORD size);
+ FX_BOOL LoadEmbedded(const uint8_t* data, FX_DWORD size);
- bool LoadFile(IFX_FileRead* pFile);
+ FX_BOOL LoadFile(IFX_FileRead* pFile);
FXFT_Face GetFace() const
{
@@ -82,15 +82,15 @@ public:
int GetDescent() const;
- bool GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox);
+ FX_BOOL GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox);
- bool IsItalic();
+ FX_BOOL IsItalic();
- bool IsBold();
+ FX_BOOL IsBold();
- bool IsFixedWidth();
+ FX_BOOL IsFixedWidth();
- bool IsVertical() const
+ FX_BOOL IsVertical() const
{
return m_bVertical;
}
@@ -103,9 +103,9 @@ public:
CFX_ByteString GetFaceName() const;
- bool IsTTFont();
+ FX_BOOL IsTTFont();
- bool GetBBox(FX_RECT &bbox);
+ FX_BOOL GetBBox(FX_RECT &bbox);
int GetHeight();
@@ -118,7 +118,7 @@ public:
FXFT_Face m_Face;
CFX_SubstFont* m_pSubstFont;
- bool IsEmbedded()
+ FX_BOOL IsEmbedded()
{
return m_bEmbedded;
}
@@ -133,14 +133,14 @@ public:
void* m_pPlatformFont;
void* m_pPlatformFontCollection;
void* m_pDwFont;
- bool m_bDwLoaded;
+ FX_BOOL m_bDwLoaded;
void ReleasePlatformResource();
void DeleteFace();
protected:
- bool m_bEmbedded;
- bool m_bVertical;
+ FX_BOOL m_bEmbedded;
+ FX_BOOL m_bVertical;
void* m_pOwnedStream;
};
#define ENCODING_INTERNAL 0
@@ -182,11 +182,11 @@ public:
int m_ItalicAngle;
- bool m_bSubstOfCJK;
+ FX_BOOL m_bSubstOfCJK;
int m_WeightCJK;
- bool m_bItlicCJK;
+ FX_BOOL m_bItlicCJK;
};
#define FX_FONT_FLAG_SERIF 0x01
#define FX_FONT_FLAG_FIXEDPITCH 0x02
@@ -206,9 +206,9 @@ public:
~CFX_FontMgr();
void InitFTLibrary();
FXFT_Face GetCachedFace(const CFX_ByteString& face_name,
- int weight, bool bItalic, uint8_t*& pFontData);
+ int weight, FX_BOOL bItalic, uint8_t*& pFontData);
FXFT_Face AddCachedFace(const CFX_ByteString& face_name,
- int weight, bool bItalic, uint8_t* pData, FX_DWORD size, int face_index);
+ int weight, FX_BOOL bItalic, uint8_t* pData, FX_DWORD size, int face_index);
FXFT_Face GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
int font_offset, uint8_t*& pFontData);
FXFT_Face AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
@@ -217,12 +217,12 @@ public:
FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index);
void ReleaseFace(FXFT_Face face);
void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
- FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags,
+ FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont);
void FreeCache();
- bool GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index);
+ FX_BOOL GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index);
CFX_FontMapper* m_pBuiltinMapper;
IFX_FontMapper* m_pExtMapper;
CFX_MapByteStringToPtr m_FaceMap;
@@ -235,7 +235,7 @@ public:
virtual ~IFX_FontMapper() {}
- virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags,
+ virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont) = 0;
CFX_FontMgr* m_pFontMgr;
@@ -277,14 +277,14 @@ public:
{
return m_pFontEnumerator;
}
- virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags,
+ virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont);
private:
CFX_ByteString GetPSNameFromTT(void* hFont);
CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name);
FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily);
- bool m_bListLoaded;
+ FX_BOOL m_bListLoaded;
FXFT_Face m_MMFaces[2];
CFX_ByteString m_LastFamily;
CFX_DWordArray m_CharsetArray;
@@ -299,12 +299,12 @@ public:
static IFX_SystemFontInfo* CreateDefault();
virtual void Release() = 0;
- virtual bool EnumFontList(CFX_FontMapper* pMapper) = 0;
- virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, int& iExact) = 0;
+ virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0;
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, int& iExact) = 0;
virtual void* GetFont(const FX_CHAR* face) = 0;
virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size) = 0;
- virtual bool GetFaceName(void* hFont, CFX_ByteString& name) = 0;
- virtual bool GetFontCharset(void* hFont, int& charset) = 0;
+ virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0;
+ virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0;
virtual int GetFaceIndex(void* hFont)
{
return 0;
@@ -326,15 +326,15 @@ public:
// IFX_SytemFontInfo:
void Release() override;
- bool EnumFontList(CFX_FontMapper* pMapper) override;
- void* MapFont(int weight, bool bItalic, int charset, int pitch_family,
+ FX_BOOL EnumFontList(CFX_FontMapper* pMapper) override;
+ void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family,
const FX_CHAR* face, int& bExact) override;
void* GetFont(const FX_CHAR* face) override;
FX_DWORD GetFontData(void* hFont, FX_DWORD table,
uint8_t* buffer, FX_DWORD size) override;
void DeleteFont(void* hFont) override;
- bool GetFaceName(void* hFont, CFX_ByteString& name) override;
- bool GetFontCharset(void* hFont, int& charset) override;
+ FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override;
+ FX_BOOL GetFontCharset(void* hFont, int& charset) override;
protected:
CFX_MapByteStringToPtr m_FontList;
@@ -357,7 +357,7 @@ public:
~CFX_FontCache();
CFX_FaceCache* GetCachedFace(CFX_Font* pFont);
void ReleaseCachedFace(CFX_Font* pFont);
- void FreeCache(bool bRelease = false);
+ void FreeCache(FX_BOOL bRelease = FALSE);
private:
using CFX_FTCacheMap = std::map<FXFT_Face, CFX_CountedFaceCache*>;
@@ -391,7 +391,7 @@ class CFX_FaceCache
{
public:
~CFX_FaceCache();
- const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle, const CFX_AffineMatrix* pMatrix,
+ const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
int dest_width, int anti_alias, int& text_flags);
const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_index, int dest_width);
@@ -399,12 +399,12 @@ public:
CFX_FaceCache(FXFT_Face face);
private:
FXFT_Face m_Face;
- CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle,
+ CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle,
const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias);
CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index,
const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias);
CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix, CFX_ByteStringC& FaceGlyphsKey,
- FX_DWORD glyph_index, bool bFontStyle, int dest_width, int anti_alias);
+ FX_DWORD glyph_index, FX_BOOL bFontStyle, int dest_width, int anti_alias);
CFX_MapByteStringToPtr m_SizeMap;
CFX_MapPtrToPtr m_PathMap;
CFX_DIBitmap* m_pBitmap;
@@ -418,16 +418,16 @@ typedef struct {
FX_FLOAT m_fOriginX, m_fOriginY;
} FXTEXT_GLYPHPOS;
FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f);
-bool OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb);
-bool OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb);
class IFX_GSUBTable
{
public:
static IFX_GSUBTable* Create(CFX_Font* pFont);
virtual ~IFX_GSUBTable() { }
- virtual bool GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
+ virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
};
#endif // CORE_INCLUDE_FXGE_FX_FONT_H_
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index 5965641a3e..fd9c148b62 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -193,11 +193,11 @@ public:
void Transform(const CFX_AffineMatrix* pMatrix);
- bool IsRect() const;
+ FX_BOOL IsRect() const;
- bool GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, bool&bThin, bool bAdjust) const;
+ FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const;
- bool IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const;
+ FX_BOOL IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const;
void Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix);
void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top);
@@ -294,10 +294,10 @@ typedef struct {
FX_DWORD m_GlyphIndex;
FX_FLOAT m_OriginX, m_OriginY;
int m_FontCharWidth;
- bool m_bGlyphAdjust;
+ FX_BOOL m_bGlyphAdjust;
FX_FLOAT m_AdjustMatrix[4];
FX_DWORD m_ExtGID;
- bool m_bFontStyle;
+ FX_BOOL m_bFontStyle;
} FXTEXT_CHARPOS;
class CFX_RenderDevice
{
@@ -313,7 +313,7 @@ public:
return m_pDeviceDriver;
}
- bool StartRendering();
+ FX_BOOL StartRendering();
void EndRendering();
@@ -321,7 +321,7 @@ public:
void SaveState();
- void RestoreState(bool bKeepSaved = false);
+ void RestoreState(FX_BOOL bKeepSaved = FALSE);
@@ -365,26 +365,26 @@ public:
m_pBitmap = pBitmap;
}
- bool CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const;
+ FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const;
const FX_RECT& GetClipBox() const
{
return m_ClipBox;
}
- bool SetClip_PathFill(const CFX_PathData* pPathData,
+ FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
);
- bool SetClip_Rect(const FX_RECT* pRect);
+ FX_BOOL SetClip_Rect(const FX_RECT* pRect);
- bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
);
- bool DrawPath(const CFX_PathData* pPathData,
+ FX_BOOL DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -395,46 +395,46 @@ public:
int blend_type = FXDIB_BLEND_NORMAL
);
- bool SetPixel(int x, int y, FX_DWORD color,
+ FX_BOOL SetPixel(int x, int y, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
- bool FillRect(const FX_RECT* pRect, FX_DWORD color,
+ FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int fill_mode = 0, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL);
+ FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL);
CFX_DIBitmap* GetBackDrop();
- bool SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_type = FXDIB_BLEND_NORMAL,
+ FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_type = FXDIB_BLEND_NORMAL,
void* pIccTransform = NULL);
- bool StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height,
+ FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height,
FX_DWORD flags = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- bool SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD color,
+ FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
- bool StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height,
+ FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height,
FX_DWORD color, FX_DWORD flags = 0, int alpha_flag = 0, void* pIccTransform = NULL);
- bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- bool ContinueDIBits(void* handle, IFX_Pause* pPause);
+ FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
void CancelDIBits(void* handle);
- bool DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
+ FX_BOOL DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
FX_DWORD fill_color, FX_DWORD text_flags,
int alpha_flag = 0, void* pIccTransform = NULL);
- bool DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
+ FX_BOOL DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
FX_FLOAT font_size, const CFX_AffineMatrix* pText2User,
const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState,
@@ -477,12 +477,12 @@ public:
~CFX_FxgeDevice();
- bool Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, bool bRgbByteOrder = false, CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false);
+ FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
- bool Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);
+ FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);
protected:
- bool m_bOwnedBitmap;
+ FX_BOOL m_bOwnedBitmap;
};
class CFX_SkiaDevice : public CFX_RenderDevice
{
@@ -492,19 +492,19 @@ public:
~CFX_SkiaDevice();
- bool Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, bool bRgbByteOrder = false, CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false);
+ FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
- bool Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);
+ FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);
protected:
- bool m_bOwnedBitmap;
+ FX_BOOL m_bOwnedBitmap;
};
class IFX_RenderDeviceDriver
{
public:
- static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, bool bRgbByteOrder = false,
- CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false);
+ static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, FX_BOOL bRgbByteOrder = FALSE,
+ CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
virtual ~IFX_RenderDeviceDriver() {}
virtual void Begin() { }
@@ -517,14 +517,14 @@ public:
return CFX_Matrix();
}
- virtual bool IsPSPrintDriver()
+ virtual FX_BOOL IsPSPrintDriver()
{
- return false;
+ return FALSE;
}
- virtual bool StartRendering()
+ virtual FX_BOOL StartRendering()
{
- return true;
+ return TRUE;
}
virtual void EndRendering() {}
@@ -534,23 +534,23 @@ public:
virtual void SaveState() = 0;
- virtual void RestoreState(bool bKeepSaved = false) = 0;
+ virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0;
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData,
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
) = 0;
- virtual bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
)
{
- return false;
+ return FALSE;
}
- virtual bool DrawPath(const CFX_PathData* pPathData,
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -561,59 +561,59 @@ public:
int blend_type = FXDIB_BLEND_NORMAL
) = 0;
- virtual bool SetPixel(int x, int y, FX_DWORD color,
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL)
{
- return false;
+ return FALSE;
}
- virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
+ virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL)
{
- return false;
+ return FALSE;
}
- virtual bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL)
{
- return false;
+ return FALSE;
}
- virtual bool GetClipBox(FX_RECT* pRect) = 0;
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0;
- virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false)
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE)
{
- return false;
+ return FALSE;
}
virtual CFX_DIBitmap* GetBackDrop()
{
return NULL;
}
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
int dest_left, int dest_top, int blend_type,
int alpha_flag = 0, void* pIccTransform = NULL) = 0;
- virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0;
- virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0;
- virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause)
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause)
{
- return false;
+ return FALSE;
}
virtual void CancelDIBits(void* handle) {}
- virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL)
{
- return false;
+ return FALSE;
}
virtual void* GetPlatformSurface()
@@ -646,13 +646,13 @@ public:
~CFX_PSRenderer();
- void Init(IFX_PSOutput* pOutput, int ps_level, int width, int height, bool bCmykOutput);
- bool StartRendering();
+ void Init(IFX_PSOutput* pOutput, int ps_level, int width, int height, FX_BOOL bCmykOutput);
+ FX_BOOL StartRendering();
void EndRendering();
void SaveState();
- void RestoreState(bool bKeepSaved = false);
+ void RestoreState(FX_BOOL bKeepSaved = FALSE);
void SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
@@ -669,7 +669,7 @@ public:
return m_ClipBox;
}
- bool DrawPath(const CFX_PathData* pPathData,
+ FX_BOOL DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -679,18 +679,18 @@ public:
void* pIccTransform = NULL
);
- bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int alpha_flag = 0, void* pIccTransform = NULL);
- bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD flags,
int alpha_flag = 0, void* pIccTransform = NULL);
- bool DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
+ FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
int alpha_flag = 0, void* pIccTransform = NULL);
- bool DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache,
+ FX_BOOL DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache,
const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
private:
@@ -701,11 +701,11 @@ private:
CFX_GraphStateData m_CurGraphState;
- bool m_bGraphStateSet;
+ FX_BOOL m_bGraphStateSet;
- bool m_bCmykOutput;
+ FX_BOOL m_bCmykOutput;
- bool m_bColorSet;
+ FX_BOOL m_bColorSet;
FX_DWORD m_LastColor;
@@ -714,7 +714,7 @@ private:
CFX_ArrayTemplate<CPSFont*> m_PSFontList;
CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack;
- bool m_bInited;
+ FX_BOOL m_bInited;
void OutputPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device);
diff --git a/core/include/fxge/fx_ge_apple.h b/core/include/fxge/fx_ge_apple.h
index ebe61cc59f..0fb8bedcfc 100644
--- a/core/include/fxge/fx_ge_apple.h
+++ b/core/include/fxge/fx_ge_apple.h
@@ -13,15 +13,15 @@ class CFX_QuartzDevice : public CFX_RenderDevice
public:
CFX_QuartzDevice();
~CFX_QuartzDevice();
- bool Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY);
- bool Attach(CFX_DIBitmap* pBitmap);
- bool Create(int32_t width, int32_t height, FXDIB_Format format);
+ FX_BOOL Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY);
+ FX_BOOL Attach(CFX_DIBitmap* pBitmap);
+ FX_BOOL Create(int32_t width, int32_t height, FXDIB_Format format);
CGContextRef GetContext();
protected:
CGContextRef m_pContext;
- bool m_bOwnedBitmap;
+ FX_BOOL m_bOwnedBitmap;
};
#endif
diff --git a/core/include/fxge/fx_ge_win32.h b/core/include/fxge/fx_ge_win32.h
index 8023bd8099..5b16146b6a 100644
--- a/core/include/fxge/fx_ge_win32.h
+++ b/core/include/fxge/fx_ge_win32.h
@@ -72,13 +72,13 @@ protected:
class CFX_WindowsDevice : public CFX_RenderDevice
{
public:
- static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, bool bCmykOutput = false);
+ static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, FX_BOOL bCmykOutput = FALSE);
- CFX_WindowsDevice(HDC hDC, bool bCmykOutput = false, bool bForcePSOutput = false, int psLevel = 2);
+ CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput = FALSE, FX_BOOL bForcePSOutput = FALSE, int psLevel = 2);
HDC GetDC() const;
- bool m_bForcePSOutput;
+ FX_BOOL m_bForcePSOutput;
static int m_psLevel;
};
diff --git a/core/include/thirdparties/libjpeg/jmorecfg.h b/core/include/thirdparties/libjpeg/jmorecfg.h
index e0a871e023..88d210954c 100644
--- a/core/include/thirdparties/libjpeg/jmorecfg.h
+++ b/core/include/thirdparties/libjpeg/jmorecfg.h
@@ -230,7 +230,7 @@ typedef unsigned int JDIMENSION;
/*
- * On a few systems, type boolean and/or its values false, true may appear
+ * On a few systems, type boolean and/or its values FALSE, TRUE may appear
* in standard header files. Or you may have conflicts with application-
* specific header files that you want to include together with these files.
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
@@ -239,11 +239,11 @@ typedef unsigned int JDIMENSION;
#ifndef HAVE_BOOLEAN
typedef int boolean;
#endif
-#ifndef false /* in case these macros already exist */
-#define false 0 /* values of boolean */
+#ifndef FALSE /* in case these macros already exist */
+#define FALSE 0 /* values of boolean */
#endif
-#ifndef true
-#define true 1
+#ifndef TRUE
+#define TRUE 1
#endif
diff --git a/core/include/thirdparties/libjpeg/jpegint.h b/core/include/thirdparties/libjpeg/jpegint.h
index 745a4c09f2..95b00d405c 100644
--- a/core/include/thirdparties/libjpeg/jpegint.h
+++ b/core/include/thirdparties/libjpeg/jpegint.h
@@ -95,7 +95,7 @@ struct jpeg_downsampler {
JSAMPIMAGE output_buf,
JDIMENSION out_row_group_index));
- boolean need_context_rows; /* true if need rows above & below */
+ boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Forward DCT (also controls coefficient quantization) */
@@ -213,7 +213,7 @@ struct jpeg_entropy_decoder {
/* This is here to share code between baseline and progressive decoders; */
/* other modules probably should not use it */
- boolean insufficient_data; /* set true after emitting warning */
+ boolean insufficient_data; /* set TRUE after emitting warning */
};
/* Inverse DCT (also performs dequantization) */
@@ -239,7 +239,7 @@ struct jpeg_upsampler {
JDIMENSION *out_row_ctr,
JDIMENSION out_rows_avail));
- boolean need_context_rows; /* true if need rows above & below */
+ boolean need_context_rows; /* TRUE if need rows above & below */
};
/* Colorspace conversion */
diff --git a/core/include/thirdparties/libjpeg/jpeglib.h b/core/include/thirdparties/libjpeg/jpeglib.h
index 78831ac4cc..7de5ab726e 100644
--- a/core/include/thirdparties/libjpeg/jpeglib.h
+++ b/core/include/thirdparties/libjpeg/jpeglib.h
@@ -153,12 +153,12 @@ typedef struct {
* CAUTION: IJG versions prior to v6a kept this array in zigzag order.
*/
UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
- /* This field is used only during compression. It's initialized false when
- * the table is created, and set true when it's been output to the file.
- * You could suppress output of a table by setting this to true.
+ /* This field is used only during compression. It's initialized FALSE when
+ * the table is created, and set TRUE when it's been output to the file.
+ * You could suppress output of a table by setting this to TRUE.
* (See jpeg_suppress_tables for an example.)
*/
- boolean sent_table; /* true when table has been output */
+ boolean sent_table; /* TRUE when table has been output */
} JQUANT_TBL;
@@ -169,12 +169,12 @@ typedef struct {
UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
/* length k bits; bits[0] is unused */
UINT8 huffval[256]; /* The symbols, in order of incr code length */
- /* This field is used only during compression. It's initialized false when
- * the table is created, and set true when it's been output to the file.
- * You could suppress output of a table by setting this to true.
+ /* This field is used only during compression. It's initialized FALSE when
+ * the table is created, and set TRUE when it's been output to the file.
+ * You could suppress output of a table by setting this to TRUE.
* (See jpeg_suppress_tables for an example.)
*/
- boolean sent_table; /* true when table has been output */
+ boolean sent_table; /* TRUE when table has been output */
} JHUFF_TBL;
@@ -384,10 +384,10 @@ struct jpeg_compress_struct {
* set num_scans and scan_info to point to an array of scan definitions.
*/
- boolean raw_data_in; /* true=caller supplies downsampled data */
- boolean arith_code; /* true=arithmetic coding, false=Huffman */
- boolean optimize_coding; /* true=optimize entropy encoding parms */
- boolean CCIR601_sampling; /* true=first samples are cosited */
+ boolean raw_data_in; /* TRUE=caller supplies downsampled data */
+ boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
+ boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
+ boolean CCIR601_sampling; /* TRUE=first samples are cosited */
int smoothing_factor; /* 1..100, or 0 for no input smoothing */
J_DCT_METHOD dct_method; /* DCT algorithm selector */
@@ -427,7 +427,7 @@ struct jpeg_compress_struct {
/*
* These fields are computed during compression startup
*/
- boolean progressive_mode; /* true if scan script uses progressive mode */
+ boolean progressive_mode; /* TRUE if scan script uses progressive mode */
int max_h_samp_factor; /* largest h_samp_factor */
int max_v_samp_factor; /* largest v_samp_factor */
@@ -500,17 +500,17 @@ struct jpeg_decompress_struct {
double output_gamma; /* image gamma wanted in output */
- boolean buffered_image; /* true=multiple output passes */
- boolean raw_data_out; /* true=downsampled data wanted */
+ boolean buffered_image; /* TRUE=multiple output passes */
+ boolean raw_data_out; /* TRUE=downsampled data wanted */
J_DCT_METHOD dct_method; /* IDCT algorithm selector */
- boolean do_fancy_upsampling; /* true=apply fancy upsampling */
- boolean do_block_smoothing; /* true=apply interblock smoothing */
+ boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
+ boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
- boolean quantize_colors; /* true=colormapped output wanted */
+ boolean quantize_colors; /* TRUE=colormapped output wanted */
/* the following are ignored if not quantize_colors: */
J_DITHER_MODE dither_mode; /* type of color dithering to use */
- boolean two_pass_quantize; /* true=use two-pass color quantization */
+ boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
int desired_number_of_colors; /* max # colors to use in created colormap */
/* these are significant only in buffered-image mode: */
boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
@@ -602,8 +602,8 @@ struct jpeg_decompress_struct {
jpeg_component_info * comp_info;
/* comp_info[i] describes component that appears i'th in SOF */
- boolean progressive_mode; /* true if SOFn specifies progressive mode */
- boolean arith_code; /* true=arithmetic coding, false=Huffman */
+ boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
+ boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
@@ -614,17 +614,17 @@ struct jpeg_decompress_struct {
/* These fields record data obtained from optional markers recognized by
* the JPEG library.
*/
- boolean saw_JFIF_marker; /* true iff a JFIF APP0 marker was found */
- /* Data copied from JFIF marker; only valid if saw_JFIF_marker is true: */
+ boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
+ /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
UINT8 JFIF_major_version; /* JFIF version number */
UINT8 JFIF_minor_version;
UINT8 density_unit; /* JFIF code for pixel size units */
UINT16 X_density; /* Horizontal pixel density */
UINT16 Y_density; /* Vertical pixel density */
- boolean saw_Adobe_marker; /* true iff an Adobe APP14 marker was found */
+ boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
UINT8 Adobe_transform; /* Color transform code from Adobe marker */
- boolean CCIR601_sampling; /* true=first samples are cosited */
+ boolean CCIR601_sampling; /* TRUE=first samples are cosited */
/* Aside from the specific data retained from APPn markers known to the
* library, the uninterpreted contents of any or all APPn and COM markers
@@ -1034,7 +1034,7 @@ EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
#define JPEG_HEADER_OK 1 /* Found valid image datastream */
#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
-/* If you pass require_image = true (normal case), you need not check for
+/* If you pass require_image = TRUE (normal case), you need not check for
* a TABLES_ONLY return code; an abbreviated file will cause an error exit.
* JPEG_SUSPENDED is only possible if you use a data source module that can
* give a suspension return (the stdio source module doesn't).
diff --git a/core/src/fdrm/crypto/fx_crypt.cpp b/core/src/fdrm/crypto/fx_crypt.cpp
index f19445f8f2..83a420ad38 100644
--- a/core/src/fdrm/crypto/fx_crypt.cpp
+++ b/core/src/fdrm/crypto/fx_crypt.cpp
@@ -249,8 +249,8 @@ void CRYPT_MD5Generate(const uint8_t* input, FX_DWORD length, uint8_t digest[16]
CRYPT_MD5Update(&ctx, input, length);
CRYPT_MD5Finish(&ctx, digest);
}
-static bool (*g_PubKeyDecryptor)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len) = NULL;
-void CRYPT_SetPubKeyDecryptor(bool (*func)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len))
+static FX_BOOL (*g_PubKeyDecryptor)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len) = NULL;
+void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, FX_DWORD size, uint8_t* data_buf, FX_DWORD& data_len))
{
g_PubKeyDecryptor = func;
}
diff --git a/core/src/fdrm/crypto/fx_crypt_aes.cpp b/core/src/fdrm/crypto/fx_crypt_aes.cpp
index 9f142226da..4bd87105aa 100644
--- a/core/src/fdrm/crypto/fx_crypt_aes.cpp
+++ b/core/src/fdrm/crypto/fx_crypt_aes.cpp
@@ -988,7 +988,7 @@ static void aes_encrypt_cbc(unsigned char *dest, const unsigned char *src, int l
}
FXSYS_memcpy(ctx->iv, iv, sizeof(iv));
}
-void CRYPT_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DWORD keylen, bool bEncrypt)
+void CRYPT_AESSetKey(void* context, FX_DWORD blocklen, const uint8_t* key, FX_DWORD keylen, FX_BOOL bEncrypt)
{
aes_setup((AESContext*)context, blocklen, key, keylen);
}
diff --git a/core/src/fdrm/crypto/fx_crypt_sha.cpp b/core/src/fdrm/crypto/fx_crypt_sha.cpp
index de1ec08d3d..b22348a03c 100644
--- a/core/src/fdrm/crypto/fx_crypt_sha.cpp
+++ b/core/src/fdrm/crypto/fx_crypt_sha.cpp
@@ -405,7 +405,7 @@ uint64_t FX_ato64i(const FX_CHAR* str)
} else if (str[i] >= 'A' && str[i] <= 'F') {
ret |= (str[i] - 'A' + 10) & 0xFF;
} else {
- FXSYS_assert(false);
+ FXSYS_assert(FALSE);
}
}
return ret;
diff --git a/core/src/fpdfapi/fpdf_basic_module.cpp b/core/src/fpdfapi/fpdf_basic_module.cpp
index 83034af640..03cfd66afb 100644
--- a/core/src/fpdfapi/fpdf_basic_module.cpp
+++ b/core/src/fpdfapi/fpdf_basic_module.cpp
@@ -44,14 +44,14 @@ CPDF_ModuleMgr::~CPDF_ModuleMgr()
{
}
-void CPDF_ModuleMgr::SetDownloadCallback(bool (*callback)(const FX_CHAR* module_name))
+void CPDF_ModuleMgr::SetDownloadCallback(FX_BOOL (*callback)(const FX_CHAR* module_name))
{
m_pDownloadCallback = callback;
}
-bool CPDF_ModuleMgr::DownloadModule(const FX_CHAR* module_name)
+FX_BOOL CPDF_ModuleMgr::DownloadModule(const FX_CHAR* module_name)
{
if (m_pDownloadCallback == NULL) {
- return false;
+ return FALSE;
}
return m_pDownloadCallback(module_name);
}
diff --git a/core/src/fpdfapi/fpdf_edit/editint.h b/core/src/fpdfapi/fpdf_edit/editint.h
index bc4c72aff9..4aec32a49a 100644
--- a/core/src/fpdfapi/fpdf_edit/editint.h
+++ b/core/src/fpdfapi/fpdf_edit/editint.h
@@ -12,7 +12,7 @@ class CPDF_ObjectStream
public:
CPDF_ObjectStream();
- bool Start();
+ FX_BOOL Start();
int32_t CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj);
int32_t CompressIndirectObject(FX_DWORD dwObjNum, const uint8_t* pBuffer, FX_DWORD dwSize);
@@ -34,15 +34,15 @@ public:
CPDF_XRefStream();
- bool Start();
+ FX_BOOL Start();
int32_t CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator);
int32_t CompressIndirectObject(FX_DWORD dwObjNum, const uint8_t* pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator);
- bool End(CPDF_Creator *pCreator, bool bEOF = false);
- bool AddObjectNumberToIndexArray(FX_DWORD objnum);
- bool EndXRefStream(CPDF_Creator* pCreator);
+ FX_BOOL End(CPDF_Creator *pCreator, FX_BOOL bEOF = FALSE);
+ FX_BOOL AddObjectNumberToIndexArray(FX_DWORD objnum);
+ FX_BOOL EndXRefStream(CPDF_Creator* pCreator);
CFX_DWordArray m_IndexArray;
@@ -51,8 +51,8 @@ public:
FX_DWORD m_dwTempObjNum;
protected:
- int32_t EndObjectStream(CPDF_Creator *pCreator, bool bEOF = true);
- bool GenerateXRefStream(CPDF_Creator* pCreator, bool bEOF);
+ int32_t EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF = TRUE);
+ FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF);
int32_t m_iSeg;
CPDF_ObjectStream m_ObjStream;
CFX_ByteTextBuf m_Buffer;
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
index b84936c273..65f78dab13 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
@@ -28,10 +28,10 @@ CPDF_PageContentGenerate::CPDF_PageContentGenerate(CPDF_Page* pPage) : m_pPage(p
CPDF_PageContentGenerate::~CPDF_PageContentGenerate()
{
}
-bool CPDF_PageContentGenerate::InsertPageObject(CPDF_PageObject* pPageObject)
+FX_BOOL CPDF_PageContentGenerate::InsertPageObject(CPDF_PageObject* pPageObject)
{
if (!pPageObject) {
- return false;
+ return FALSE;
}
return m_pageObjects.Add(pPageObject);
}
@@ -51,7 +51,7 @@ void CPDF_PageContentGenerate::GenerateContent()
pPageDict->RemoveAt("Contents");
}
CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
- pStream->SetData(buf.GetBuffer(), buf.GetLength(), false, false);
+ pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
m_pDocument->AddIndirectObject(pStream);
pPageDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
}
@@ -158,7 +158,7 @@ void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix)
ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix);
}
CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
- pStream->SetData(buf.GetBuffer(), buf.GetLength(), false, false);
+ pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
m_pDocument->AddIndirectObject(pStream);
m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
}
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index b197b25979..22826a3609 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -13,7 +13,7 @@
extern void FlateEncode(const uint8_t* src_buf, FX_DWORD src_data, uint8_t*& dest_buf, FX_DWORD& dest_size);
extern void FlateEncode(const uint8_t* src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns,
uint8_t*& dest_buf, FX_DWORD& dest_size);
-extern bool IsSignatureDict(const CPDF_Dictionary* pDict);
+extern FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict);
int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *pFile, FX_FILESIZE& offset)
{
int32_t len = 0;
@@ -43,7 +43,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *
break;
case PDFOBJ_STRING: {
CFX_ByteString str = pObj->GetString();
- bool bHex = ((CPDF_String*)pObj)->IsHex();
+ FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
if ((len = pFile->AppendString(PDF_EncodeString(str, bHex))) < 0) {
return -1;
}
@@ -156,7 +156,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *
}
offset += 8;
CPDF_StreamAcc acc;
- acc.LoadAllData(p, true);
+ acc.LoadAllData(p, TRUE);
if (pFile->AppendBlock(acc.GetData(), acc.GetSize()) < 0) {
return -1;
}
@@ -168,12 +168,12 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *
break;
}
default:
- ASSERT(false);
+ ASSERT(FALSE);
break;
}
return 1;
}
-int32_t PDF_CreatorWriteTrailer(CPDF_Document* pDocument, CFX_FileBufferArchive* pFile, CPDF_Array* pIDArray, bool bCompress)
+int32_t PDF_CreatorWriteTrailer(CPDF_Document* pDocument, CFX_FileBufferArchive* pFile, CPDF_Array* pIDArray, FX_BOOL bCompress)
{
FX_FILESIZE offset = 0;
int32_t len = 0;
@@ -285,10 +285,10 @@ int32_t PDF_CreatorWriteEncrypt(const CPDF_Dictionary* pEncryptDict, FX_DWORD dw
offset += len + 6;
return offset;
}
-bool PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2, FX_DWORD* pBuffer)
+FX_BOOL PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2, FX_DWORD* pBuffer)
{
if (!pBuffer) {
- return false;
+ return FALSE;
}
void* pContext = FX_Random_MT_Start(dwSeed1);
int32_t i = 0;
@@ -301,21 +301,21 @@ bool PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2, FX_DWORD* pBuffer)
*pBuffer++ = FX_Random_MT_Generate(pContext);
}
FX_Random_MT_Close(pContext);
- return true;
+ return TRUE;
}
class CPDF_FlateEncoder
{
public:
CPDF_FlateEncoder();
~CPDF_FlateEncoder();
- bool Initialize(CPDF_Stream* pStream, bool bFlateEncode);
- bool Initialize(const uint8_t* pBuffer, FX_DWORD size, bool bFlateEncode, bool bXRefStream = false);
+ FX_BOOL Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode);
+ FX_BOOL Initialize(const uint8_t* pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream = FALSE);
void CloneDict();
uint8_t* m_pData;
FX_DWORD m_dwSize;
CPDF_Dictionary* m_pDict;
- bool m_bCloned;
- bool m_bNewData;
+ FX_BOOL m_bCloned;
+ FX_BOOL m_bNewData;
CPDF_StreamAcc m_Acc;
};
CPDF_FlateEncoder::CPDF_FlateEncoder()
@@ -323,19 +323,19 @@ CPDF_FlateEncoder::CPDF_FlateEncoder()
m_pData = NULL;
m_dwSize = 0;
m_pDict = NULL;
- m_bCloned = false;
- m_bNewData = false;
+ m_bCloned = FALSE;
+ m_bNewData = FALSE;
}
void CPDF_FlateEncoder::CloneDict()
{
if (!m_bCloned) {
m_pDict = (CPDF_Dictionary*)m_pDict->Clone();
- m_bCloned = true;
+ m_bCloned = TRUE;
}
}
-bool CPDF_FlateEncoder::Initialize(CPDF_Stream* pStream, bool bFlateEncode)
+FX_BOOL CPDF_FlateEncoder::Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode)
{
- m_Acc.LoadAllData(pStream, true);
+ m_Acc.LoadAllData(pStream, TRUE);
if ((pStream && pStream->GetDict() && pStream->GetDict()->KeyExist("Filter")) || !bFlateEncode) {
if (pStream->GetDict()->KeyExist("Filter") && !bFlateEncode) {
CPDF_StreamAcc destAcc;
@@ -344,40 +344,40 @@ bool CPDF_FlateEncoder::Initialize(CPDF_Stream* pStream, bool bFlateEncode)
m_pData = (uint8_t*)destAcc.DetachData();
m_pDict = (CPDF_Dictionary*)pStream->GetDict()->Clone();
m_pDict->RemoveAt(FX_BSTRC("Filter"));
- m_bNewData = true;
- m_bCloned = true;
+ m_bNewData = TRUE;
+ m_bCloned = TRUE;
} else {
m_pData = (uint8_t*)m_Acc.GetData();
m_dwSize = m_Acc.GetSize();
m_pDict = pStream->GetDict();
}
- return true;
+ return TRUE;
}
m_pData = NULL;
m_dwSize = 0;
- m_bNewData = true;
- m_bCloned = true;
+ m_bNewData = TRUE;
+ m_bCloned = TRUE;
::FlateEncode(m_Acc.GetData(), m_Acc.GetSize(), m_pData, m_dwSize);
m_pDict = (CPDF_Dictionary*)pStream->GetDict()->Clone();
m_pDict->SetAtInteger("Length", m_dwSize);
m_pDict->SetAtName("Filter", "FlateDecode");
m_pDict->RemoveAt("DecodeParms");
- return true;
+ return TRUE;
}
-bool CPDF_FlateEncoder::Initialize(const uint8_t* pBuffer, FX_DWORD size, bool bFlateEncode, bool bXRefStream)
+FX_BOOL CPDF_FlateEncoder::Initialize(const uint8_t* pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream)
{
if (!bFlateEncode) {
m_pData = (uint8_t*)pBuffer;
m_dwSize = size;
- return true;
+ return TRUE;
}
- m_bNewData = true;
+ m_bNewData = TRUE;
if (bXRefStream) {
::FlateEncode(pBuffer, size, 12, 1, 8, 7, m_pData, m_dwSize);
} else {
::FlateEncode(pBuffer, size, m_pData, m_dwSize);
}
- return true;
+ return TRUE;
}
CPDF_FlateEncoder::~CPDF_FlateEncoder()
{
@@ -393,33 +393,33 @@ class CPDF_Encryptor
public:
CPDF_Encryptor();
~CPDF_Encryptor();
- bool Initialize(CPDF_CryptoHandler* pHandler, int objnum, uint8_t* src_data, FX_DWORD src_size);
+ FX_BOOL Initialize(CPDF_CryptoHandler* pHandler, int objnum, uint8_t* src_data, FX_DWORD src_size);
uint8_t* m_pData;
FX_DWORD m_dwSize;
- bool m_bNewBuf;
+ FX_BOOL m_bNewBuf;
};
CPDF_Encryptor::CPDF_Encryptor()
{
m_pData = NULL;
m_dwSize = 0;
- m_bNewBuf = false;
+ m_bNewBuf = FALSE;
}
-bool CPDF_Encryptor::Initialize(CPDF_CryptoHandler* pHandler, int objnum, uint8_t* src_data, FX_DWORD src_size)
+FX_BOOL CPDF_Encryptor::Initialize(CPDF_CryptoHandler* pHandler, int objnum, uint8_t* src_data, FX_DWORD src_size)
{
if (src_size == 0) {
- return true;
+ return TRUE;
}
if (pHandler == NULL) {
m_pData = (uint8_t*)src_data;
m_dwSize = src_size;
- m_bNewBuf = false;
- return true;
+ m_bNewBuf = FALSE;
+ return TRUE;
}
m_dwSize = pHandler->EncryptGetSize(objnum, 0, src_data, src_size);
m_pData = FX_Alloc(uint8_t, m_dwSize);
pHandler->EncryptContent(objnum, 0, src_data, src_size, m_pData, m_dwSize);
- m_bNewBuf = true;
- return true;
+ m_bNewBuf = TRUE;
+ return TRUE;
}
CPDF_Encryptor::~CPDF_Encryptor()
{
@@ -432,14 +432,14 @@ CPDF_ObjectStream::CPDF_ObjectStream()
, m_index(0)
{
}
-bool CPDF_ObjectStream::Start()
+FX_BOOL CPDF_ObjectStream::Start()
{
m_ObjNumArray.RemoveAll();
m_OffsetArray.RemoveAll();
m_Buffer.Clear();
m_dwObjNum = 0;
m_index = 0;
- return true;
+ return TRUE;
}
int32_t CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj)
{
@@ -547,12 +547,12 @@ CPDF_XRefStream::CPDF_XRefStream()
, m_iSeg(0)
{
}
-bool CPDF_XRefStream::Start()
+FX_BOOL CPDF_XRefStream::Start()
{
m_IndexArray.RemoveAll();
m_Buffer.Clear();
m_iSeg = 0;
- return true;
+ return TRUE;
}
int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator)
{
@@ -578,7 +578,7 @@ int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const uint8_t
}
return EndObjectStream(pCreator);
}
-static void _AppendIndex0(CFX_ByteTextBuf& buffer, bool bFirstObject = true)
+static void _AppendIndex0(CFX_ByteTextBuf& buffer, FX_BOOL bFirstObject = TRUE)
{
buffer.AppendByte(0);
buffer.AppendByte(0);
@@ -613,7 +613,7 @@ static void _AppendIndex2(CFX_ByteTextBuf& buffer, FX_DWORD objnum, int32_t inde
buffer.AppendByte(FX_GETBYTEOFFSET8(index));
buffer.AppendByte(FX_GETBYTEOFFSET0(index));
}
-int32_t CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, bool bEOF)
+int32_t CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF)
{
FX_FILESIZE objOffset = 0;
if (bEOF) {
@@ -644,7 +644,7 @@ int32_t CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, bool bEOF)
_AppendIndex2(m_Buffer, dwObjStmNum, index++);
}
} else {
- _AppendIndex0(m_Buffer, false);
+ _AppendIndex0(m_Buffer, FALSE);
}
}
if (iSize > 0 && bEOF) {
@@ -682,12 +682,12 @@ int32_t CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, bool bEOF)
}
return 1;
}
-bool CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, bool bEOF)
+FX_BOOL CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF)
{
FX_FILESIZE offset_tmp = pCreator->m_Offset;
FX_DWORD objnum = ++pCreator->m_dwLastObjNum;
CFX_FileBufferArchive *pFile = &pCreator->m_File;
- bool bIncremental = (pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
+ FX_BOOL bIncremental = (pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
if (bIncremental) {
AddObjectNumberToIndexArray(objnum);
} else {
@@ -696,7 +696,7 @@ bool CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, bool bEOF)
if (offset) {
_AppendIndex1(m_Buffer, *offset);
} else {
- _AppendIndex0(m_Buffer, false);
+ _AppendIndex0(m_Buffer, FALSE);
}
}
}
@@ -704,49 +704,49 @@ bool CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, bool bEOF)
FX_FILESIZE &offset = pCreator->m_Offset;
int32_t len = pFile->AppendDWord(objnum);
if (len < 0) {
- return false;
+ return FALSE;
}
offset += len;
if ((len = pFile->AppendString(FX_BSTRC(" 0 obj\r\n<</Type /XRef/W[1 4 2]/Index["))) < 0) {
- return false;
+ return FALSE;
}
offset += len;
if (!bIncremental) {
if ((len = pFile->AppendDWord(0)) < 0) {
- return false;
+ return FALSE;
}
if ((len = pFile->AppendString(FX_BSTRC(" "))) < 0) {
- return false;
+ return FALSE;
}
offset += len + 1;
if ((len = pFile->AppendDWord(objnum + 1)) < 0) {
- return false;
+ return FALSE;
}
offset += len;
} else {
int32_t iSeg = m_IndexArray.GetSize() / 2;
for (int32_t i = 0; i < iSeg; i++) {
if ((len = pFile->AppendDWord(m_IndexArray.ElementAt(i * 2))) < 0) {
- return false;
+ return FALSE;
}
if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return false;
+ return FALSE;
}
offset += len + 1;
if ((len = pFile->AppendDWord(m_IndexArray.ElementAt(i * 2 + 1))) < 0) {
- return false;
+ return FALSE;
}
if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return false;
+ return FALSE;
}
offset += len + 1;
}
}
if (pFile->AppendString(FX_BSTRC("]/Size ")) < 0) {
- return false;
+ return FALSE;
}
if ((len = pFile->AppendDWord(objnum + 1)) < 0) {
- return false;
+ return FALSE;
}
offset += len + 7;
if (m_PrevOffset > 0) {
@@ -762,26 +762,26 @@ bool CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, bool bEOF)
}
offset += len + 6;
}
- bool bPredictor = true;
+ FX_BOOL bPredictor = TRUE;
CPDF_FlateEncoder encoder;
encoder.Initialize(m_Buffer.GetBuffer(), m_Buffer.GetLength(), pCreator->m_bCompress, bPredictor);
if (pCreator->m_bCompress) {
if (pFile->AppendString(FX_BSTRC("/Filter /FlateDecode")) < 0) {
- return false;
+ return FALSE;
}
offset += 20;
if (bPredictor) {
if ((len = pFile->AppendString(FX_BSTRC("/DecodeParms<</Columns 7/Predictor 12>>"))) < 0) {
- return false;
+ return FALSE;
}
offset += len;
}
}
if (pFile->AppendString(FX_BSTRC("/Length ")) < 0) {
- return false;
+ return FALSE;
}
if ((len = pFile->AppendDWord(encoder.m_dwSize)) < 0) {
- return false;
+ return FALSE;
}
offset += len + 8;
if (bEOF) {
@@ -801,27 +801,27 @@ bool CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, bool bEOF)
}
}
if ((len = pFile->AppendString(FX_BSTRC(">>stream\r\n"))) < 0) {
- return false;
+ return FALSE;
}
offset += len;
if (pFile->AppendBlock(encoder.m_pData, encoder.m_dwSize) < 0) {
- return false;
+ return FALSE;
}
if ((len = pFile->AppendString(FX_BSTRC("\r\nendstream\r\nendobj\r\n"))) < 0) {
- return false;
+ return FALSE;
}
offset += encoder.m_dwSize + len;
m_PrevOffset = offset_tmp;
- return true;
+ return TRUE;
}
-bool CPDF_XRefStream::End(CPDF_Creator *pCreator, bool bEOF )
+FX_BOOL CPDF_XRefStream::End(CPDF_Creator *pCreator, FX_BOOL bEOF )
{
if (EndObjectStream(pCreator, bEOF) < 0) {
- return false;
+ return FALSE;
}
return GenerateXRefStream(pCreator, bEOF);
}
-bool CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator)
+FX_BOOL CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator)
{
if (!(pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL)) {
_AppendIndex0(m_Buffer);
@@ -830,7 +830,7 @@ bool CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator)
if (offset) {
_AppendIndex1(m_Buffer, *offset);
} else {
- _AppendIndex0(m_Buffer, false);
+ _AppendIndex0(m_Buffer, FALSE);
}
}
} else {
@@ -843,9 +843,9 @@ bool CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator)
}
}
}
- return GenerateXRefStream(pCreator, false);
+ return GenerateXRefStream(pCreator, FALSE);
}
-bool CPDF_XRefStream::AddObjectNumberToIndexArray(FX_DWORD objnum)
+FX_BOOL CPDF_XRefStream::AddObjectNumberToIndexArray(FX_DWORD objnum)
{
int32_t iSize = m_IndexArray.GetSize();
if (iSize == 0) {
@@ -862,13 +862,13 @@ bool CPDF_XRefStream::AddObjectNumberToIndexArray(FX_DWORD objnum)
m_IndexArray.Add(1);
}
}
- return true;
+ return TRUE;
}
CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc)
{
m_pDocument = pDoc;
m_pParser = (CPDF_Parser*)pDoc->m_pParser;
- m_bCompress = true;
+ m_bCompress = TRUE;
if (m_pParser) {
m_pEncryptDict = m_pParser->GetEncryptDict();
m_pCryptoHandler = m_pParser->GetCryptoHandler();
@@ -876,11 +876,11 @@ CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc)
m_pEncryptDict = NULL;
m_pCryptoHandler = NULL;
}
- m_bSecurityChanged = false;
- m_bStandardSecurity = false;
+ m_bSecurityChanged = FALSE;
+ m_bStandardSecurity = FALSE;
m_pMetadata = NULL;
- m_bEncryptCloned = false;
- m_bEncryptMetadata = false;
+ m_bEncryptCloned = FALSE;
+ m_bEncryptMetadata = FALSE;
m_Offset = 0;
m_iStage = -1;
m_dwFlags = 0;
@@ -892,7 +892,7 @@ CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc)
m_pIDArray = NULL;
m_FileVersion = 0;
m_dwEnryptObjNum = 0;
- m_bNewCrypto = false;
+ m_bNewCrypto = FALSE;
}
CPDF_Creator::~CPDF_Creator()
{
@@ -903,10 +903,10 @@ CPDF_Creator::~CPDF_Creator()
}
Clear();
}
-static bool _IsXRefNeedEnd(CPDF_XRefStream* pXRef, FX_DWORD flag)
+static FX_BOOL _IsXRefNeedEnd(CPDF_XRefStream* pXRef, FX_DWORD flag)
{
if (!(flag & FPDFCREATE_INCREMENTAL)) {
- return false;
+ return FALSE;
}
int32_t iSize = pXRef->m_IndexArray.GetSize() / 2;
int32_t iCount = 0;
@@ -1001,7 +1001,7 @@ int32_t CPDF_Creator::AppendObjectNumberToXRef(FX_DWORD objnum)
int32_t CPDF_Creator::WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto)
{
CPDF_FlateEncoder encoder;
- encoder.Initialize((CPDF_Stream*)pStream, pStream == m_pMetadata ? false : m_bCompress);
+ encoder.Initialize((CPDF_Stream*)pStream, pStream == m_pMetadata ? FALSE : m_bCompress);
CPDF_Encryptor encryptor;
if(!encryptor.Initialize(pCrypto, objnum, encoder.m_pData, encoder.m_dwSize)) {
return -1;
@@ -1067,7 +1067,7 @@ int32_t CPDF_Creator::WriteIndirectObj(const CPDF_Object* pObj)
}
return WriteIndirectObj(pObj->GetObjNum(), pObj);
}
-int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, bool bEncrypt)
+int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt)
{
int32_t len = 0;
if (pObj == NULL) {
@@ -1096,7 +1096,7 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, b
break;
case PDFOBJ_STRING: {
CFX_ByteString str = pObj->GetString();
- bool bHex = ((CPDF_String*)pObj)->IsHex();
+ FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
if (m_pCryptoHandler == NULL || !bEncrypt) {
CFX_ByteString content = PDF_EncodeString(str, bHex);
if ((len = m_File.AppendString(content)) < 0) {
@@ -1206,10 +1206,10 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, b
}
m_Offset += 2;
CPDF_Dictionary* p = (CPDF_Dictionary*)pObj;
- bool bSignDict = IsSignatureDict(p);
+ FX_BOOL bSignDict = IsSignatureDict(p);
FX_POSITION pos = p->GetStartPos();
while (pos) {
- bool bSignValue = false;
+ FX_BOOL bSignValue = FALSE;
CFX_ByteString key;
CPDF_Object* pValue = p->GetNextElement(pos, key);
if (m_File.AppendString(FX_BSTRC("/")) < 0) {
@@ -1220,7 +1220,7 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, b
}
m_Offset += len + 1;
if (bSignDict && key == FX_BSTRC("Contents")) {
- bSignValue = true;
+ bSignValue = TRUE;
}
if (pValue->GetObjNum()) {
if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
@@ -1255,8 +1255,8 @@ int32_t CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum)
}
m_ObjectOffset[objnum] = m_Offset;
void* valuetemp = NULL;
- bool bExistInMap = m_pDocument->m_IndirectObjs.Lookup((void*)(uintptr_t)objnum, valuetemp);
- bool bObjStm = (m_pParser->m_V5Type[objnum] == 2) && m_pEncryptDict && !m_pXRefStream;
+ FX_BOOL bExistInMap = m_pDocument->m_IndirectObjs.Lookup((void*)(uintptr_t)objnum, valuetemp);
+ FX_BOOL bObjStm = (m_pParser->m_V5Type[objnum] == 2) && m_pEncryptDict && !m_pXRefStream;
if(m_pParser->m_bVersionUpdated || m_bSecurityChanged || bExistInMap || bObjStm) {
CPDF_Object* pObj = m_pDocument->GetIndirectObject(objnum);
if (pObj == NULL) {
@@ -1334,7 +1334,7 @@ int32_t CPDF_Creator::WriteOldObjs(IFX_Pause *pPause)
}
return 0;
}
-int32_t CPDF_Creator::WriteNewObjs(bool bIncremental, IFX_Pause *pPause)
+int32_t CPDF_Creator::WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause)
{
int32_t iCount = m_NewObjNumArray.GetSize();
int32_t index = (int32_t)(uintptr_t)m_Pos;
@@ -1385,8 +1385,8 @@ void CPDF_Creator::InitOldObjNumOffsets()
}
void CPDF_Creator::InitNewObjNumOffsets()
{
- bool bIncremental = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
- bool bNoOriginal = (m_dwFlags & FPDFCREATE_NO_ORIGINAL) != 0;
+ FX_BOOL bIncremental = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
+ FX_BOOL bNoOriginal = (m_dwFlags & FPDFCREATE_NO_ORIGINAL) != 0;
FX_DWORD nOldSize = m_pParser ? m_pParser->m_CrossRef.GetSize() : 0;
FX_POSITION pos = m_pDocument->m_IndirectObjs.GetStartPosition();
while (pos) {
@@ -1414,7 +1414,7 @@ void CPDF_Creator::InitNewObjNumOffsets()
}
int32_t i = 0;
FX_DWORD dwStartObjNum = 0;
- bool bCrossRefValid = m_pParser && m_pParser->GetLastXRefOffset() > 0;
+ FX_BOOL bCrossRefValid = m_pParser && m_pParser->GetLastXRefOffset() > 0;
while (i < iCount) {
dwStartObjNum = m_NewObjNumArray.ElementAt(i);
if ((bIncremental && (bNoOriginal || bCrossRefValid)) || !m_ObjectOffset.GetPtrAt(dwStartObjNum)) {
@@ -1427,10 +1427,10 @@ void CPDF_Creator::InitNewObjNumOffsets()
}
FX_DWORD dwLastObjNum = dwStartObjNum;
i++;
- bool bNewStart = false;
+ FX_BOOL bNewStart = FALSE;
for (; i < iCount; i++) {
FX_DWORD dwCurObjNum = m_NewObjNumArray.ElementAt(i);
- bool bExist = (dwCurObjNum < nOldSize && m_ObjectOffset.GetPtrAt(dwCurObjNum) != NULL);
+ FX_BOOL bExist = (dwCurObjNum < nOldSize && m_ObjectOffset.GetPtrAt(dwCurObjNum) != NULL);
if (bExist || dwCurObjNum - dwLastObjNum > 1) {
if (!bNewStart) {
m_ObjectOffset.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
@@ -1546,7 +1546,7 @@ int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause)
if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_pParser->GetLastXRefOffset() == 0) {
InitOldObjNumOffsets();
FX_DWORD dwEnd = m_pParser->GetLastObjNum();
- bool bObjStm = (m_dwFlags & FPDFCREATE_OBJECTSTREAM) != 0;
+ FX_BOOL bObjStm = (m_dwFlags & FPDFCREATE_OBJECTSTREAM) != 0;
for (FX_DWORD objnum = 0; objnum <= dwEnd; objnum++) {
if (m_pParser->m_V5Type[objnum] == 0 || m_pParser->m_V5Type[objnum] == 255) {
continue;
@@ -1622,7 +1622,7 @@ int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause)
if (m_iStage == 80) {
m_XrefStart = m_Offset;
if (m_dwFlags & FPDFCREATE_OBJECTSTREAM) {
- m_pXRefStream->End(this, true);
+ m_pXRefStream->End(this, TRUE);
m_XrefStart = m_pXRefStream->m_PrevOffset;
m_iStage = 90;
} else if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 || !m_pParser->IsXRefStream()) {
@@ -1765,7 +1765,7 @@ int32_t CPDF_Creator::WriteDoc_Stage4(IFX_Pause *pPause)
{
FXSYS_assert(m_iStage >= 90);
if ((m_dwFlags & FPDFCREATE_OBJECTSTREAM) == 0) {
- bool bXRefStream = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser->IsXRefStream();
+ FX_BOOL bXRefStream = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser->IsXRefStream();
if (!bXRefStream) {
if (m_File.AppendString(FX_BSTRC("trailer\r\n<<")) < 0) {
return -1;
@@ -1976,39 +1976,39 @@ void CPDF_Creator::Clear()
m_pIDArray = NULL;
}
}
-bool CPDF_Creator::Create(const FX_CHAR* filename, FX_DWORD flags)
+FX_BOOL CPDF_Creator::Create(const FX_CHAR* filename, FX_DWORD flags)
{
if (!m_File.AttachFile(filename)) {
- return false;
+ return FALSE;
}
- bool bRet = Create(flags);
+ FX_BOOL bRet = Create(flags);
if (!bRet || !(flags & FPDFCREATE_PROGRESSIVE)) {
Clear();
}
return bRet;
}
-bool CPDF_Creator::Create(const FX_WCHAR* filename, FX_DWORD flags)
+FX_BOOL CPDF_Creator::Create(const FX_WCHAR* filename, FX_DWORD flags)
{
if (!m_File.AttachFile(filename)) {
- return false;
+ return FALSE;
}
- bool bRet = Create(flags);
+ FX_BOOL bRet = Create(flags);
if (!bRet || !(flags & FPDFCREATE_PROGRESSIVE)) {
Clear();
}
return bRet;
}
-bool CPDF_Creator::Create(IFX_StreamWrite* pFile, FX_DWORD flags)
+FX_BOOL CPDF_Creator::Create(IFX_StreamWrite* pFile, FX_DWORD flags)
{
if (!pFile) {
- return false;
+ return FALSE;
}
- if (!m_File.AttachFile(pFile, false)) {
- return false;
+ if (!m_File.AttachFile(pFile, FALSE)) {
+ return FALSE;
}
return Create(flags);
}
-bool CPDF_Creator::Create(FX_DWORD flags)
+FX_BOOL CPDF_Creator::Create(FX_DWORD flags)
{
m_dwFlags = flags;
m_iStage = 0;
@@ -2019,14 +2019,14 @@ bool CPDF_Creator::Create(FX_DWORD flags)
m_NewObjNumArray.RemoveAll();
InitID();
if (flags & FPDFCREATE_PROGRESSIVE) {
- return true;
+ return TRUE;
}
return Continue(NULL) > -1;
}
-void CPDF_Creator::InitID(bool bDefault )
+void CPDF_Creator::InitID(FX_BOOL bDefault )
{
CPDF_Array* pOldIDArray = m_pParser ? m_pParser->GetIDArray() : NULL;
- bool bNewId = !m_pIDArray;
+ FX_BOOL bNewId = !m_pIDArray;
if (!m_pIDArray) {
FX_DWORD* pBuffer = NULL;
m_pIDArray = CPDF_Array::Create();
@@ -2037,7 +2037,7 @@ void CPDF_Creator::InitID(bool bDefault )
pBuffer = FX_Alloc(FX_DWORD, 4);
PDF_GenerateFileID((FX_DWORD)(uintptr_t)this, m_dwLastObjNum, pBuffer);
CFX_ByteStringC bsBuffer((const uint8_t*)pBuffer, 4 * sizeof(FX_DWORD));
- m_pIDArray->Add(CPDF_String::Create(bsBuffer, true), m_pDocument);
+ m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
}
if (pBuffer) {
FX_Free(pBuffer);
@@ -2055,7 +2055,7 @@ void CPDF_Creator::InitID(bool bDefault )
FX_DWORD* pBuffer = FX_Alloc(FX_DWORD, 4);
PDF_GenerateFileID((FX_DWORD)(uintptr_t)this, m_dwLastObjNum, pBuffer);
CFX_ByteStringC bsBuffer((const uint8_t*)pBuffer, 4 * sizeof(FX_DWORD));
- m_pIDArray->Add(CPDF_String::Create(bsBuffer, true), m_pDocument);
+ m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
FX_Free(pBuffer);
return;
}
@@ -2071,8 +2071,8 @@ void CPDF_Creator::InitID(bool bDefault )
}
m_pCryptoHandler = new CPDF_StandardCryptoHandler;
m_pCryptoHandler->Init(m_pEncryptDict, &handler);
- m_bNewCrypto = true;
- m_bSecurityChanged = true;
+ m_bNewCrypto = TRUE;
+ m_bSecurityChanged = TRUE;
}
}
}
@@ -2103,18 +2103,18 @@ int32_t CPDF_Creator::Continue(IFX_Pause *pPause)
}
return m_iStage;
}
-bool CPDF_Creator::SetFileVersion(int32_t fileVersion )
+FX_BOOL CPDF_Creator::SetFileVersion(int32_t fileVersion )
{
if (fileVersion < 10 || fileVersion > 17) {
- return false;
+ return FALSE;
}
m_FileVersion = fileVersion;
- return true;
+ return TRUE;
}
void CPDF_Creator::RemoveSecurity()
{
ResetStandardSecurity();
- m_bSecurityChanged = true;
+ m_bSecurityChanged = TRUE;
m_pEncryptDict = NULL;
m_pCryptoHandler = NULL;
}
@@ -2124,7 +2124,7 @@ void CPDF_Creator::ResetStandardSecurity()
delete m_pCryptoHandler;
m_pCryptoHandler = NULL;
}
- m_bNewCrypto = false;
+ m_bNewCrypto = FALSE;
if (!m_bStandardSecurity) {
return;
}
@@ -2132,5 +2132,5 @@ void CPDF_Creator::ResetStandardSecurity()
m_pEncryptDict->Release();
m_pEncryptDict = NULL;
}
- m_bStandardSecurity = false;
+ m_bStandardSecurity = FALSE;
}
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
index 3621c7957a..5a5fb94ef3 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
@@ -12,7 +12,7 @@ CPDF_Document::CPDF_Document() : CPDF_IndirectObjects(NULL)
{
m_pRootDict = NULL;
m_pInfoDict = NULL;
- m_bLinearized = false;
+ m_bLinearized = FALSE;
m_dwFirstPageNo = 0;
m_dwFirstPageObjNum = 0;
m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
@@ -215,7 +215,7 @@ static void _InsertWidthArray(HDC hDC, int start, int end, CPDF_Array* pWidthArr
}
FX_Free(widths);
}
-CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, bool bVert, bool bTranslateName)
+CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName)
{
LOGFONTA lfa;
FXSYS_memcpy(&lfa, pLogFont, (char*)lfa.lfFaceName - (char*)&lfa);
@@ -239,7 +239,7 @@ CFX_ByteString _FPDF_GetPSNameFromTT(HDC hDC)
}
return result;
}
-CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, bool bVert, bool bTranslateName)
+CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName)
{
pLogFont->lfHeight = -1000;
pLogFont->lfWidth = 0;
@@ -269,7 +269,7 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, bool bVert, bool bT
if ((pLogFont->lfPitchAndFamily & 0xf8) == FF_SCRIPT) {
flags |= PDFFONT_SCRIPT;
}
- bool bCJK = pLogFont->lfCharSet == CHINESEBIG5_CHARSET || pLogFont->lfCharSet == GB2312_CHARSET ||
+ FX_BOOL bCJK = pLogFont->lfCharSet == CHINESEBIG5_CHARSET || pLogFont->lfCharSet == GB2312_CHARSET ||
pLogFont->lfCharSet == HANGEUL_CHARSET || pLogFont->lfCharSet == SHIFTJIS_CHARSET;
CFX_ByteString basefont;
if (bTranslateName && bCJK) {
@@ -549,7 +549,7 @@ static void _CFString2CFXByteString(CFStringRef src, CFX_ByteString &dest)
dest = (FX_CHAR*)pBuffer;
free(pBuffer);
}
-bool IsHasCharSet(CFArrayRef languages, const CFX_DWordArray &charSets)
+FX_BOOL IsHasCharSet(CFArrayRef languages, const CFX_DWordArray &charSets)
{
int iCount = charSets.GetSize();
for (int i = 0; i < CFArrayGetCount(languages); ++i) {
@@ -557,11 +557,11 @@ bool IsHasCharSet(CFArrayRef languages, const CFX_DWordArray &charSets)
FX_DWORD CharSet = FX_GetCharsetFromLang(CFStringGetCStringPtr(language, kCFStringEncodingMacRoman), -1);
for (int j = 0; j < iCount; ++j) {
if (CharSet == charSets[j]) {
- return true;
+ return TRUE;
}
}
}
- return false;
+ return FALSE;
}
void FX_GetCharWidth(CTFontRef font, UniChar start, UniChar end, int* width)
{
@@ -599,7 +599,7 @@ static void _InsertWidthArray(CTFontRef font, int start, int end, CPDF_Array* pW
}
FX_Free(widths);
}
-CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, bool bVert, bool bTranslateName)
+CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName)
{
CTFontRef font = (CTFontRef)pFont;
CTFontDescriptorRef descriptor = CTFontCopyFontDescriptor(font);
@@ -607,7 +607,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, bool bVert, bool bTranslat
return NULL;
}
CFX_ByteString basefont;
- bool bCJK = false;
+ FX_BOOL bCJK = FALSE;
int flags = 0, italicangle = 0, ascend = 0, descend = 0, capheight = 0, bbox[4];
FXSYS_memset(bbox, 0, sizeof(int) * 4);
CFArrayRef languages = (CFArrayRef)CTFontDescriptorCopyAttribute(descriptor, kCTFontLanguagesAttribute);
@@ -621,7 +621,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, bool bVert, bool bTranslat
charSets.Add(FXFONT_HANGEUL_CHARSET);
charSets.Add(FXFONT_SHIFTJIS_CHARSET);
if (IsHasCharSet(languages, charSets)) {
- bCJK = true;
+ bCJK = TRUE;
}
CFRelease(descriptor);
CFDictionaryRef traits = (CFDictionaryRef)CTFontCopyTraits(font);
@@ -737,7 +737,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, bool bVert, bool bTranslat
CFX_ByteString cmap;
CFX_ByteString ordering;
int supplement;
- bool bFound = false;
+ FX_BOOL bFound = FALSE;
CPDF_Array* pWidthArray = new CPDF_Array;
charSets.RemoveAll();
charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
@@ -747,7 +747,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, bool bVert, bool bTranslat
supplement = 4;
pWidthArray->AddInteger(1);
_InsertWidthArray(font, 0x20, 0x7e, pWidthArray);
- bFound = true;
+ bFound = TRUE;
}
charSets.RemoveAll();
charSets.Add(FXFONT_GB2312_CHARSET);
@@ -758,7 +758,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, bool bVert, bool bTranslat
_InsertWidthArray(font, 0x20, 0x20, pWidthArray);
pWidthArray->AddInteger(814);
_InsertWidthArray(font, 0x21, 0x7e, pWidthArray);
- bFound = true;
+ bFound = TRUE;
}
charSets.RemoveAll();
charSets.Add(FXFONT_HANGEUL_CHARSET);
@@ -768,7 +768,7 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, bool bVert, bool bTranslat
supplement = 2;
pWidthArray->AddInteger(1);
_InsertWidthArray(font, 0x20, 0x7e, pWidthArray);
- bFound = true;
+ bFound = TRUE;
}
charSets.RemoveAll();
charSets.Add(FXFONT_SHIFTJIS_CHARSET);
@@ -867,12 +867,12 @@ static void _InsertWidthArray1(CFX_Font* pFont, IFX_FontEncoding* pEncoding, FX_
}
FX_Free(widths);
}
-CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, bool bVert)
+CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
{
if (pFont == NULL) {
return NULL;
}
- bool bCJK = charset == FXFONT_CHINESEBIG5_CHARSET || charset == FXFONT_GB2312_CHARSET ||
+ FX_BOOL bCJK = charset == FXFONT_CHINESEBIG5_CHARSET || charset == FXFONT_GB2312_CHARSET ||
charset == FXFONT_HANGEUL_CHARSET || charset == FXFONT_SHIFTJIS_CHARSET;
CFX_ByteString basefont = pFont->GetFamilyName();
basefont.Replace(" ", "");
@@ -1052,7 +1052,7 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, bool bVert)
return LoadFont(pBaseDict);
}
static int InsertDeletePDFPage(CPDF_Document* pDoc, CPDF_Dictionary* pPages,
- int nPagesToGo, CPDF_Dictionary* pPage, bool bInsert, CFX_PtrArray& stackList)
+ int nPagesToGo, CPDF_Dictionary* pPage, FX_BOOL bInsert, CFX_PtrArray& stackList)
{
CPDF_Array* pKidList = pPages->GetArray("Kids");
if (!pKidList) {
@@ -1122,7 +1122,7 @@ static int InsertNewPage(CPDF_Document* pDoc, int iPage, CPDF_Dictionary* pPageD
} else {
CFX_PtrArray stack;
stack.Add(pPages);
- if (InsertDeletePDFPage(pDoc, pPages, iPage, pPageDict, true, stack) < 0) {
+ if (InsertDeletePDFPage(pDoc, pPages, iPage, pPageDict, TRUE, stack) < 0) {
return -1;
}
}
@@ -1165,7 +1165,7 @@ void CPDF_Document::DeletePage(int iPage)
}
CFX_PtrArray stack;
stack.Add(pPages);
- if (InsertDeletePDFPage(this, pPages, iPage, NULL, false, stack) < 0) {
+ if (InsertDeletePDFPage(this, pPages, iPage, NULL, FALSE, stack) < 0) {
return;
}
m_PageList.RemoveAt(iPage);
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
index 21ce31e3c3..dad7326a5b 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
@@ -16,7 +16,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size)
int32_t height;
int32_t num_comps;
int32_t bits;
- bool color_trans;
+ FX_BOOL color_trans;
if (!CPDF_ModuleMgr::Get()->GetJpegModule()->
LoadInfo(pData, size, width, height, num_comps, bits, color_trans)) {
return NULL;
@@ -48,7 +48,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size)
pDict->SetAt("DecodeParms", pParms);
pParms->SetAtInteger("ColorTransform", 0);
}
- m_bIsMask = false;
+ m_bIsMask = FALSE;
m_Width = width;
m_Height = height;
if (m_pStream == NULL) {
@@ -92,7 +92,7 @@ void CPDF_Image::SetJpegImage(IFX_FileRead *pFile)
void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap, int quality, uint8_t* &buf, FX_STRSIZE &size)
{
}
-void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, uint8_t* &buf, FX_STRSIZE &size, bool bLossLess)
+void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, uint8_t* &buf, FX_STRSIZE &size, FX_BOOL bLossLess)
{
}
void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_FileWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const CPDF_ImageSetParam* pParam)
@@ -105,7 +105,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
uint8_t* src_buf = pBitmap->GetBuffer();
int32_t src_pitch = pBitmap->GetPitch();
int32_t bpp = pBitmap->GetBPP();
- bool bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb);
+ FX_BOOL bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb);
CPDF_Dictionary* pDict = new CPDF_Dictionary;
pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
@@ -121,7 +121,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b);
}
if (set_a == 0 || reset_a == 0) {
- pDict->SetAt(FX_BSTRC("ImageMask"), new CPDF_Boolean(true));
+ pDict->SetAt(FX_BSTRC("ImageMask"), new CPDF_Boolean(TRUE));
if (reset_a == 0) {
CPDF_Array* pArray = new CPDF_Array;
pArray->AddInteger(1);
@@ -142,7 +142,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
pBuf[4] = (FX_CHAR)set_g;
pBuf[5] = (FX_CHAR)set_b;
ct.ReleaseBuffer(6);
- pCS->Add(CPDF_String::Create(ct, true));
+ pCS->Add(CPDF_String::Create(ct, TRUE));
pDict->SetAt(FX_BSTRC("ColorSpace"), pCS);
}
pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 1);
@@ -194,10 +194,10 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
}
}
const CFX_DIBitmap* pMaskBitmap = NULL;
- bool bDeleteMask = false;
+ FX_BOOL bDeleteMask = FALSE;
if (pBitmap->HasAlpha()) {
pMaskBitmap = pBitmap->GetAlphaMask();
- bDeleteMask = true;
+ bDeleteMask = TRUE;
}
if (!pMaskBitmap && pMask) {
FXDIB_Format maskFormat = pMask->GetFormat();
@@ -220,7 +220,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
if (pMaskBitmap->GetBPP() == 8 && (iCompress & PDF_IMAGE_MASK_LOSSY_COMPRESS) != 0) {
_DCTEncodeBitmap(pMaskDict, pMaskBitmap, pParam ? pParam->nQuality : 75, mask_buf, mask_size);
} else if (pMaskBitmap->GetFormat() == FXDIB_1bppMask) {
- _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, mask_size, true);
+ _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, mask_size, TRUE);
} else {
mask_buf = FX_Alloc2D(uint8_t, maskHeight, maskWidth);
mask_size = maskHeight * maskWidth; // Safe since checked alloc returned.
@@ -245,15 +245,15 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
delete pMaskBitmap;
}
}
- bool bStream = pFileWrite != NULL && pFileRead != NULL;
+ FX_BOOL bStream = pFileWrite != NULL && pFileRead != NULL;
if (opType == 0) {
if (iCompress & PDF_IMAGE_LOSSLESS_COMPRESS) {
if (pBitmap->GetBPP() == 1) {
- _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, true);
+ _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, TRUE);
}
} else {
if (pBitmap->GetBPP() == 1) {
- _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, false);
+ _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, FALSE);
} else if (pBitmap->GetBPP() >= 8 && pBitmap->GetPalette() != NULL) {
CFX_DIBitmap *pNewBitmap = new CFX_DIBitmap();
pNewBitmap->Copy(pBitmap);
diff --git a/core/src/fpdfapi/fpdf_font/font_int.h b/core/src/fpdfapi/fpdf_font/font_int.h
index e52540853d..f57e52758a 100644
--- a/core/src/fpdfapi/fpdf_font/font_int.h
+++ b/core/src/fpdfapi/fpdf_font/font_int.h
@@ -12,15 +12,15 @@ class CPDF_CMapManager
public:
CPDF_CMapManager();
~CPDF_CMapManager();
- void* GetPackage(bool bPrompt);
- CPDF_CMap* GetPredefinedCMap(const CFX_ByteString& name, bool bPrompt);
- CPDF_CID2UnicodeMap* GetCID2UnicodeMap(int charset, bool bPrompt);
+ void* GetPackage(FX_BOOL bPrompt);
+ CPDF_CMap* GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
+ CPDF_CID2UnicodeMap* GetCID2UnicodeMap(int charset, FX_BOOL bPrompt);
void ReloadAll();
private:
- CPDF_CMap* LoadPredefinedCMap(const CFX_ByteString& name, bool bPrompt);
- CPDF_CID2UnicodeMap* LoadCID2UnicodeMap(int charset, bool bPrompt);
- void DropAll(bool bReload);
- bool m_bPrompted;
+ CPDF_CMap* LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
+ CPDF_CID2UnicodeMap* LoadCID2UnicodeMap(int charset, FX_BOOL bPrompt);
+ void DropAll(FX_BOOL bReload);
+ FX_BOOL m_bPrompted;
CFX_MapByteStringToPtr m_CMaps;
CPDF_CID2UnicodeMap* m_CID2UnicodeMaps[6];
};
@@ -56,7 +56,7 @@ class CPDF_CMapParser
public:
CPDF_CMapParser();
~CPDF_CMapParser() {}
- bool Initialize(CPDF_CMap*);
+ FX_BOOL Initialize(CPDF_CMap*);
void ParseWord(const CFX_ByteStringC& str);
CFX_BinaryBuf m_AddMaps;
private:
@@ -80,10 +80,10 @@ class CPDF_CMap
{
public:
CPDF_CMap();
- bool LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* name, bool bPromptCJK);
- bool LoadEmbedded(const uint8_t* pData, FX_DWORD dwSize);
+ FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* name, FX_BOOL bPromptCJK);
+ FX_BOOL LoadEmbedded(const uint8_t* pData, FX_DWORD dwSize);
void Release();
- bool IsLoaded() const
+ FX_BOOL IsLoaded() const
{
return m_bLoaded;
}
@@ -91,7 +91,7 @@ public:
{
return m_Charset;
}
- bool IsVertWriting() const
+ FX_BOOL IsVertWriting() const
{
return m_bVertical;
}
@@ -109,14 +109,14 @@ protected:
friend class CPDF_CIDFont;
protected:
CFX_ByteString m_PredefinedCMap;
- bool m_bVertical;
+ FX_BOOL m_bVertical;
int m_Charset, m_Coding;
CodingScheme m_CodingScheme;
int m_nCodeRanges;
uint8_t* m_pLeadingBytes;
FX_WORD* m_pMapping;
uint8_t* m_pAddMapping;
- bool m_bLoaded;
+ FX_BOOL m_bLoaded;
const FXCMAP_CMap* m_pEmbedMap;
CPDF_CMap* m_pUseMap;
};
@@ -146,9 +146,9 @@ class CPDF_CID2UnicodeMap
public:
CPDF_CID2UnicodeMap();
~CPDF_CID2UnicodeMap();
- bool Initialize();
- bool IsLoaded();
- void Load(CPDF_CMapManager* pMgr, int charset, bool bPromptCJK);
+ FX_BOOL Initialize();
+ FX_BOOL IsLoaded();
+ void Load(CPDF_CMapManager* pMgr, int charset, FX_BOOL bPromptCJK);
FX_WCHAR UnicodeFromCID(FX_WORD CID);
protected:
int m_Charset;
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index afcce6d18c..8037a8c674 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -12,16 +12,16 @@
#include "../fpdf_page/pageint.h"
#include "font_int.h"
-bool FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id)
+FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id)
{
for (int i = 0; i < FXFT_Get_Face_CharmapCount(face); i ++) {
if (FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(face)[i]) == platform_id &&
FXFT_Get_Charmap_EncodingID(FXFT_Get_Face_Charmaps(face)[i]) == encoding_id) {
FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[i]);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
CPDF_FontGlobals::CPDF_FontGlobals()
: m_pContrastRamps(NULL)
@@ -120,7 +120,7 @@ CPDF_Font::CPDF_Font(int fonttype) : m_FontType(fonttype)
m_pFontFile = NULL;
m_Flags = 0;
m_pToUnicodeMap = NULL;
- m_bToUnicodeLoaded = false;
+ m_bToUnicodeLoaded = FALSE;
m_pCharMap = new CPDF_FontCharMap(this);
}
CPDF_Font::~CPDF_Font()
@@ -135,9 +135,9 @@ CPDF_Font::~CPDF_Font()
m_pDocument->GetPageData()->ReleaseFontFileStreamAcc((CPDF_Stream*)m_pFontFile->GetStream());
}
}
-bool CPDF_Font::IsVertWriting() const
+FX_BOOL CPDF_Font::IsVertWriting() const
{
- bool bVertWriting = false;
+ FX_BOOL bVertWriting = FALSE;
CPDF_CIDFont* pCIDFont = GetCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
@@ -236,33 +236,33 @@ void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc)
{
m_Flags = pFontDesc->GetInteger(FX_BSTRC("Flags"), PDFFONT_NONSYMBOLIC);
int ItalicAngle = 0;
- bool bExistItalicAngle = false;
+ FX_BOOL bExistItalicAngle = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("ItalicAngle"))) {
ItalicAngle = pFontDesc->GetInteger(FX_BSTRC("ItalicAngle"));
- bExistItalicAngle = true;
+ bExistItalicAngle = TRUE;
}
if (ItalicAngle < 0) {
m_Flags |= PDFFONT_ITALIC;
m_ItalicAngle = ItalicAngle;
}
- bool bExistStemV = false;
+ FX_BOOL bExistStemV = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("StemV"))) {
m_StemV = pFontDesc->GetInteger(FX_BSTRC("StemV"));
- bExistStemV = true;
+ bExistStemV = TRUE;
}
- bool bExistAscent = false;
+ FX_BOOL bExistAscent = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("Ascent"))) {
m_Ascent = pFontDesc->GetInteger(FX_BSTRC("Ascent"));
- bExistAscent = true;
+ bExistAscent = TRUE;
}
- bool bExistDescent = false;
+ FX_BOOL bExistDescent = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("Descent"))) {
m_Descent = pFontDesc->GetInteger(FX_BSTRC("Descent"));
- bExistDescent = true;
+ bExistDescent = TRUE;
}
- bool bExistCapHeight = false;
+ FX_BOOL bExistCapHeight = FALSE;
if (pFontDesc->KeyExist(FX_BSTRC("CapHeight"))) {
- bExistCapHeight = true;
+ bExistCapHeight = TRUE;
}
if (bExistItalicAngle && bExistAscent && bExistCapHeight && bExistDescent && bExistStemV) {
m_Flags |= PDFFONT_USEEXTERNATTR;
@@ -316,7 +316,7 @@ void CPDF_Font::CheckFontMetrics()
m_Ascent = TT2PDF(FXFT_Get_Face_Ascender(m_Font.m_Face), m_Font.m_Face);
m_Descent = TT2PDF(FXFT_Get_Face_Descender(m_Font.m_Face), m_Font.m_Face);
} else {
- bool bFirst = true;
+ FX_BOOL bFirst = TRUE;
for (int i = 0; i < 256; i ++) {
FX_RECT rect;
GetCharBBox(i, rect);
@@ -325,7 +325,7 @@ void CPDF_Font::CheckFontMetrics()
}
if (bFirst) {
m_FontBBox = rect;
- bFirst = false;
+ bFirst = FALSE;
} else {
if (m_FontBBox.top < rect.top) {
m_FontBBox.top = rect.top;
@@ -361,7 +361,7 @@ void CPDF_Font::CheckFontMetrics()
}
void CPDF_Font::LoadUnicodeMap()
{
- m_bToUnicodeLoaded = true;
+ m_bToUnicodeLoaded = TRUE;
CPDF_Stream* pStream = m_pFontDict->GetStream(FX_BSTRC("ToUnicode"));
if (pStream == NULL) {
return;
@@ -466,10 +466,10 @@ CPDF_Font* CPDF_Font::CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDic
}
return pFont;
}
-bool CPDF_Font::Load()
+FX_BOOL CPDF_Font::Load()
{
if (m_pFontDict == NULL) {
- return false;
+ return FALSE;
}
CFX_ByteString type = m_pFontDict->GetString(FX_BSTRC("Subtype"));
m_BaseFont = m_pFontDict->GetString(FX_BSTRC("BaseFont"));
@@ -623,7 +623,7 @@ void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream)
{
int CIDSet = 0;
CPDF_StreamAcc stream;
- stream.LoadAllData(pStream, false);
+ stream.LoadAllData(pStream, FALSE);
CPDF_SimpleParser parser(stream.GetData(), stream.GetSize());
m_Map.EstimateSize(stream.GetSize() / 8, 1024);
while (1) {
@@ -719,12 +719,12 @@ void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream)
}
}
if (CIDSet) {
- m_pBaseMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(CIDSet, false);
+ m_pBaseMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(CIDSet, FALSE);
} else {
m_pBaseMap = NULL;
}
}
-static bool GetPredefinedEncoding(int& basemap, const CFX_ByteString& value)
+static FX_BOOL GetPredefinedEncoding(int& basemap, const CFX_ByteString& value)
{
if (value == FX_BSTRC("WinAnsiEncoding")) {
basemap = PDFFONT_ENCODING_WINANSI;
@@ -735,12 +735,12 @@ static bool GetPredefinedEncoding(int& basemap, const CFX_ByteString& value)
} else if (value == FX_BSTRC("PDFDocEncoding")) {
basemap = PDFFONT_ENCODING_PDFDOC;
} else {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, CFX_ByteString*& pCharNames,
- bool bEmbedded, bool bTrueType)
+ FX_BOOL bEmbedded, FX_BOOL bTrueType)
{
if (pEncoding == NULL) {
if (m_BaseFont == FX_BSTRC("Symbol")) {
@@ -802,18 +802,18 @@ void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, CFX_
}
}
}
-bool CPDF_Font::IsStandardFont() const
+FX_BOOL CPDF_Font::IsStandardFont() const
{
if (m_FontType != PDFFONT_TYPE1) {
- return false;
+ return FALSE;
}
if (m_pFontFile != NULL) {
- return false;
+ return FALSE;
}
if (((CPDF_Type1Font*)this)->GetBase14Font() < 0) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
CPDF_SimpleFont::CPDF_SimpleFont(int fonttype) : CPDF_Font(fonttype)
{
@@ -828,10 +828,10 @@ CPDF_SimpleFont::~CPDF_SimpleFont()
{
delete[] m_pCharNames;
}
-int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph)
+int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
{
if (pVertGlyph) {
- *pVertGlyph = false;
+ *pVertGlyph = FALSE;
}
if (charcode > 0xff) {
return -1;
@@ -923,7 +923,7 @@ const FX_CHAR* GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNa
}
return name;
}
-bool CPDF_SimpleFont::LoadCommon()
+FX_BOOL CPDF_SimpleFont::LoadCommon()
{
CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
if (pFontDesc) {
@@ -931,9 +931,9 @@ bool CPDF_SimpleFont::LoadCommon()
}
CPDF_Array* pWidthArray = m_pFontDict->GetArray(FX_BSTRC("Widths"));
int width_start = 0, width_end = -1;
- m_bUseFontWidth = true;
+ m_bUseFontWidth = TRUE;
if (pWidthArray) {
- m_bUseFontWidth = false;
+ m_bUseFontWidth = FALSE;
if (pFontDesc && pFontDesc->KeyExist(FX_BSTRC("MissingWidth"))) {
int MissingWidth = pFontDesc->GetInteger(FX_BSTRC("MissingWidth"));
for (int i = 0; i < 256; i ++) {
@@ -970,7 +970,7 @@ bool CPDF_SimpleFont::LoadCommon()
delete[] m_pCharNames;
m_pCharNames = NULL;
if (m_Font.m_Face == NULL) {
- return true;
+ return TRUE;
}
if (m_Flags & PDFFONT_ALLCAP) {
unsigned char lowercases[] = {'a', 'z', 0xe0, 0xf6, 0xf8, 0xfd};
@@ -988,7 +988,7 @@ bool CPDF_SimpleFont::LoadCommon()
}
}
CheckFontMetrics();
- return true;
+ return TRUE;
}
void CPDF_SimpleFont::LoadSubstFont()
{
@@ -1013,7 +1013,7 @@ void CPDF_SimpleFont::LoadSubstFont()
if (m_Font.m_pSubstFont->m_SubstFlags & FXFONT_SUBST_NONSYMBOL) {
}
}
-bool CPDF_SimpleFont::IsUnicodeCompatible() const
+FX_BOOL CPDF_SimpleFont::IsUnicodeCompatible() const
{
return m_BaseEncoding != PDFFONT_ENCODING_BUILTIN && m_BaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL &&
m_BaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS;
@@ -1022,7 +1022,7 @@ CPDF_Type1Font::CPDF_Type1Font() : CPDF_SimpleFont(PDFFONT_TYPE1)
{
m_Base14Font = -1;
}
-bool CPDF_Type1Font::_Load()
+FX_BOOL CPDF_Type1Font::_Load()
{
m_Base14Font = _PDF_GetStandardFontName(m_BaseFont);
if (m_Base14Font >= 0) {
@@ -1046,21 +1046,21 @@ bool CPDF_Type1Font::_Load()
}
return LoadCommon();
}
-static bool FT_UseType1Charmap(FXFT_Face face)
+static FX_BOOL FT_UseType1Charmap(FXFT_Face face)
{
if (FXFT_Get_Face_CharmapCount(face) == 0) {
- return false;
+ return FALSE;
}
if (FXFT_Get_Face_CharmapCount(face) == 1 &&
FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == FXFT_ENCODING_UNICODE) {
- return false;
+ return FALSE;
}
if (FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == FXFT_ENCODING_UNICODE) {
FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[1]);
} else {
FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[0]);
}
- return true;
+ return TRUE;
}
extern FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode);
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -1112,21 +1112,21 @@ void CPDF_Type1Font::LoadGlyphMap()
return;
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- bool bCoreText = true;
+ FX_BOOL bCoreText = TRUE;
CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
if (!m_Font.m_pPlatformFont) {
if (m_Font.GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- bCoreText = false;
+ bCoreText = FALSE;
}
m_Font.m_pPlatformFont = quartz2d.CreateFont(m_Font.m_pFontData, m_Font.m_dwSize);
if (NULL == m_Font.m_pPlatformFont) {
- bCoreText = false;
+ bCoreText = FALSE;
}
}
#endif
if (!IsEmbedded() && (m_Base14Font < 12) && m_Font.IsTTFont()) {
if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
- bool bGotOne = false;
+ FX_BOOL bGotOne = FALSE;
for (int charcode = 0; charcode < 256; charcode ++) {
const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
for (int j = 0; j < 4; j ++) {
@@ -1143,7 +1143,7 @@ void CPDF_Type1Font::LoadGlyphMap()
}
#endif
if (m_GlyphIndex[charcode]) {
- bGotOne = true;
+ bGotOne = TRUE;
break;
}
}
@@ -1237,9 +1237,9 @@ void CPDF_Type1Font::LoadGlyphMap()
}
return;
}
- bool bUnicode = false;
+ FX_BOOL bUnicode = FALSE;
if (0 == FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE)) {
- bUnicode = true;
+ bUnicode = TRUE;
}
for (int charcode = 0; charcode < 256; charcode ++) {
const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
@@ -1315,9 +1315,9 @@ void CPDF_Type1Font::LoadGlyphMap()
#endif
return;
}
- bool bUnicode = false;
+ FX_BOOL bUnicode = FALSE;
if (0 == FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE)) {
- bUnicode = true;
+ bUnicode = TRUE;
}
for (int charcode = 0; charcode < 256; charcode ++) {
const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
@@ -1363,7 +1363,7 @@ CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding)
m_Unicodes[i] = pSrc[i];
}
}
-bool CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const
+FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const
{
return FXSYS_memcmp(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) == 0;
}
@@ -1372,10 +1372,10 @@ CPDF_Object* CPDF_FontEncoding::Realize()
int predefined = 0;
for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS; cs ++) {
const FX_WORD* pSrc = PDF_UnicodesForPredefinedCharSet(cs);
- bool match = true;
+ FX_BOOL match = TRUE;
for (int i = 0; i < 256; ++i) {
if (m_Unicodes[i] != pSrc[i]) {
- match = false;
+ match = FALSE;
break;
}
}
@@ -1413,7 +1413,7 @@ CPDF_Object* CPDF_FontEncoding::Realize()
CPDF_TrueTypeFont::CPDF_TrueTypeFont() : CPDF_SimpleFont(PDFFONT_TRUETYPE)
{
}
-bool CPDF_TrueTypeFont::_Load()
+FX_BOOL CPDF_TrueTypeFont::_Load()
{
return LoadCommon();
}
@@ -1426,14 +1426,14 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
if (m_pFontFile && m_Font.m_Face->num_charmaps > 0
&& (baseEncoding == PDFFONT_ENCODING_MACROMAN || baseEncoding == PDFFONT_ENCODING_WINANSI)
&& (m_Flags & PDFFONT_SYMBOLIC)) {
- bool bSupportWin = false;
- bool bSupportMac = false;
+ FX_BOOL bSupportWin = FALSE;
+ FX_BOOL bSupportMac = FALSE;
for (int i = 0; i < FXFT_Get_Face_CharmapCount(m_Font.m_Face); i++) {
int platform_id = FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(m_Font.m_Face)[i]);
if (platform_id == 0 || platform_id == 3) {
- bSupportWin = true;
+ bSupportWin = TRUE;
} else if (platform_id == 0 || platform_id == 1) {
- bSupportMac = true;
+ bSupportMac = TRUE;
}
}
if (baseEncoding == PDFFONT_ENCODING_WINANSI && !bSupportWin) {
@@ -1459,8 +1459,8 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
return;
}
- bool bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
- bool bMacRoman = false, bMSSymbol = false;
+ FX_BOOL bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
+ FX_BOOL bMacRoman = FALSE, bMSSymbol = FALSE;
if (!bMSUnicode) {
if (m_Flags & PDFFONT_NONSYMBOLIC) {
bMacRoman = FT_UseTTCharmap(m_Font.m_Face, 1, 0);
@@ -1470,7 +1470,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
bMacRoman = !bMSSymbol && FT_UseTTCharmap(m_Font.m_Face, 1, 0);
}
}
- bool bToUnicode = m_pFontDict->KeyExist(FX_BSTRC("ToUnicode"));
+ FX_BOOL bToUnicode = m_pFontDict->KeyExist(FX_BSTRC("ToUnicode"));
for (int charcode = 0; charcode < 256; charcode ++) {
const FX_CHAR* name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
if (name == NULL) {
@@ -1523,13 +1523,13 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
const uint8_t prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
- bool bGotOne = false;
+ FX_BOOL bGotOne = FALSE;
for (int charcode = 0; charcode < 256; charcode ++) {
for (int j = 0; j < 4; j ++) {
FX_WORD unicode = prefix[j] * 256 + charcode;
m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
if (m_GlyphIndex[charcode]) {
- bGotOne = true;
+ bGotOne = TRUE;
break;
}
}
@@ -1552,12 +1552,12 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
}
if (FT_UseTTCharmap(m_Font.m_Face, 1, 0)) {
- bool bGotOne = false;
+ FX_BOOL bGotOne = FALSE;
for (int charcode = 0; charcode < 256; charcode ++) {
m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
m_Encoding.m_Unicodes[charcode] = FT_UnicodeFromCharCode(FXFT_ENCODING_APPLE_ROMAN, charcode);
if (m_GlyphIndex[charcode]) {
- bGotOne = true;
+ bGotOne = TRUE;
}
}
if (m_pFontFile || bGotOne) {
@@ -1565,7 +1565,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
}
if (FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE) == 0) {
- bool bGotOne = false;
+ FX_BOOL bGotOne = FALSE;
const FX_WORD* pUnicodes = PDF_UnicodesForPredefinedCharSet(baseEncoding);
for (int charcode = 0; charcode < 256; charcode ++) {
if (m_pFontFile == NULL) {
@@ -1580,7 +1580,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
if (m_GlyphIndex[charcode]) {
- bGotOne = true;
+ bGotOne = TRUE;
}
}
if (bGotOne) {
@@ -1614,7 +1614,7 @@ CPDF_Type3Font::~CPDF_Type3Font()
delete (CPDF_Type3Char*)key;
}
}
-bool CPDF_Type3Font::_Load()
+FX_BOOL CPDF_Type3Font::_Load()
{
m_pFontResources = m_pFontDict->GetDict(FX_BSTRC("Resources"));
CPDF_Array* pMatrix = m_pFontDict->GetArray(FX_BSTRC("FontMatrix"));
@@ -1648,7 +1648,7 @@ bool CPDF_Type3Font::_Load()
m_pCharProcs = m_pFontDict->GetDict(FX_BSTRC("CharProcs"));
CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
if (pEncoding) {
- LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, false, false);
+ LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, FALSE, FALSE);
if (m_pCharNames) {
for (int i = 0; i < 256; i ++) {
m_Encoding.m_Unicodes[i] = PDF_UnicodeFromAdobeName(m_pCharNames[i]);
@@ -1658,7 +1658,7 @@ bool CPDF_Type3Font::_Load()
}
}
}
- return true;
+ return TRUE;
}
void CPDF_Type3Font::CheckType3FontMetrics()
{
@@ -1736,8 +1736,8 @@ CPDF_Type3Char::CPDF_Type3Char()
{
m_pForm = NULL;
m_pBitmap = NULL;
- m_bPageRequired = false;
- m_bColored = false;
+ m_bPageRequired = FALSE;
+ m_bColored = FALSE;
}
CPDF_Type3Char::~CPDF_Type3Char()
{
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 8f95e59dee..f70b9ecfc4 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -13,18 +13,18 @@
#include "font_int.h"
extern short TT2PDF(int m, FXFT_Face face);
-extern bool FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id);
+extern FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id);
CPDF_CMapManager::CPDF_CMapManager()
{
- m_bPrompted = false;
+ m_bPrompted = FALSE;
FXSYS_memset(m_CID2UnicodeMaps, 0, sizeof m_CID2UnicodeMaps);
}
CPDF_CMapManager::~CPDF_CMapManager()
{
- DropAll(false);
+ DropAll(FALSE);
}
-CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, bool bPromptCJK)
+CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
{
CPDF_CMap* pCMap;
if (m_CMaps.Lookup(name, (void*&)pCMap)) {
@@ -37,7 +37,7 @@ CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, bool
m_CMaps.SetAt(name, pCMap);
return pCMap;
}
-CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name, bool bPromptCJK)
+CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
{
CPDF_CMap* pCMap = new CPDF_CMap;
const FX_CHAR* pname = name;
@@ -59,9 +59,9 @@ int _CharsetFromOrdering(const CFX_ByteString& Ordering)
}
void CPDF_CMapManager::ReloadAll()
{
- DropAll(true);
+ DropAll(TRUE);
}
-void CPDF_CMapManager::DropAll(bool bReload)
+void CPDF_CMapManager::DropAll(FX_BOOL bReload)
{
FX_POSITION pos = m_CMaps.GetStartPosition();
while (pos) {
@@ -72,7 +72,7 @@ void CPDF_CMapManager::DropAll(bool bReload)
continue;
}
if (bReload) {
- pCMap->LoadPredefined(this, name, false);
+ pCMap->LoadPredefined(this, name, FALSE);
} else {
delete pCMap;
}
@@ -83,20 +83,20 @@ void CPDF_CMapManager::DropAll(bool bReload)
continue;
}
if (bReload) {
- pMap->Load(this, i, false);
+ pMap->Load(this, i, FALSE);
} else {
delete pMap;
}
}
}
-CPDF_CID2UnicodeMap* CPDF_CMapManager::GetCID2UnicodeMap(int charset, bool bPromptCJK)
+CPDF_CID2UnicodeMap* CPDF_CMapManager::GetCID2UnicodeMap(int charset, FX_BOOL bPromptCJK)
{
if (m_CID2UnicodeMaps[charset] == NULL) {
m_CID2UnicodeMaps[charset] = LoadCID2UnicodeMap(charset, bPromptCJK);
}
return m_CID2UnicodeMaps[charset];
}
-CPDF_CID2UnicodeMap* CPDF_CMapManager::LoadCID2UnicodeMap(int charset, bool bPromptCJK)
+CPDF_CID2UnicodeMap* CPDF_CMapManager::LoadCID2UnicodeMap(int charset, FX_BOOL bPromptCJK)
{
CPDF_CID2UnicodeMap* pMap = new CPDF_CID2UnicodeMap();
if (!pMap->Initialize()) {
@@ -112,13 +112,13 @@ CPDF_CMapParser::CPDF_CMapParser()
m_Status = 0;
m_CodeSeq = 0;
}
-bool CPDF_CMapParser::Initialize(CPDF_CMap* pCMap)
+FX_BOOL CPDF_CMapParser::Initialize(CPDF_CMap* pCMap)
{
m_pCMap = pCMap;
m_Status = 0;
m_CodeSeq = 0;
m_AddMaps.EstimateSize(0, 10240);
- return true;
+ return TRUE;
}
static FX_DWORD CMap_GetCode(const CFX_ByteStringC& word)
{
@@ -147,10 +147,10 @@ static FX_DWORD CMap_GetCode(const CFX_ByteStringC& word)
}
return num;
}
-static bool _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& first, const CFX_ByteStringC& second)
+static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& first, const CFX_ByteStringC& second)
{
if (first.GetLength() == 0 || first.GetAt(0) != '<') {
- return false;
+ return FALSE;
}
int i;
for (i = 1; i < first.GetLength(); i ++)
@@ -159,7 +159,7 @@ static bool _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& fi
}
range.m_CharSize = (i - 1) / 2;
if (range.m_CharSize > 4) {
- return false;
+ return FALSE;
}
for (i = 0; i < range.m_CharSize; i ++) {
uint8_t digit1 = first.GetAt(i * 2 + 1);
@@ -176,7 +176,7 @@ static bool _CMap_GetCodeRange(_CMap_CodeRange& range, const CFX_ByteStringC& fi
byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10));
range.m_Upper[i] = byte;
}
- return true;
+ return TRUE;
}
static CFX_ByteString CMap_GetString(const CFX_ByteStringC& word)
{
@@ -282,7 +282,7 @@ CPDF_CMap::CPDF_CMap()
m_Coding = CIDCODING_UNKNOWN;
m_CodingScheme = TwoBytes;
m_bVertical = 0;
- m_bLoaded = false;
+ m_bLoaded = FALSE;
m_pMapping = NULL;
m_pLeadingBytes = NULL;
m_pAddMapping = NULL;
@@ -346,14 +346,14 @@ const CPDF_PredefinedCMap g_PredefinedCMaps[] = {
};
extern void FPDFAPI_FindEmbeddedCMap(const char* name, int charset, int coding, const FXCMAP_CMap*& pMap);
extern FX_WORD FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode);
-bool CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, bool bPromptCJK)
+FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, FX_BOOL bPromptCJK)
{
m_PredefinedCMap = pName;
if (m_PredefinedCMap == FX_BSTRC("Identity-H") || m_PredefinedCMap == FX_BSTRC("Identity-V")) {
m_Coding = CIDCODING_CID;
m_bVertical = pName[9] == 'V';
- m_bLoaded = true;
- return true;
+ m_bLoaded = TRUE;
+ return TRUE;
}
CFX_ByteString cmapid = m_PredefinedCMap;
m_bVertical = cmapid.Right(1) == FX_BSTRC("V");
@@ -363,7 +363,7 @@ bool CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, boo
int index = 0;
while (1) {
if (g_PredefinedCMaps[index].m_pName == NULL) {
- return false;
+ return FALSE;
}
if (cmapid == CFX_ByteStringC(g_PredefinedCMaps[index].m_pName)) {
break;
@@ -384,10 +384,10 @@ bool CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, boo
}
FPDFAPI_FindEmbeddedCMap(pName, m_Charset, m_Coding, m_pEmbedMap);
if (m_pEmbedMap) {
- m_bLoaded = true;
- return true;
+ m_bLoaded = TRUE;
+ return TRUE;
}
- return false;
+ return FALSE;
}
extern "C" {
static int compare_dword(const void* data1, const void* data2)
@@ -395,7 +395,7 @@ extern "C" {
return (*(FX_DWORD*)data1) - (*(FX_DWORD*)data2);
}
};
-bool CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size)
+FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size)
{
m_pMapping = FX_Alloc(FX_WORD, 65536);
CPDF_CMapParser parser;
@@ -414,7 +414,7 @@ bool CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size)
FXSYS_memcpy(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(), parser.m_AddMaps.GetSize());
FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8, compare_dword);
}
- return true;
+ return TRUE;
}
extern "C" {
static int compareCID(const void* key, const void* element)
@@ -668,11 +668,11 @@ CPDF_CID2UnicodeMap::CPDF_CID2UnicodeMap()
CPDF_CID2UnicodeMap::~CPDF_CID2UnicodeMap()
{
}
-bool CPDF_CID2UnicodeMap::Initialize()
+FX_BOOL CPDF_CID2UnicodeMap::Initialize()
{
- return true;
+ return TRUE;
}
-bool CPDF_CID2UnicodeMap::IsLoaded()
+FX_BOOL CPDF_CID2UnicodeMap::IsLoaded()
{
return m_EmbeddedCount != 0;
}
@@ -687,7 +687,7 @@ FX_WCHAR CPDF_CID2UnicodeMap::UnicodeFromCID(FX_WORD CID)
return 0;
}
void FPDFAPI_LoadCID2UnicodeMap(int charset, const FX_WORD*& pMap, FX_DWORD& count);
-void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, int charset, bool bPromptCJK)
+void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, int charset, FX_BOOL bPromptCJK)
{
m_Charset = charset;
FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount);
@@ -700,8 +700,8 @@ CPDF_CIDFont::CPDF_CIDFont() : CPDF_Font(PDFFONT_CIDFONT)
m_pCID2UnicodeMap = NULL;
m_pAnsiWidths = NULL;
m_pCIDToGIDMap = NULL;
- m_bCIDIsGID = false;
- m_bAdobeCourierStd = false;
+ m_bCIDIsGID = FALSE;
+ m_bAdobeCourierStd = FALSE;
m_pTTGSUBTable = NULL;
FXSYS_memset(m_CharBBox, 0xff, 256 * sizeof(FX_SMALL_RECT));
}
@@ -721,9 +721,9 @@ FX_WORD CPDF_CIDFont::CIDFromCharCode(FX_DWORD charcode) const
}
return m_pCMap->CIDFromCharCode(charcode);
}
-bool CPDF_CIDFont::IsVertWriting() const
+FX_BOOL CPDF_CIDFont::IsVertWriting() const
{
- return m_pCMap ? m_pCMap->IsVertWriting() : false;
+ return m_pCMap ? m_pCMap->IsVertWriting() : FALSE;
}
extern FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, FX_WORD cid);
static FX_DWORD _EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap, int charset, FX_WCHAR unicode)
@@ -873,27 +873,27 @@ static void FT_UseCIDCharmap(FXFT_Face face, int coding)
FXFT_Set_Charmap(face, *FXFT_Get_Face_Charmaps(face));
}
}
-bool CPDF_CIDFont::_Load()
+FX_BOOL CPDF_CIDFont::_Load()
{
if (m_pFontDict->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("TrueType")) {
return LoadGB2312();
}
CPDF_Array* pFonts = m_pFontDict->GetArray(FX_BSTRC("DescendantFonts"));
if (pFonts == NULL) {
- return false;
+ return FALSE;
}
if (pFonts->GetCount() != 1) {
- return false;
+ return FALSE;
}
CPDF_Dictionary* pCIDFontDict = pFonts->GetDict(0);
if (pCIDFontDict == NULL) {
- return false;
+ return FALSE;
}
m_BaseFont = pCIDFontDict->GetString(FX_BSTRC("BaseFont"));
if ((m_BaseFont.Compare("CourierStd") == 0 || m_BaseFont.Compare("CourierStd-Bold") == 0
|| m_BaseFont.Compare("CourierStd-BoldOblique") == 0 || m_BaseFont.Compare("CourierStd-Oblique") == 0)
&& !IsEmbedded()) {
- m_bAdobeCourierStd = true;
+ m_bAdobeCourierStd = TRUE;
}
CPDF_Dictionary* pFontDesc = pCIDFontDict->GetDict(FX_BSTRC("FontDescriptor"));
if (pFontDesc) {
@@ -901,12 +901,12 @@ bool CPDF_CIDFont::_Load()
}
CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
if (pEncoding == NULL) {
- return false;
+ return FALSE;
}
CFX_ByteString subtype = pCIDFontDict->GetString(FX_BSTRC("Subtype"));
- m_bType1 = false;
+ m_bType1 = FALSE;
if (subtype == FX_BSTRC("CIDFontType0")) {
- m_bType1 = true;
+ m_bType1 = TRUE;
}
if (pEncoding->GetType() == PDFOBJ_NAME) {
CFX_ByteString cmap = pEncoding->GetString();
@@ -916,13 +916,13 @@ bool CPDF_CIDFont::_Load()
m_pAllocatedCMap = m_pCMap = new CPDF_CMap;
CPDF_Stream* pStream = (CPDF_Stream*)pEncoding;
CPDF_StreamAcc acc;
- acc.LoadAllData(pStream, false);
+ acc.LoadAllData(pStream, FALSE);
m_pCMap->LoadEmbedded(acc.GetData(), acc.GetSize());
} else {
- return false;
+ return FALSE;
}
if (m_pCMap == NULL) {
- return false;
+ return FALSE;
}
m_Charset = m_pCMap->m_Charset;
if (m_Charset == CIDSET_UNKNOWN) {
@@ -955,14 +955,14 @@ bool CPDF_CIDFont::_Load()
if (pmap) {
if (pmap->GetType() == PDFOBJ_STREAM) {
m_pCIDToGIDMap = new CPDF_StreamAcc;
- m_pCIDToGIDMap->LoadAllData((CPDF_Stream*)pmap, false);
+ m_pCIDToGIDMap->LoadAllData((CPDF_Stream*)pmap, FALSE);
} else if (pmap->GetString() == FX_BSTRC("Identity")) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (m_pFontFile) {
- m_bCIDIsGID = true;
+ m_bCIDIsGID = TRUE;
}
#else
- m_bCIDIsGID = true;
+ m_bCIDIsGID = TRUE;
#endif
}
}
@@ -983,7 +983,7 @@ bool CPDF_CIDFont::_Load()
m_DefaultW1 = -1000;
}
}
- return true;
+ return TRUE;
}
FX_FLOAT _CIDTransformToFloat(uint8_t ch)
{
@@ -1001,7 +1001,7 @@ void CPDF_CIDFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
rect.top = m_CharBBox[charcode].Top;
return;
}
- bool bVert = false;
+ FX_BOOL bVert = FALSE;
int glyph_index = GlyphFromCharCode(charcode, &bVert);
if (m_Font.m_Face == NULL) {
rect = FX_RECT(0, 0, 0, 0);
@@ -1120,10 +1120,10 @@ void CPDF_CIDFont::GetVertOrigin(FX_WORD CID, short& vx, short &vy) const
vx = (short)dwWidth / 2;
vy = (short)m_DefaultVY;
}
-int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, bool *pVertGlyph)
+int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL *pVertGlyph)
{
if (pVertGlyph) {
- *pVertGlyph = false;
+ *pVertGlyph = FALSE;
}
int index = FXFT_Get_Char_Index(m_Font.m_Face, unicode );
if (unicode == 0x2502) {
@@ -1136,7 +1136,7 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, bool *pVertGlyph)
if (vindex) {
index = vindex;
if (pVertGlyph) {
- *pVertGlyph = true;
+ *pVertGlyph = TRUE;
}
}
return index;
@@ -1157,21 +1157,21 @@ int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, bool *pVertGlyph)
if (vindex) {
index = vindex;
if (pVertGlyph) {
- *pVertGlyph = true;
+ *pVertGlyph = TRUE;
}
}
}
return index;
}
if (pVertGlyph) {
- *pVertGlyph = false;
+ *pVertGlyph = FALSE;
}
return index;
}
-int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph)
+int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
{
if (pVertGlyph) {
- *pVertGlyph = false;
+ *pVertGlyph = FALSE;
}
if (m_pFontFile == NULL && m_pCIDToGIDMap == NULL) {
FX_WORD cid = CIDFromCharCode(charcode);
@@ -1206,8 +1206,8 @@ int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, bool *pVertGlyph)
}
charcode += 31;
int index = 0, iBaseEncoding;
- bool bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
- bool bMacRoman = false;
+ FX_BOOL bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
+ FX_BOOL bMacRoman = FALSE;
if (!bMSUnicode) {
bMacRoman = FT_UseTTCharmap(m_Font.m_Face, 1, 0);
}
@@ -1327,16 +1327,16 @@ int CPDF_CIDFont::AppendChar(FX_CHAR* str, FX_DWORD charcode) const
{
return m_pCMap->AppendChar(str, charcode);
}
-bool CPDF_CIDFont::IsUnicodeCompatible() const
+FX_BOOL CPDF_CIDFont::IsUnicodeCompatible() const
{
if (!m_pCMap->IsLoaded() || m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
return m_pCMap->m_Coding != CIDCODING_UNKNOWN;
}
- return true;
+ return TRUE;
}
-bool CPDF_CIDFont::IsFontStyleFromCharCode(FX_DWORD charcode) const
+FX_BOOL CPDF_CIDFont::IsFontStyleFromCharCode(FX_DWORD charcode) const
{
- return true;
+ return TRUE;
}
void CPDF_CIDFont::LoadSubstFont()
{
@@ -1390,7 +1390,7 @@ void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result,
}
}
}
-bool CPDF_CIDFont::LoadGB2312()
+FX_BOOL CPDF_CIDFont::LoadGB2312()
{
m_BaseFont = m_pFontDict->GetString(FX_BSTRC("BaseFont"));
CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
@@ -1398,10 +1398,10 @@ bool CPDF_CIDFont::LoadGB2312()
LoadFontDescriptor(pFontDesc);
}
m_Charset = CIDSET_GB1;
- m_bType1 = false;
+ m_bType1 = FALSE;
m_pCMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetPredefinedCMap(
- FX_BSTRC("GBK-EUC-H"), false);
- m_pCID2UnicodeMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(m_Charset, false);
+ FX_BSTRC("GBK-EUC-H"), FALSE);
+ m_pCID2UnicodeMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(m_Charset, FALSE);
if (!IsEmbedded()) {
LoadSubstFont();
}
@@ -1411,7 +1411,7 @@ bool CPDF_CIDFont::LoadGB2312()
for (int i = 32; i < 127; i ++) {
m_pAnsiWidths[i] = 500;
}
- return true;
+ return TRUE;
}
const struct _CIDTransform {
FX_WORD CID;
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index 980e16c43e..a65359c1d4 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -48,15 +48,15 @@ void CFX_GlyphMap::SetAt(int key, int value)
}
m_Buffer.InsertBlock(low * sizeof(_IntPair), &pair, sizeof(_IntPair));
}
-bool CFX_GlyphMap::Lookup(int key, int &value)
+FX_BOOL CFX_GlyphMap::Lookup(int key, int &value)
{
void* pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_IntPair),
sizeof(_IntPair), _CompareInt);
if (pResult == NULL) {
- return false;
+ return FALSE;
}
value = ((FX_DWORD*)pResult)[1];
- return true;
+ return TRUE;
}
bool CFX_CTTGSUBTable::LoadGSUBTable(FT_Bytes gsub)
{
@@ -108,7 +108,7 @@ bool CFX_CTTGSUBTable::GetVerticalGlyph(TT_uint32_t glyphnum, TT_uint32_t *vglyp
}
}
}
- m_bFeautureMapLoad = true;
+ m_bFeautureMapLoad = TRUE;
}
FX_POSITION pos = m_featureMap.GetStartPosition();
while (pos) {
@@ -420,7 +420,7 @@ void CFX_CTTGSUBTable::ParseSingleSubstFormat2(FT_Bytes raw, TSingleSubstFormat2
rec->Substitute[i] = GetUInt16(sp);
}
}
-bool CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum)
+FX_BOOL CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum)
{
return m_GsubImp.GetVerticalGlyph(glyphnum, vglyphnum);
}
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
index 133667b4d8..1b18f82d6e 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -17,15 +17,15 @@ public:
CFX_GlyphMap();
~CFX_GlyphMap();
void SetAt(int key, int value);
- bool Lookup(int key, int &value);
+ FX_BOOL Lookup(int key, int &value);
protected:
CFX_BinaryBuf m_Buffer;
};
class CFX_CTTGSUBTable
{
public:
- CFX_CTTGSUBTable(void): m_bFeautureMapLoad(false), loaded(false) {};
- CFX_CTTGSUBTable(FT_Bytes gsub): m_bFeautureMapLoad(false), loaded(false)
+ CFX_CTTGSUBTable(void): m_bFeautureMapLoad(FALSE), loaded(false) {};
+ CFX_CTTGSUBTable(FT_Bytes gsub): m_bFeautureMapLoad(FALSE), loaded(false)
{
LoadGSUBTable(gsub);
}
@@ -395,7 +395,7 @@ private:
return ret;
}
CFX_CMapDWordToDWord m_featureMap;
- bool m_bFeautureMapLoad;
+ FX_BOOL m_bFeautureMapLoad;
bool loaded;
struct tt_gsub_header header;
struct TScriptList ScriptList;
@@ -406,7 +406,7 @@ class CFX_GSUBTable final : public IFX_GSUBTable
{
public:
~CFX_GSUBTable() override {}
- virtual bool GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) override;
+ virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) override;
CFX_CTTGSUBTable m_GsubImp;
};
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 729e96c312..f404352318 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -44,7 +44,7 @@ void CPDF_PageObject::Copy(const CPDF_PageObject* pSrc)
m_Top = pSrc->m_Top;
m_Bottom = pSrc->m_Bottom;
}
-void CPDF_PageObject::AppendClipPath(CPDF_Path path, int type, bool bAutoMerge)
+void CPDF_PageObject::AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge)
{
m_ClipPath.AppendPath(path, type, bAutoMerge);
}
@@ -353,7 +353,7 @@ FX_FLOAT CPDF_TextObject::GetCharWidth(FX_DWORD charcode) const
{
FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
CPDF_Font* pFont = m_TextState.GetFont();
- bool bVertWriting = false;
+ FX_BOOL bVertWriting = FALSE;
CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
@@ -373,7 +373,7 @@ FX_FLOAT CPDF_TextObject::GetSpaceCharWidth() const
return GetCharWidth(charCode);
}
FX_FLOAT fontSize = m_TextState.GetFontSize() / 4000.0f;
- bool bVertWriting = false;
+ FX_BOOL bVertWriting = FALSE;
CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
@@ -388,7 +388,7 @@ FX_FLOAT CPDF_TextObject::GetSpaceCharWidth() const
void CPDF_TextObject::GetCharRect(int index, CFX_FloatRect& rect) const
{
CPDF_Font* pFont = m_TextState.GetFont();
- bool bVertWriting = false;
+ FX_BOOL bVertWriting = FALSE;
CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
@@ -441,7 +441,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
FX_FLOAT min_y = 10000 * 1.0f;
FX_FLOAT max_y = -10000 * 1.0f;
CPDF_Font* pFont = m_TextState.GetFont();
- bool bVertWriting = false;
+ FX_BOOL bVertWriting = FALSE;
CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
@@ -570,7 +570,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
void CPDF_TextObject::CalcCharPos(FX_FLOAT* pPosArray) const
{
CPDF_Font* pFont = m_TextState.GetFont();
- bool bVertWriting = false;
+ FX_BOOL bVertWriting = FALSE;
CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
@@ -720,7 +720,7 @@ void CPDF_FormObject::CalcBoundingBox()
m_Right = form_rect.right;
m_Top = form_rect.top;
}
-CPDF_PageObjects::CPDF_PageObjects(bool bReleaseMembers)
+CPDF_PageObjects::CPDF_PageObjects(FX_BOOL bReleaseMembers)
: m_pFormDict(nullptr),
m_pFormStream(nullptr),
m_pDocument(nullptr),
@@ -728,7 +728,7 @@ CPDF_PageObjects::CPDF_PageObjects(bool bReleaseMembers)
m_pResources(nullptr),
m_Transparency(0),
m_ObjectList(128),
- m_bBackgroundAlphaNeeded(false),
+ m_bBackgroundAlphaNeeded(FALSE),
m_bReleaseMembers(bReleaseMembers),
m_pParser(nullptr),
m_ParseState(CONTENT_NOT_PARSED)
@@ -856,7 +856,7 @@ CPDF_Page::CPDF_Page()
{
m_pPageRender = NULL;
}
-void CPDF_Page::Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, bool bPageCache)
+void CPDF_Page::Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache)
{
m_pDocument = (CPDF_Document*)pDocument;
m_pFormDict = pPageDict;
@@ -923,7 +923,7 @@ void CPDF_Page::Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, bool
m_Transparency = PDFTRANS_ISOLATED;
LoadTransInfo();
}
-void CPDF_Page::StartParse(CPDF_ParseOptions* pOptions, bool bReParse)
+void CPDF_Page::StartParse(CPDF_ParseOptions* pOptions, FX_BOOL bReParse)
{
if (bReParse) {
ClearCacheObjects();
@@ -935,7 +935,7 @@ void CPDF_Page::StartParse(CPDF_ParseOptions* pOptions, bool bReParse)
m_pParser->Start(this, pOptions);
m_ParseState = CONTENT_PARSING;
}
-void CPDF_Page::ParseContent(CPDF_ParseOptions* pOptions, bool bReParse)
+void CPDF_Page::ParseContent(CPDF_ParseOptions* pOptions, FX_BOOL bReParse)
{
StartParse(pOptions, bReParse);
ContinueParse(NULL);
@@ -1068,8 +1068,8 @@ void CPDF_Page::GetDisplayMatrix(CFX_AffineMatrix& matrix, int xPos, int yPos,
}
CPDF_ParseOptions::CPDF_ParseOptions()
{
- m_bTextOnly = false;
- m_bMarkedContent = true;
- m_bSeparateForm = true;
- m_bDecodeInlineImage = false;
+ m_bTextOnly = FALSE;
+ m_bMarkedContent = TRUE;
+ m_bSeparateForm = TRUE;
+ m_bDecodeInlineImage = FALSE;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index b1c8837326..198054ef7e 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -40,7 +40,7 @@ CPDF_DeviceCS::CPDF_DeviceCS(CPDF_Document* pDoc, int family)
: CPDF_ColorSpace(pDoc, family, ComponentsForFamily(family)) {
}
-bool CPDF_DeviceCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_DeviceCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
if (m_Family == PDFCS_DEVICERGB) {
R = pBuf[0];
@@ -81,56 +81,56 @@ bool CPDF_DeviceCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B
} else {
ASSERT(m_Family == PDFCS_PATTERN);
R = G = B = 0;
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_DeviceCS::v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
+FX_BOOL CPDF_DeviceCS::v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
{
if (m_Family != PDFCS_DEVICECMYK) {
- return false;
+ return FALSE;
}
c = pBuf[0];
m = pBuf[1];
y = pBuf[2];
k = pBuf[3];
- return true;
+ return TRUE;
}
-bool CPDF_DeviceCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+FX_BOOL CPDF_DeviceCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
{
if (m_Family == PDFCS_DEVICERGB) {
pBuf[0] = R;
pBuf[1] = G;
pBuf[2] = B;
- return true;
+ return TRUE;
}
if (m_Family == PDFCS_DEVICEGRAY) {
if (R == G && R == B) {
*pBuf = R;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (m_Family == PDFCS_DEVICECMYK) {
sRGB_to_AdobeCMYK(R, G, B, pBuf[0], pBuf[1], pBuf[2], pBuf[3]);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDF_DeviceCS::v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
+FX_BOOL CPDF_DeviceCS::v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
{
if (m_Family == PDFCS_DEVICERGB) {
AdobeCMYK_to_sRGB(c, m, y, k, pBuf[0], pBuf[1], pBuf[2]);
- return true;
+ return TRUE;
}
if (m_Family == PDFCS_DEVICECMYK) {
pBuf[0] = c;
pBuf[1] = m;
pBuf[2] = y;
pBuf[3] = k;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
static void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels)
{
@@ -149,7 +149,7 @@ static void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels)
pSrcBuf += 3;
}
}
-void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, bool bTransMask) const
+void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
if (bTransMask && m_Family == PDFCS_DEVICECMYK) {
for (int i = 0; i < pixels; i ++) {
@@ -274,11 +274,11 @@ public:
explicit CPDF_CalGray(CPDF_Document* pDoc)
: CPDF_ColorSpace(pDoc, PDFCS_CALGRAY, 1) {
}
- bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
- bool SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const override;
+ FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const override;
void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width,
- int image_height, bool bTransMask = false) const override;
+ int image_height, FX_BOOL bTransMask = FALSE) const override;
private:
FX_FLOAT m_WhitePoint[3];
@@ -286,7 +286,7 @@ private:
FX_FLOAT m_Gamma;
};
-bool CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+FX_BOOL CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CPDF_Dictionary* pDict = pArray->GetDict(1);
CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
@@ -302,22 +302,22 @@ bool CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
if (m_Gamma == 0) {
m_Gamma = 1.0f;
}
- return true;
+ return TRUE;
}
-bool CPDF_CalGray::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_CalGray::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
R = G = B = *pBuf;
- return true;
+ return TRUE;
}
-bool CPDF_CalGray::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+FX_BOOL CPDF_CalGray::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
{
if (R == G && R == B) {
*pBuf = R;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-void CPDF_CalGray::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, bool bTransMask) const
+void CPDF_CalGray::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
for (int i = 0; i < pixels; i ++) {
*pDestBuf ++ = pSrcBuf[i];
@@ -331,24 +331,24 @@ public:
explicit CPDF_CalRGB(CPDF_Document* pDoc)
: CPDF_ColorSpace(pDoc, PDFCS_CALRGB, 3) {
}
- bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
- bool SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const override;
+ FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const override;
void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width,
- int image_height, bool bTransMask = false) const override;
+ int image_height, FX_BOOL bTransMask = FALSE) const override;
FX_FLOAT m_WhitePoint[3];
FX_FLOAT m_BlackPoint[3];
FX_FLOAT m_Gamma[3];
FX_FLOAT m_Matrix[9];
- bool m_bGamma;
- bool m_bMatrix;
+ FX_BOOL m_bGamma;
+ FX_BOOL m_bMatrix;
};
-bool CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CPDF_Dictionary* pDict = pArray->GetDict(1);
if (!pDict)
- return false;
+ return FALSE;
CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
int i;
@@ -361,25 +361,25 @@ bool CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
}
pParam = pDict->GetArray(FX_BSTRC("Gamma"));
if (pParam) {
- m_bGamma = true;
+ m_bGamma = TRUE;
for (i = 0; i < 3; i ++) {
m_Gamma[i] = pParam->GetNumber(i);
}
} else {
- m_bGamma = false;
+ m_bGamma = FALSE;
}
pParam = pDict->GetArray(FX_BSTRC("Matrix"));
if (pParam) {
- m_bMatrix = true;
+ m_bMatrix = TRUE;
for (i = 0; i < 9; i ++) {
m_Matrix[i] = pParam->GetNumber(i);
}
} else {
- m_bMatrix = false;
+ m_bMatrix = FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_CalRGB::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_CalRGB::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
FX_FLOAT A_ = pBuf[0];
FX_FLOAT B_ = pBuf[1];
@@ -400,16 +400,16 @@ bool CPDF_CalRGB::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B)
Z = C_;
}
XYZ_to_sRGB_WhitePoint(X, Y, Z, R, G, B, m_WhitePoint[0], m_WhitePoint[1], m_WhitePoint[2]);
- return true;
+ return TRUE;
}
-bool CPDF_CalRGB::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+FX_BOOL CPDF_CalRGB::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
{
pBuf[0] = R;
pBuf[1] = G;
pBuf[2] = B;
- return true;
+ return TRUE;
}
-void CPDF_CalRGB::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, bool bTransMask) const
+void CPDF_CalRGB::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
if (bTransMask) {
FX_FLOAT Cal[3];
@@ -435,21 +435,21 @@ public:
: CPDF_ColorSpace(pDoc, PDFCS_LAB, 3) {
}
void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const override;
- bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
- bool SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const override;
+ FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const override;
void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width,
- int image_height, bool bTransMask = false) const;
+ int image_height, FX_BOOL bTransMask = FALSE) const;
FX_FLOAT m_WhitePoint[3];
FX_FLOAT m_BlackPoint[3];
FX_FLOAT m_Ranges[4];
};
-bool CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+FX_BOOL CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CPDF_Dictionary* pDict = pArray->GetDict(1);
if (!pDict) {
- return false;
+ return FALSE;
}
CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
int i;
@@ -465,7 +465,7 @@ bool CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
for (i = 0; i < 4; i ++) {
m_Ranges[i] = pParam ? pParam->GetNumber(i) : def_ranges[i];
}
- return true;
+ return TRUE;
}
void CPDF_LabCS::GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
{
@@ -484,7 +484,7 @@ void CPDF_LabCS::GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min,
}
}
}
-bool CPDF_LabCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_LabCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
FX_FLOAT Lstar = pBuf[0];
FX_FLOAT astar = pBuf[1];
@@ -509,13 +509,13 @@ bool CPDF_LabCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) c
Z = 1.0889f * N * N * N;
}
XYZ_to_sRGB(X, Y, Z, R, G, B);
- return true;
+ return TRUE;
}
-bool CPDF_LabCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+FX_BOOL CPDF_LabCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
{
- return false;
+ return FALSE;
}
-void CPDF_LabCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, bool bTransMask) const
+void CPDF_LabCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
for (int i = 0; i < pixels; i ++) {
FX_FLOAT lab[3];
@@ -532,12 +532,12 @@ void CPDF_LabCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, i
}
}
CPDF_IccProfile::CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize):
- m_bsRGB(false),
+ m_bsRGB(FALSE),
m_pTransform(NULL),
m_nSrcComponents(0)
{
if (dwSize == 3144 && FXSYS_memcmp(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0) {
- m_bsRGB = true;
+ m_bsRGB = TRUE;
m_nSrcComponents = 3;
}
else if (CPDF_ModuleMgr::Get()->GetIccModule()) {
@@ -559,23 +559,23 @@ public:
m_pProfile(nullptr),
m_pCache(nullptr),
m_pRanges(nullptr),
- m_bOwn(false) {
+ m_bOwn(FALSE) {
}
~CPDF_ICCBasedCS() override;
- bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
- bool SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const override;
- bool v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const override;
- void EnableStdConversion(bool bEnabled) override;
+ FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const override;
+ FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const override;
+ void EnableStdConversion(FX_BOOL bEnabled) override;
void TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width,
- int image_height, bool bTransMask = false) const override;
+ int image_height, FX_BOOL bTransMask = FALSE) const override;
CPDF_ColorSpace* m_pAlterCS;
CPDF_IccProfile* m_pProfile;
uint8_t* m_pCache;
FX_FLOAT* m_pRanges;
- bool m_bOwn;
+ FX_BOOL m_bOwn;
};
CPDF_ICCBasedCS::~CPDF_ICCBasedCS()
@@ -594,15 +594,15 @@ CPDF_ICCBasedCS::~CPDF_ICCBasedCS()
}
}
-bool CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CPDF_Stream* pStream = pArray->GetStream(1);
if (pStream == NULL) {
- return false;
+ return FALSE;
}
m_pProfile = pDoc->LoadIccProfile(pStream);
if (!m_pProfile) {
- return false;
+ return FALSE;
}
m_nComponents = m_pProfile->GetComponents(); //Try using the nComponents from ICC profile
CPDF_Dictionary* pDict = pStream->GetDict();
@@ -615,13 +615,13 @@ bool CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
if (pAlterCS->CountComponents() > 0) { // Use Alternative colorspace
m_nComponents = pAlterCS->CountComponents();
m_pAlterCS = pAlterCS;
- m_bOwn = true;
+ m_bOwn = TRUE;
}
else { // No valid alternative colorspace
pAlterCS->ReleaseCS();
int32_t nDictComponents = pDict ? pDict->GetInteger(FX_BSTRC("N")) : 0;
if (nDictComponents != 1 && nDictComponents != 3 && nDictComponents != 4) {
- return false;
+ return FALSE;
}
m_nComponents = nDictComponents;
}
@@ -633,7 +633,7 @@ bool CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
}
else {
m_pAlterCS = pAlterCS;
- m_bOwn = true;
+ m_bOwn = TRUE;
}
}
}
@@ -661,15 +661,15 @@ bool CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
m_pRanges[i] = 0;
}
}
- return true;
+ return TRUE;
}
-bool CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
if (m_pProfile && m_pProfile->m_bsRGB) {
R = pBuf[0];
G = pBuf[1];
B = pBuf[2];
- return true;
+ return TRUE;
}
ICodec_IccModule *pIccModule = CPDF_ModuleMgr::Get()->GetIccModule();
if (m_pProfile->m_pTransform == NULL || pIccModule == NULL) {
@@ -678,7 +678,7 @@ bool CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT&
} else {
R = G = B = 0.0f;
}
- return true;
+ return TRUE;
}
FX_FLOAT rgb[3];
pIccModule->SetComponents(m_nComponents);
@@ -686,31 +686,31 @@ bool CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT&
R = rgb[0];
G = rgb[1];
B = rgb[2];
- return true;
+ return TRUE;
}
-bool CPDF_ICCBasedCS::v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
+FX_BOOL CPDF_ICCBasedCS::v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
{
if (m_nComponents != 4) {
- return false;
+ return FALSE;
}
c = pBuf[0];
m = pBuf[1];
y = pBuf[2];
k = pBuf[3];
- return true;
+ return TRUE;
}
-bool CPDF_ICCBasedCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+FX_BOOL CPDF_ICCBasedCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
{
- return false;
+ return FALSE;
}
-void CPDF_ICCBasedCS::EnableStdConversion(bool bEnabled)
+void CPDF_ICCBasedCS::EnableStdConversion(FX_BOOL bEnabled)
{
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pAlterCS) {
m_pAlterCS->EnableStdConversion(bEnabled);
}
}
-void CPDF_ICCBasedCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, bool bTransMask) const
+void CPDF_ICCBasedCS::TranslateImageLine(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
if (m_pProfile->m_bsRGB) {
ReverseRGB(pDestBuf, pSrcBuf, pixels);
@@ -765,10 +765,10 @@ public:
}
~CPDF_IndexedCS() override;
- bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
+ FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
CPDF_ColorSpace* GetBaseCS() const override;
- void EnableStdConversion(bool bEnabled) override;
+ void EnableStdConversion(FX_BOOL bEnabled) override;
CPDF_ColorSpace* m_pBaseCS;
CPDF_CountedColorSpace* m_pCountedBaseCS;
@@ -787,19 +787,19 @@ CPDF_IndexedCS::~CPDF_IndexedCS()
m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
}
}
-bool CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
if (pArray->GetCount() < 4) {
- return false;
+ return FALSE;
}
CPDF_Object* pBaseObj = pArray->GetElementValue(1);
if (pBaseObj == m_pArray) {
- return false;
+ return FALSE;
}
CPDF_DocPageData* pDocPageData = pDoc->GetPageData();
m_pBaseCS = pDocPageData->GetColorSpace(pBaseObj, NULL);
if (m_pBaseCS == NULL) {
- return false;
+ return FALSE;
}
m_pCountedBaseCS = pDocPageData->FindColorSpacePtr(m_pBaseCS->GetArray());
m_nBaseComponents = m_pBaseCS->CountComponents();
@@ -812,29 +812,29 @@ bool CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
m_MaxIndex = pArray->GetInteger(2);
CPDF_Object* pTableObj = pArray->GetElementValue(3);
if (pTableObj == NULL) {
- return false;
+ return FALSE;
}
if (pTableObj->GetType() == PDFOBJ_STRING) {
m_Table = ((CPDF_String*)pTableObj)->GetString();
} else if (pTableObj->GetType() == PDFOBJ_STREAM) {
CPDF_StreamAcc acc;
- acc.LoadAllData((CPDF_Stream*)pTableObj, false);
+ acc.LoadAllData((CPDF_Stream*)pTableObj, FALSE);
m_Table = CFX_ByteStringC(acc.GetData(), acc.GetSize());
}
- return true;
+ return TRUE;
}
-bool CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
int index = (int32_t)(*pBuf);
if (index < 0 || index > m_MaxIndex) {
- return false;
+ return FALSE;
}
if (m_nBaseComponents) {
if (index == INT_MAX || (index + 1) > INT_MAX / m_nBaseComponents ||
(index + 1)*m_nBaseComponents > (int)m_Table.GetLength()) {
R = G = B = 0;
- return false;
+ return FALSE;
}
}
CFX_FixedBufGrow<FX_FLOAT, 16> Comps(m_nBaseComponents);
@@ -844,13 +844,13 @@ bool CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT&
comps[i] = m_pCompMinMax[i * 2] + m_pCompMinMax[i * 2 + 1] * pTable[index * m_nBaseComponents + i] / 255;
}
m_pBaseCS->GetRGB(comps, R, G, B);
- return true;
+ return TRUE;
}
CPDF_ColorSpace*CPDF_IndexedCS::GetBaseCS() const
{
return m_pBaseCS;
}
-void CPDF_IndexedCS::EnableStdConversion(bool bEnabled)
+void CPDF_IndexedCS::EnableStdConversion(FX_BOOL bEnabled)
{
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pBaseCS) {
@@ -871,39 +871,39 @@ CPDF_PatternCS::~CPDF_PatternCS()
m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
}
}
-bool CPDF_PatternCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+FX_BOOL CPDF_PatternCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CPDF_Object* pBaseCS = pArray->GetElementValue(1);
if (pBaseCS == m_pArray) {
- return false;
+ return FALSE;
}
CPDF_DocPageData* pDocPageData = pDoc->GetPageData();
m_pBaseCS = pDocPageData->GetColorSpace(pBaseCS, NULL);
if (m_pBaseCS) {
if (m_pBaseCS->GetFamily() == PDFCS_PATTERN) {
- return false;
+ return FALSE;
}
m_pCountedBaseCS = pDocPageData->FindColorSpacePtr(m_pBaseCS->GetArray());
m_nComponents = m_pBaseCS->CountComponents() + 1;
if (m_pBaseCS->CountComponents() > MAX_PATTERN_COLORCOMPS) {
- return false;
+ return FALSE;
}
} else {
m_nComponents = 1;
}
- return true;
+ return TRUE;
}
-bool CPDF_PatternCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_PatternCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
if (m_pBaseCS) {
ASSERT(m_pBaseCS->GetFamily() != PDFCS_PATTERN);
PatternValue* pvalue = (PatternValue*)pBuf;
if (m_pBaseCS->GetRGB(pvalue->m_Comps, R, G, B)) {
- return true;
+ return TRUE;
}
}
R = G = B = 0.75f;
- return false;
+ return FALSE;
}
CPDF_ColorSpace* CPDF_PatternCS::GetBaseCS() const
{
@@ -919,9 +919,9 @@ public:
}
~CPDF_SeparationCS() override;
void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const override;
- bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
- void EnableStdConversion(bool bEnabled) override;
+ FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
+ void EnableStdConversion(FX_BOOL bEnabled) override;
CPDF_ColorSpace* m_pAltCS;
CPDF_Function* m_pFunc;
@@ -940,7 +940,7 @@ void CPDF_SeparationCS::GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOA
min = 0;
max = 1.0f;
}
-bool CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+FX_BOOL CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CFX_ByteString name = pArray->GetString(1);
if (name == FX_BSTRC("None")) {
@@ -949,11 +949,11 @@ bool CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
m_Type = Colorant;
CPDF_Object* pAltCS = pArray->GetElementValue(2);
if (pAltCS == m_pArray) {
- return false;
+ return FALSE;
}
m_pAltCS = Load(pDoc, pAltCS);
if (!m_pAltCS) {
- return false;
+ return FALSE;
}
CPDF_Object* pFuncObj = pArray->GetElementValue(3);
if (pFuncObj && pFuncObj->GetType() != PDFOBJ_NAME) {
@@ -964,16 +964,16 @@ bool CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
m_pFunc = NULL;
}
}
- return true;
+ return TRUE;
}
-bool CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
if (m_Type == None) {
- return false;
+ return FALSE;
}
if (m_pFunc == NULL) {
if (m_pAltCS == NULL) {
- return false;
+ return FALSE;
}
int nComps = m_pAltCS->CountComponents();
CFX_FixedBufGrow<FX_FLOAT, 16> results(nComps);
@@ -981,22 +981,22 @@ bool CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOA
results[i] = *pBuf;
}
m_pAltCS->GetRGB(results, R, G, B);
- return true;
+ return TRUE;
}
CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
int nresults = 0;
m_pFunc->Call(pBuf, 1, results, nresults);
if (nresults == 0) {
- return false;
+ return FALSE;
}
if (m_pAltCS) {
m_pAltCS->GetRGB(results, R, G, B);
- return true;
+ return TRUE;
}
R = G = B = 0;
- return false;
+ return FALSE;
}
-void CPDF_SeparationCS::EnableStdConversion(bool bEnabled)
+void CPDF_SeparationCS::EnableStdConversion(FX_BOOL bEnabled)
{
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pAltCS) {
@@ -1013,9 +1013,9 @@ public:
}
~CPDF_DeviceNCS() override;
void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const override;
- bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- bool GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
- void EnableStdConversion(bool bEnabled) override;
+ FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const override;
+ void EnableStdConversion(FX_BOOL bEnabled) override;
CPDF_ColorSpace* m_pAltCS;
CPDF_Function* m_pFunc;
@@ -1033,45 +1033,45 @@ void CPDF_DeviceNCS::GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT&
min = 0;
max = 1.0f;
}
-bool CPDF_DeviceNCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+FX_BOOL CPDF_DeviceNCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CPDF_Object* pObj = pArray->GetElementValue(1);
if (!pObj) {
- return false;
+ return FALSE;
}
if (pObj->GetType() != PDFOBJ_ARRAY) {
- return false;
+ return FALSE;
}
m_nComponents = ((CPDF_Array*)pObj)->GetCount();
CPDF_Object* pAltCS = pArray->GetElementValue(2);
if (!pAltCS || pAltCS == m_pArray) {
- return false;
+ return FALSE;
}
m_pAltCS = Load(pDoc, pAltCS);
m_pFunc = CPDF_Function::Load(pArray->GetElementValue(3));
if (m_pAltCS == NULL || m_pFunc == NULL) {
- return false;
+ return FALSE;
}
if (m_pFunc->CountOutputs() < m_pAltCS->CountComponents()) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_DeviceNCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+FX_BOOL CPDF_DeviceNCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
{
if (m_pFunc == NULL) {
- return false;
+ return FALSE;
}
CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
int nresults = 0;
m_pFunc->Call(pBuf, m_nComponents, results, nresults);
if (nresults == 0) {
- return false;
+ return FALSE;
}
m_pAltCS->GetRGB(results, R, G, B);
- return true;
+ return TRUE;
}
-void CPDF_DeviceNCS::EnableStdConversion(bool bEnabled)
+void CPDF_DeviceNCS::EnableStdConversion(FX_BOOL bEnabled)
{
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pAltCS) {
@@ -1197,33 +1197,33 @@ FX_FLOAT* CPDF_ColorSpace::CreateBuf()
uint8_t* pBuf = FX_Alloc(uint8_t, size);
return (FX_FLOAT*)pBuf;
}
-bool CPDF_ColorSpace::sRGB() const
+FX_BOOL CPDF_ColorSpace::sRGB() const
{
if (m_Family == PDFCS_DEVICERGB) {
- return true;
+ return TRUE;
}
if (m_Family != PDFCS_ICCBASED) {
- return false;
+ return FALSE;
}
CPDF_ICCBasedCS* pCS = (CPDF_ICCBasedCS*)this;
return pCS->m_pProfile->m_bsRGB;
}
-bool CPDF_ColorSpace::GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
+FX_BOOL CPDF_ColorSpace::GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
{
if (v_GetCMYK(pBuf, c, m, y, k)) {
- return true;
+ return TRUE;
}
FX_FLOAT R, G, B;
if (!GetRGB(pBuf, R, G, B)) {
- return false;
+ return FALSE;
}
sRGB_to_AdobeCMYK(R, G, B, c, m, y, k);
- return true;
+ return TRUE;
}
-bool CPDF_ColorSpace::SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
+FX_BOOL CPDF_ColorSpace::SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
{
if (v_SetCMYK(pBuf, c, m, y, k)) {
- return true;
+ return TRUE;
}
FX_FLOAT R, G, B;
AdobeCMYK_to_sRGB(c, m, y, k, R, G, B);
@@ -1247,7 +1247,7 @@ int CPDF_ColorSpace::GetMaxIndex() const
CPDF_IndexedCS* pCS = (CPDF_IndexedCS*)this;
return pCS->m_MaxIndex;
}
-void CPDF_ColorSpace::TranslateImageLine(uint8_t* dest_buf, const uint8_t* src_buf, int pixels, int image_width, int image_height, bool bTransMask) const
+void CPDF_ColorSpace::TranslateImageLine(uint8_t* dest_buf, const uint8_t* src_buf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
{
CFX_FixedBufGrow<FX_FLOAT, 16> srcbuf(m_nComponents);
FX_FLOAT* src = srcbuf;
@@ -1265,7 +1265,7 @@ void CPDF_ColorSpace::TranslateImageLine(uint8_t* dest_buf, const uint8_t* src_b
*dest_buf ++ = (int32_t)(R * 255);
}
}
-void CPDF_ColorSpace::EnableStdConversion(bool bEnabled)
+void CPDF_ColorSpace::EnableStdConversion(FX_BOOL bEnabled)
{
if (bEnabled) {
m_dwStdConversion ++;
@@ -1397,23 +1397,23 @@ void CPDF_Color::Copy(const CPDF_Color* pSrc)
if (m_pCS->GetFamily() == PDFCS_PATTERN) {
PatternValue* pvalue = (PatternValue*)m_pBuffer;
if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) {
- pvalue->m_pPattern = pvalue->m_pPattern->m_pDocument->GetPageData()->GetPattern(pvalue->m_pPattern->m_pPatternObj, false, &pvalue->m_pPattern->m_ParentMatrix);
+ pvalue->m_pPattern = pvalue->m_pPattern->m_pDocument->GetPageData()->GetPattern(pvalue->m_pPattern->m_pPatternObj, FALSE, &pvalue->m_pPattern->m_ParentMatrix);
}
}
}
-bool CPDF_Color::GetRGB(int& R, int& G, int& B) const
+FX_BOOL CPDF_Color::GetRGB(int& R, int& G, int& B) const
{
if (m_pCS == NULL || m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
FX_FLOAT r=0.0f, g=0.0f, b=0.0f;
if (!m_pCS->GetRGB(m_pBuffer, r, g, b)) {
- return false;
+ return FALSE;
}
R = (int32_t)(r * 255 + 0.5f);
G = (int32_t)(g * 255 + 0.5f);
B = (int32_t)(b * 255 + 0.5f);
- return true;
+ return TRUE;
}
CPDF_Pattern* CPDF_Color::GetPattern() const
{
@@ -1438,10 +1438,10 @@ FX_FLOAT* CPDF_Color::GetPatternColor() const
PatternValue* pvalue = (PatternValue*)m_pBuffer;
return pvalue->m_nComps ? pvalue->m_Comps : NULL;
}
-bool CPDF_Color::IsEqual(const CPDF_Color& other) const
+FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const
{
if (m_pCS != other.m_pCS || m_pCS == NULL) {
- return false;
+ return FALSE;
}
return FXSYS_memcmp(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 568863a89b..05233a12a4 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -78,7 +78,7 @@ void CPDF_PageModule::ReleaseDoc(CPDF_Document* pDoc)
}
void CPDF_PageModule::ClearDoc(CPDF_Document* pDoc)
{
- pDoc->GetPageData()->Clear(false);
+ pDoc->GetPageData()->Clear(FALSE);
}
void CPDF_PageModule::NotifyCJKAvailable()
{
@@ -88,7 +88,7 @@ void CPDF_PageModule::NotifyCJKAvailable()
CPDF_Font* CPDF_Document::LoadFont(CPDF_Dictionary* pFontDict)
{
ASSERT(pFontDict);
- return GetValidatePageData()->GetFont(pFontDict, false);
+ return GetValidatePageData()->GetFont(pFontDict, FALSE);
}
CPDF_StreamAcc* CPDF_Document::LoadFontFile(CPDF_Stream* pStream)
@@ -101,7 +101,7 @@ CPDF_ColorSpace* CPDF_Document::LoadColorSpace(CPDF_Object* pCSObj, CPDF_Diction
{
return GetValidatePageData()->GetColorSpace(pCSObj, pResources);
}
-CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj, bool bShading, const CFX_AffineMatrix* matrix)
+CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix)
{
return GetValidatePageData()->GetPattern(pPatternObj, bShading, matrix);
}
@@ -126,14 +126,14 @@ void CPDF_Document::RemoveColorSpaceFromPageData(CPDF_Object* pCSObj)
}
CPDF_DocPageData::CPDF_DocPageData(CPDF_Document* pPDFDoc)
: m_pPDFDoc(pPDFDoc),
- m_bForceClear(false)
+ m_bForceClear(FALSE)
{
}
CPDF_DocPageData::~CPDF_DocPageData()
{
- Clear(false);
- Clear(true);
+ Clear(FALSE);
+ Clear(TRUE);
for (auto& it : m_PatternMap)
delete it.second;
@@ -148,7 +148,7 @@ CPDF_DocPageData::~CPDF_DocPageData()
m_ColorSpaceMap.clear();
}
-void CPDF_DocPageData::Clear(bool bForceRelease)
+void CPDF_DocPageData::Clear(FX_BOOL bForceRelease)
{
m_bForceClear = bForceRelease;
@@ -235,7 +235,7 @@ void CPDF_DocPageData::Clear(bool bForceRelease)
}
}
-CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, bool findOnly)
+CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly)
{
if (!pFontDict) {
return NULL;
@@ -432,7 +432,7 @@ void CPDF_DocPageData::ReleaseColorSpace(CPDF_Object* pColorSpace)
}
}
-CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, bool bShading, const CFX_AffineMatrix* matrix)
+CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix)
{
if (!pPatternObj)
return nullptr;
@@ -455,7 +455,7 @@ CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, bool bShadi
if (type == 1) {
pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix);
} else if (type == 2) {
- pPattern = new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, false, matrix);
+ pPattern = new CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix);
}
}
}
@@ -501,7 +501,7 @@ CPDF_Image* CPDF_DocPageData::GetImage(CPDF_Object* pImageStream)
}
CPDF_Image* pImage = new CPDF_Image(m_pPDFDoc);
- pImage->LoadImageF((CPDF_Stream*)pImageStream, false);
+ pImage->LoadImageF((CPDF_Stream*)pImageStream, FALSE);
CPDF_CountedImage* imageData = new CPDF_CountedImage(pImage);
m_ImageMap[dwImageObjNum] = imageData;
@@ -540,7 +540,7 @@ CPDF_IccProfile* CPDF_DocPageData::GetIccProfile(CPDF_Stream* pIccProfileStream)
}
CPDF_StreamAcc stream;
- stream.LoadAllData(pIccProfileStream, false);
+ stream.LoadAllData(pIccProfileStream, FALSE);
uint8_t digest[20];
CPDF_Stream* pCopiedStream = nullptr;
CRYPT_SHA1Generate(stream.GetData(), stream.GetSize(), digest);
@@ -590,14 +590,14 @@ CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(CPDF_Stream* pFontStream)
org_size = 0;
CPDF_StreamAcc* pFontFile = new CPDF_StreamAcc;
- pFontFile->LoadAllData(pFontStream, false, org_size);
+ pFontFile->LoadAllData(pFontStream, FALSE, org_size);
CPDF_CountedStreamAcc* ftData = new CPDF_CountedStreamAcc(pFontFile);
m_FontFileMap[pFontStream] = ftData;
return ftData->AddRef();
}
-void CPDF_DocPageData::ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, bool bForce)
+void CPDF_DocPageData::ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOOL bForce)
{
if (!pFontStream)
return;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index a92219d268..c961f8b20f 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -25,8 +25,8 @@ class CPDF_PSProc
{
public:
~CPDF_PSProc();
- bool Parse(CPDF_SimpleParser& parser);
- bool Execute(CPDF_PSEngine* pEngine);
+ FX_BOOL Parse(CPDF_SimpleParser& parser);
+ FX_BOOL Execute(CPDF_PSEngine* pEngine);
CFX_PtrArray m_Operators;
};
#define PSENGINE_STACKSIZE 100
@@ -35,12 +35,12 @@ class CPDF_PSEngine
public:
CPDF_PSEngine();
~CPDF_PSEngine();
- bool Parse(const FX_CHAR* string, int size);
- bool Execute()
+ FX_BOOL Parse(const FX_CHAR* string, int size);
+ FX_BOOL Execute()
{
return m_MainProc.Execute(this);
}
- bool DoOperator(PDF_PSOP op);
+ FX_BOOL DoOperator(PDF_PSOP op);
void Reset()
{
m_StackCount = 0;
@@ -73,7 +73,7 @@ CPDF_PSProc::~CPDF_PSProc()
}
}
}
-bool CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
+FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
{
int size = m_Operators.GetSize();
for (int i = 0; i < size; i ++) {
@@ -85,7 +85,7 @@ bool CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
i ++;
} else if (op == PSOP_IF) {
if (i < 2 || m_Operators[i - 2] != (void*)PSOP_PROC) {
- return false;
+ return FALSE;
}
if ((int)pEngine->Pop()) {
((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine);
@@ -93,7 +93,7 @@ bool CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
} else if (op == PSOP_IFELSE) {
if (i < 4 || m_Operators[i - 2] != (void*)PSOP_PROC ||
m_Operators[i - 4] != (void*)PSOP_PROC) {
- return false;
+ return FALSE;
}
if ((int)pEngine->Pop()) {
((CPDF_PSProc*)m_Operators[i - 3])->Execute(pEngine);
@@ -104,7 +104,7 @@ bool CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
pEngine->DoOperator(op);
}
}
- return true;
+ return TRUE;
}
CPDF_PSEngine::CPDF_PSEngine()
{
@@ -145,31 +145,31 @@ const struct _PDF_PSOpName {
{"copy", PSOP_COPY}, {"index", PSOP_INDEX}, {"roll", PSOP_ROLL},
{NULL, PSOP_PROC}
};
-bool CPDF_PSEngine::Parse(const FX_CHAR* string, int size)
+FX_BOOL CPDF_PSEngine::Parse(const FX_CHAR* string, int size)
{
CPDF_SimpleParser parser((uint8_t*)string, size);
CFX_ByteStringC word = parser.GetWord();
if (word != FX_BSTRC("{")) {
- return false;
+ return FALSE;
}
return m_MainProc.Parse(parser);
}
-bool CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
+FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
{
while (1) {
CFX_ByteStringC word = parser.GetWord();
if (word.IsEmpty()) {
- return false;
+ return FALSE;
}
if (word == FX_BSTRC("}")) {
- return true;
+ return TRUE;
}
if (word == FX_BSTRC("{")) {
CPDF_PSProc* pProc = new CPDF_PSProc;
m_Operators.Add((void*)PSOP_PROC);
m_Operators.Add(pProc);
if (!pProc->Parse(parser)) {
- return false;
+ return FALSE;
}
} else {
int i = 0;
@@ -190,7 +190,7 @@ bool CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
}
}
#define PI 3.1415926535897932384626433832795f
-bool CPDF_PSEngine::DoOperator(PDF_PSOP op)
+FX_BOOL CPDF_PSEngine::DoOperator(PDF_PSOP op)
{
int i1, i2;
FX_FLOAT d1, d2;
@@ -418,7 +418,7 @@ bool CPDF_PSEngine::DoOperator(PDF_PSOP op)
default:
break;
}
- return true;
+ return TRUE;
}
static FX_FLOAT PDF_Interpolate(FX_FLOAT x, FX_FLOAT xmin, FX_FLOAT xmax, FX_FLOAT ymin, FX_FLOAT ymax)
{
@@ -445,8 +445,8 @@ class CPDF_SampledFunc : public CPDF_Function
public:
CPDF_SampledFunc();
virtual ~CPDF_SampledFunc();
- virtual bool v_Init(CPDF_Object* pObj);
- virtual bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
+ virtual FX_BOOL v_Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
SampleEncodeInfo* m_pEncodeInfo;
SampleDecodeInfo* m_pDecodeInfo;
FX_DWORD m_nBitsPerSample;
@@ -469,10 +469,10 @@ CPDF_SampledFunc::~CPDF_SampledFunc()
FX_Free(m_pDecodeInfo);
}
}
-bool CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
+FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
{
if (pObj->GetType() != PDFOBJ_STREAM) {
- return false;
+ return FALSE;
}
CPDF_Stream* pStream = (CPDF_Stream*)pObj;
CPDF_Dictionary* pDict = pStream->GetDict();
@@ -481,11 +481,11 @@ bool CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
m_nBitsPerSample = pDict->GetInteger(FX_BSTRC("BitsPerSample"));
if (m_nBitsPerSample > 32) {
- return false;
+ return FALSE;
}
m_SampleMax = 0xffffffff >> (32 - m_nBitsPerSample);
m_pSampleStream = new CPDF_StreamAcc;
- m_pSampleStream->LoadAllData(pStream, false);
+ m_pSampleStream->LoadAllData(pStream, FALSE);
m_pEncodeInfo = FX_Alloc(SampleEncodeInfo, m_nInputs);
FX_SAFE_DWORD nTotalSampleBits = 1;
for (int i = 0; i < m_nInputs; i ++) {
@@ -514,7 +514,7 @@ bool CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
if (!nTotalSampleBytes.IsValid() ||
nTotalSampleBytes.ValueOrDie() == 0 ||
nTotalSampleBytes.ValueOrDie() > m_pSampleStream->GetSize()) {
- return false;
+ return FALSE;
}
m_pDecodeInfo = FX_Alloc(SampleDecodeInfo, m_nOutputs);
for (int i = 0; i < m_nOutputs; i ++) {
@@ -526,9 +526,9 @@ bool CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
m_pDecodeInfo[i].decode_max = m_pRanges[i * 2 + 1];
}
}
- return true;
+ return TRUE;
}
-bool CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
+FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
{
int pos = 0;
CFX_FixedBufGrow<FX_FLOAT, 16> encoded_input_buf(m_nInputs);
@@ -555,21 +555,21 @@ bool CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
FX_SAFE_INT32 bits_to_output = m_nOutputs;
bits_to_output *= m_nBitsPerSample;
if (!bits_to_output.IsValid()) {
- return false;
+ return FALSE;
}
FX_SAFE_INT32 bitpos = pos;
bitpos *= bits_to_output.ValueOrDie();
if (!bitpos.IsValid()) {
- return false;
+ return FALSE;
}
FX_SAFE_INT32 range_check = bitpos;
range_check += bits_to_output.ValueOrDie();
if (!range_check.IsValid()) {
- return false;
+ return FALSE;
}
const uint8_t* pSampleData = m_pSampleStream->GetData();
if (!pSampleData) {
- return false;
+ return FALSE;
}
for (int j = 0; j < m_nOutputs; j ++) {
FX_DWORD sample = _GetBits32(pSampleData, bitpos.ValueOrDie() + j * m_nBitsPerSample, m_nBitsPerSample);
@@ -586,7 +586,7 @@ bool CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
bitpos2 += j;
bitpos2 *= m_nBitsPerSample;
if (!bitpos2.IsValid()) {
- return false;
+ return FALSE;
}
FX_DWORD sample1 = _GetBits32(pSampleData, bitpos2.ValueOrDie(), m_nBitsPerSample);
encoded += (encoded_input[i] - index[i]) * ((FX_FLOAT)sample1 - (FX_FLOAT)sample);
@@ -595,23 +595,23 @@ bool CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
results[j] = PDF_Interpolate(encoded, 0, (FX_FLOAT)m_SampleMax,
m_pDecodeInfo[j].decode_min, m_pDecodeInfo[j].decode_max);
}
- return true;
+ return TRUE;
}
class CPDF_PSFunc : public CPDF_Function
{
public:
- virtual bool v_Init(CPDF_Object* pObj);
- virtual bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
+ virtual FX_BOOL v_Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
CPDF_PSEngine m_PS;
};
-bool CPDF_PSFunc::v_Init(CPDF_Object* pObj)
+FX_BOOL CPDF_PSFunc::v_Init(CPDF_Object* pObj)
{
CPDF_Stream* pStream = (CPDF_Stream*)pObj;
CPDF_StreamAcc acc;
- acc.LoadAllData(pStream, false);
+ acc.LoadAllData(pStream, FALSE);
return m_PS.Parse((const FX_CHAR*)acc.GetData(), acc.GetSize());
}
-bool CPDF_PSFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
+FX_BOOL CPDF_PSFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
{
CPDF_PSEngine& PS = (CPDF_PSEngine&)m_PS;
PS.Reset();
@@ -621,20 +621,20 @@ bool CPDF_PSFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
}
PS.Execute();
if (PS.GetStackSize() < m_nOutputs) {
- return false;
+ return FALSE;
}
for (i = 0; i < m_nOutputs; i ++) {
results[m_nOutputs - i - 1] = PS.Pop();
}
- return true;
+ return TRUE;
}
class CPDF_ExpIntFunc : public CPDF_Function
{
public:
CPDF_ExpIntFunc();
virtual ~CPDF_ExpIntFunc();
- virtual bool v_Init(CPDF_Object* pObj);
- virtual bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
+ virtual FX_BOOL v_Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
FX_FLOAT m_Exponent;
FX_FLOAT* m_pBeginValues;
FX_FLOAT* m_pEndValues;
@@ -654,11 +654,11 @@ CPDF_ExpIntFunc::~CPDF_ExpIntFunc()
FX_Free(m_pEndValues);
}
}
-bool CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj)
+FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj)
{
CPDF_Dictionary* pDict = pObj->GetDict();
if (pDict == NULL) {
- return false;
+ return FALSE;
}
CPDF_Array* pArray0 = pDict->GetArray(FX_BSTRC("C0"));
if (m_nOutputs == 0) {
@@ -677,27 +677,27 @@ bool CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj)
m_Exponent = pDict->GetFloat(FX_BSTRC("N"));
m_nOrigOutputs = m_nOutputs;
if (m_nOutputs && m_nInputs > INT_MAX / m_nOutputs) {
- return false;
+ return FALSE;
}
m_nOutputs *= m_nInputs;
- return true;
+ return TRUE;
}
-bool CPDF_ExpIntFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
+FX_BOOL CPDF_ExpIntFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
{
for (int i = 0; i < m_nInputs; i ++)
for (int j = 0; j < m_nOrigOutputs; j ++) {
results[i * m_nOrigOutputs + j] = m_pBeginValues[j] + (FX_FLOAT)FXSYS_pow(inputs[i], m_Exponent) *
(m_pEndValues[j] - m_pBeginValues[j]);
}
- return true;
+ return TRUE;
}
class CPDF_StitchFunc : public CPDF_Function
{
public:
CPDF_StitchFunc();
virtual ~CPDF_StitchFunc();
- virtual bool v_Init(CPDF_Object* pObj);
- virtual bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
+ virtual FX_BOOL v_Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
int m_nSubs;
CPDF_Function** m_pSubFunctions;
FX_FLOAT* m_pBounds;
@@ -724,19 +724,19 @@ CPDF_StitchFunc::~CPDF_StitchFunc()
FX_Free(m_pEncode);
}
}
-bool CPDF_StitchFunc::v_Init(CPDF_Object* pObj)
+FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj)
{
CPDF_Dictionary* pDict = pObj->GetDict();
if (pDict == NULL) {
- return false;
+ return FALSE;
}
CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Functions"));
if (pArray == NULL) {
- return false;
+ return FALSE;
}
m_nSubs = pArray->GetCount();
if (m_nSubs == 0) {
- return false;
+ return FALSE;
}
m_pSubFunctions = FX_Alloc(CPDF_Function*, m_nSubs);
m_nOutputs = 0;
@@ -744,11 +744,11 @@ bool CPDF_StitchFunc::v_Init(CPDF_Object* pObj)
for (i = 0; i < m_nSubs; i ++) {
CPDF_Object* pSub = pArray->GetElementValue(i);
if (pSub == pObj) {
- return false;
+ return FALSE;
}
m_pSubFunctions[i] = CPDF_Function::Load(pSub);
if (m_pSubFunctions[i] == NULL) {
- return false;
+ return FALSE;
}
if (m_pSubFunctions[i]->CountOutputs() > m_nOutputs) {
m_nOutputs = m_pSubFunctions[i]->CountOutputs();
@@ -758,7 +758,7 @@ bool CPDF_StitchFunc::v_Init(CPDF_Object* pObj)
m_pBounds[0] = m_pDomains[0];
pArray = pDict->GetArray(FX_BSTRC("Bounds"));
if (pArray == NULL) {
- return false;
+ return FALSE;
}
for (i = 0; i < m_nSubs - 1; i ++) {
m_pBounds[i + 1] = pArray->GetFloat(i);
@@ -767,14 +767,14 @@ bool CPDF_StitchFunc::v_Init(CPDF_Object* pObj)
m_pEncode = FX_Alloc2D(FX_FLOAT, m_nSubs, 2);
pArray = pDict->GetArray(FX_BSTRC("Encode"));
if (pArray == NULL) {
- return false;
+ return FALSE;
}
for (i = 0; i < m_nSubs * 2; i ++) {
m_pEncode[i] = pArray->GetFloat(i);
}
- return true;
+ return TRUE;
}
-bool CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const
+FX_BOOL CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const
{
FX_FLOAT input = inputs[0];
int i;
@@ -783,12 +783,12 @@ bool CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const
break;
}
if (m_pSubFunctions[i] == NULL) {
- return false;
+ return FALSE;
}
input = PDF_Interpolate(input, m_pBounds[i], m_pBounds[i + 1], m_pEncode[i * 2], m_pEncode[i * 2 + 1]);
int nresults;
m_pSubFunctions[i]->Call(&input, m_nInputs, outputs, nresults);
- return true;
+ return TRUE;
}
CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj)
{
@@ -837,7 +837,7 @@ CPDF_Function::~CPDF_Function()
m_pRanges = NULL;
}
}
-bool CPDF_Function::Init(CPDF_Object* pObj)
+FX_BOOL CPDF_Function::Init(CPDF_Object* pObj)
{
CPDF_Dictionary* pDict;
if (pObj->GetType() == PDFOBJ_STREAM) {
@@ -847,11 +847,11 @@ bool CPDF_Function::Init(CPDF_Object* pObj)
}
CPDF_Array* pDomains = pDict->GetArray(FX_BSTRC("Domain"));
if (pDomains == NULL) {
- return false;
+ return FALSE;
}
m_nInputs = pDomains->GetCount() / 2;
if (m_nInputs == 0) {
- return false;
+ return FALSE;
}
m_pDomains = FX_Alloc2D(FX_FLOAT, m_nInputs, 2);
for (int i = 0; i < m_nInputs * 2; i ++) {
@@ -868,7 +868,7 @@ bool CPDF_Function::Init(CPDF_Object* pObj)
}
FX_DWORD old_outputs = m_nOutputs;
if (!v_Init(pObj)) {
- return false;
+ return FALSE;
}
if (m_pRanges && m_nOutputs > (int)old_outputs) {
m_pRanges = FX_Realloc(FX_FLOAT, m_pRanges, m_nOutputs * 2);
@@ -876,12 +876,12 @@ bool CPDF_Function::Init(CPDF_Object* pObj)
FXSYS_memset(m_pRanges + (old_outputs * 2), 0, sizeof(FX_FLOAT) * (m_nOutputs - old_outputs) * 2);
}
}
- return true;
+ return TRUE;
}
-bool CPDF_Function::Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int& nresults) const
+FX_BOOL CPDF_Function::Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int& nresults) const
{
if (m_nInputs != ninputs) {
- return false;
+ return FALSE;
}
nresults = m_nOutputs;
for (int i = 0; i < m_nInputs; i ++) {
@@ -901,5 +901,5 @@ bool CPDF_Function::Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int&
}
}
}
- return true;
+ return TRUE;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index 3264be42c6..b4d030e679 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -97,7 +97,7 @@ void CPDF_ClipPathData::SetCount(int path_count, int text_count)
CPDF_Rect CPDF_ClipPath::GetClipBox() const
{
CPDF_Rect rect;
- bool bStarted = false;
+ FX_BOOL bStarted = FALSE;
int count = GetPathCount();
if (count) {
rect = GetPath(0).GetBoundingBox();
@@ -105,26 +105,26 @@ CPDF_Rect CPDF_ClipPath::GetClipBox() const
CPDF_Rect path_rect = GetPath(i).GetBoundingBox();
rect.Intersect(path_rect);
}
- bStarted = true;
+ bStarted = TRUE;
}
count = GetTextCount();
if (count) {
CPDF_Rect layer_rect;
- bool bLayerStarted = false;
+ FX_BOOL bLayerStarted = FALSE;
for (int i = 0; i < count; i ++) {
CPDF_TextObject* pTextObj = GetText(i);
if (pTextObj == NULL) {
if (!bStarted) {
rect = layer_rect;
- bStarted = true;
+ bStarted = TRUE;
} else {
rect.Intersect(layer_rect);
}
- bLayerStarted = false;
+ bLayerStarted = FALSE;
} else {
if (!bLayerStarted) {
layer_rect = pTextObj->GetBBox(NULL);
- bLayerStarted = true;
+ bLayerStarted = TRUE;
} else {
layer_rect.Union(pTextObj->GetBBox(NULL));
}
@@ -133,7 +133,7 @@ CPDF_Rect CPDF_ClipPath::GetClipBox() const
}
return rect;
}
-void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, bool bAutoMerge)
+void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge)
{
CPDF_ClipPathData* pData = GetModify();
if (pData->m_PathCount && bAutoMerge) {
@@ -256,7 +256,7 @@ void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern, FX_FLOAT* pValue, i
CPDF_ColorStateData* pData = GetModify();
pData->m_FillColor.SetValue(pPattern, pValue, nValues);
int R, G, B;
- bool ret = pData->m_FillColor.GetRGB(R, G, B);
+ FX_BOOL ret = pData->m_FillColor.GetRGB(R, G, B);
if (pPattern->m_PatternType == 1 && ((CPDF_TilingPattern*)pPattern)->m_bColored && !ret) {
pData->m_FillRGB = 0x00BFBFBF;
return;
@@ -268,7 +268,7 @@ void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern, FX_FLOAT* pValue,
CPDF_ColorStateData* pData = GetModify();
pData->m_StrokeColor.SetValue(pPattern, pValue, nValues);
int R, G, B;
- bool ret = pData->m_StrokeColor.GetRGB(R, G, B);
+ FX_BOOL ret = pData->m_StrokeColor.GetRGB(R, G, B);
if (pPattern->m_PatternType == 1 && ((CPDF_TilingPattern*)pPattern)->m_bColored && !ret) {
pData->m_StrokeRGB = 0x00BFBFBF;
return;
@@ -295,7 +295,7 @@ CPDF_TextStateData::CPDF_TextStateData(const CPDF_TextStateData& src)
}
FXSYS_memcpy(this, &src, sizeof(CPDF_TextStateData));
if (m_pDocument && m_pFont) {
- m_pFont = m_pDocument->GetPageData()->GetFont(m_pFont->GetFontDict(), false);
+ m_pFont = m_pDocument->GetPageData()->GetFont(m_pFont->GetFontDict(), FALSE);
}
}
CPDF_TextStateData::~CPDF_TextStateData()
@@ -545,7 +545,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser
}
pGeneralState->SetBlendMode(mode);
if (pGeneralState->m_BlendType > FXDIB_BLEND_MULTIPLY) {
- pParser->GetObjectList()->m_bBackgroundAlphaNeeded = true;
+ pParser->GetObjectList()->m_bBackgroundAlphaNeeded = TRUE;
}
break;
}
@@ -631,12 +631,12 @@ CPDF_ContentMarkItem::~CPDF_ContentMarkItem()
((CPDF_Dictionary*)m_pParam)->Release();
}
}
-bool CPDF_ContentMarkItem::HasMCID() const
+FX_BOOL CPDF_ContentMarkItem::HasMCID() const
{
if (m_pParam && (m_ParamType == DirectDict || m_ParamType == PropertiesDict)) {
return ((CPDF_Dictionary *)m_pParam)->KeyExist(FX_BSTRC("MCID"));
}
- return false;
+ return FALSE;
}
CPDF_ContentMarkData::CPDF_ContentMarkData(const CPDF_ContentMarkData& src)
{
@@ -658,7 +658,7 @@ int CPDF_ContentMarkData::GetMCID() const
}
return -1;
}
-void CPDF_ContentMarkData::AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, bool bDirect)
+void CPDF_ContentMarkData::AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDirect)
{
CPDF_ContentMarkItem& item = m_Marks.Add();
item.SetName(name);
@@ -676,23 +676,23 @@ void CPDF_ContentMarkData::DeleteLastMark()
}
m_Marks.RemoveAt(size - 1);
}
-bool CPDF_ContentMark::HasMark(const CFX_ByteStringC& mark) const
+FX_BOOL CPDF_ContentMark::HasMark(const CFX_ByteStringC& mark) const
{
if (m_pObject == NULL) {
- return false;
+ return FALSE;
}
for (int i = 0; i < m_pObject->CountItems(); i ++) {
CPDF_ContentMarkItem& item = m_pObject->GetItem(i);
if (item.GetName() == mark) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_ContentMark::LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const
+FX_BOOL CPDF_ContentMark::LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const
{
if (m_pObject == NULL) {
- return false;
+ return FALSE;
}
for (int i = 0; i < m_pObject->CountItems(); i ++) {
CPDF_ContentMarkItem& item = m_pObject->GetItem(i);
@@ -702,8 +702,8 @@ bool CPDF_ContentMark::LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*&
item.GetParamType() == CPDF_ContentMarkItem::DirectDict) {
pDict = (CPDF_Dictionary*)item.GetParam();
}
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
index 739a0bdf04..aabfd141d6 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
@@ -57,7 +57,7 @@ CPDF_Image* CPDF_Image::Clone()
CPDF_Image* pImage = new CPDF_Image(m_pDocument);
pImage->LoadImageF((CPDF_Stream*)((CPDF_Object*)m_pStream)->Clone(), m_bInline);
if (m_bInline) {
- CPDF_Dictionary *pInlineDict = (CPDF_Dictionary*)m_pInlineDict->Clone(true);
+ CPDF_Dictionary *pInlineDict = (CPDF_Dictionary*)m_pInlineDict->Clone(TRUE);
pImage->SetInlineDict(pInlineDict);
}
return pImage;
@@ -67,7 +67,7 @@ CPDF_Image::CPDF_Image(CPDF_Document* pDoc)
m_pDocument = pDoc;
m_pStream = NULL;
m_pOC = NULL;
- m_bInline = false;
+ m_bInline = FALSE;
m_pInlineDict = NULL;
m_pDIBSource = NULL;
m_pMask = NULL;
@@ -84,7 +84,7 @@ CPDF_Image::~CPDF_Image()
}
}
}
-bool CPDF_Image::LoadImageF(CPDF_Stream* pStream, bool bInline)
+FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline)
{
m_pStream = pStream;
if (m_bInline && m_pInlineDict) {
@@ -101,5 +101,5 @@ bool CPDF_Image::LoadImageF(CPDF_Stream* pStream, bool bInline)
m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate"));
m_Height = pDict->GetInteger(FX_BSTRC("Height"));
m_Width = pDict->GetInteger(FX_BSTRC("Width"));
- return true;
+ return TRUE;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index b27f958d5e..892e2153b7 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -9,7 +9,7 @@
#include "../../../include/fpdfapi/fpdf_serial.h"
#include "pageint.h"
-#define REQUIRE_PARAMS(count) if (m_ParamCount != count) { m_bAbort = true; return; }
+#define REQUIRE_PARAMS(count) if (m_ParamCount != count) { m_bAbort = TRUE; return; }
CPDF_StreamContentParser::CPDF_StreamContentParser(
CPDF_Document* pDocument,
@@ -30,7 +30,7 @@ CPDF_StreamContentParser::CPDF_StreamContentParser(
m_Level(level),
m_ParamStartPos(0),
m_ParamCount(0),
- m_bAbort(false),
+ m_bAbort(FALSE),
m_pCurStates(new CPDF_AllStates),
m_pLastTextObject(nullptr),
m_DefFontSize(0),
@@ -43,9 +43,9 @@ CPDF_StreamContentParser::CPDF_StreamContentParser(
m_pLastImage(nullptr),
m_pLastImageDict(nullptr),
m_pLastCloneImageDict(nullptr),
- m_bReleaseLastDict(true),
- m_bColored(false),
- m_bResourceMissing(false)
+ m_bReleaseLastDict(TRUE),
+ m_bColored(FALSE),
+ m_bResourceMissing(FALSE)
{
if (pmtContentToUser) {
m_mtContentToUser = *pmtContentToUser;
@@ -183,7 +183,7 @@ CPDF_Object* CPDF_StreamContentParser::GetObject(FX_DWORD index)
if (param.m_Type == 0) {
return param.m_pObject;
}
- ASSERT(false);
+ ASSERT(FALSE);
return NULL;
}
CFX_ByteString CPDF_StreamContentParser::GetString(FX_DWORD index)
@@ -226,7 +226,7 @@ FX_FLOAT CPDF_StreamContentParser::GetNumber16(FX_DWORD index)
{
return GetNumber(index);
}
-void CPDF_StreamContentParser::SetGraphicStates(CPDF_PageObject* pObj, bool bColor, bool bText, bool bGraph)
+void CPDF_StreamContentParser::SetGraphicStates(CPDF_PageObject* pObj, FX_BOOL bColor, FX_BOOL bText, FX_BOOL bGraph)
{
pObj->m_GeneralState = m_pCurStates->m_GeneralState;
pObj->m_ClipPath = m_pCurStates->m_ClipPath;
@@ -318,7 +318,7 @@ const CPDF_StreamContentParser::OpCode CPDF_StreamContentParser::g_OpCodes[] =
{FXBSTR_ID('w', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineWidth},
{FXBSTR_ID('y', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_13},
};
-bool CPDF_StreamContentParser::OnOperator(const FX_CHAR* op)
+FX_BOOL CPDF_StreamContentParser::OnOperator(const FX_CHAR* op)
{
int i = 0;
FX_DWORD opid = 0;
@@ -336,7 +336,7 @@ bool CPDF_StreamContentParser::OnOperator(const FX_CHAR* op)
int compare = opid - g_OpCodes[middle].m_OpId;
if (compare == 0) {
(this->*g_OpCodes[middle].m_OpHandler)();
- return true;
+ return TRUE;
}
if (compare < 0) {
high = middle - 1;
@@ -352,14 +352,14 @@ void CPDF_StreamContentParser::Handle_CloseFillStrokePath()
return;
}
Handle_ClosePath();
- AddPathObject(FXFILL_WINDING, true);
+ AddPathObject(FXFILL_WINDING, TRUE);
}
void CPDF_StreamContentParser::Handle_FillStrokePath()
{
if (m_Options.m_bTextOnly) {
return;
}
- AddPathObject(FXFILL_WINDING, true);
+ AddPathObject(FXFILL_WINDING, TRUE);
}
void CPDF_StreamContentParser::Handle_CloseEOFillStrokePath()
{
@@ -367,14 +367,14 @@ void CPDF_StreamContentParser::Handle_CloseEOFillStrokePath()
return;
}
AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE);
- AddPathObject(FXFILL_ALTERNATE, true);
+ AddPathObject(FXFILL_ALTERNATE, TRUE);
}
void CPDF_StreamContentParser::Handle_EOFillStrokePath()
{
if (m_Options.m_bTextOnly) {
return;
}
- AddPathObject(FXFILL_ALTERNATE, true);
+ AddPathObject(FXFILL_ALTERNATE, TRUE);
}
void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary()
{
@@ -386,13 +386,13 @@ void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary()
if (pProperty == NULL) {
return;
}
- bool bDirect = true;
+ FX_BOOL bDirect = TRUE;
if (pProperty->GetType() == PDFOBJ_NAME) {
pProperty = FindResourceObj(FX_BSTRC("Properties"), pProperty->GetString());
if (pProperty == NULL) {
return;
}
- bDirect = false;
+ bDirect = FALSE;
}
if (pProperty->GetType() != PDFOBJ_DICTIONARY) {
return;
@@ -405,7 +405,7 @@ void CPDF_StreamContentParser::Handle_BeginMarkedContent()
return;
}
CFX_ByteString tag = GetString(0);
- m_CurContentMark.GetModify()->AddMark(tag, NULL, false);
+ m_CurContentMark.GetModify()->AddMark(tag, NULL, FALSE);
}
struct _FX_BSTR {
const FX_CHAR* m_Ptr;
@@ -622,20 +622,20 @@ void CPDF_StreamContentParser::Handle_SetCharWidth()
{
m_Type3Data[0] = GetNumber(1);
m_Type3Data[1] = GetNumber(0);
- m_bColored = true;
+ m_bColored = TRUE;
}
void CPDF_StreamContentParser::Handle_SetCachedDevice()
{
for (int i = 0; i < 6; i ++) {
m_Type3Data[i] = GetNumber(5 - i);
}
- m_bColored = false;
+ m_bColored = FALSE;
}
void CPDF_StreamContentParser::Handle_ExecuteXObject()
{
CFX_ByteString name = GetString(0);
if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() && m_pLastImage->GetStream()->GetObjNum()) {
- AddImage(NULL, m_pLastImage, false);
+ AddImage(NULL, m_pLastImage, FALSE);
return;
}
if (m_Options.m_bTextOnly) {
@@ -673,14 +673,14 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject()
}
}
}
- bool bForm;
+ FX_BOOL bForm;
if (m_pDocument->IsFormStream(((CPDF_Reference*)pRes)->GetRefObjNum(), bForm) && !bForm) {
return;
}
}
CPDF_Stream* pXObject = (CPDF_Stream*)FindResourceObj(FX_BSTRC("XObject"), name);
if (pXObject == NULL || pXObject->GetType() != PDFOBJ_STREAM) {
- m_bResourceMissing = true;
+ m_bResourceMissing = TRUE;
return;
}
CFX_ByteStringC type = pXObject->GetDict() ? pXObject->GetDict()->GetConstString(FX_BSTRC("Subtype")) : CFX_ByteStringC();
@@ -688,7 +688,7 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject()
if (m_Options.m_bTextOnly) {
return;
}
- CPDF_ImageObject* pObj = AddImage(pXObject, NULL, false);
+ CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE);
m_LastImageName = name;
m_pLastImage = pObj->m_pImage;
} else if (type == FX_BSTRC("Form")) {
@@ -719,10 +719,10 @@ void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream)
m_pCurStates.get(), m_Level + 1);
parser.m_pCurStates->m_CTM = form_matrix;
if (ClipPath.NotNull()) {
- parser.m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, true);
+ parser.m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
}
CPDF_StreamAcc stream;
- stream.LoadAllData(pStream, false);
+ stream.LoadAllData(pStream, FALSE);
if (stream.GetSize() == 0) {
return;
}
@@ -740,13 +740,13 @@ void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream)
status.m_TextState = m_pCurStates->m_TextState;
pFormObj->m_pForm->ParseContent(&status, NULL, NULL, &m_Options, m_Level + 1);
if (!m_pObjectList->m_bBackgroundAlphaNeeded && pFormObj->m_pForm->m_bBackgroundAlphaNeeded) {
- m_pObjectList->m_bBackgroundAlphaNeeded = true;
+ m_pObjectList->m_bBackgroundAlphaNeeded = TRUE;
}
pFormObj->CalcBoundingBox();
- SetGraphicStates(pFormObj, true, true, true);
+ SetGraphicStates(pFormObj, TRUE, TRUE, TRUE);
m_pObjectList->m_ObjectList.AddTail(pFormObj);
}
-CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, CPDF_Image* pImage, bool bInline)
+CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, CPDF_Image* pImage, FX_BOOL bInline)
{
if (pStream == NULL && pImage == NULL) {
return NULL;
@@ -763,7 +763,7 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, CPDF_
pImageObj->m_pImage = new CPDF_Image(m_pDocument);
pImageObj->m_pImage->LoadImageF(pStream, bInline);
}
- SetGraphicStates(pImageObj, pImageObj->m_pImage->IsMask(), false, false);
+ SetGraphicStates(pImageObj, pImageObj->m_pImage->IsMask(), FALSE, FALSE);
pImageObj->m_Matrix = ImageMatrix;
pImageObj->CalcBoundingBox();
m_pObjectList->m_ObjectList.AddTail(pImageObj);
@@ -817,21 +817,21 @@ void CPDF_StreamContentParser::Handle_FillPath()
if (m_Options.m_bTextOnly) {
return;
}
- AddPathObject(FXFILL_WINDING, false);
+ AddPathObject(FXFILL_WINDING, FALSE);
}
void CPDF_StreamContentParser::Handle_FillPathOld()
{
if (m_Options.m_bTextOnly) {
return;
}
- AddPathObject(FXFILL_WINDING, false);
+ AddPathObject(FXFILL_WINDING, FALSE);
}
void CPDF_StreamContentParser::Handle_EOFillPath()
{
if (m_Options.m_bTextOnly) {
return;
}
- AddPathObject(FXFILL_ALTERNATE, false);
+ AddPathObject(FXFILL_ALTERNATE, FALSE);
}
void CPDF_StreamContentParser::Handle_SetGray_Fill()
{
@@ -850,7 +850,7 @@ void CPDF_StreamContentParser::Handle_SetExtendGraphState()
CFX_ByteString name = GetString(0);
CPDF_Dictionary* pGS = (CPDF_Dictionary*)FindResourceObj(FX_BSTRC("ExtGState"), name);
if (pGS == NULL || pGS->GetType() != PDFOBJ_DICTIONARY) {
- m_bResourceMissing = true;
+ m_bResourceMissing = TRUE;
return;
}
m_pCurStates->ProcessExtGS(pGS, this);
@@ -934,7 +934,7 @@ void CPDF_StreamContentParser::Handle_EndPath()
if (m_Options.m_bTextOnly) {
return;
}
- AddPathObject(0, false);
+ AddPathObject(0, FALSE);
}
void CPDF_StreamContentParser::Handle_SaveGraphState()
{
@@ -999,14 +999,14 @@ void CPDF_StreamContentParser::Handle_CloseStrokePath()
return;
}
Handle_ClosePath();
- AddPathObject(0, true);
+ AddPathObject(0, TRUE);
}
void CPDF_StreamContentParser::Handle_StrokePath()
{
if (m_Options.m_bTextOnly) {
return;
}
- AddPathObject(0, true);
+ AddPathObject(0, TRUE);
}
void CPDF_StreamContentParser::Handle_SetColor_Fill()
{
@@ -1060,7 +1060,7 @@ void CPDF_StreamContentParser::Handle_SetColorPS_Fill()
}
}
if (nvalues != nargs) {
- CPDF_Pattern* pPattern = FindPattern(GetString(0), false);
+ CPDF_Pattern* pPattern = FindPattern(GetString(0), FALSE);
if (pPattern) {
m_pCurStates->m_ColorState.SetFillPattern(pPattern, values, nvalues);
}
@@ -1093,7 +1093,7 @@ void CPDF_StreamContentParser::Handle_SetColorPS_Stroke()
}
}
if (nvalues != nargs) {
- CPDF_Pattern* pPattern = FindPattern(GetString(0), false);
+ CPDF_Pattern* pPattern = FindPattern(GetString(0), FALSE);
if (pPattern) {
m_pCurStates->m_ColorState.SetStrokePattern(pPattern, values, nvalues);
}
@@ -1111,7 +1111,7 @@ void CPDF_StreamContentParser::Handle_ShadeFill()
if (m_Options.m_bTextOnly) {
return;
}
- CPDF_Pattern* pPattern = FindPattern(GetString(0), true);
+ CPDF_Pattern* pPattern = FindPattern(GetString(0), TRUE);
if (pPattern == NULL) {
return;
}
@@ -1127,7 +1127,7 @@ void CPDF_StreamContentParser::Handle_ShadeFill()
}
CPDF_ShadingObject* pObj = new CPDF_ShadingObject;
pObj->m_pShading = pShading;
- SetGraphicStates(pObj, false, false, false);
+ SetGraphicStates(pObj, FALSE, FALSE, FALSE);
pObj->m_Matrix = m_pCurStates->m_CTM;
pObj->m_Matrix.Concat(m_mtContentToUser);
CFX_FloatRect bbox;
@@ -1206,7 +1206,7 @@ CPDF_Font* CPDF_StreamContentParser::FindFont(const CFX_ByteString& name)
{
CPDF_Dictionary* pFontDict = (CPDF_Dictionary*)FindResourceObj(FX_BSTRC("Font"), name);
if (pFontDict == NULL || pFontDict->GetType() != PDFOBJ_DICTIONARY) {
- m_bResourceMissing = true;
+ m_bResourceMissing = TRUE;
return CPDF_Font::GetStockFont(m_pDocument, FX_BSTRC("Helvetica"));
}
CPDF_Font* pFont = m_pDocument->LoadFont(pFontDict);
@@ -1238,17 +1238,17 @@ CPDF_ColorSpace* CPDF_StreamContentParser::FindColorSpace(const CFX_ByteString&
}
CPDF_Object* pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
if (pCSObj == NULL) {
- m_bResourceMissing = true;
+ m_bResourceMissing = TRUE;
return NULL;
}
return m_pDocument->LoadColorSpace(pCSObj);
}
-CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name, bool bShading)
+CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name, FX_BOOL bShading)
{
CPDF_Object* pPattern = FindResourceObj(bShading ? FX_BSTRC("Shading") : FX_BSTRC("Pattern"), name);
if (pPattern == NULL || (pPattern->GetType() != PDFOBJ_DICTIONARY &&
pPattern->GetType() != PDFOBJ_STREAM)) {
- m_bResourceMissing = true;
+ m_bResourceMissing = TRUE;
return NULL;
}
return m_pDocument->LoadPattern(pPattern, bShading, &m_pCurStates->m_ParentMatrix);
@@ -1287,7 +1287,7 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs, FX_FLOAT fIn
}
CPDF_TextObject* pText = new CPDF_TextObject;
m_pLastTextObject = pText;
- SetGraphicStates(pText, true, true, true);
+ SetGraphicStates(pText, TRUE, TRUE, TRUE);
if (textmode && textmode != 3 && textmode != 4 && textmode != 7) {
FX_FLOAT* pCTM = pText->m_TextState.GetModify()->m_CTM;
pCTM[0] = m_pCurStates->m_CTM.a;
@@ -1501,7 +1501,7 @@ void CPDF_StreamContentParser::AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag)
m_pPathPoints[m_PathPointCount - 1].m_PointX = x;
m_pPathPoints[m_PathPointCount - 1].m_PointY = y;
}
-void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke)
+void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke)
{
int PathPointCount = m_PathPointCount, PathClipType = m_PathClipType;
m_PathPointCount = 0;
@@ -1510,7 +1510,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke)
if (PathPointCount && PathClipType) {
CPDF_Path path;
path.New()->AppendRect(0, 0, 0, 0);
- m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, true);
+ m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, TRUE);
}
return;
}
@@ -1529,7 +1529,7 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke)
pPathObj->m_FillType = FillType;
pPathObj->m_Path = Path;
pPathObj->m_Matrix = matrix;
- SetGraphicStates(pPathObj, true, false, true);
+ SetGraphicStates(pPathObj, TRUE, FALSE, TRUE);
pPathObj->CalcBoundingBox();
m_pObjectList->m_ObjectList.AddTail(pPathObj);
}
@@ -1538,13 +1538,13 @@ void CPDF_StreamContentParser::AddPathObject(int FillType, bool bStroke)
Path.Transform(&matrix);
matrix.SetIdentity();
}
- m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, true);
+ m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE);
}
}
CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf)
{
CFX_ByteTextBuf buf;
- bool bFirst = true;
+ FX_BOOL bFirst = TRUE;
int code = 0;
const uint8_t* str = src_buf.GetBuffer();
FX_DWORD size = src_buf.GetSize();
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index ca5e9fe529..b2cfce73d9 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -18,18 +18,18 @@ const FX_CHAR* const _PDF_OpCharType =
"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
"IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII";
-bool _PDF_HasInvalidOpChar(const FX_CHAR* op)
+FX_BOOL _PDF_HasInvalidOpChar(const FX_CHAR* op)
{
if(!op) {
- return false;
+ return FALSE;
}
uint8_t ch;
while((ch = *op++)) {
if(_PDF_OpCharType[ch] == 'I') {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
class CPDF_StreamParserAutoClearer {
public:
@@ -60,7 +60,7 @@ FX_DWORD CPDF_StreamContentParser::Parse(const uint8_t* pData, FX_DWORD dwSize,
return m_pSyntax->GetPos();
case CPDF_StreamParser::Keyword:
if(!OnOperator((char*)syntax.GetWordBuf()) && _PDF_HasInvalidOpChar((char*)syntax.GetWordBuf())) {
- m_bAbort = true;
+ m_bAbort = TRUE;
}
if (m_bAbort) {
return m_pSyntax->GetPos();
@@ -143,7 +143,7 @@ void CPDF_StreamContentParser::Handle_BeginImage()
return;
}
pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
- CPDF_ImageObject *pImgObj = AddImage(pStream, NULL, true);
+ CPDF_ImageObject *pImgObj = AddImage(pStream, NULL, TRUE);
if (!pImgObj) {
if (pStream) {
pStream->Release();
@@ -159,7 +159,7 @@ void CPDF_StreamContentParser::ParsePathObject()
int last_pos = m_pSyntax->GetPos();
while (1) {
CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
- bool bProcessed = true;
+ FX_BOOL bProcessed = TRUE;
switch (type) {
case CPDF_StreamParser::EndOfData:
return;
@@ -198,7 +198,7 @@ void CPDF_StreamContentParser::ParsePathObject()
nParams = 0;
break;
default:
- bProcessed = false;
+ bProcessed = FALSE;
break;
}
} else if (len == 2) {
@@ -206,10 +206,10 @@ void CPDF_StreamContentParser::ParsePathObject()
AddPathRect(params[0], params[1], params[2], params[3]);
nParams = 0;
} else {
- bProcessed = false;
+ bProcessed = FALSE;
}
} else {
- bProcessed = false;
+ bProcessed = FALSE;
}
if (bProcessed) {
last_pos = m_pSyntax->GetPos();
@@ -220,14 +220,14 @@ void CPDF_StreamContentParser::ParsePathObject()
if (nParams == 6) {
break;
}
- bool bInteger;
+ FX_BOOL bInteger;
int value;
FX_atonum(CFX_ByteStringC(m_pSyntax->GetWordBuf(), m_pSyntax->GetWordSize()), bInteger, &value);
params[nParams++] = bInteger ? (FX_FLOAT)value : *(FX_FLOAT*)&value;
break;
}
default:
- bProcessed = false;
+ bProcessed = FALSE;
}
if (!bProcessed) {
m_pSyntax->SetPos(last_pos);
@@ -279,7 +279,7 @@ ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(const uint8_t* src_buf, FX_DWOR
const CPDF_Dictionary* pParams);
FX_DWORD _A85Decode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
FX_DWORD _HexDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
-FX_DWORD FPDFAPI_FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
+FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, FX_DWORD limit,
int width, int height, CFX_ByteString& decoder,
@@ -296,10 +296,10 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, FX_DWORD limit,
return _HexDecode(src_buf, limit, dest_buf, dest_size);
}
if (decoder == FX_BSTRC("FlateDecode") || decoder == FX_BSTRC("Fl")) {
- return FPDFAPI_FlateOrLZWDecode(false, src_buf, limit, pParam, dest_size, dest_buf, dest_size);
+ return FPDFAPI_FlateOrLZWDecode(FALSE, src_buf, limit, pParam, dest_size, dest_buf, dest_size);
}
if (decoder == FX_BSTRC("LZWDecode") || decoder == FX_BSTRC("LZW")) {
- return FPDFAPI_FlateOrLZWDecode(true, src_buf, limit, pParam, 0, dest_buf, dest_size);
+ return FPDFAPI_FlateOrLZWDecode(TRUE, src_buf, limit, pParam, 0, dest_buf, dest_size);
}
if (decoder == FX_BSTRC("DCTDecode") || decoder == FX_BSTRC("DCT")) {
ICodec_ScanlineDecoder* pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
@@ -313,7 +313,7 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, FX_DWORD limit,
dest_buf = 0;
return (FX_DWORD) - 1;
}
-CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, bool bDecode)
+CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode)
{
if (m_Pos == m_Size) {
return NULL;
@@ -447,7 +447,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
m_pLastObj = NULL;
}
m_WordSize = 0;
- bool bIsNumber = true;
+ FX_BOOL bIsNumber = TRUE;
if (m_Pos >= m_Size) {
return EndOfData;
}
@@ -485,7 +485,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
m_WordBuffer[m_WordSize++] = ch;
}
if (type != 'N') {
- bIsNumber = false;
+ bIsNumber = FALSE;
}
if (m_Size <= m_Pos) {
break;
@@ -506,7 +506,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
}
if (m_WordSize == 4) {
if (*(FX_DWORD*)m_WordBuffer == FXDWORD_TRUE) {
- m_pLastObj = CPDF_Boolean::Create(true);
+ m_pLastObj = CPDF_Boolean::Create(TRUE);
return Others;
}
if (*(FX_DWORD*)m_WordBuffer == FXDWORD_NULL) {
@@ -515,7 +515,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
}
} else if (m_WordSize == 5) {
if (*(FX_DWORD*)m_WordBuffer == FXDWORD_FALS && m_WordBuffer[4] == 'e') {
- m_pLastObj = CPDF_Boolean::Create(false);
+ m_pLastObj = CPDF_Boolean::Create(FALSE);
return Others;
}
}
@@ -584,9 +584,9 @@ void CPDF_StreamParser::SkipPathObject()
}
}
}
-CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray, bool bInArray)
+CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray, FX_BOOL bInArray)
{
- bool bIsNumber;
+ FX_BOOL bIsNumber;
GetNextWord(bIsNumber);
if (m_WordSize == 0) {
return NULL;
@@ -604,7 +604,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray, bool bInA
}
if (first_char == '<') {
if (m_WordSize == 1) {
- return CPDF_String::Create(ReadHexString(), true);
+ return CPDF_String::Create(ReadHexString(), TRUE);
}
CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
while (1) {
@@ -621,7 +621,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray, bool bInA
return NULL;
}
CFX_ByteString key = PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1));
- CPDF_Object* pObj = ReadNextObject(true);
+ CPDF_Object* pObj = ReadNextObject(TRUE);
if (pObj == NULL) {
if (pDict) {
pDict->Release();
@@ -642,7 +642,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray, bool bInA
}
CPDF_Array* pArray = CPDF_Array::Create();
while (1) {
- CPDF_Object* pObj = ReadNextObject(bAllowNestedArray, true);
+ CPDF_Object* pObj = ReadNextObject(bAllowNestedArray, TRUE);
if (pObj == NULL) {
if (m_WordSize == 0 || m_WordBuffer[0] == ']') {
return pArray;
@@ -657,22 +657,22 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray, bool bInA
}
if (m_WordSize == 4) {
if (*(FX_DWORD*)m_WordBuffer == FXDWORD_TRUE) {
- return CPDF_Boolean::Create(true);
+ return CPDF_Boolean::Create(TRUE);
}
if (*(FX_DWORD*)m_WordBuffer == FXDWORD_NULL) {
return CPDF_Null::Create();
}
} else if (m_WordSize == 5) {
if (*(FX_DWORD*)m_WordBuffer == FXDWORD_FALS && m_WordBuffer[4] == 'e') {
- return CPDF_Boolean::Create(false);
+ return CPDF_Boolean::Create(FALSE);
}
}
return NULL;
}
-void CPDF_StreamParser::GetNextWord(bool& bIsNumber)
+void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
{
m_WordSize = 0;
- bIsNumber = true;
+ bIsNumber = TRUE;
if (m_Size <= m_Pos) {
return;
}
@@ -701,7 +701,7 @@ void CPDF_StreamParser::GetNextWord(bool& bIsNumber)
type = PDF_CharType[ch];
}
if (type == 'D') {
- bIsNumber = false;
+ bIsNumber = FALSE;
m_WordBuffer[m_WordSize++] = ch;
if (ch == '/') {
while (1) {
@@ -746,7 +746,7 @@ void CPDF_StreamParser::GetNextWord(bool& bIsNumber)
m_WordBuffer[m_WordSize++] = ch;
}
if (type != 'N') {
- bIsNumber = false;
+ bIsNumber = FALSE;
}
if (m_Size <= m_Pos) {
return;
@@ -862,7 +862,7 @@ CFX_ByteString CPDF_StreamParser::ReadHexString()
}
int ch = m_pBuf[m_Pos++];
CFX_ByteTextBuf buf;
- bool bFirst = true;
+ FX_BOOL bFirst = TRUE;
int code = 0;
while (1) {
if (ch == '>') {
@@ -947,7 +947,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
return;
}
m_pObjects = pPage;
- m_bForm = false;
+ m_bForm = FALSE;
if (pOptions) {
m_Options = *pOptions;
}
@@ -962,7 +962,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
if (pContent->GetType() == PDFOBJ_STREAM) {
m_nStreams = 0;
m_pSingleStream = new CPDF_StreamAcc;
- m_pSingleStream->LoadAllData((CPDF_Stream*)pContent, false);
+ m_pSingleStream->LoadAllData((CPDF_Stream*)pContent, FALSE);
} else if (pContent->GetType() == PDFOBJ_ARRAY) {
CPDF_Array* pArray = (CPDF_Array*)pContent;
m_nStreams = pArray->GetCount();
@@ -981,7 +981,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
{
m_pType3Char = pType3Char;
m_pObjects = pForm;
- m_bForm = true;
+ m_bForm = TRUE;
CFX_AffineMatrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
if (pGraphicStates) {
form_matrix.Concat(pGraphicStates->m_CTM);
@@ -1011,7 +1011,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
m_pParser->GetCurStates()->m_CTM = form_matrix;
m_pParser->GetCurStates()->m_ParentMatrix = form_matrix;
if (ClipPath.NotNull()) {
- m_pParser->GetCurStates()->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, true);
+ m_pParser->GetCurStates()->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
}
if (pForm->m_Transparency & PDFTRANS_GROUP) {
CPDF_GeneralStateData* pData = m_pParser->GetCurStates()->m_GeneralState.GetModify();
@@ -1023,9 +1023,9 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
m_nStreams = 0;
m_pSingleStream = new CPDF_StreamAcc;
if (pForm->m_pDocument) {
- m_pSingleStream->LoadAllData(pForm->m_pFormStream, false);
+ m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
} else {
- m_pSingleStream->LoadAllData(pForm->m_pFormStream, false);
+ m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
}
m_pData = (uint8_t*)m_pSingleStream->GetData();
m_Size = m_pSingleStream->GetSize();
@@ -1070,7 +1070,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause)
CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArray(FX_BSTRC("Contents"));
m_pStreamArray[m_CurrentOffset] = new CPDF_StreamAcc;
CPDF_Stream* pStreamObj = (CPDF_Stream*)(pContent ? pContent->GetElementValue(m_CurrentOffset) : NULL);
- m_pStreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, false);
+ m_pStreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, FALSE);
m_CurrentOffset ++;
}
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index 8292d2d90e..48b3a40495 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -8,7 +8,7 @@
#include "pageint.h"
CPDF_Pattern::CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix) :
- m_pPatternObj(NULL), m_PatternType(PATTERN_TILING), m_pDocument(NULL), m_bForceClear(false)
+ m_pPatternObj(NULL), m_PatternType(PATTERN_TILING), m_pDocument(NULL), m_bForceClear(FALSE)
{
if (pParentMatrix) {
m_ParentMatrix = *pParentMatrix;
@@ -37,28 +37,28 @@ CPDF_TilingPattern::~CPDF_TilingPattern()
delete m_pForm;
m_pForm = NULL;
}
-bool CPDF_TilingPattern::Load()
+FX_BOOL CPDF_TilingPattern::Load()
{
if (m_pForm != NULL) {
- return true;
+ return TRUE;
}
CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
if (pDict == NULL) {
- return false;
+ return FALSE;
}
m_bColored = pDict->GetInteger(FX_BSTRC("PaintType")) == 1;
m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber(FX_BSTRC("XStep")));
m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber(FX_BSTRC("YStep")));
if (m_pPatternObj->GetType() != PDFOBJ_STREAM) {
- return false;
+ return FALSE;
}
CPDF_Stream* pStream = (CPDF_Stream*)m_pPatternObj;
m_pForm = new CPDF_Form(m_pDocument, NULL, pStream);
m_pForm->ParseContent(NULL, &m_ParentMatrix, NULL, NULL);
m_BBox = pDict->GetRect(FX_BSTRC("BBox"));
- return true;
+ return TRUE;
}
-CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, bool bShading, const CFX_AffineMatrix* parentMatrix) : CPDF_Pattern(parentMatrix)
+CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix) : CPDF_Pattern(parentMatrix)
{
m_PatternType = PATTERN_SHADING;
m_pPatternObj = bShading ? NULL : pPatternObj;
@@ -102,14 +102,14 @@ void CPDF_ShadingPattern::Clear()
m_pCountedCS = NULL;
m_nFuncs = 0;
}
-bool CPDF_ShadingPattern::Load()
+FX_BOOL CPDF_ShadingPattern::Load()
{
if (m_ShadingType != 0) {
- return true;
+ return TRUE;
}
CPDF_Dictionary* pShadingDict = m_pShadingObj ? m_pShadingObj->GetDict() : NULL;
if (pShadingDict == NULL) {
- return false;
+ return FALSE;
}
if (m_nFuncs) {
for (int i = 0; i < m_nFuncs; i ++)
@@ -133,7 +133,7 @@ bool CPDF_ShadingPattern::Load()
}
CPDF_Object* pCSObj = pShadingDict->GetElementValue(FX_BSTRC("ColorSpace"));
if (pCSObj == NULL) {
- return false;
+ return FALSE;
}
CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData();
m_pCS = pDocPageData->GetColorSpace(pCSObj, NULL);
@@ -141,14 +141,14 @@ bool CPDF_ShadingPattern::Load()
m_pCountedCS = pDocPageData->FindColorSpacePtr(m_pCS->GetArray());
}
m_ShadingType = pShadingDict->GetInteger(FX_BSTRC("ShadingType"));
- return true;
+ return TRUE;
}
-bool CPDF_ShadingPattern::Reload()
+FX_BOOL CPDF_ShadingPattern::Reload()
{
Clear();
return Load();
}
-bool CPDF_MeshStream::Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS)
+FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS)
{
m_Stream.LoadAllData(pShadingStream);
m_BitStream.Init(m_Stream.GetData(), m_Stream.GetSize());
@@ -160,21 +160,21 @@ bool CPDF_MeshStream::Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs,
m_nCompBits = pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
m_nFlagBits = pDict->GetInteger(FX_BSTRC("BitsPerFlag"));
if (!m_nCoordBits || !m_nCompBits) {
- return false;
+ return FALSE;
}
int nComps = pCS->CountComponents();
if (nComps > 8) {
- return false;
+ return FALSE;
}
m_nComps = nFuncs ? 1 : nComps;
if (((int)m_nComps < 0) || m_nComps > 8) {
- return false;
+ return FALSE;
}
m_CoordMax = m_nCoordBits == 32 ? -1 : (1 << m_nCoordBits) - 1;
m_CompMax = (1 << m_nCompBits) - 1;
CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
if (pDecode == NULL || pDecode->GetCount() != 4 + m_nComps * 2) {
- return false;
+ return FALSE;
}
m_xmin = pDecode->GetNumber(0);
m_xmax = pDecode->GetNumber(1);
@@ -184,7 +184,7 @@ bool CPDF_MeshStream::Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs,
m_ColorMin[i] = pDecode->GetNumber(i * 2 + 4);
m_ColorMax[i] = pDecode->GetNumber(i * 2 + 5);
}
- return true;
+ return TRUE;
}
FX_DWORD CPDF_MeshStream::GetFlag()
{
@@ -231,18 +231,18 @@ FX_DWORD CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex, CFX_AffineMatrix* p
m_BitStream.ByteAlign();
return flag;
}
-bool CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap)
+FX_BOOL CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap)
{
for (int i = 0; i < count; i ++) {
if (m_BitStream.IsEOF()) {
- return false;
+ return FALSE;
}
GetCoords(vertex[i].x, vertex[i].y);
pObject2Bitmap->Transform(vertex[i].x, vertex[i].y);
GetColor(vertex[i].r, vertex[i].g, vertex[i].b);
m_BitStream.ByteAlign();
}
- return true;
+ return TRUE;
}
CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream, int type, const CFX_AffineMatrix* pMatrix,
CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS)
@@ -255,8 +255,8 @@ CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream, int type, const CFX_AffineMa
return CFX_FloatRect(0, 0, 0, 0);
}
CFX_FloatRect rect;
- bool bStarted = false;
- bool bGouraud = type == 4 || type == 5;
+ FX_BOOL bStarted = FALSE;
+ FX_BOOL bGouraud = type == 4 || type == 5;
int full_point_count = type == 7 ? 16 : (type == 6 ? 12 : 1);
int full_color_count = (type == 6 || type == 7) ? 4 : 1;
while (!stream.m_BitStream.IsEOF()) {
@@ -276,7 +276,7 @@ CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream, int type, const CFX_AffineMa
rect.UpdateRect(x, y);
} else {
rect.InitRect(x, y);
- bStarted = true;
+ bStarted = TRUE;
}
}
stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * color_count);
diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h
index 021b33a421..8cd393cf32 100644
--- a/core/src/fpdfapi/fpdf_page/pageint.h
+++ b/core/src/fpdfapi/fpdf_page/pageint.h
@@ -21,7 +21,7 @@ public:
CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize);
~CPDF_StreamParser();
- CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, bool bDecode);
+ CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode);
typedef enum { EndOfData, Number, Keyword, Name, Others } SyntaxType;
SyntaxType ParseNextElement();
@@ -48,10 +48,10 @@ public:
m_Pos = pos;
}
- CPDF_Object* ReadNextObject(bool bAllowNestedArray = false, bool bInArray = false);
+ CPDF_Object* ReadNextObject(FX_BOOL bAllowNestedArray = FALSE, FX_BOOL bInArray = FALSE);
void SkipPathObject();
protected:
- void GetNextWord(bool& bIsNumber);
+ void GetNextWord(FX_BOOL& bIsNumber);
CFX_ByteString ReadString();
CFX_ByteString ReadHexString();
const uint8_t* m_pBuf;
@@ -105,7 +105,7 @@ typedef struct {
int m_Type;
union {
struct {
- bool m_bInteger;
+ FX_BOOL m_bInteger;
union {
int m_Integer;
FX_FLOAT m_Float;
@@ -137,10 +137,10 @@ public:
int level);
~CPDF_StreamContentParser();
- bool ShouldAbort() const { return m_bAbort; }
+ FX_BOOL ShouldAbort() const { return m_bAbort; }
CPDF_PageObjects* GetObjectList() const { return m_pObjectList; }
CPDF_AllStates* GetCurStates() const { return m_pCurStates.get(); }
- bool IsColored() const { return m_bColored; }
+ FX_BOOL IsColored() const { return m_bColored; }
const FX_FLOAT* GetType3Data() const { return m_Type3Data; }
void AddNumberParam(const FX_CHAR* str, int len);
@@ -156,7 +156,7 @@ public:
{
return (int32_t)(GetNumber(index));
}
- bool OnOperator(const FX_CHAR* op);
+ FX_BOOL OnOperator(const FX_CHAR* op);
void BigCaseCaller(int index);
FX_DWORD GetParsePos()
{
@@ -171,16 +171,16 @@ public:
void ParsePathObject();
void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag);
void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h);
- void AddPathObject(int FillType, bool bStroke);
- CPDF_ImageObject* AddImage(CPDF_Stream* pStream, CPDF_Image* pImage, bool bInline);
+ void AddPathObject(int FillType, FX_BOOL bStroke);
+ CPDF_ImageObject* AddImage(CPDF_Stream* pStream, CPDF_Image* pImage, FX_BOOL bInline);
void AddDuplicateImage();
void AddForm(CPDF_Stream*);
- void SetGraphicStates(CPDF_PageObject* pObj, bool bColor, bool bText, bool bGraph);
+ void SetGraphicStates(CPDF_PageObject* pObj, FX_BOOL bColor, FX_BOOL bText, FX_BOOL bGraph);
void SaveStates(CPDF_AllStates*);
void RestoreStates(CPDF_AllStates*);
CPDF_Font* FindFont(const CFX_ByteString& name);
CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name);
- CPDF_Pattern* FindPattern(const CFX_ByteString& name, bool bShading);
+ CPDF_Pattern* FindPattern(const CFX_ByteString& name, FX_BOOL bShading);
CPDF_Object* FindResourceObj(const CFX_ByteStringC& type, const CFX_ByteString& name);
protected:
@@ -277,7 +277,7 @@ protected:
_ContentParam m_ParamBuf1[PARAM_BUF_SIZE];
FX_DWORD m_ParamStartPos;
FX_DWORD m_ParamCount;
- bool m_bAbort;
+ FX_BOOL m_bAbort;
CPDF_StreamParser* m_pSyntax;
nonstd::unique_ptr<CPDF_AllStates> m_pCurStates;
CPDF_ContentMark m_CurContentMark;
@@ -299,11 +299,11 @@ protected:
CFX_BinaryBuf m_LastImageData;
CPDF_Dictionary* m_pLastImageDict;
CPDF_Dictionary* m_pLastCloneImageDict;
- bool m_bReleaseLastDict;
- bool m_bSameLastDict;
- bool m_bColored;
+ FX_BOOL m_bReleaseLastDict;
+ FX_BOOL m_bSameLastDict;
+ FX_BOOL m_bColored;
FX_FLOAT m_Type3Data[6];
- bool m_bResourceMissing;
+ FX_BOOL m_bResourceMissing;
CFX_PtrArray m_StateStack;
};
class CPDF_ContentParser
@@ -331,7 +331,7 @@ protected:
void Clear();
ParseStatus m_Status;
CPDF_PageObjects* m_pObjects;
- bool m_bForm;
+ FX_BOOL m_bForm;
CPDF_ParseOptions m_Options;
CPDF_Type3Char* m_pType3Char;
int m_InternalStage;
@@ -363,22 +363,22 @@ class CPDF_DocPageData
explicit CPDF_DocPageData(CPDF_Document *pPDFDoc);
~CPDF_DocPageData();
- void Clear(bool bRelease = false);
- CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, bool findOnly);
+ void Clear(FX_BOOL bRelease = FALSE);
+ CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly);
CPDF_Font* GetStandardFont(const CFX_ByteStringC& fontName, CPDF_FontEncoding* pEncoding);
void ReleaseFont(CPDF_Dictionary* pFontDict);
CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources);
CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj);
void ReleaseColorSpace(CPDF_Object* pColorSpace);
- CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, bool bShading, const CFX_AffineMatrix* matrix);
+ CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix);
void ReleasePattern(CPDF_Object* pPatternObj);
CPDF_Image* GetImage(CPDF_Object* pImageStream);
void ReleaseImage(CPDF_Object* pImageStream);
CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream);
void ReleaseIccProfile(CPDF_IccProfile* pIccProfile);
CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream);
- void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, bool bForce = false);
- bool IsForceClear() const {return m_bForceClear;}
+ void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOOL bForce = FALSE);
+ FX_BOOL IsForceClear() const {return m_bForceClear;}
CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const;
CPDF_CountedPattern* FindPatternPtr(CPDF_Object* pPatternObj) const;
@@ -397,7 +397,7 @@ class CPDF_DocPageData
CPDF_Document* const m_pPDFDoc;
CFX_MapByteStringToPtr m_HashProfileMap;
- bool m_bForceClear;
+ FX_BOOL m_bForceClear;
CPDF_ColorSpaceMap m_ColorSpaceMap;
CPDF_FontFileMap m_FontFileMap;
@@ -412,7 +412,7 @@ class CPDF_Function
public:
static CPDF_Function* Load(CPDF_Object* pFuncObj);
virtual ~CPDF_Function();
- bool Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int& nresults) const;
+ FX_BOOL Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int& nresults) const;
int CountInputs()
{
return m_nInputs;
@@ -426,9 +426,9 @@ protected:
int m_nInputs, m_nOutputs;
FX_FLOAT* m_pDomains;
FX_FLOAT* m_pRanges;
- bool Init(CPDF_Object* pObj);
- virtual bool v_Init(CPDF_Object* pObj) = 0;
- virtual bool v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
+ FX_BOOL Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0;
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
};
class CPDF_IccProfile
{
@@ -436,7 +436,7 @@ public:
CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize);
~CPDF_IccProfile();
int32_t GetComponents() const { return m_nSrcComponents; }
- bool m_bsRGB;
+ FX_BOOL m_bsRGB;
void* m_pTransform;
private:
int32_t m_nSrcComponents;
@@ -447,20 +447,20 @@ class CPDF_DeviceCS : public CPDF_ColorSpace
public:
CPDF_DeviceCS(CPDF_Document* pDoc, int family);
- bool GetRGB(FX_FLOAT* pBuf,
+ FX_BOOL GetRGB(FX_FLOAT* pBuf,
FX_FLOAT& R,
FX_FLOAT& G,
FX_FLOAT& B) const override;
- bool SetRGB(FX_FLOAT* pBuf,
+ FX_BOOL SetRGB(FX_FLOAT* pBuf,
FX_FLOAT R,
FX_FLOAT G,
FX_FLOAT B) const override;
- bool v_GetCMYK(FX_FLOAT* pBuf,
+ FX_BOOL v_GetCMYK(FX_FLOAT* pBuf,
FX_FLOAT& c,
FX_FLOAT& m,
FX_FLOAT& y,
FX_FLOAT& k) const override;
- bool v_SetCMYK(FX_FLOAT* pBuf,
+ FX_BOOL v_SetCMYK(FX_FLOAT* pBuf,
FX_FLOAT c,
FX_FLOAT m,
FX_FLOAT y,
@@ -470,7 +470,7 @@ public:
int pixels,
int image_width,
int image_height,
- bool bTransMask = false) const override;
+ FX_BOOL bTransMask = FALSE) const override;
};
class CPDF_PatternCS : public CPDF_ColorSpace
@@ -482,8 +482,8 @@ public:
m_pCountedBaseCS(nullptr) {
}
~CPDF_PatternCS() override;
- bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
- bool GetRGB(FX_FLOAT* pBuf,
+ FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
+ FX_BOOL GetRGB(FX_FLOAT* pBuf,
FX_FLOAT& R,
FX_FLOAT& G,
FX_FLOAT& B) const override;
diff --git a/core/src/fpdfapi/fpdf_parser/filters_int.h b/core/src/fpdfapi/fpdf_parser/filters_int.h
index c27ade8a70..2ec54fb1f5 100644
--- a/core/src/fpdfapi/fpdf_parser/filters_int.h
+++ b/core/src/fpdfapi/fpdf_parser/filters_int.h
@@ -31,11 +31,11 @@ public:
class CPDF_LzwFilter : public CFX_DataFilter
{
public:
- CPDF_LzwFilter(bool bEarlyChange);
+ CPDF_LzwFilter(FX_BOOL bEarlyChange);
virtual ~CPDF_LzwFilter() {}
virtual void v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- bool m_bEarlyChange;
+ FX_BOOL m_bEarlyChange;
FX_DWORD m_CodeArray[5021];
FX_DWORD m_nCodes;
FX_DWORD m_CodeLen;
@@ -54,7 +54,7 @@ public:
virtual ~CPDF_PredictorFilter();
virtual void v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- bool m_bTiff;
+ FX_BOOL m_bTiff;
FX_DWORD m_Pitch, m_Bpp;
uint8_t* m_pRefLine;
uint8_t* m_pCurLine;
@@ -102,14 +102,14 @@ public:
CFX_BinaryBuf m_InputBuf;
uint8_t* m_pScanline;
int m_Pitch, m_Height, m_Width, m_nComps, m_iLine;
- bool m_bGotHeader;
+ FX_BOOL m_bGotHeader;
};
class CPDF_FaxFilter : public CFX_DataFilter
{
public:
CPDF_FaxFilter();
virtual ~CPDF_FaxFilter();
- bool Initialize(int Encoding, int bEndOfLine, int bByteAlign, int bBlack, int nRows, int nColumns);
+ FX_BOOL Initialize(int Encoding, int bEndOfLine, int bByteAlign, int bBlack, int nRows, int nColumns);
virtual void v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf);
int m_Encoding, m_bEndOfLine, m_bByteAlign, m_bBlack;
@@ -118,9 +118,9 @@ public:
uint8_t* m_pRefBuf;
CFX_BinaryBuf m_InputBuf;
int m_InputBitPos;
- void ProcessData(const uint8_t* src_buf, FX_DWORD src_size, int& bitpos, bool bFinish,
+ void ProcessData(const uint8_t* src_buf, FX_DWORD src_size, int& bitpos, FX_BOOL bFinish,
CFX_BinaryBuf& dest_buf);
- bool ReadLine(const uint8_t* src_buf, int bitsize, int& bitpos);
+ FX_BOOL ReadLine(const uint8_t* src_buf, int bitsize, int& bitpos);
};
#endif // CORE_SRC_FPDFAPI_FPDF_PARSER_FILTERS_INT_H_
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
index e60888a292..47c08fb4a3 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
@@ -91,7 +91,7 @@ FX_DWORD _HexDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_bu
}
dest_buf = FX_Alloc( uint8_t, i / 2 + 1);
dest_size = 0;
- bool bFirstDigit = true;
+ FX_BOOL bFirstDigit = TRUE;
for (i = 0; i < src_size; i ++) {
uint8_t ch = src_buf[i];
if (ch == ' ' || ch == '\n' || ch == '\t' || ch == '\r') {
@@ -186,9 +186,9 @@ ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(const uint8_t* src_buf, FX_DWOR
const CPDF_Dictionary* pParams)
{
int K = 0;
- bool EndOfLine = false;
- bool ByteAlign = false;
- bool BlackIs1 = false;
+ FX_BOOL EndOfLine = FALSE;
+ FX_BOOL ByteAlign = FALSE;
+ FX_BOOL BlackIs1 = FALSE;
int Columns = 1728;
int Rows = 0;
if (pParams) {
@@ -208,25 +208,25 @@ ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(const uint8_t* src_buf, FX_DWOR
return CPDF_ModuleMgr::Get()->GetFaxModule()->CreateDecoder(src_buf, src_size, width, height,
K, EndOfLine, ByteAlign, BlackIs1, Columns, Rows);
}
-static bool CheckFlateDecodeParams(int Colors, int BitsPerComponent, int Columns)
+static FX_BOOL CheckFlateDecodeParams(int Colors, int BitsPerComponent, int Columns)
{
if (Columns < 0) {
- return false;
+ return FALSE;
}
int check = Columns;
if (Colors < 0 || (check > 0 && Colors > INT_MAX / check)) {
- return false;
+ return FALSE;
}
check *= Colors;
if (BitsPerComponent < 0 ||
(check > 0 && BitsPerComponent > INT_MAX / check)) {
- return false;
+ return FALSE;
}
check *= BitsPerComponent;
if (check > INT_MAX - 7) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc, const CPDF_Dictionary* pParams)
@@ -245,11 +245,11 @@ ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(const uint8_t* src_buf, FX_DW
return CPDF_ModuleMgr::Get()->GetFlateModule()->CreateDecoder(src_buf, src_size, width, height,
nComps, bpc, predictor, Colors, BitsPerComponent, Columns);
}
-FX_DWORD FPDFAPI_FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
+FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size)
{
int predictor = 0;
- bool bEarlyChange = true;
+ FX_BOOL bEarlyChange = TRUE;
int Colors = 0, BitsPerComponent = 0, Columns = 0;
if (pParams) {
predictor = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("Predictor"));
@@ -265,14 +265,14 @@ FX_DWORD FPDFAPI_FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf, FX_DWORD sr
bEarlyChange, predictor, Colors, BitsPerComponent, Columns, estimated_size,
dest_buf, dest_size);
}
-bool PDF_DataDecode(const uint8_t* src_buf, FX_DWORD src_size, const CPDF_Dictionary* pDict,
+FX_BOOL PDF_DataDecode(const uint8_t* src_buf, FX_DWORD src_size, const CPDF_Dictionary* pDict,
uint8_t*& dest_buf, FX_DWORD& dest_size, CFX_ByteString& ImageEncoding,
- CPDF_Dictionary*& pImageParms, FX_DWORD last_estimated_size, bool bImageAcc)
+ CPDF_Dictionary*& pImageParms, FX_DWORD last_estimated_size, FX_BOOL bImageAcc)
{
CPDF_Object* pDecoder = pDict ? pDict->GetElementValue(FX_BSTRC("Filter")) : NULL;
if (pDecoder == NULL || (pDecoder->GetType() != PDFOBJ_ARRAY && pDecoder->GetType() != PDFOBJ_NAME)) {
- return false;
+ return FALSE;
}
CPDF_Object* pParams = pDict ? pDict->GetElementValue(FX_BSTRC("DecodeParms")) : NULL;
CFX_ByteStringArray DecoderList;
@@ -310,11 +310,11 @@ bool PDF_DataDecode(const uint8_t* src_buf, FX_DWORD src_size, const CPDF_Dictio
dest_buf = (uint8_t*)last_buf;
dest_size = last_size;
pImageParms = pParam;
- return true;
+ return TRUE;
}
- offset = FPDFAPI_FlateOrLZWDecode(false, last_buf, last_size, pParam, estimated_size, new_buf, new_size);
+ offset = FPDFAPI_FlateOrLZWDecode(FALSE, last_buf, last_size, pParam, estimated_size, new_buf, new_size);
} else if (decoder == FX_BSTRC("LZWDecode") || decoder == FX_BSTRC("LZW")) {
- offset = FPDFAPI_FlateOrLZWDecode(true, last_buf, last_size, pParam, estimated_size, new_buf, new_size);
+ offset = FPDFAPI_FlateOrLZWDecode(TRUE, last_buf, last_size, pParam, estimated_size, new_buf, new_size);
} else if (decoder == FX_BSTRC("ASCII85Decode") || decoder == FX_BSTRC("A85")) {
offset = _A85Decode(last_buf, last_size, new_buf, new_size);
} else if (decoder == FX_BSTRC("ASCIIHexDecode") || decoder == FX_BSTRC("AHx")) {
@@ -325,7 +325,7 @@ bool PDF_DataDecode(const uint8_t* src_buf, FX_DWORD src_size, const CPDF_Dictio
dest_buf = (uint8_t*)last_buf;
dest_size = last_size;
pImageParms = pParam;
- return true;
+ return TRUE;
}
offset = RunLengthDecode(last_buf, last_size, new_buf, new_size);
} else {
@@ -340,13 +340,13 @@ bool PDF_DataDecode(const uint8_t* src_buf, FX_DWORD src_size, const CPDF_Dictio
pImageParms = pParam;
dest_buf = (uint8_t*)last_buf;
dest_size = last_size;
- return true;
+ return TRUE;
}
if (last_buf != src_buf) {
FX_Free(last_buf);
}
if (offset == -1) {
- return false;
+ return FALSE;
}
last_buf = new_buf;
last_size = new_size;
@@ -355,7 +355,7 @@ bool PDF_DataDecode(const uint8_t* src_buf, FX_DWORD src_size, const CPDF_Dictio
pImageParms = NULL;
dest_buf = last_buf;
dest_size = last_size;
- return true;
+ return TRUE;
}
extern const FX_WORD PDFDocEncoding[256] = {
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009,
@@ -389,7 +389,7 @@ CFX_WideString PDF_DecodeText(const uint8_t* src_data, FX_DWORD src_len, CFX_Cha
{
CFX_WideString result;
if (src_len >= 2 && ((src_data[0] == 0xfe && src_data[1] == 0xff) || (src_data[0] == 0xff && src_data[1] == 0xfe))) {
- bool bBE = src_data[0] == 0xfe;
+ FX_BOOL bBE = src_data[0] == 0xfe;
FX_DWORD max_chars = (src_len - 2) / 2;
if (!max_chars) {
return result;
@@ -472,7 +472,7 @@ CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len, CFX_CharMap* pCh
result.ReleaseBuffer(encLen);
return result;
}
-CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, bool bHex)
+CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex)
{
CFX_ByteTextBuf result;
int srclen = src.GetLength();
@@ -521,7 +521,7 @@ FX_DWORD FlateDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_b
{
CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
if (pEncoders) {
- return pEncoders->GetFlateModule()->FlateOrLZWDecode(false, src_buf, src_size, false, 0, 0, 0, 0, 0, dest_buf, dest_size);
+ return pEncoders->GetFlateModule()->FlateOrLZWDecode(FALSE, src_buf, src_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size);
}
return 0;
}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
index 0ea692ed4d..c0f45c5379 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
@@ -12,7 +12,7 @@ CPDF_Document::CPDF_Document(CPDF_Parser* pParser) : CPDF_IndirectObjects(pParse
ASSERT(pParser != NULL);
m_pRootDict = NULL;
m_pInfoDict = NULL;
- m_bLinearized = false;
+ m_bLinearized = FALSE;
m_dwFirstPageNo = 0;
m_dwFirstPageObjNum = 0;
m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
@@ -58,7 +58,7 @@ void CPDF_Document::LoadDoc()
}
void CPDF_Document::LoadAsynDoc(CPDF_Dictionary *pLinearized)
{
- m_bLinearized = true;
+ m_bLinearized = TRUE;
m_LastObjNum = m_pParser->GetLastObjNum();
CPDF_Object* indirectObj = GetIndirectObject(m_pParser->GetRootObjNum());
m_pRootDict = indirectObj ? indirectObj->GetDict() : NULL;
@@ -228,7 +228,7 @@ int CPDF_Document::GetPageIndex(FX_DWORD objnum)
{
FX_DWORD nPages = m_PageList.GetSize();
FX_DWORD skip_count = 0;
- bool bSkipped = false;
+ FX_BOOL bSkipped = FALSE;
for (FX_DWORD i = 0; i < nPages; i ++) {
FX_DWORD objnum1 = m_PageList.GetAt(i);
if (objnum1 == objnum) {
@@ -236,7 +236,7 @@ int CPDF_Document::GetPageIndex(FX_DWORD objnum)
}
if (!bSkipped && objnum1 == 0) {
skip_count = i;
- bSkipped = true;
+ bSkipped = TRUE;
}
}
CPDF_Dictionary* pRoot = GetRoot();
@@ -297,7 +297,7 @@ int CPDF_Document::_GetPageCount() const
}
return _CountPages(pPages, 0);
}
-bool CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pThisPageDict)
+FX_BOOL CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pThisPageDict)
{
for (int i = 0; i < m_PageList.GetSize(); i ++) {
CPDF_Dictionary* pPageDict = GetPage(i);
@@ -316,42 +316,42 @@ bool CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pTh
continue;
}
if (((CPDF_Reference*) pRef)->GetRefObjNum() == objnum) {
- return true;
+ return TRUE;
}
}
} else if (pContents->GetObjNum() == objnum) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-FX_DWORD CPDF_Document::GetUserPermissions(bool bCheckRevision) const
+FX_DWORD CPDF_Document::GetUserPermissions(FX_BOOL bCheckRevision) const
{
if (m_pParser == NULL) {
return (FX_DWORD) - 1;
}
return m_pParser->GetPermissions(bCheckRevision);
}
-bool CPDF_Document::IsOwner() const
+FX_BOOL CPDF_Document::IsOwner() const
{
if (m_pParser == NULL) {
- return true;
+ return TRUE;
}
return m_pParser->IsOwner();
}
-bool CPDF_Document::IsFormStream(FX_DWORD objnum, bool& bForm) const
+FX_BOOL CPDF_Document::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const
{
{
CPDF_Object* pObj;
if (m_IndirectObjs.Lookup((void*)(uintptr_t)objnum, (void*&)pObj)) {
bForm = pObj->GetType() == PDFOBJ_STREAM &&
((CPDF_Stream*)pObj)->GetDict()->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("Form");
- return true;
+ return TRUE;
}
}
if (m_pParser == NULL) {
- bForm = false;
- return true;
+ bForm = FALSE;
+ return TRUE;
}
return m_pParser->IsFormStream(objnum, bForm);
}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
index ff6f0e12bd..9f356a4748 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
@@ -14,7 +14,7 @@ const uint8_t defpasscode[32] = {
0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a
};
void CalcEncryptKey(CPDF_Dictionary* pEncrypt, const uint8_t* password, FX_DWORD pass_size,
- uint8_t* key, int keylen, bool bIgnoreMeta, CPDF_Array* pIdArray)
+ uint8_t* key, int keylen, FX_BOOL bIgnoreMeta, CPDF_Array* pIdArray)
{
int revision = pEncrypt->GetInteger(FX_BSTRC("R"));
uint8_t passcode[32];
@@ -57,7 +57,7 @@ CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler()
typedef struct _PDF_CRYPTOITEM {
int32_t m_Cipher;
int32_t m_KeyLen;
- bool m_bChecked;
+ FX_BOOL m_bChecked;
CPDF_StandardCryptoHandler* m_pCryptoHandler;
} PDF_CRYPTOITEM;
CPDF_StandardSecurityHandler::CPDF_StandardSecurityHandler()
@@ -66,7 +66,7 @@ CPDF_StandardSecurityHandler::CPDF_StandardSecurityHandler()
m_Revision = 0;
m_pParser = NULL;
m_pEncryptDict = NULL;
- m_bOwner = false;
+ m_bOwner = FALSE;
m_Permissions = 0;
m_Cipher = FXCIPHER_NONE;
m_KeyLen = 0;
@@ -74,36 +74,36 @@ CPDF_StandardSecurityHandler::CPDF_StandardSecurityHandler()
CPDF_StandardSecurityHandler::~CPDF_StandardSecurityHandler()
{
}
-bool CPDF_StandardSecurityHandler::OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict)
+FX_BOOL CPDF_StandardSecurityHandler::OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict)
{
m_pParser = pParser;
if (!LoadDict(pEncryptDict)) {
- return false;
+ return FALSE;
}
if (m_Cipher == FXCIPHER_NONE) {
- return true;
+ return TRUE;
}
return CheckSecurity(m_KeyLen);
}
-bool CPDF_StandardSecurityHandler::CheckSecurity(int32_t key_len)
+FX_BOOL CPDF_StandardSecurityHandler::CheckSecurity(int32_t key_len)
{
CFX_ByteString password = m_pParser->GetPassword();
- if (CheckPassword(password, password.GetLength(), true, m_EncryptKey, key_len)) {
+ if (CheckPassword(password, password.GetLength(), TRUE, m_EncryptKey, key_len)) {
if (password.IsEmpty()) {
- if (!CheckPassword(password, password.GetLength(), false, m_EncryptKey, key_len)) {
- return false;
+ if (!CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey, key_len)) {
+ return FALSE;
}
}
- m_bOwner = true;
- return true;
+ m_bOwner = TRUE;
+ return TRUE;
}
- return CheckPassword(password, password.GetLength(), false, m_EncryptKey, key_len);
+ return CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey, key_len);
}
FX_DWORD CPDF_StandardSecurityHandler::GetPermissions()
{
return m_Permissions;
}
-static bool _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, const CFX_ByteStringC& name, int& cipher, int& keylen)
+static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, const CFX_ByteStringC& name, int& cipher, int& keylen)
{
int Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
cipher = FXCIPHER_RC4;
@@ -111,14 +111,14 @@ static bool _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, const CFX_ByteStringC&
if (Version >= 4) {
CPDF_Dictionary* pCryptFilters = pEncryptDict->GetDict(FX_BSTRC("CF"));
if (pCryptFilters == NULL) {
- return false;
+ return FALSE;
}
if (name == FX_BSTRC("Identity")) {
cipher = FXCIPHER_NONE;
} else {
CPDF_Dictionary* pDefFilter = pCryptFilters->GetDict(name);
if (pDefFilter == NULL) {
- return false;
+ return FALSE;
}
int nKeyBits = 0;
if (Version == 4) {
@@ -142,14 +142,14 @@ static bool _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, const CFX_ByteStringC&
keylen = Version > 1 ? pEncryptDict->GetInteger(FX_BSTRC("Length"), 40) / 8 : 5;
}
if (keylen > 32 || keylen < 0) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict)
+FX_BOOL CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict)
{
m_pEncryptDict = pEncryptDict;
- m_bOwner = false;
+ m_bOwner = FALSE;
m_Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
m_Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
m_Permissions = pEncryptDict->GetInteger(FX_BSTRC("P"), -1);
@@ -159,17 +159,17 @@ bool CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict)
CFX_ByteString stmf_name = pEncryptDict->GetString(FX_BSTRC("StmF"));
CFX_ByteString strf_name = pEncryptDict->GetString(FX_BSTRC("StrF"));
if (stmf_name != strf_name) {
- return false;
+ return FALSE;
}
if (!_LoadCryptInfo(pEncryptDict, strf_name, m_Cipher, m_KeyLen)) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len)
+FX_BOOL CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len)
{
m_pEncryptDict = pEncryptDict;
- m_bOwner = false;
+ m_bOwner = FALSE;
m_Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
m_Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
m_Permissions = pEncryptDict->GetInteger(FX_BSTRC("P"), -1);
@@ -178,23 +178,23 @@ bool CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict, FX_DW
stmf_name = pEncryptDict->GetString(FX_BSTRC("StmF"));
strf_name = pEncryptDict->GetString(FX_BSTRC("StrF"));
if (stmf_name != strf_name) {
- return false;
+ return FALSE;
}
}
if (!_LoadCryptInfo(pEncryptDict, strf_name, cipher, key_len)) {
- return false;
+ return FALSE;
}
m_Cipher = cipher;
m_KeyLen = key_len;
- return true;
- return true;
+ return TRUE;
+ return TRUE;
}
-bool CPDF_StandardSecurityHandler::GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen)
+FX_BOOL CPDF_StandardSecurityHandler::GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen)
{
cipher = m_Cipher;
buffer = m_EncryptKey;
keylen = m_KeyLen;
- return true;
+ return TRUE;
}
#define FX_GET_32WORD(n,b,i) \
{ \
@@ -252,7 +252,7 @@ void Revision6_Hash(const uint8_t* password, FX_DWORD size, const uint8_t* salt,
content.AppendBlock(vector, 48);
}
}
- CRYPT_AESSetKey(aes, 16, key, 16, true);
+ CRYPT_AESSetKey(aes, 16, key, 16, TRUE);
CRYPT_AESSetIV(aes, iv);
CRYPT_AESEncrypt(aes, E, content.GetBuffer(), iBufLen);
int iHash = 0;
@@ -288,16 +288,16 @@ void Revision6_Hash(const uint8_t* password, FX_DWORD size, const uint8_t* salt,
FXSYS_memcpy(hash, input, 32);
}
}
-bool CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* password, FX_DWORD size,
- bool bOwner, uint8_t* key)
+FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* password, FX_DWORD size,
+ FX_BOOL bOwner, uint8_t* key)
{
CFX_ByteString okey = m_pEncryptDict ? m_pEncryptDict->GetString(FX_BSTRC("O")) : CFX_ByteString();
if (okey.GetLength() < 48) {
- return false;
+ return FALSE;
}
CFX_ByteString ukey = m_pEncryptDict ? m_pEncryptDict->GetString(FX_BSTRC("U")) : CFX_ByteString();
if (ukey.GetLength() < 48) {
- return false;
+ return FALSE;
}
const uint8_t* pkey = bOwner ? (const uint8_t*)okey : (const uint8_t*)ukey;
uint8_t sha[128];
@@ -314,10 +314,10 @@ bool CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* password,
CRYPT_SHA256Finish(sha, digest);
}
if (FXSYS_memcmp(digest, pkey, 32) != 0) {
- return false;
+ return FALSE;
}
if (key == NULL) {
- return true;
+ return TRUE;
}
if (m_Revision >= 6) {
Revision6_Hash(password, size, (const uint8_t*)pkey + 40, (bOwner ? (const uint8_t*)ukey : NULL), digest);
@@ -332,19 +332,19 @@ bool CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* password,
}
CFX_ByteString ekey = m_pEncryptDict ? m_pEncryptDict->GetString(bOwner ? FX_BSTRC("OE") : FX_BSTRC("UE")) : CFX_ByteString();
if (ekey.GetLength() < 32) {
- return false;
+ return FALSE;
}
uint8_t* aes = FX_Alloc(uint8_t, 2048);
- CRYPT_AESSetKey(aes, 16, digest, 32, false);
+ CRYPT_AESSetKey(aes, 16, digest, 32, FALSE);
uint8_t iv[16];
FXSYS_memset(iv, 0, 16);
CRYPT_AESSetIV(aes, iv);
CRYPT_AESDecrypt(aes, key, ekey, 32);
- CRYPT_AESSetKey(aes, 16, key, 32, false);
+ CRYPT_AESSetKey(aes, 16, key, 32, FALSE);
CRYPT_AESSetIV(aes, iv);
CFX_ByteString perms = m_pEncryptDict->GetString(FX_BSTRC("Perms"));
if (perms.IsEmpty()) {
- return false;
+ return FALSE;
}
uint8_t perms_buf[16];
FXSYS_memset(perms_buf, 0, sizeof(perms_buf));
@@ -357,21 +357,21 @@ bool CPDF_StandardSecurityHandler::AES256_CheckPassword(const uint8_t* password,
CRYPT_AESDecrypt(aes, buf, perms_buf, 16);
FX_Free(aes);
if (buf[9] != 'a' || buf[10] != 'd' || buf[11] != 'b') {
- return false;
+ return FALSE;
}
if (FXDWORD_GET_LSBFIRST(buf) != m_Permissions) {
- return false;
+ return FALSE;
}
if ((buf[8] == 'T' && !IsMetadataEncrypted()) || (buf[8] == 'F' && IsMetadataEncrypted())) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-int CPDF_StandardSecurityHandler::CheckPassword(const uint8_t* password, FX_DWORD pass_size, bool bOwner, uint8_t* key)
+int CPDF_StandardSecurityHandler::CheckPassword(const uint8_t* password, FX_DWORD pass_size, FX_BOOL bOwner, uint8_t* key)
{
return CheckPassword(password, pass_size, bOwner, key, m_KeyLen);
}
-int CPDF_StandardSecurityHandler::CheckPassword(const uint8_t* password, FX_DWORD size, bool bOwner, uint8_t* key, int32_t key_len)
+int CPDF_StandardSecurityHandler::CheckPassword(const uint8_t* password, FX_DWORD size, FX_BOOL bOwner, uint8_t* key, int32_t key_len)
{
if (m_Revision >= 5) {
return AES256_CheckPassword(password, size, bOwner, key);
@@ -383,16 +383,16 @@ int CPDF_StandardSecurityHandler::CheckPassword(const uint8_t* password, FX_DWOR
if (bOwner) {
return CheckOwnerPassword(password, size, key, key_len);
}
- return CheckUserPassword(password, size, false, key, key_len) || CheckUserPassword(password, size, true, key, key_len);
+ return CheckUserPassword(password, size, FALSE, key, key_len) || CheckUserPassword(password, size, TRUE, key, key_len);
}
-bool CPDF_StandardSecurityHandler::CheckUserPassword(const uint8_t* password, FX_DWORD pass_size,
- bool bIgnoreEncryptMeta, uint8_t* key, int32_t key_len)
+FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(const uint8_t* password, FX_DWORD pass_size,
+ FX_BOOL bIgnoreEncryptMeta, uint8_t* key, int32_t key_len)
{
CalcEncryptKey(m_pEncryptDict, password, pass_size, key, key_len, bIgnoreEncryptMeta,
m_pParser->GetIDArray());
CFX_ByteString ukey = m_pEncryptDict ? m_pEncryptDict->GetString(FX_BSTRC("U")) : CFX_ByteString();
if (ukey.GetLength() < 16) {
- return false;
+ return FALSE;
}
uint8_t ukeybuf[32];
if (m_Revision == 2) {
@@ -425,9 +425,9 @@ bool CPDF_StandardSecurityHandler::CheckUserPassword(const uint8_t* password, FX
return FXSYS_memcmp(test, ukeybuf, 16) == 0;
}
if (FXSYS_memcmp((void*)ukey.c_str(), ukeybuf, 16) == 0) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(const uint8_t* owner_pass, FX_DWORD pass_size)
{
@@ -480,18 +480,18 @@ CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(const uint8_t* owne
}
return CFX_ByteString(okeybuf, len);
}
-bool CPDF_StandardSecurityHandler::CheckOwnerPassword(const uint8_t* password, FX_DWORD pass_size,
+FX_BOOL CPDF_StandardSecurityHandler::CheckOwnerPassword(const uint8_t* password, FX_DWORD pass_size,
uint8_t* key, int32_t key_len)
{
CFX_ByteString user_pass = GetUserPassword(password, pass_size, key_len);
- if (CheckUserPassword(user_pass, user_pass.GetLength(), false, key, key_len)) {
- return true;
+ if (CheckUserPassword(user_pass, user_pass.GetLength(), FALSE, key, key_len)) {
+ return TRUE;
}
- return CheckUserPassword(user_pass, user_pass.GetLength(), true, key, key_len);
+ return CheckUserPassword(user_pass, user_pass.GetLength(), TRUE, key, key_len);
}
-bool CPDF_StandardSecurityHandler::IsMetadataEncrypted()
+FX_BOOL CPDF_StandardSecurityHandler::IsMetadataEncrypted()
{
- return m_pEncryptDict->GetBoolean(FX_BSTRC("EncryptMetadata"), true);
+ return m_pEncryptDict->GetBoolean(FX_BSTRC("EncryptMetadata"), TRUE);
}
CPDF_SecurityHandler* FPDF_CreateStandardSecurityHandler()
{
@@ -499,7 +499,7 @@ CPDF_SecurityHandler* FPDF_CreateStandardSecurityHandler()
}
void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
const uint8_t* user_pass, FX_DWORD user_size,
- const uint8_t* owner_pass, FX_DWORD owner_size, bool bDefault, FX_DWORD type)
+ const uint8_t* owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type)
{
int cipher = 0, key_len = 0;
if (!LoadDict(pEncryptDict, type, cipher, key_len)) {
@@ -517,10 +517,10 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_
CRYPT_SHA256Update(sha, m_EncryptKey, 32);
CRYPT_SHA256Update(sha, (uint8_t*)"there", 5);
CRYPT_SHA256Finish(sha, m_EncryptKey);
- AES256_SetPassword(pEncryptDict, user_pass, user_size, false, m_EncryptKey);
+ AES256_SetPassword(pEncryptDict, user_pass, user_size, FALSE, m_EncryptKey);
if (bDefault) {
- AES256_SetPassword(pEncryptDict, owner_pass, owner_size, true, m_EncryptKey);
- AES256_SetPerms(pEncryptDict, m_Permissions, pEncryptDict->GetBoolean(FX_BSTRC("EncryptMetadata"), true), m_EncryptKey);
+ AES256_SetPassword(pEncryptDict, owner_pass, owner_size, TRUE, m_EncryptKey);
+ AES256_SetPerms(pEncryptDict, m_Permissions, pEncryptDict->GetBoolean(FX_BSTRC("EncryptMetadata"), TRUE), m_EncryptKey);
}
return;
}
@@ -554,7 +554,7 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_
}
pEncryptDict->SetAtString(FX_BSTRC("O"), CFX_ByteString(passcode, 32));
}
- CalcEncryptKey(m_pEncryptDict, (uint8_t*)user_pass, user_size, m_EncryptKey, key_len, false, pIdArray);
+ CalcEncryptKey(m_pEncryptDict, (uint8_t*)user_pass, user_size, m_EncryptKey, key_len, FALSE, pIdArray);
if (m_Revision < 3) {
uint8_t tempbuf[32];
FXSYS_memcpy(tempbuf, defpasscode, 32);
@@ -586,13 +586,13 @@ void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_
const uint8_t* user_pass, FX_DWORD user_size,
const uint8_t* owner_pass, FX_DWORD owner_size, FX_DWORD type)
{
- OnCreate(pEncryptDict, pIdArray, user_pass, user_size, owner_pass, owner_size, true, type);
+ OnCreate(pEncryptDict, pIdArray, user_pass, user_size, owner_pass, owner_size, TRUE, type);
}
void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray, const uint8_t* user_pass, FX_DWORD user_size, FX_DWORD type)
{
- OnCreate(pEncryptDict, pIdArray, user_pass, user_size, NULL, 0, false, type);
+ OnCreate(pEncryptDict, pIdArray, user_pass, user_size, NULL, 0, FALSE, type);
}
-void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptDict, const uint8_t* password, FX_DWORD size, bool bOwner, const uint8_t* key)
+void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptDict, const uint8_t* password, FX_DWORD size, FX_BOOL bOwner, const uint8_t* key)
{
uint8_t sha[128];
CRYPT_SHA1Start(sha);
@@ -627,7 +627,7 @@ void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptD
CRYPT_SHA256Finish(sha, digest1);
}
uint8_t* aes = FX_Alloc(uint8_t, 2048);
- CRYPT_AESSetKey(aes, 16, digest1, 32, true);
+ CRYPT_AESSetKey(aes, 16, digest1, 32, TRUE);
uint8_t iv[16];
FXSYS_memset(iv, 0, 16);
CRYPT_AESSetIV(aes, iv);
@@ -636,7 +636,7 @@ void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptD
pEncryptDict->SetAtString(bOwner ? FX_BSTRC("OE") : FX_BSTRC("UE"), CFX_ByteString(digest1, 32));
}
void CPDF_StandardSecurityHandler::AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permissions,
- bool bEncryptMetadata, const uint8_t* key)
+ FX_BOOL bEncryptMetadata, const uint8_t* key)
{
uint8_t buf[16];
buf[0] = (uint8_t)permissions;
@@ -652,7 +652,7 @@ void CPDF_StandardSecurityHandler::AES256_SetPerms(CPDF_Dictionary* pEncryptDict
buf[10] = 'd';
buf[11] = 'b';
uint8_t* aes = FX_Alloc(uint8_t, 2048);
- CRYPT_AESSetKey(aes, 16, key, 32, true);
+ CRYPT_AESSetKey(aes, 16, key, 32, TRUE);
uint8_t iv[16], buf1[16];
FXSYS_memset(iv, 0, 16);
CRYPT_AESSetIV(aes, iv);
@@ -660,7 +660,7 @@ void CPDF_StandardSecurityHandler::AES256_SetPerms(CPDF_Dictionary* pEncryptDict
FX_Free(aes);
pEncryptDict->SetAtString(FX_BSTRC("Perms"), CFX_ByteString(buf1, 16));
}
-void CPDF_StandardCryptoHandler::CryptBlock(bool bEncrypt, FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size,
+void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size,
uint8_t* dest_buf, FX_DWORD& dest_size)
{
if (m_Cipher == FXCIPHER_NONE) {
@@ -720,18 +720,18 @@ void CPDF_StandardCryptoHandler::CryptBlock(bool bEncrypt, FX_DWORD objnum, FX_D
}
typedef struct _AESCryptContext {
uint8_t m_Context[2048];
- bool m_bIV;
+ FX_BOOL m_bIV;
uint8_t m_Block[16];
FX_DWORD m_BlockOffset;
} AESCryptContext;
-void* CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennum, bool bEncrypt)
+void* CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt)
{
if (m_Cipher == FXCIPHER_NONE) {
return this;
}
if (m_Cipher == FXCIPHER_AES && m_KeyLen == 32) {
AESCryptContext* pContext = FX_Alloc(AESCryptContext, 1);
- pContext->m_bIV = true;
+ pContext->m_bIV = TRUE;
pContext->m_BlockOffset = 0;
CRYPT_AESSetKey(pContext->m_Context, 16, m_EncryptKey, 32, bEncrypt);
if (bEncrypt) {
@@ -757,7 +757,7 @@ void* CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennum, b
}
if (m_Cipher == FXCIPHER_AES) {
AESCryptContext* pContext = FX_Alloc(AESCryptContext, 1);
- pContext->m_bIV = true;
+ pContext->m_bIV = TRUE;
pContext->m_BlockOffset = 0;
CRYPT_AESSetKey(pContext->m_Context, 16, realkey, 16, bEncrypt);
if (bEncrypt) {
@@ -772,25 +772,25 @@ void* CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennum, b
CRYPT_ArcFourSetup(pContext, realkey, realkeylen);
return pContext;
}
-bool CPDF_StandardCryptoHandler::CryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, bool bEncrypt)
+FX_BOOL CPDF_StandardCryptoHandler::CryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt)
{
if (!context) {
- return false;
+ return FALSE;
}
if (m_Cipher == FXCIPHER_NONE) {
dest_buf.AppendBlock(src_buf, src_size);
- return true;
+ return TRUE;
}
if (m_Cipher == FXCIPHER_RC4) {
int old_size = dest_buf.GetSize();
dest_buf.AppendBlock(src_buf, src_size);
CRYPT_ArcFourCrypt(context, dest_buf.GetBuffer() + old_size, src_size);
- return true;
+ return TRUE;
}
AESCryptContext* pContext = (AESCryptContext*)context;
if (pContext->m_bIV && bEncrypt) {
dest_buf.AppendBlock(pContext->m_Block, 16);
- pContext->m_bIV = false;
+ pContext->m_bIV = FALSE;
}
FX_DWORD src_off = 0;
FX_DWORD src_left = src_size;
@@ -806,7 +806,7 @@ bool CPDF_StandardCryptoHandler::CryptStream(void* context, const uint8_t* src_b
if (pContext->m_BlockOffset == 16) {
if (!bEncrypt && pContext->m_bIV) {
CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block);
- pContext->m_bIV = false;
+ pContext->m_bIV = FALSE;
pContext->m_BlockOffset = 0;
} else if (src_off < src_size) {
uint8_t block_buf[16];
@@ -823,19 +823,19 @@ bool CPDF_StandardCryptoHandler::CryptStream(void* context, const uint8_t* src_b
break;
}
}
- return true;
+ return TRUE;
}
-bool CPDF_StandardCryptoHandler::CryptFinish(void* context, CFX_BinaryBuf& dest_buf, bool bEncrypt)
+FX_BOOL CPDF_StandardCryptoHandler::CryptFinish(void* context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt)
{
if (!context) {
- return false;
+ return FALSE;
}
if (m_Cipher == FXCIPHER_NONE) {
- return true;
+ return TRUE;
}
if (m_Cipher == FXCIPHER_RC4) {
FX_Free(context);
- return true;
+ return TRUE;
}
AESCryptContext* pContext = (AESCryptContext*)context;
if (bEncrypt) {
@@ -856,24 +856,24 @@ bool CPDF_StandardCryptoHandler::CryptFinish(void* context, CFX_BinaryBuf& dest_
}
}
FX_Free(pContext);
- return true;
+ return TRUE;
}
void* CPDF_StandardCryptoHandler::DecryptStart(FX_DWORD objnum, FX_DWORD gennum)
{
- return CryptStart(objnum, gennum, false);
+ return CryptStart(objnum, gennum, FALSE);
}
FX_DWORD CPDF_StandardCryptoHandler::DecryptGetSize(FX_DWORD src_size)
{
return m_Cipher == FXCIPHER_AES ? src_size - 16 : src_size;
}
-bool CPDF_StandardCryptoHandler::Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler)
+FX_BOOL CPDF_StandardCryptoHandler::Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler)
{
const uint8_t* key;
if (!pSecurityHandler->GetCryptInfo(m_Cipher, key, m_KeyLen)) {
- return false;
+ return FALSE;
}
if (m_KeyLen > 32 || m_KeyLen < 0) {
- return false;
+ return FALSE;
}
if (m_Cipher != FXCIPHER_NONE) {
FXSYS_memcpy(m_EncryptKey, key, m_KeyLen);
@@ -881,9 +881,9 @@ bool CPDF_StandardCryptoHandler::Init(CPDF_Dictionary* pEncryptDict, CPDF_Securi
if (m_Cipher == FXCIPHER_AES) {
m_pAESContext = FX_Alloc(uint8_t, 2048);
}
- return true;
+ return TRUE;
}
-bool CPDF_StandardCryptoHandler::Init(int cipher, const uint8_t* key, int keylen)
+FX_BOOL CPDF_StandardCryptoHandler::Init(int cipher, const uint8_t* key, int keylen)
{
if (cipher == FXCIPHER_AES) {
switch(keylen) {
@@ -892,15 +892,15 @@ bool CPDF_StandardCryptoHandler::Init(int cipher, const uint8_t* key, int keylen
case 32:
break;
default:
- return false;
+ return FALSE;
}
} else if (cipher == FXCIPHER_AES2) {
if (keylen != 32) {
- return false;
+ return FALSE;
}
} else if (cipher == FXCIPHER_RC4) {
if (keylen < 5 || keylen > 16) {
- return false;
+ return FALSE;
}
} else {
if (keylen > 32) {
@@ -913,16 +913,16 @@ bool CPDF_StandardCryptoHandler::Init(int cipher, const uint8_t* key, int keylen
if (m_Cipher == FXCIPHER_AES) {
m_pAESContext = FX_Alloc(uint8_t, 2048);
}
- return true;
+ return TRUE;
}
-bool CPDF_StandardCryptoHandler::DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size,
+FX_BOOL CPDF_StandardCryptoHandler::DecryptStream(void* context, const uint8_t* src_buf, FX_DWORD src_size,
CFX_BinaryBuf& dest_buf)
{
- return CryptStream(context, src_buf, src_size, dest_buf, false);
+ return CryptStream(context, src_buf, src_size, dest_buf, FALSE);
}
-bool CPDF_StandardCryptoHandler::DecryptFinish(void* context, CFX_BinaryBuf& dest_buf)
+FX_BOOL CPDF_StandardCryptoHandler::DecryptFinish(void* context, CFX_BinaryBuf& dest_buf)
{
- return CryptFinish(context, dest_buf, false);
+ return CryptFinish(context, dest_buf, FALSE);
}
FX_DWORD CPDF_StandardCryptoHandler::EncryptGetSize(FX_DWORD objnum, FX_DWORD version, const uint8_t* src_buf, FX_DWORD src_size)
{
@@ -931,11 +931,11 @@ FX_DWORD CPDF_StandardCryptoHandler::EncryptGetSize(FX_DWORD objnum, FX_DWORD ve
}
return src_size;
}
-bool CPDF_StandardCryptoHandler::EncryptContent(FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size,
+FX_BOOL CPDF_StandardCryptoHandler::EncryptContent(FX_DWORD objnum, FX_DWORD gennum, const uint8_t* src_buf, FX_DWORD src_size,
uint8_t* dest_buf, FX_DWORD& dest_size)
{
- CryptBlock(true, objnum, gennum, src_buf, src_size, dest_buf, dest_size);
- return true;
+ CryptBlock(TRUE, objnum, gennum, src_buf, src_size, dest_buf, dest_size);
+ return TRUE;
}
void CPDF_CryptoHandler::Decrypt(FX_DWORD objnum, FX_DWORD gennum, CFX_ByteString& str)
{
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
index ffce46bdd2..1958fab280 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
@@ -9,7 +9,7 @@ CFDF_Document::CFDF_Document() : CPDF_IndirectObjects(NULL)
{
m_pRootDict = NULL;
m_pFile = NULL;
- m_bOwnFile = false;
+ m_bOwnFile = FALSE;
}
CFDF_Document::~CFDF_Document()
{
@@ -26,7 +26,7 @@ CFDF_Document* CFDF_Document::CreateNewDoc()
pDoc->m_pRootDict->SetAt(FX_BSTRC("FDF"), pFDFDict);
return pDoc;
}
-CFDF_Document* CFDF_Document::ParseFile(IFX_FileRead *pFile, bool bOwnFile)
+CFDF_Document* CFDF_Document::ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile)
{
if (!pFile) {
return NULL;
@@ -41,16 +41,16 @@ CFDF_Document* CFDF_Document::ParseFile(IFX_FileRead *pFile, bool bOwnFile)
}
CFDF_Document* CFDF_Document::ParseMemory(const uint8_t* pData, FX_DWORD size)
{
- return CFDF_Document::ParseFile(FX_CreateMemoryStream((uint8_t*)pData, size), true);
+ return CFDF_Document::ParseFile(FX_CreateMemoryStream((uint8_t*)pData, size), TRUE);
}
-void CFDF_Document::ParseStream(IFX_FileRead *pFile, bool bOwnFile)
+void CFDF_Document::ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile)
{
m_pFile = pFile;
m_bOwnFile = bOwnFile;
CPDF_SyntaxParser parser;
parser.InitParser(m_pFile, 0);
while (1) {
- bool bNumber;
+ FX_BOOL bNumber;
CFX_ByteString word = parser.GetNextWord(bNumber);
if (bNumber) {
FX_DWORD objnum = FXSYS_atoi(word);
@@ -85,10 +85,10 @@ void CFDF_Document::ParseStream(IFX_FileRead *pFile, bool bOwnFile)
}
}
}
-bool CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const
+FX_BOOL CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const
{
if (m_pRootDict == NULL) {
- return false;
+ return FALSE;
}
buf << FX_BSTRC("%FDF-1.2\r\n");
FX_POSITION pos = m_IndirectObjs.GetStartPosition();
@@ -99,7 +99,7 @@ bool CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const
buf << (FX_DWORD)objnum << FX_BSTRC(" 0 obj\r\n") << pObj << FX_BSTRC("\r\nendobj\r\n\r\n");
}
buf << FX_BSTRC("trailer\r\n<</Root ") << m_pRootDict->GetObjNum() << FX_BSTRC(" 0 R>>\r\n%%EOF\r\n");
- return true;
+ return TRUE;
}
CFX_WideString CFDF_Document::GetWin32Path() const
{
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
index f81aa73cb3..fed4546fab 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
@@ -25,7 +25,7 @@ static void my_free_func(void* opaque, void* address)
CFX_DataFilter::CFX_DataFilter()
{
- m_bEOF = false;
+ m_bEOF = FALSE;
m_pDestFilter = NULL;
m_SrcPos = 0;
}
@@ -68,14 +68,14 @@ void CFX_DataFilter::FilterFinish(CFX_BinaryBuf& dest_buf)
} else {
v_FilterFinish(dest_buf);
}
- m_bEOF = true;
+ m_bEOF = TRUE;
}
void CFX_DataFilter::ReportEOF(FX_DWORD left_input)
{
if (m_bEOF) {
return;
}
- m_bEOF = true;
+ m_bEOF = TRUE;
m_SrcPos -= left_input;
}
CFX_DataFilter* FPDF_CreateFilter(const CFX_ByteStringC& name, const CPDF_Dictionary* pParam, int width, int height)
@@ -113,9 +113,9 @@ CFX_DataFilter* FPDF_CreateFilter(const CFX_ByteStringC& name, const CPDF_Dictio
return new CPDF_RunLenFilter;
case FXBSTR_ID('C', 'C', 'I', 'T'): {
int Encoding = 0;
- int bEndOfLine = false;
- int bByteAlign = false;
- int bBlack = false;
+ int bEndOfLine = FALSE;
+ int bByteAlign = FALSE;
+ int bBlack = FALSE;
int nRows = 0;
int nColumns = 1728;
if (pParam) {
@@ -178,7 +178,7 @@ CFX_DataFilter* _FPDF_CreateFilterFromDict(CPDF_Dictionary* pDict)
}
return pFirstFilter;
}
-CPDF_StreamFilter* CPDF_Stream::GetStreamFilter(bool bRaw) const
+CPDF_StreamFilter* CPDF_Stream::GetStreamFilter(FX_BOOL bRaw) const
{
CFX_DataFilter* pFirstFilter = NULL;
if (m_pCryptoHandler) {
@@ -294,7 +294,7 @@ void CPDF_DecryptFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, C
}
void CPDF_DecryptFilter::v_FilterFinish(CFX_BinaryBuf& dest_buf)
{
- m_bEOF = true;
+ m_bEOF = TRUE;
if (m_pContext == NULL) {
return;
}
@@ -330,7 +330,7 @@ void CPDF_FlateFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX
}
}
}
-CPDF_LzwFilter::CPDF_LzwFilter(bool bEarlyChange)
+CPDF_LzwFilter::CPDF_LzwFilter(FX_BOOL bEarlyChange)
{
m_bEarlyChange = bEarlyChange ? 1 : 0;
m_CodeLen = 9;
@@ -697,7 +697,7 @@ void CPDF_RunLenFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CF
CPDF_JpegFilter::CPDF_JpegFilter()
{
m_pContext = NULL;
- m_bGotHeader = false;
+ m_bGotHeader = FALSE;
m_pScanline = NULL;
m_iLine = 0;
}
@@ -742,7 +742,7 @@ void CPDF_JpegFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_
return;
}
CPDF_ModuleMgr::Get()->GetJpegModule()->StartScanline(m_pContext, 1);
- m_bGotHeader = true;
+ m_bGotHeader = TRUE;
m_Pitch = m_Width * m_nComps;
}
if (m_pScanline == NULL) {
@@ -765,9 +765,9 @@ void CPDF_JpegFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_
CPDF_FaxFilter::CPDF_FaxFilter()
{
m_Encoding = 0;
- m_bEndOfLine = false;
- m_bByteAlign = false;
- m_bBlack = false;
+ m_bEndOfLine = FALSE;
+ m_bByteAlign = FALSE;
+ m_bBlack = FALSE;
m_nRows = 0;
m_nColumns = 0;
m_Pitch = 0;
@@ -785,7 +785,7 @@ CPDF_FaxFilter::~CPDF_FaxFilter()
FX_Free(m_pRefBuf);
}
}
-bool CPDF_FaxFilter::Initialize(int Encoding, int bEndOfLine, int bByteAlign, int bBlack, int nRows, int nColumns)
+FX_BOOL CPDF_FaxFilter::Initialize(int Encoding, int bEndOfLine, int bByteAlign, int bBlack, int nRows, int nColumns)
{
m_Encoding = Encoding;
m_bEndOfLine = bEndOfLine;
@@ -800,7 +800,7 @@ bool CPDF_FaxFilter::Initialize(int Encoding, int bEndOfLine, int bByteAlign, in
FXSYS_memset(m_pRefBuf, 0xff, m_Pitch);
m_iRow = 0;
m_InputBitPos = 0;
- return true;
+ return TRUE;
}
void CPDF_FaxFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
{
@@ -821,19 +821,19 @@ void CPDF_FaxFilter::v_FilterIn(const uint8_t* src_buf, FX_DWORD src_size, CFX_B
fax_src_size = src_size;
bitpos = 0;
}
- ProcessData(fax_src_buf, fax_src_size, bitpos, false, dest_buf);
+ ProcessData(fax_src_buf, fax_src_size, bitpos, FALSE, dest_buf);
int left_bits = fax_src_size * 8 - bitpos;
m_InputBuf.AppendBlock(fax_src_buf + bitpos / 8, (left_bits + 7) / 8);
m_InputBitPos = bitpos % 8;
}
void CPDF_FaxFilter::v_FilterFinish(CFX_BinaryBuf& dest_buf)
{
- ProcessData(m_InputBuf.GetBuffer(), m_InputBuf.GetSize(), m_InputBitPos, true, dest_buf);
+ ProcessData(m_InputBuf.GetBuffer(), m_InputBuf.GetSize(), m_InputBitPos, TRUE, dest_buf);
}
-bool _FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos);
-bool _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* dest_buf, const uint8_t* ref_buf, int columns);
-bool _FaxGet1DLine(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* dest_buf, int columns);
-void CPDF_FaxFilter::ProcessData(const uint8_t* src_buf, FX_DWORD src_size, int& bitpos, bool bFinish,
+FX_BOOL _FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos);
+FX_BOOL _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* dest_buf, const uint8_t* ref_buf, int columns);
+FX_BOOL _FaxGet1DLine(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* dest_buf, int columns);
+void CPDF_FaxFilter::ProcessData(const uint8_t* src_buf, FX_DWORD src_size, int& bitpos, FX_BOOL bFinish,
CFX_BinaryBuf& dest_buf)
{
int bitsize = src_size * 8;
@@ -863,21 +863,21 @@ void CPDF_FaxFilter::ProcessData(const uint8_t* src_buf, FX_DWORD src_size, int&
}
}
}
-bool CPDF_FaxFilter::ReadLine(const uint8_t* src_buf, int bitsize, int& bitpos)
+FX_BOOL CPDF_FaxFilter::ReadLine(const uint8_t* src_buf, int bitsize, int& bitpos)
{
if (!_FaxSkipEOL(src_buf, bitsize, bitpos)) {
- return false;
+ return FALSE;
}
- bool ret;
+ FX_BOOL ret;
if (m_Encoding < 0) {
ret = _FaxG4GetRow(src_buf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_nColumns);
} else if (m_Encoding == 0) {
ret = _FaxGet1DLine(src_buf, bitsize, bitpos, m_pScanlineBuf, m_nColumns);
} else {
if (bitpos == bitsize) {
- return false;
+ return FALSE;
}
- bool bNext1D = src_buf[bitpos / 8] & (1 << (7 - bitpos % 8));
+ FX_BOOL bNext1D = src_buf[bitpos / 8] & (1 << (7 - bitpos % 8));
bitpos ++;
if (bNext1D) {
ret = _FaxGet1DLine(src_buf, bitsize, bitpos, m_pScanlineBuf, m_nColumns);
@@ -886,14 +886,14 @@ bool CPDF_FaxFilter::ReadLine(const uint8_t* src_buf, int bitsize, int& bitpos)
}
}
if (!ret) {
- return false;
+ return FALSE;
}
if (m_bEndOfLine)
if (!_FaxSkipEOL(src_buf, bitsize, bitpos)) {
- return false;
+ return FALSE;
}
if (m_bByteAlign) {
bitpos = (bitpos + 7) / 8 * 8;
}
- return true;
+ return TRUE;
}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 96e6807102..c7d1dece25 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -180,7 +180,7 @@ void CPDF_Object::SetString(const CFX_ByteString& str)
((CPDF_Name*)this)->m_Name = str;
return;
}
- ASSERT(false);
+ ASSERT(FALSE);
}
int CPDF_Object::GetDirectType() const
{
@@ -190,13 +190,13 @@ int CPDF_Object::GetDirectType() const
CPDF_Reference* pRef = (CPDF_Reference*)this;
return pRef->m_pObjList->GetIndirectType(pRef->m_RefObjNum);
}
-bool CPDF_Object::IsIdentical(CPDF_Object* pOther) const
+FX_BOOL CPDF_Object::IsIdentical(CPDF_Object* pOther) const
{
if (this == pOther) {
- return true;
+ return TRUE;
}
if (pOther == NULL) {
- return false;
+ return FALSE;
}
if (pOther->m_Type != m_Type) {
if (m_Type == PDFOBJ_REFERENCE && GetDirect()) {
@@ -205,7 +205,7 @@ bool CPDF_Object::IsIdentical(CPDF_Object* pOther) const
if (pOther->m_Type == PDFOBJ_REFERENCE) {
return IsIdentical(pOther->GetDirect());
}
- return false;
+ return FALSE;
}
switch (m_Type) {
case PDFOBJ_BOOLEAN:
@@ -221,13 +221,13 @@ bool CPDF_Object::IsIdentical(CPDF_Object* pOther) const
case PDFOBJ_DICTIONARY:
return (((CPDF_Dictionary*)this)->Identical((CPDF_Dictionary*)pOther));
case PDFOBJ_NULL:
- return true;
+ return TRUE;
case PDFOBJ_STREAM:
return (((CPDF_Stream*)this)->Identical((CPDF_Stream*)pOther));
case PDFOBJ_REFERENCE:
return (((CPDF_Reference*)this)->Identical((CPDF_Reference*)pOther));
}
- return false;
+ return FALSE;
}
CPDF_Object* CPDF_Object::GetDirect() const
{
@@ -240,12 +240,12 @@ CPDF_Object* CPDF_Object::GetDirect() const
}
return pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
}
-CPDF_Object* CPDF_Object::Clone(bool bDirect) const
+CPDF_Object* CPDF_Object::Clone(FX_BOOL bDirect) const
{
CFX_MapPtrToPtr visited;
return CloneInternal(bDirect, &visited);
}
-CPDF_Object* CPDF_Object::CloneInternal(bool bDirect, CFX_MapPtrToPtr* visited) const
+CPDF_Object* CPDF_Object::CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const
{
switch (m_Type) {
case PDFOBJ_BOOLEAN:
@@ -284,7 +284,7 @@ CPDF_Object* CPDF_Object::CloneInternal(bool bDirect, CFX_MapPtrToPtr* visited)
case PDFOBJ_STREAM: {
CPDF_Stream* pThis = (CPDF_Stream*)this;
CPDF_StreamAcc acc;
- acc.LoadAllData(pThis, true);
+ acc.LoadAllData(pThis, TRUE);
FX_DWORD streamSize = acc.GetSize();
CPDF_Dictionary* pDict = pThis->GetDict();
if (pDict)
@@ -299,7 +299,7 @@ CPDF_Object* CPDF_Object::CloneInternal(bool bDirect, CFX_MapPtrToPtr* visited)
if (!pRef->GetDirect())
return nullptr;
- return pRef->GetDirect()->CloneInternal(true, visited);
+ return pRef->GetDirect()->CloneInternal(TRUE, visited);
}
return new CPDF_Reference(pRef->m_pObjList, obj_num);
}
@@ -320,7 +320,7 @@ CFX_WideString CPDF_Object::GetUnicodeText(CFX_CharMap* pCharMap) const
}
if (m_Type == PDFOBJ_STREAM) {
CPDF_StreamAcc stream;
- stream.LoadAllData((CPDF_Stream*)this, false);
+ stream.LoadAllData((CPDF_Stream*)this, FALSE);
CFX_WideString result = PDF_DecodeText(stream.GetData(), stream.GetSize(), pCharMap);
return result;
}
@@ -335,19 +335,19 @@ void CPDF_Object::SetUnicodeText(const FX_WCHAR* pUnicodes, int len)
((CPDF_String*)this)->m_String = PDF_EncodeText(pUnicodes, len);
} else if (m_Type == PDFOBJ_STREAM) {
CFX_ByteString result = PDF_EncodeText(pUnicodes, len);
- ((CPDF_Stream*)this)->SetData((uint8_t*)result.c_str(), result.GetLength(), false, false);
+ ((CPDF_Stream*)this)->SetData((uint8_t*)result.c_str(), result.GetLength(), FALSE, FALSE);
}
}
CPDF_Number::CPDF_Number(int value)
- : CPDF_Object(PDFOBJ_NUMBER), m_bInteger(true), m_Integer(value) {
+ : CPDF_Object(PDFOBJ_NUMBER), m_bInteger(TRUE), m_Integer(value) {
}
CPDF_Number::CPDF_Number(FX_FLOAT value)
- : CPDF_Object(PDFOBJ_NUMBER), m_bInteger(false), m_Float(value) {
+ : CPDF_Object(PDFOBJ_NUMBER), m_bInteger(FALSE), m_Float(value) {
}
-CPDF_Number::CPDF_Number(bool bInteger, void* pData)
+CPDF_Number::CPDF_Number(FX_BOOL bInteger, void* pData)
: CPDF_Object(PDFOBJ_NUMBER), m_bInteger(bInteger), m_Integer(*(int*)pData) {
}
@@ -359,7 +359,7 @@ void CPDF_Number::SetString(const CFX_ByteStringC& str)
{
FX_atonum(str, m_bInteger, &m_Integer);
}
-bool CPDF_Number::Identical(CPDF_Number* pOther) const
+FX_BOOL CPDF_Number::Identical(CPDF_Number* pOther) const
{
return m_bInteger == pOther->m_bInteger && m_Integer == pOther->m_Integer;
}
@@ -369,10 +369,10 @@ CFX_ByteString CPDF_Number::GetString() const
}
void CPDF_Number::SetNumber(FX_FLOAT value)
{
- m_bInteger = false;
+ m_bInteger = FALSE;
m_Float = value;
}
-CPDF_String::CPDF_String(const CFX_WideString& str) : CPDF_Object(PDFOBJ_STRING), m_bHex(false) {
+CPDF_String::CPDF_String(const CFX_WideString& str) : CPDF_Object(PDFOBJ_STRING), m_bHex(FALSE) {
m_String = PDF_EncodeText(str);
}
CPDF_Array::~CPDF_Array()
@@ -553,16 +553,16 @@ void CPDF_Array::AddReference(CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
ASSERT(m_Type == PDFOBJ_ARRAY);
Add(new CPDF_Reference(pDoc, objnum));
}
-bool CPDF_Array::Identical(CPDF_Array* pOther) const
+FX_BOOL CPDF_Array::Identical(CPDF_Array* pOther) const
{
if (m_Objects.GetSize() != pOther->m_Objects.GetSize()) {
- return false;
+ return FALSE;
}
for (int i = 0; i < m_Objects.GetSize(); i ++)
if (!((CPDF_Object*)m_Objects[i])->IsIdentical((CPDF_Object*)pOther->m_Objects[i])) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
CPDF_Dictionary::~CPDF_Dictionary()
{
@@ -677,7 +677,7 @@ FX_FLOAT CPDF_Dictionary::GetNumber(const CFX_ByteStringC& key) const
}
return 0;
}
-bool CPDF_Dictionary::GetBoolean(const CFX_ByteStringC& key, bool bDefault) const
+FX_BOOL CPDF_Dictionary::GetBoolean(const CFX_ByteStringC& key, FX_BOOL bDefault) const
{
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
@@ -734,7 +734,7 @@ CFX_AffineMatrix CPDF_Dictionary::GetMatrix(const CFX_ByteStringC& key) const
}
return matrix;
}
-bool CPDF_Dictionary::KeyExist(const CFX_ByteStringC& key) const
+FX_BOOL CPDF_Dictionary::KeyExist(const CFX_ByteStringC& key) const
{
void* value;
return m_Map.Lookup(key, value);
@@ -786,13 +786,13 @@ void CPDF_Dictionary::ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteSt
m_Map.RemoveKey(oldkey);
m_Map.SetAt(newkey, p);
}
-bool CPDF_Dictionary::Identical(CPDF_Dictionary* pOther) const
+FX_BOOL CPDF_Dictionary::Identical(CPDF_Dictionary* pOther) const
{
if (pOther == NULL) {
- return false;
+ return FALSE;
}
if (m_Map.GetCount() != pOther->m_Map.GetCount()) {
- return false;
+ return FALSE;
}
FX_POSITION pos = m_Map.GetStartPosition();
while (pos) {
@@ -800,12 +800,12 @@ bool CPDF_Dictionary::Identical(CPDF_Dictionary* pOther) const
void* value;
m_Map.GetNextAssoc(pos, key, value);
if (!value)
- return false;
+ return FALSE;
if (!((CPDF_Object*)value)->IsIdentical(pOther->GetElement(key))) {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
void CPDF_Dictionary::SetAtInteger(const CFX_ByteStringC& key, int i)
{
@@ -833,7 +833,7 @@ void CPDF_Dictionary::SetAtNumber(const CFX_ByteStringC& key, FX_FLOAT f)
pNumber->SetNumber(f);
SetAt(key, pNumber);
}
-void CPDF_Dictionary::SetAtBoolean(const CFX_ByteStringC& key, bool bValue)
+void CPDF_Dictionary::SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue)
{
SetAt(key, new CPDF_Boolean(bValue));
}
@@ -905,7 +905,7 @@ void CPDF_Stream::InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDi
m_pDict->SetAtInteger(FX_BSTRC("Length"), size);
}
}
-void CPDF_Stream::SetData(const uint8_t* pData, FX_DWORD size, bool bCompressed, bool bKeepBuf)
+void CPDF_Stream::SetData(const uint8_t* pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf)
{
if (m_GenNum == (FX_DWORD) - 1) {
if (m_pDataBuf) {
@@ -933,7 +933,7 @@ void CPDF_Stream::SetData(const uint8_t* pData, FX_DWORD size, bool bCompressed,
m_pDict->RemoveAt(FX_BSTRC("DecodeParms"));
}
}
-bool CPDF_Stream::ReadRawData(FX_FILESIZE offset, uint8_t* buf, FX_DWORD size) const
+FX_BOOL CPDF_Stream::ReadRawData(FX_FILESIZE offset, uint8_t* buf, FX_DWORD size) const
{
if ((m_GenNum != (FX_DWORD) - 1) && m_pFile) {
return m_pFile->ReadBlock(buf, m_FileOffset + offset, size);
@@ -941,7 +941,7 @@ bool CPDF_Stream::ReadRawData(FX_FILESIZE offset, uint8_t* buf, FX_DWORD size) c
if (m_pDataBuf) {
FXSYS_memcpy(buf, m_pDataBuf + offset, size);
}
- return true;
+ return TRUE;
}
void CPDF_Stream::InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict)
{
@@ -952,23 +952,23 @@ void CPDF_Stream::InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict)
m_pDict->SetAtInteger(FX_BSTRC("Length"), m_dwSize);
}
}
-bool CPDF_Stream::Identical(CPDF_Stream* pOther) const
+FX_BOOL CPDF_Stream::Identical(CPDF_Stream* pOther) const
{
if (!m_pDict)
- return pOther->m_pDict ? false : true;
+ return pOther->m_pDict ? FALSE : TRUE;
if (!m_pDict->Identical(pOther->m_pDict)) {
- return false;
+ return FALSE;
}
if (m_dwSize != pOther->m_dwSize) {
- return false;
+ return FALSE;
}
if (m_GenNum != (FX_DWORD) - 1 && pOther->m_GenNum != (FX_DWORD) - 1) {
if (m_pFile == pOther->m_pFile && m_pFile == NULL) {
- return true;
+ return TRUE;
}
if (!m_pFile || !pOther->m_pFile) {
- return false;
+ return FALSE;
}
uint8_t srcBuf[1024];
uint8_t destBuf[1024];
@@ -976,20 +976,20 @@ bool CPDF_Stream::Identical(CPDF_Stream* pOther) const
FX_DWORD srcOffset = m_FileOffset;
FX_DWORD destOffset = pOther->m_FileOffset;
if (m_pFile == pOther->m_pFile && srcOffset == destOffset) {
- return true;
+ return TRUE;
}
while (size > 0) {
FX_DWORD actualSize = size > 1024 ? 1024 : size;
m_pFile->ReadBlock(srcBuf, srcOffset, actualSize);
pOther->m_pFile->ReadBlock(destBuf, destOffset, actualSize);
if (FXSYS_memcmp(srcBuf, destBuf, actualSize) != 0) {
- return false;
+ return FALSE;
}
size -= actualSize;
srcOffset += actualSize;
destOffset += actualSize;
}
- return true;
+ return TRUE;
}
if (m_GenNum != (FX_DWORD) - 1 || pOther->m_GenNum != (FX_DWORD) - 1) {
IFX_FileRead* pFile = NULL;
@@ -1005,7 +1005,7 @@ bool CPDF_Stream::Identical(CPDF_Stream* pOther) const
offset = m_FileOffset;
}
if (NULL == pBuf) {
- return false;
+ return FALSE;
}
uint8_t srcBuf[1024];
FX_DWORD size = m_dwSize;
@@ -1013,17 +1013,17 @@ bool CPDF_Stream::Identical(CPDF_Stream* pOther) const
FX_DWORD actualSize = std::min(size, 1024U);
pFile->ReadBlock(srcBuf, offset, actualSize);
if (FXSYS_memcmp(srcBuf, pBuf, actualSize) != 0) {
- return false;
+ return FALSE;
}
pBuf += actualSize;
size -= actualSize;
offset += actualSize;
}
- return true;
+ return TRUE;
}
return FXSYS_memcmp(m_pDataBuf, pOther->m_pDataBuf, m_dwSize) == 0;
}
-CPDF_Stream* CPDF_Stream::Clone(bool bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const
+CPDF_Stream* CPDF_Stream::Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, void* pUserData) const
{
CPDF_Dictionary *pCloneDict = (CPDF_Dictionary*)m_pDict->Clone(bDirect);
IFX_FileStream *pFS = NULL;
@@ -1032,12 +1032,12 @@ CPDF_Stream* CPDF_Stream::Clone(bool bDirect, FPDF_LPFCloneStreamCallback lpfCal
}
if (!pFS) {
CPDF_StreamAcc acc;
- acc.LoadAllData(this, true);
+ acc.LoadAllData(this, TRUE);
FX_DWORD streamSize = acc.GetSize();
return new CPDF_Stream(acc.DetachData(), streamSize, pCloneDict);
}
CPDF_Stream* pObj = new CPDF_Stream(NULL, 0, NULL);
- CPDF_StreamFilter *pSF = GetStreamFilter(true);
+ CPDF_StreamFilter *pSF = GetStreamFilter(TRUE);
if (pSF) {
uint8_t* pBuf = FX_Alloc(uint8_t, 4096);
FX_DWORD dwRead;
@@ -1054,20 +1054,20 @@ CPDF_Stream* CPDF_Stream::Clone(bool bDirect, FPDF_LPFCloneStreamCallback lpfCal
pObj->InitStream((IFX_FileRead*)pFS, pCloneDict);
return pObj;
}
-extern bool PDF_DataDecode(const uint8_t* src_buf, FX_DWORD src_size, const CPDF_Dictionary* pDict,
+extern FX_BOOL PDF_DataDecode(const uint8_t* src_buf, FX_DWORD src_size, const CPDF_Dictionary* pDict,
uint8_t*& dest_buf, FX_DWORD& dest_size, CFX_ByteString& ImageEncoding,
- CPDF_Dictionary*& pImageParms, FX_DWORD estimated_size, bool bImageAcc);
+ CPDF_Dictionary*& pImageParms, FX_DWORD estimated_size, FX_BOOL bImageAcc);
CPDF_StreamAcc::CPDF_StreamAcc()
{
- m_bNewBuf = false;
+ m_bNewBuf = FALSE;
m_pData = NULL;
m_dwSize = 0;
m_pImageParam = NULL;
m_pStream = NULL;
m_pSrcData = NULL;
}
-void CPDF_StreamAcc::LoadAllData(const CPDF_Stream* pStream, bool bRawAccess, FX_DWORD estimated_size,
- bool bImageAcc)
+void CPDF_StreamAcc::LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess, FX_DWORD estimated_size,
+ FX_BOOL bImageAcc)
{
if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM) {
return;
@@ -1111,7 +1111,7 @@ void CPDF_StreamAcc::LoadAllData(const CPDF_Stream* pStream, bool bRawAccess, FX
m_pData = pDecryptedData;
m_dwSize = dwDecryptedSize;
} else {
- bool bRet = PDF_DataDecode(pDecryptedData, dwDecryptedSize, m_pStream->GetDict(),
+ FX_BOOL bRet = PDF_DataDecode(pDecryptedData, dwDecryptedSize, m_pStream->GetDict(),
m_pData, m_dwSize, m_ImageDecoder, m_pImageParam, estimated_size, bImageAcc);
if (!bRet) {
m_pData = pDecryptedData;
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 07f6ca783c..854be75ad4 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -13,19 +13,19 @@
#include "../../../include/fxcrt/fx_safe_types.h"
#include "../fpdf_page/pageint.h"
-bool IsSignatureDict(const CPDF_Dictionary* pDict)
+FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict)
{
CPDF_Object* pType = pDict->GetElementValue(FX_BSTRC("Type"));
if (!pType) {
pType = pDict->GetElementValue(FX_BSTRC("FT"));
if (!pType) {
- return false;
+ return FALSE;
}
}
if (pType->GetString() == FX_BSTRC("Sig")) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
static int _CompareFileSize(const void* p1, const void* p2)
{
@@ -48,13 +48,13 @@ CPDF_Parser::CPDF_Parser()
m_pLinearized = NULL;
m_dwFirstPageNo = 0;
m_dwXrefStartObjNum = 0;
- m_bOwnFileRead = true;
+ m_bOwnFileRead = TRUE;
m_FileVersion = 0;
- m_bForceUseSecurityHandler = false;
+ m_bForceUseSecurityHandler = FALSE;
}
CPDF_Parser::~CPDF_Parser()
{
- CloseParser(false);
+ CloseParser(FALSE);
}
FX_DWORD CPDF_Parser::GetLastObjNum()
{
@@ -65,9 +65,9 @@ void CPDF_Parser::SetEncryptDictionary(CPDF_Dictionary* pDict)
{
m_pEncryptDict = pDict;
}
-void CPDF_Parser::CloseParser(bool bReParse)
+void CPDF_Parser::CloseParser(FX_BOOL bReParse)
{
- m_bVersionUpdated = false;
+ m_bVersionUpdated = FALSE;
if (!bReParse) {
delete m_pDocument;
m_pDocument = NULL;
@@ -124,7 +124,7 @@ static int32_t GetHeaderOffset(IFX_FileRead* pFile)
}
return -1;
}
-FX_DWORD CPDF_Parser::StartParse(const FX_CHAR* filename, bool bReParse)
+FX_DWORD CPDF_Parser::StartParse(const FX_CHAR* filename, FX_BOOL bReParse)
{
IFX_FileRead* pFileAccess = FX_CreateFileRead(filename);
if (!pFileAccess) {
@@ -132,7 +132,7 @@ FX_DWORD CPDF_Parser::StartParse(const FX_CHAR* filename, bool bReParse)
}
return StartParse(pFileAccess, bReParse);
}
-FX_DWORD CPDF_Parser::StartParse(const FX_WCHAR* filename, bool bReParse)
+FX_DWORD CPDF_Parser::StartParse(const FX_WCHAR* filename, FX_BOOL bReParse)
{
IFX_FileRead* pFileAccess = FX_CreateFileRead(filename);
if (!pFileAccess) {
@@ -142,10 +142,10 @@ FX_DWORD CPDF_Parser::StartParse(const FX_WCHAR* filename, bool bReParse)
}
CPDF_SecurityHandler* FPDF_CreateStandardSecurityHandler();
CPDF_SecurityHandler* FPDF_CreatePubKeyHandler(void*);
-FX_DWORD CPDF_Parser::StartParse(IFX_FileRead* pFileAccess, bool bReParse, bool bOwnFileRead)
+FX_DWORD CPDF_Parser::StartParse(IFX_FileRead* pFileAccess, FX_BOOL bReParse, FX_BOOL bOwnFileRead)
{
CloseParser(bReParse);
- m_bXRefStream = false;
+ m_bXRefStream = FALSE;
m_LastXRefOffset = 0;
m_bOwnFileRead = bOwnFileRead;
int32_t offset = GetHeaderOffset(pFileAccess);
@@ -176,15 +176,15 @@ FX_DWORD CPDF_Parser::StartParse(IFX_FileRead* pFileAccess, bool bReParse, bool
if (!bReParse) {
m_pDocument = new CPDF_Document(this);
}
- bool bXRefRebuilt = false;
- if (m_Syntax.SearchWord(FX_BSTRC("startxref"), true, false, 4096)) {
+ FX_BOOL bXRefRebuilt = FALSE;
+ if (m_Syntax.SearchWord(FX_BSTRC("startxref"), TRUE, FALSE, 4096)) {
FX_FILESIZE startxref_offset = m_Syntax.SavePos();
void* pResult = FXSYS_bsearch(&startxref_offset, m_SortedOffset.GetData(), m_SortedOffset.GetSize(), sizeof(FX_FILESIZE), _CompareFileSize);
if (pResult == NULL) {
m_SortedOffset.Add(startxref_offset);
}
m_Syntax.GetKeyword();
- bool bNumber;
+ FX_BOOL bNumber;
CFX_ByteString xrefpos_str = m_Syntax.GetNextWord(bNumber);
if (!bNumber) {
return PDFPARSE_ERROR_FORMAT;
@@ -194,14 +194,14 @@ FX_DWORD CPDF_Parser::StartParse(IFX_FileRead* pFileAccess, bool bReParse, bool
if (!RebuildCrossRef()) {
return PDFPARSE_ERROR_FORMAT;
}
- bXRefRebuilt = true;
+ bXRefRebuilt = TRUE;
m_LastXRefOffset = 0;
}
} else {
if (!RebuildCrossRef()) {
return PDFPARSE_ERROR_FORMAT;
}
- bXRefRebuilt = true;
+ bXRefRebuilt = TRUE;
}
FX_DWORD dwRet = SetEncryptHandler();
if (dwRet != PDFPARSE_ERROR_SUCCESS) {
@@ -340,26 +340,26 @@ static int32_t GetDirectInteger(CPDF_Dictionary* pDict, const CFX_ByteStringC& k
}
return 0;
}
-static bool CheckDirectType(CPDF_Dictionary* pDict, const CFX_ByteStringC& key, int32_t iType)
+static FX_BOOL CheckDirectType(CPDF_Dictionary* pDict, const CFX_ByteStringC& key, int32_t iType)
{
CPDF_Object* pObj = pDict->GetElement(key);
if (!pObj) {
- return true;
+ return TRUE;
}
return pObj->GetType() == iType;
}
-bool CPDF_Parser::LoadAllCrossRefV4(FX_FILESIZE xrefpos)
+FX_BOOL CPDF_Parser::LoadAllCrossRefV4(FX_FILESIZE xrefpos)
{
- if (!LoadCrossRefV4(xrefpos, 0, true, false)) {
- return false;
+ if (!LoadCrossRefV4(xrefpos, 0, TRUE, FALSE)) {
+ return FALSE;
}
m_pTrailer = LoadTrailerV4();
if (m_pTrailer == NULL) {
- return false;
+ return FALSE;
}
int32_t xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size"));
if (xrefsize <= 0 || xrefsize > (1 << 20)) {
- return false;
+ return FALSE;
}
m_CrossRef.SetSize(xrefsize);
m_V5Type.SetSize(xrefsize);
@@ -367,51 +367,51 @@ bool CPDF_Parser::LoadAllCrossRefV4(FX_FILESIZE xrefpos)
CrossRefList.Add(xrefpos);
XRefStreamList.Add(GetDirectInteger(m_pTrailer, FX_BSTRC("XRefStm")));
if (!CheckDirectType(m_pTrailer, FX_BSTRC("Prev"), PDFOBJ_NUMBER)) {
- return false;
+ return FALSE;
}
FX_FILESIZE newxrefpos = GetDirectInteger(m_pTrailer, FX_BSTRC("Prev"));
if (newxrefpos == xrefpos) {
- return false;
+ return FALSE;
}
xrefpos = newxrefpos;
while (xrefpos) {
CrossRefList.InsertAt(0, xrefpos);
- LoadCrossRefV4(xrefpos, 0, true, false);
+ LoadCrossRefV4(xrefpos, 0, TRUE, FALSE);
CPDF_Dictionary* pDict = LoadTrailerV4();
if (pDict == NULL) {
- return false;
+ return FALSE;
}
if (!CheckDirectType(pDict, FX_BSTRC("Prev"), PDFOBJ_NUMBER)) {
pDict->Release();
- return false;
+ return FALSE;
}
newxrefpos = GetDirectInteger(pDict, FX_BSTRC("Prev"));
if (newxrefpos == xrefpos) {
pDict->Release();
- return false;
+ return FALSE;
}
xrefpos = newxrefpos;
XRefStreamList.InsertAt(0, pDict->GetInteger(FX_BSTRC("XRefStm")));
m_Trailers.Add(pDict);
}
for (int32_t i = 0; i < CrossRefList.GetSize(); i ++)
- if (!LoadCrossRefV4(CrossRefList[i], XRefStreamList[i], false, i == 0)) {
- return false;
+ if (!LoadCrossRefV4(CrossRefList[i], XRefStreamList[i], FALSE, i == 0)) {
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_Parser::LoadLinearizedAllCrossRefV4(FX_FILESIZE xrefpos, FX_DWORD dwObjCount)
+FX_BOOL CPDF_Parser::LoadLinearizedAllCrossRefV4(FX_FILESIZE xrefpos, FX_DWORD dwObjCount)
{
if (!LoadLinearizedCrossRefV4(xrefpos, dwObjCount)) {
- return false;
+ return FALSE;
}
m_pTrailer = LoadTrailerV4();
if (m_pTrailer == NULL) {
- return false;
+ return FALSE;
}
int32_t xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size"));
if (xrefsize == 0) {
- return false;
+ return FALSE;
}
CFX_FileSizeArray CrossRefList, XRefStreamList;
CrossRefList.Add(xrefpos);
@@ -419,22 +419,22 @@ bool CPDF_Parser::LoadLinearizedAllCrossRefV4(FX_FILESIZE xrefpos, FX_DWORD dwOb
xrefpos = GetDirectInteger(m_pTrailer, FX_BSTRC("Prev"));
while (xrefpos) {
CrossRefList.InsertAt(0, xrefpos);
- LoadCrossRefV4(xrefpos, 0, true, false);
+ LoadCrossRefV4(xrefpos, 0, TRUE, FALSE);
CPDF_Dictionary* pDict = LoadTrailerV4();
if (pDict == NULL) {
- return false;
+ return FALSE;
}
xrefpos = GetDirectInteger(pDict, FX_BSTRC("Prev"));
XRefStreamList.InsertAt(0, pDict->GetInteger(FX_BSTRC("XRefStm")));
m_Trailers.Add(pDict);
}
for (int32_t i = 1; i < CrossRefList.GetSize(); i ++)
- if (!LoadCrossRefV4(CrossRefList[i], XRefStreamList[i], false, i == 0)) {
- return false;
+ if (!LoadCrossRefV4(CrossRefList[i], XRefStreamList[i], FALSE, i == 0)) {
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount)
+FX_BOOL CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount)
{
FX_FILESIZE dwStartPos = pos - m_Syntax.m_HeaderOffset;
m_Syntax.RestorePos(dwStartPos);
@@ -454,11 +454,11 @@ bool CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount)
FX_DWORD dwReadSize = block_size * recordsize;
if ((FX_FILESIZE)(dwStartPos + dwReadSize) > m_Syntax.m_FileLen) {
FX_Free(pBuf);
- return false;
+ return FALSE;
}
if (!m_Syntax.ReadBlock((uint8_t*)pBuf, dwReadSize)) {
FX_Free(pBuf);
- return false;
+ return FALSE;
}
for (int32_t i = 0; i < block_size; i ++) {
FX_DWORD objnum = start_objnum + block * 1024 + i;
@@ -472,14 +472,14 @@ bool CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount)
for (int32_t c = 0; c < 10; c ++) {
if (pEntry[c] < '0' || pEntry[c] > '9') {
FX_Free(pBuf);
- return false;
+ return FALSE;
}
}
}
m_CrossRef.SetAtGrow(objnum, offset);
int32_t version = FXSYS_atoi(pEntry + 11);
if (version >= 1) {
- m_bVersionUpdated = true;
+ m_bVersionUpdated = TRUE;
}
m_ObjVersion.SetAtGrow(objnum, version);
if (m_CrossRef[objnum] < m_Syntax.m_FileLen) {
@@ -494,13 +494,13 @@ bool CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount)
}
FX_Free(pBuf);
m_Syntax.RestorePos(SavedPos + count * recordsize);
- return true;
+ return TRUE;
}
-bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bSkip, bool bFirst)
+FX_BOOL CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip, FX_BOOL bFirst)
{
m_Syntax.RestorePos(pos);
if (m_Syntax.GetKeyword() != FX_BSTRC("xref")) {
- return false;
+ return FALSE;
}
void* pResult = FXSYS_bsearch(&pos, m_SortedOffset.GetData(), m_SortedOffset.GetSize(), sizeof(FX_FILESIZE), _CompareFileSize);
if (pResult == NULL) {
@@ -514,10 +514,10 @@ bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bS
}
while (1) {
FX_FILESIZE SavedPos = m_Syntax.SavePos();
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString word = m_Syntax.GetNextWord(bIsNumber);
if (word.IsEmpty()) {
- return false;
+ return FALSE;
}
if (!bIsNumber) {
m_Syntax.RestorePos(SavedPos);
@@ -525,22 +525,22 @@ bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bS
}
FX_DWORD start_objnum = FXSYS_atoi(word);
if (start_objnum >= (1 << 20)) {
- return false;
+ return FALSE;
}
FX_DWORD count = m_Syntax.GetDirectNum();
m_Syntax.ToNextWord();
SavedPos = m_Syntax.SavePos();
- bool bFirstItem = false;
+ FX_BOOL bFirstItem = FALSE;
int32_t recordsize = 20;
if (bFirst) {
- bFirstItem = true;
+ bFirstItem = TRUE;
}
m_dwXrefStartObjNum = start_objnum;
if (!bSkip) {
char* pBuf = FX_Alloc(char, 1024 * recordsize + 1);
pBuf[1024 * recordsize] = '\0';
int32_t nBlocks = count / 1024 + 1;
- bool bFirstBlock = true;
+ FX_BOOL bFirstBlock = TRUE;
for (int32_t block = 0; block < nBlocks; block ++) {
int32_t block_size = block == nBlocks - 1 ? count % 1024 : 1024;
m_Syntax.ReadBlock((uint8_t*)pBuf, block_size * recordsize);
@@ -550,7 +550,7 @@ bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bS
if (pEntry[17] == 'f') {
if (bFirstItem) {
objnum = 0;
- bFirstItem = false;
+ bFirstItem = FALSE;
}
if (bFirstBlock) {
FX_FILESIZE offset = (FX_FILESIZE)FXSYS_atoi64(pEntry);
@@ -568,14 +568,14 @@ bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bS
for (int32_t c = 0; c < 10; c ++) {
if (pEntry[c] < '0' || pEntry[c] > '9') {
FX_Free(pBuf);
- return false;
+ return FALSE;
}
}
}
m_CrossRef.SetAtGrow(objnum, offset);
int32_t version = FXSYS_atoi(pEntry + 11);
if (version >= 1) {
- m_bVersionUpdated = true;
+ m_bVersionUpdated = TRUE;
}
m_ObjVersion.SetAtGrow(objnum, version);
if (m_CrossRef[objnum] < m_Syntax.m_FileLen) {
@@ -587,7 +587,7 @@ bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bS
m_V5Type.SetAtGrow(objnum, 1);
}
if (bFirstBlock) {
- bFirstBlock = false;
+ bFirstBlock = FALSE;
}
}
}
@@ -596,25 +596,25 @@ bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, bool bS
m_Syntax.RestorePos(SavedPos + count * recordsize);
}
if (streampos)
- if (!LoadCrossRefV5(streampos, streampos, false)) {
- return false;
+ if (!LoadCrossRefV5(streampos, streampos, FALSE)) {
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_Parser::LoadAllCrossRefV5(FX_FILESIZE xrefpos)
+FX_BOOL CPDF_Parser::LoadAllCrossRefV5(FX_FILESIZE xrefpos)
{
- if (!LoadCrossRefV5(xrefpos, xrefpos, true)) {
- return false;
+ if (!LoadCrossRefV5(xrefpos, xrefpos, TRUE)) {
+ return FALSE;
}
while (xrefpos)
- if (!LoadCrossRefV5(xrefpos, xrefpos, false)) {
- return false;
+ if (!LoadCrossRefV5(xrefpos, xrefpos, FALSE)) {
+ return FALSE;
}
- m_ObjectStreamMap.InitHashTable(101, false);
- m_bXRefStream = true;
- return true;
+ m_ObjectStreamMap.InitHashTable(101, FALSE);
+ m_bXRefStream = TRUE;
+ return TRUE;
}
-bool CPDF_Parser::RebuildCrossRef()
+FX_BOOL CPDF_Parser::RebuildCrossRef()
{
m_CrossRef.RemoveAll();
m_V5Type.RemoveAll();
@@ -633,7 +633,7 @@ bool CPDF_Parser::RebuildCrossRef()
FX_FILESIZE start_pos = 0, start_pos1 = 0;
FX_FILESIZE last_obj = -1, last_xref = -1, last_trailer = -1;
while (pos < m_Syntax.m_FileLen) {
- bool bOverFlow = false;
+ FX_BOOL bOverFlow = FALSE;
FX_DWORD size = (FX_DWORD)(m_Syntax.m_FileLen - pos);
if (size > 4096) {
size = 4096;
@@ -812,7 +812,7 @@ bool CPDF_Parser::RebuildCrossRef()
FX_FILESIZE nLen = obj_end - obj_pos - offset;
if ((FX_DWORD)nLen > size - i) {
pos = obj_end + m_Syntax.m_HeaderOffset;
- bOverFlow = true;
+ bOverFlow = TRUE;
} else {
i += (FX_DWORD)nLen;
}
@@ -822,7 +822,7 @@ bool CPDF_Parser::RebuildCrossRef()
m_CrossRef[objnum] = obj_pos;
m_ObjVersion.SetAt(objnum, (int16_t)gennum);
if (oldgen != gennum) {
- m_bVersionUpdated = true;
+ m_bVersionUpdated = TRUE;
}
}
} else {
@@ -881,7 +881,7 @@ bool CPDF_Parser::RebuildCrossRef()
FX_FILESIZE dwSavePos = m_Syntax.SavePos();
CFX_ByteString strWord = m_Syntax.GetKeyword();
if (!strWord.Compare(FX_BSTRC("startxref"))) {
- bool bNumber = false;
+ FX_BOOL bNumber = FALSE;
CFX_ByteString bsOffset = m_Syntax.GetNextWord(bNumber);
if (bNumber) {
m_LastXRefOffset = FXSYS_atoi(bsOffset);
@@ -982,7 +982,7 @@ bool CPDF_Parser::RebuildCrossRef()
m_SortedOffset.Add(offset);
}
FX_Free(buffer);
- return true;
+ return TRUE;
}
static FX_DWORD _GetVarInt(const uint8_t* p, int32_t n)
{
@@ -992,11 +992,11 @@ static FX_DWORD _GetVarInt(const uint8_t* p, int32_t n)
}
return result;
}
-bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainXRef)
+FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef)
{
CPDF_Stream* pStream = (CPDF_Stream*)ParseIndirectObjectAt(m_pDocument, pos, 0, NULL);
if (!pStream) {
- return false;
+ return FALSE;
}
if (m_pDocument) {
CPDF_Dictionary * pDict = m_pDocument->GetRoot();
@@ -1006,17 +1006,17 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainX
if (pStream->GetType() == PDFOBJ_STREAM) {
pStream->Release();
}
- return false;
+ return FALSE;
}
}
if (pStream->GetType() != PDFOBJ_STREAM) {
- return false;
+ return FALSE;
}
prev = pStream->GetDict()->GetInteger(FX_BSTRC("Prev"));
int32_t size = pStream->GetDict()->GetInteger(FX_BSTRC("Size"));
if (size < 0) {
pStream->Release();
- return false;
+ return FALSE;
}
if (bMainXRef) {
m_pTrailer = (CPDF_Dictionary*)pStream->GetDict()->Clone();
@@ -1050,7 +1050,7 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainX
pArray = pStream->GetDict()->GetArray(FX_BSTRC("W"));
if (pArray == NULL) {
pStream->Release();
- return false;
+ return FALSE;
}
CFX_DWordArray WidthArray;
FX_SAFE_DWORD dwAccWidth = 0;
@@ -1060,7 +1060,7 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainX
}
if (!dwAccWidth.IsValid() || WidthArray.GetSize() < 3) {
pStream->Release();
- return false;
+ return FALSE;
}
FX_DWORD totalWidth = dwAccWidth.ValueOrDie();
CPDF_StreamAcc acc;
@@ -1120,7 +1120,7 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainX
} else {
if (offset < 0 || offset >= m_V5Type.GetSize()) {
pStream->Release();
- return false;
+ return FALSE;
}
m_V5Type[offset] = 255;
}
@@ -1129,7 +1129,7 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, bool bMainX
segindex += count;
}
pStream->Release();
- return true;
+ return TRUE;
}
CPDF_Array* CPDF_Parser::GetIDArray()
{
@@ -1162,32 +1162,32 @@ FX_DWORD CPDF_Parser::GetInfoObjNum()
}
return ((CPDF_Reference*) pRef)->GetRefObjNum();
}
-bool CPDF_Parser::IsFormStream(FX_DWORD objnum, bool& bForm)
+FX_BOOL CPDF_Parser::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm)
{
- bForm = false;
+ bForm = FALSE;
if (objnum >= (FX_DWORD)m_CrossRef.GetSize()) {
- return true;
+ return TRUE;
}
if (m_V5Type[objnum] == 0) {
- return true;
+ return TRUE;
}
if (m_V5Type[objnum] == 2) {
- return true;
+ return TRUE;
}
FX_FILESIZE pos = m_CrossRef[objnum];
void* pResult = FXSYS_bsearch(&pos, m_SortedOffset.GetData(), m_SortedOffset.GetSize(), sizeof(FX_FILESIZE), _CompareFileSize);
if (pResult == NULL) {
- return true;
+ return TRUE;
}
if ((FX_FILESIZE*)pResult - (FX_FILESIZE*)m_SortedOffset.GetData() == m_SortedOffset.GetSize() - 1) {
- return false;
+ return FALSE;
}
FX_FILESIZE size = ((FX_FILESIZE*)pResult)[1] - pos;
FX_FILESIZE SavedPos = m_Syntax.SavePos();
m_Syntax.RestorePos(pos);
- bForm = m_Syntax.SearchMultiWord(FX_BSTRC("/Form\0stream"), true, size) == 0;
+ bForm = m_Syntax.SearchMultiWord(FX_BSTRC("/Form\0stream"), TRUE, size) == 0;
m_Syntax.RestorePos(SavedPos);
- return true;
+ return TRUE;
}
CPDF_Object* CPDF_Parser::ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext)
{
@@ -1209,7 +1209,7 @@ CPDF_Object* CPDF_Parser::ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX
int32_t n = pObjStream->GetDict()->GetInteger(FX_BSTRC("N"));
int32_t offset = pObjStream->GetDict()->GetInteger(FX_BSTRC("First"));
CPDF_SyntaxParser syntax;
- CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((uint8_t*)pObjStream->GetData(), (size_t)pObjStream->GetSize(), false));
+ CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((uint8_t*)pObjStream->GetData(), (size_t)pObjStream->GetSize(), FALSE));
syntax.InitParser(file.Get(), 0);
CPDF_Object* pRet = NULL;
while (n) {
@@ -1282,7 +1282,7 @@ void CPDF_Parser::GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD
CPDF_SyntaxParser syntax;
const uint8_t* pData = pObjStream->GetData();
FX_DWORD totalsize = pObjStream->GetSize();
- CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((uint8_t*)pData, (size_t)totalsize, false));
+ CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((uint8_t*)pData, (size_t)totalsize, FALSE));
syntax.InitParser(file.Get(), 0);
while (n) {
FX_DWORD thisnum = syntax.GetDirectNum();
@@ -1310,7 +1310,7 @@ void CPDF_Parser::GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD
}
FX_FILESIZE SavedPos = m_Syntax.SavePos();
m_Syntax.RestorePos(pos);
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString word = m_Syntax.GetNextWord(bIsNumber);
if (!bIsNumber) {
m_Syntax.RestorePos(SavedPos);
@@ -1336,16 +1336,16 @@ void CPDF_Parser::GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD
return;
}
FX_FILESIZE nextoff = ((FX_FILESIZE*)pResult)[1];
- bool bNextOffValid = false;
+ FX_BOOL bNextOffValid = FALSE;
if (nextoff != pos) {
m_Syntax.RestorePos(nextoff);
word = m_Syntax.GetNextWord(bIsNumber);
if (word == FX_BSTRC("xref")) {
- bNextOffValid = true;
+ bNextOffValid = TRUE;
} else if (bIsNumber) {
word = m_Syntax.GetNextWord(bIsNumber);
if (bIsNumber && m_Syntax.GetKeyword() == FX_BSTRC("obj")) {
- bNextOffValid = true;
+ bNextOffValid = TRUE;
}
}
}
@@ -1373,7 +1373,7 @@ CPDF_Object* CPDF_Parser::ParseIndirectObjectAt(CPDF_IndirectObjects* pObjList,
{
FX_FILESIZE SavedPos = m_Syntax.SavePos();
m_Syntax.RestorePos(pos);
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString word = m_Syntax.GetNextWord(bIsNumber);
if (!bIsNumber) {
m_Syntax.RestorePos(SavedPos);
@@ -1416,7 +1416,7 @@ CPDF_Object* CPDF_Parser::ParseIndirectObjectAtByStrict(CPDF_IndirectObjects* pO
{
FX_FILESIZE SavedPos = m_Syntax.SavePos();
m_Syntax.RestorePos(pos);
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString word = m_Syntax.GetNextWord(bIsNumber);
if (!bIsNumber) {
m_Syntax.RestorePos(SavedPos);
@@ -1458,7 +1458,7 @@ CPDF_Dictionary* CPDF_Parser::LoadTrailerV4()
}
return (CPDF_Dictionary*)pObj;
}
-FX_DWORD CPDF_Parser::GetPermissions(bool bCheckRevision)
+FX_DWORD CPDF_Parser::GetPermissions(FX_BOOL bCheckRevision)
{
if (m_pSecurityHandler == NULL) {
return (FX_DWORD) - 1;
@@ -1473,11 +1473,11 @@ FX_DWORD CPDF_Parser::GetPermissions(bool bCheckRevision)
}
return dwPermission;
}
-bool CPDF_Parser::IsOwner()
+FX_BOOL CPDF_Parser::IsOwner()
{
- return m_pSecurityHandler == NULL ? true : m_pSecurityHandler->IsOwner();
+ return m_pSecurityHandler == NULL ? TRUE : m_pSecurityHandler->IsOwner();
}
-void CPDF_Parser::SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, bool bForced)
+void CPDF_Parser::SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, FX_BOOL bForced)
{
ASSERT(m_pSecurityHandler == NULL);
if (!m_bForceUseSecurityHandler) {
@@ -1492,29 +1492,29 @@ void CPDF_Parser::SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, boo
m_Syntax.m_pCryptoHandler = pSecurityHandler->CreateCryptoHandler();
m_Syntax.m_pCryptoHandler->Init(NULL, pSecurityHandler);
}
-bool CPDF_Parser::IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset)
+FX_BOOL CPDF_Parser::IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset)
{
m_Syntax.InitParser(pFileAccess, offset);
m_Syntax.RestorePos(m_Syntax.m_HeaderOffset + 9);
FX_FILESIZE SavedPos = m_Syntax.SavePos();
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString word = m_Syntax.GetNextWord(bIsNumber);
if (!bIsNumber) {
- return false;
+ return FALSE;
}
FX_DWORD objnum = FXSYS_atoi(word);
word = m_Syntax.GetNextWord(bIsNumber);
if (!bIsNumber) {
- return false;
+ return FALSE;
}
FX_DWORD gennum = FXSYS_atoi(word);
if (m_Syntax.GetKeyword() != FX_BSTRC("obj")) {
m_Syntax.RestorePos(SavedPos);
- return false;
+ return FALSE;
}
m_pLinearized = m_Syntax.GetObject(NULL, objnum, gennum, 0);
if (!m_pLinearized) {
- return false;
+ return FALSE;
}
if (m_pLinearized->GetDict() && m_pLinearized->GetDict()->GetElement(FX_BSTRC("Linearized"))) {
m_Syntax.GetNextWord(bIsNumber);
@@ -1522,10 +1522,10 @@ bool CPDF_Parser::IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset)
if (!pLen) {
m_pLinearized->Release();
m_pLinearized = NULL;
- return false;
+ return FALSE;
}
if (pLen->GetInteger() != (int)pFileAccess->GetSize()) {
- return false;
+ return FALSE;
}
CPDF_Object *pNo = m_pLinearized->GetDict()->GetElement(FX_BSTRC("P"));
if (pNo && pNo->GetType() == PDFOBJ_NUMBER) {
@@ -1535,16 +1535,16 @@ bool CPDF_Parser::IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset)
if (pTable && pTable->GetType() == PDFOBJ_NUMBER) {
m_LastXRefOffset = pTable->GetInteger();
}
- return true;
+ return TRUE;
}
m_pLinearized->Release();
m_pLinearized = NULL;
- return false;
+ return FALSE;
}
-FX_DWORD CPDF_Parser::StartAsynParse(IFX_FileRead* pFileAccess, bool bReParse, bool bOwnFileRead)
+FX_DWORD CPDF_Parser::StartAsynParse(IFX_FileRead* pFileAccess, FX_BOOL bReParse, FX_BOOL bOwnFileRead)
{
CloseParser(bReParse);
- m_bXRefStream = false;
+ m_bXRefStream = FALSE;
m_LastXRefOffset = 0;
m_bOwnFileRead = bOwnFileRead;
int32_t offset = GetHeaderOffset(pFileAccess);
@@ -1559,19 +1559,19 @@ FX_DWORD CPDF_Parser::StartAsynParse(IFX_FileRead* pFileAccess, bool bReParse, b
m_pDocument = new CPDF_Document(this);
}
FX_FILESIZE dwFirstXRefOffset = m_Syntax.SavePos();
- bool bXRefRebuilt = false;
- bool bLoadV4 = false;
- if (!(bLoadV4 = LoadCrossRefV4(dwFirstXRefOffset, 0, false, false)) && !LoadCrossRefV5(dwFirstXRefOffset, dwFirstXRefOffset, true)) {
+ FX_BOOL bXRefRebuilt = FALSE;
+ FX_BOOL bLoadV4 = FALSE;
+ if (!(bLoadV4 = LoadCrossRefV4(dwFirstXRefOffset, 0, FALSE, FALSE)) && !LoadCrossRefV5(dwFirstXRefOffset, dwFirstXRefOffset, TRUE)) {
if (!RebuildCrossRef()) {
return PDFPARSE_ERROR_FORMAT;
}
- bXRefRebuilt = true;
+ bXRefRebuilt = TRUE;
m_LastXRefOffset = 0;
}
if (bLoadV4) {
m_pTrailer = LoadTrailerV4();
if (m_pTrailer == NULL) {
- return false;
+ return FALSE;
}
int32_t xrefsize = GetDirectInteger(m_pTrailer, FX_BSTRC("Size"));
if (xrefsize > 0) {
@@ -1623,18 +1623,18 @@ FX_DWORD CPDF_Parser::StartAsynParse(IFX_FileRead* pFileAccess, bool bReParse, b
}
return PDFPARSE_ERROR_SUCCESS;
}
-bool CPDF_Parser::LoadLinearizedAllCrossRefV5(FX_FILESIZE xrefpos)
+FX_BOOL CPDF_Parser::LoadLinearizedAllCrossRefV5(FX_FILESIZE xrefpos)
{
- if (!LoadCrossRefV5(xrefpos, xrefpos, false)) {
- return false;
+ if (!LoadCrossRefV5(xrefpos, xrefpos, FALSE)) {
+ return FALSE;
}
while (xrefpos)
- if (!LoadCrossRefV5(xrefpos, xrefpos, false)) {
- return false;
+ if (!LoadCrossRefV5(xrefpos, xrefpos, FALSE)) {
+ return FALSE;
}
- m_ObjectStreamMap.InitHashTable(101, false);
- m_bXRefStream = true;
- return true;
+ m_ObjectStreamMap.InitHashTable(101, FALSE);
+ m_bXRefStream = TRUE;
+ return TRUE;
}
FX_DWORD CPDF_Parser::LoadLinearizedMainXRefTable()
{
@@ -1688,7 +1688,7 @@ CPDF_SyntaxParser::CPDF_SyntaxParser()
m_pFileBuf = NULL;
m_MetadataObjnum = 0;
m_dwWordPos = 0;
- m_bFileStream = false;
+ m_bFileStream = FALSE;
}
CPDF_SyntaxParser::~CPDF_SyntaxParser()
{
@@ -1696,19 +1696,19 @@ CPDF_SyntaxParser::~CPDF_SyntaxParser()
FX_Free(m_pFileBuf);
}
}
-bool CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, uint8_t& ch)
+FX_BOOL CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, uint8_t& ch)
{
FX_FILESIZE save_pos = m_Pos;
m_Pos = pos;
- bool ret = GetNextChar(ch);
+ FX_BOOL ret = GetNextChar(ch);
m_Pos = save_pos;
return ret;
}
-bool CPDF_SyntaxParser::GetNextChar(uint8_t& ch)
+FX_BOOL CPDF_SyntaxParser::GetNextChar(uint8_t& ch)
{
FX_FILESIZE pos = m_Pos + m_HeaderOffset;
if (pos >= m_FileLen) {
- return false;
+ return FALSE;
}
if (m_BufOffset >= pos || (FX_FILESIZE)(m_BufOffset + m_BufSize) <= pos) {
FX_FILESIZE read_pos = pos;
@@ -1725,19 +1725,19 @@ bool CPDF_SyntaxParser::GetNextChar(uint8_t& ch)
}
}
if (!m_pFileAccess->ReadBlock(m_pFileBuf, read_pos, read_size)) {
- return false;
+ return FALSE;
}
m_BufOffset = read_pos;
}
ch = m_pFileBuf[pos - m_BufOffset];
m_Pos ++;
- return true;
+ return TRUE;
}
-bool CPDF_SyntaxParser::GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch)
+FX_BOOL CPDF_SyntaxParser::GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch)
{
pos += m_HeaderOffset;
if (pos >= m_FileLen) {
- return false;
+ return FALSE;
}
if (m_BufOffset >= pos || (FX_FILESIZE)(m_BufOffset + m_BufSize) <= pos) {
FX_FILESIZE read_pos;
@@ -1756,26 +1756,26 @@ bool CPDF_SyntaxParser::GetCharAtBackward(FX_FILESIZE pos, uint8_t& ch)
}
}
if (!m_pFileAccess->ReadBlock(m_pFileBuf, read_pos, read_size)) {
- return false;
+ return FALSE;
}
m_BufOffset = read_pos;
}
ch = m_pFileBuf[pos - m_BufOffset];
- return true;
+ return TRUE;
}
-bool CPDF_SyntaxParser::ReadBlock(uint8_t* pBuf, FX_DWORD size)
+FX_BOOL CPDF_SyntaxParser::ReadBlock(uint8_t* pBuf, FX_DWORD size)
{
if (!m_pFileAccess->ReadBlock(pBuf, m_Pos + m_HeaderOffset, size)) {
- return false;
+ return FALSE;
}
m_Pos += size;
- return true;
+ return TRUE;
}
#define MAX_WORD_BUFFER 256
void CPDF_SyntaxParser::GetNextWord()
{
m_WordSize = 0;
- m_bIsNumber = true;
+ m_bIsNumber = TRUE;
uint8_t ch;
if (!GetNextChar(ch)) {
return;
@@ -1802,7 +1802,7 @@ void CPDF_SyntaxParser::GetNextWord()
type = PDF_CharType[ch];
}
if (type == 'D') {
- m_bIsNumber = false;
+ m_bIsNumber = FALSE;
m_WordBuffer[m_WordSize++] = ch;
if (ch == '/') {
while (1) {
@@ -1844,7 +1844,7 @@ void CPDF_SyntaxParser::GetNextWord()
m_WordBuffer[m_WordSize++] = ch;
}
if (type != 'N') {
- m_bIsNumber = false;
+ m_bIsNumber = FALSE;
}
if (!GetNextChar(ch)) {
return;
@@ -1950,7 +1950,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString()
return CFX_ByteString();
}
CFX_BinaryBuf buf;
- bool bFirst = true;
+ FX_BOOL bFirst = TRUE;
uint8_t code = 0;
while (1) {
if (ch == '>') {
@@ -2036,7 +2036,7 @@ void CPDF_SyntaxParser::ToNextWord()
}
m_Pos --;
}
-CFX_ByteString CPDF_SyntaxParser::GetNextWord(bool& bIsNumber)
+CFX_ByteString CPDF_SyntaxParser::GetNextWord(FX_BOOL& bIsNumber)
{
GetNextWord();
bIsNumber = m_bIsNumber;
@@ -2047,15 +2047,15 @@ CFX_ByteString CPDF_SyntaxParser::GetKeyword()
GetNextWord();
return CFX_ByteString((const FX_CHAR*)m_WordBuffer, m_WordSize);
}
-CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, PARSE_CONTEXT* pContext, bool bDecrypt)
+CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, PARSE_CONTEXT* pContext, FX_BOOL bDecrypt)
{
CFX_AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth) {
return NULL;
}
FX_FILESIZE SavedPos = m_Pos;
- bool bTypeOnly = pContext && (pContext->m_Flags & PDFPARSE_TYPEONLY);
- bool bIsNumber;
+ FX_BOOL bTypeOnly = pContext && (pContext->m_Flags & PDFPARSE_TYPEONLY);
+ FX_BOOL bIsNumber;
CFX_ByteString word = GetNextWord(bIsNumber);
if (word.GetLength() == 0) {
if (bTypeOnly) {
@@ -2102,7 +2102,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO
if (m_pCryptoHandler && bDecrypt) {
m_pCryptoHandler->Decrypt(objnum, gennum, str);
}
- return CPDF_String::Create(str, false);
+ return CPDF_String::Create(str, FALSE);
}
if (word == FX_BSTRC("<")) {
if (bTypeOnly) {
@@ -2112,7 +2112,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO
if (m_pCryptoHandler && bDecrypt) {
m_pCryptoHandler->Decrypt(objnum, gennum, str);
}
- return CPDF_String::Create(str, true);
+ return CPDF_String::Create(str, TRUE);
}
if (word == FX_BSTRC("[")) {
if (bTypeOnly) {
@@ -2145,7 +2145,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO
int32_t nKeys = 0;
FX_FILESIZE dwSignValuePos = 0;
while (1) {
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString key = GetNextWord(bIsNumber);
if (key.IsEmpty()) {
if (pDict)
@@ -2183,7 +2183,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO
if (IsSignatureDict(pDict)) {
FX_FILESIZE dwSavePos = m_Pos;
m_Pos = dwSignValuePos;
- CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, NULL, false);
+ CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, NULL, FALSE);
pDict->SetAt(FX_BSTRC("Contents"), pObj);
m_Pos = dwSavePos;
}
@@ -2194,7 +2194,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO
}
}
FX_FILESIZE SavedPos = m_Pos;
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString nextword = GetNextWord(bIsNumber);
if (nextword == FX_BSTRC("stream")) {
CPDF_Stream* pStream = ReadStream(pDict, pContext, objnum, gennum);
@@ -2225,8 +2225,8 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(CPDF_IndirectObjects* pObjList
return NULL;
}
FX_FILESIZE SavedPos = m_Pos;
- bool bTypeOnly = pContext && (pContext->m_Flags & PDFPARSE_TYPEONLY);
- bool bIsNumber;
+ FX_BOOL bTypeOnly = pContext && (pContext->m_Flags & PDFPARSE_TYPEONLY);
+ FX_BOOL bIsNumber;
CFX_ByteString word = GetNextWord(bIsNumber);
if (word.GetLength() == 0) {
if (bTypeOnly) {
@@ -2273,7 +2273,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(CPDF_IndirectObjects* pObjList
if (m_pCryptoHandler) {
m_pCryptoHandler->Decrypt(objnum, gennum, str);
}
- return CPDF_String::Create(str, false);
+ return CPDF_String::Create(str, FALSE);
}
if (word == FX_BSTRC("<")) {
if (bTypeOnly) {
@@ -2283,7 +2283,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(CPDF_IndirectObjects* pObjList
if (m_pCryptoHandler) {
m_pCryptoHandler->Decrypt(objnum, gennum, str);
}
- return CPDF_String::Create(str, true);
+ return CPDF_String::Create(str, TRUE);
}
if (word == FX_BSTRC("[")) {
if (bTypeOnly) {
@@ -2319,7 +2319,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(CPDF_IndirectObjects* pObjList
}
CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
while (1) {
- bool bIsNumber;
+ FX_BOOL bIsNumber;
FX_FILESIZE SavedPos = m_Pos;
CFX_ByteString key = GetNextWord(bIsNumber);
if (key.IsEmpty()) {
@@ -2366,7 +2366,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(CPDF_IndirectObjects* pObjList
}
}
FX_FILESIZE SavedPos = m_Pos;
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString nextword = GetNextWord(bIsNumber);
if (nextword == FX_BSTRC("stream")) {
CPDF_Stream* pStream = ReadStream(pDict, pContext, objnum, gennum);
@@ -2495,32 +2495,32 @@ int32_t CPDF_SyntaxParser::GetDirectNum()
m_WordBuffer[m_WordSize] = 0;
return FXSYS_atoi((const FX_CHAR*)m_WordBuffer);
}
-bool CPDF_SyntaxParser::IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, const uint8_t* tag, FX_DWORD taglen)
+FX_BOOL CPDF_SyntaxParser::IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, const uint8_t* tag, FX_DWORD taglen)
{
uint8_t type = PDF_CharType[tag[0]];
- bool bCheckLeft = type != 'D' && type != 'W';
+ FX_BOOL bCheckLeft = type != 'D' && type != 'W';
type = PDF_CharType[tag[taglen - 1]];
- bool bCheckRight = type != 'D' && type != 'W';
+ FX_BOOL bCheckRight = type != 'D' && type != 'W';
uint8_t ch;
if (bCheckRight && startpos + (int32_t)taglen <= limit && GetCharAt(startpos + (int32_t)taglen, ch)) {
uint8_t type = PDF_CharType[ch];
if (type == 'N' || type == 'R') {
- return false;
+ return FALSE;
}
}
if (bCheckLeft && startpos > 0 && GetCharAt(startpos - 1, ch)) {
uint8_t type = PDF_CharType[ch];
if (type == 'N' || type == 'R') {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
-bool CPDF_SyntaxParser::SearchWord(const CFX_ByteStringC& tag, bool bWholeWord, bool bForward, FX_FILESIZE limit)
+FX_BOOL CPDF_SyntaxParser::SearchWord(const CFX_ByteStringC& tag, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit)
{
int32_t taglen = tag.GetLength();
if (taglen == 0) {
- return false;
+ return FALSE;
}
FX_FILESIZE pos = m_Pos;
int32_t offset = 0;
@@ -2533,20 +2533,20 @@ bool CPDF_SyntaxParser::SearchWord(const CFX_ByteStringC& tag, bool bWholeWord,
if (bForward) {
if (limit) {
if (pos >= m_Pos + limit) {
- return false;
+ return FALSE;
}
}
if (!GetCharAt(pos, byte)) {
- return false;
+ return FALSE;
}
} else {
if (limit) {
if (pos <= m_Pos - limit) {
- return false;
+ return FALSE;
}
}
if (!GetCharAtBackward(pos, byte)) {
- return false;
+ return FALSE;
}
}
if (byte == tag_data[offset]) {
@@ -2566,7 +2566,7 @@ bool CPDF_SyntaxParser::SearchWord(const CFX_ByteStringC& tag, bool bWholeWord,
FX_FILESIZE startpos = bForward ? pos - taglen + 1 : pos;
if (!bWholeWord || IsWholeWord(startpos, limit, tag.GetPtr(), taglen)) {
m_Pos = startpos;
- return true;
+ return TRUE;
}
}
if (bForward) {
@@ -2577,17 +2577,17 @@ bool CPDF_SyntaxParser::SearchWord(const CFX_ByteStringC& tag, bool bWholeWord,
pos --;
}
if (pos < 0) {
- return false;
+ return FALSE;
}
}
- return false;
+ return FALSE;
}
struct _SearchTagRecord {
const uint8_t* m_pTag;
FX_DWORD m_Len;
FX_DWORD m_Offset;
};
-int32_t CPDF_SyntaxParser::SearchMultiWord(const CFX_ByteStringC& tags, bool bWholeWord, FX_FILESIZE limit)
+int32_t CPDF_SyntaxParser::SearchMultiWord(const CFX_ByteStringC& tags, FX_BOOL bWholeWord, FX_FILESIZE limit)
{
int32_t ntags = 1, i;
for (i = 0; i < tags.GetLength(); i ++)
@@ -2695,17 +2695,17 @@ public:
CPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRead);
~CPDF_DataAvail();
- virtual bool IsDocAvail(IFX_DownloadHints* pHints) override;
+ virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) override;
virtual void SetDocument(CPDF_Document* pDoc) override;
- virtual bool IsPageAvail(int iPage, IFX_DownloadHints* pHints) override;
+ virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) override;
virtual int32_t IsFormAvail(IFX_DownloadHints *pHints) override;
virtual int32_t IsLinearizedPDF() override;
- virtual bool IsLinearized() override
+ virtual FX_BOOL IsLinearized() override
{
return m_bLinearized;
}
@@ -2717,52 +2717,52 @@ protected:
static int s_CurrentDataAvailRecursionDepth;
FX_DWORD GetObjectSize(FX_DWORD objnum, FX_FILESIZE& offset);
- bool IsObjectsAvail(CFX_PtrArray& obj_array, bool bParsePage, IFX_DownloadHints* pHints, CFX_PtrArray &ret_array);
- bool CheckDocStatus(IFX_DownloadHints *pHints);
- bool CheckHeader(IFX_DownloadHints* pHints);
- bool CheckFirstPage(IFX_DownloadHints *pHints);
- bool CheckEnd(IFX_DownloadHints *pHints);
- bool CheckCrossRef(IFX_DownloadHints* pHints);
- bool CheckCrossRefItem(IFX_DownloadHints *pHints);
- bool CheckTrailer(IFX_DownloadHints* pHints);
- bool CheckRoot(IFX_DownloadHints* pHints);
- bool CheckInfo(IFX_DownloadHints* pHints);
- bool CheckPages(IFX_DownloadHints* pHints);
- bool CheckPage(IFX_DownloadHints* pHints);
- bool CheckResources(IFX_DownloadHints* pHints);
- bool CheckAnnots(IFX_DownloadHints* pHints);
- bool CheckAcroForm(IFX_DownloadHints* pHints);
- bool CheckAcroFormSubObject(IFX_DownloadHints* pHints);
- bool CheckTrailerAppend(IFX_DownloadHints* pHints);
- bool CheckPageStatus(IFX_DownloadHints* pHints);
- bool CheckAllCrossRefStream(IFX_DownloadHints *pHints);
+ FX_BOOL IsObjectsAvail(CFX_PtrArray& obj_array, FX_BOOL bParsePage, IFX_DownloadHints* pHints, CFX_PtrArray &ret_array);
+ FX_BOOL CheckDocStatus(IFX_DownloadHints *pHints);
+ FX_BOOL CheckHeader(IFX_DownloadHints* pHints);
+ FX_BOOL CheckFirstPage(IFX_DownloadHints *pHints);
+ FX_BOOL CheckEnd(IFX_DownloadHints *pHints);
+ FX_BOOL CheckCrossRef(IFX_DownloadHints* pHints);
+ FX_BOOL CheckCrossRefItem(IFX_DownloadHints *pHints);
+ FX_BOOL CheckTrailer(IFX_DownloadHints* pHints);
+ FX_BOOL CheckRoot(IFX_DownloadHints* pHints);
+ FX_BOOL CheckInfo(IFX_DownloadHints* pHints);
+ FX_BOOL CheckPages(IFX_DownloadHints* pHints);
+ FX_BOOL CheckPage(IFX_DownloadHints* pHints);
+ FX_BOOL CheckResources(IFX_DownloadHints* pHints);
+ FX_BOOL CheckAnnots(IFX_DownloadHints* pHints);
+ FX_BOOL CheckAcroForm(IFX_DownloadHints* pHints);
+ FX_BOOL CheckAcroFormSubObject(IFX_DownloadHints* pHints);
+ FX_BOOL CheckTrailerAppend(IFX_DownloadHints* pHints);
+ FX_BOOL CheckPageStatus(IFX_DownloadHints* pHints);
+ FX_BOOL CheckAllCrossRefStream(IFX_DownloadHints *pHints);
int32_t CheckCrossRefStream(IFX_DownloadHints *pHints, FX_FILESIZE &xref_offset);
- bool IsLinearizedFile(uint8_t* pData, FX_DWORD dwLen);
+ FX_BOOL IsLinearizedFile(uint8_t* pData, FX_DWORD dwLen);
void SetStartOffset(FX_FILESIZE dwOffset);
- bool GetNextToken(CFX_ByteString &token);
- bool GetNextChar(uint8_t &ch);
+ FX_BOOL GetNextToken(CFX_ByteString &token);
+ FX_BOOL GetNextChar(uint8_t &ch);
CPDF_Object * ParseIndirectObjectAt(FX_FILESIZE pos, FX_DWORD objnum);
- CPDF_Object * GetObject(FX_DWORD objnum, IFX_DownloadHints* pHints, bool *pExistInFile);
- bool GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages);
- bool PreparePageItem();
- bool LoadPages(IFX_DownloadHints* pHints);
- bool LoadAllXref(IFX_DownloadHints* pHints);
- bool LoadAllFile(IFX_DownloadHints* pHints);
- bool CheckLinearizedData(IFX_DownloadHints* pHints);
- bool CheckFileResources(IFX_DownloadHints* pHints);
- bool CheckPageAnnots(int iPage, IFX_DownloadHints* pHints);
+ CPDF_Object * GetObject(FX_DWORD objnum, IFX_DownloadHints* pHints, FX_BOOL *pExistInFile);
+ FX_BOOL GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages);
+ FX_BOOL PreparePageItem();
+ FX_BOOL LoadPages(IFX_DownloadHints* pHints);
+ FX_BOOL LoadAllXref(IFX_DownloadHints* pHints);
+ FX_BOOL LoadAllFile(IFX_DownloadHints* pHints);
+ FX_BOOL CheckLinearizedData(IFX_DownloadHints* pHints);
+ FX_BOOL CheckFileResources(IFX_DownloadHints* pHints);
+ FX_BOOL CheckPageAnnots(int iPage, IFX_DownloadHints* pHints);
- bool CheckLinearizedFirstPage(int iPage, IFX_DownloadHints* pHints);
- bool HaveResourceAncestor(CPDF_Dictionary *pDict);
- bool CheckPage(int32_t iPage, IFX_DownloadHints* pHints);
- bool LoadDocPages(IFX_DownloadHints* pHints);
- bool LoadDocPage(int32_t iPage, IFX_DownloadHints* pHints);
- bool CheckPageNode(CPDF_PageNode &pageNodes, int32_t iPage, int32_t &iCount, IFX_DownloadHints* pHints);
- bool CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints);
- bool CheckArrayPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints);
- bool CheckPageCount(IFX_DownloadHints* pHints);
- bool IsFirstCheck(int iPage);
+ FX_BOOL CheckLinearizedFirstPage(int iPage, IFX_DownloadHints* pHints);
+ FX_BOOL HaveResourceAncestor(CPDF_Dictionary *pDict);
+ FX_BOOL CheckPage(int32_t iPage, IFX_DownloadHints* pHints);
+ FX_BOOL LoadDocPages(IFX_DownloadHints* pHints);
+ FX_BOOL LoadDocPage(int32_t iPage, IFX_DownloadHints* pHints);
+ FX_BOOL CheckPageNode(CPDF_PageNode &pageNodes, int32_t iPage, int32_t &iCount, IFX_DownloadHints* pHints);
+ FX_BOOL CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints);
+ FX_BOOL CheckArrayPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints);
+ FX_BOOL CheckPageCount(IFX_DownloadHints* pHints);
+ FX_BOOL IsFirstCheck(int iPage);
void ResetFirstCheck(int iPage);
CPDF_Parser m_parser;
@@ -2779,7 +2779,7 @@ protected:
CPDF_Object *m_pTrailer;
- bool m_bDocAvail;
+ FX_BOOL m_bDocAvail;
FX_FILESIZE m_dwHeaderOffset;
@@ -2823,31 +2823,31 @@ protected:
FX_DWORD m_PagesObjNum;
- bool m_bLinearized;
+ FX_BOOL m_bLinearized;
FX_DWORD m_dwFirstPageNo;
- bool m_bLinearedDataOK;
+ FX_BOOL m_bLinearedDataOK;
- bool m_bMainXRefLoadTried;
+ FX_BOOL m_bMainXRefLoadTried;
- bool m_bMainXRefLoadedOK;
+ FX_BOOL m_bMainXRefLoadedOK;
- bool m_bPagesTreeLoad;
+ FX_BOOL m_bPagesTreeLoad;
- bool m_bPagesLoad;
+ FX_BOOL m_bPagesLoad;
CPDF_Parser * m_pCurrentParser;
FX_FILESIZE m_dwCurrentXRefSteam;
- bool m_bAnnotsLoad;
+ FX_BOOL m_bAnnotsLoad;
- bool m_bHaveAcroForm;
+ FX_BOOL m_bHaveAcroForm;
FX_DWORD m_dwAcroFormObjNum;
- bool m_bAcroFormLoad;
+ FX_BOOL m_bAcroFormLoad;
CPDF_Object * m_pAcroForm;
@@ -2857,11 +2857,11 @@ protected:
CPDF_Object * m_pPageResource;
- bool m_bNeedDownLoadResource;
+ FX_BOOL m_bNeedDownLoadResource;
- bool m_bPageLoadedOK;
+ FX_BOOL m_bPageLoadedOK;
- bool m_bLinearizedFormParamLoad;
+ FX_BOOL m_bLinearizedFormParamLoad;
CFX_PtrArray m_PagesArray;
@@ -2869,9 +2869,9 @@ protected:
FX_FILESIZE m_dwPrevXRefOffset;
- bool m_bTotalLoadPageTree;
+ FX_BOOL m_bTotalLoadPageTree;
- bool m_bCurPageDictLoadOK;
+ FX_BOOL m_bCurPageDictLoadOK;
CPDF_PageNode m_pageNodes;
@@ -2916,19 +2916,19 @@ CPDF_DataAvail::CPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRea
m_dwEncryptObjNum = 0;
m_dwPrevXRefOffset = 0;
m_dwLastXRefOffset = 0;
- m_bDocAvail = false;
- m_bMainXRefLoadTried = false;
- m_bDocAvail = false;
- m_bLinearized = false;
- m_bPagesLoad = false;
- m_bPagesTreeLoad = false;
- m_bMainXRefLoadedOK = false;
- m_bAnnotsLoad = false;
- m_bHaveAcroForm = false;
- m_bAcroFormLoad = false;
- m_bPageLoadedOK = false;
- m_bNeedDownLoadResource = false;
- m_bLinearizedFormParamLoad = false;
+ m_bDocAvail = FALSE;
+ m_bMainXRefLoadTried = FALSE;
+ m_bDocAvail = FALSE;
+ m_bLinearized = FALSE;
+ m_bPagesLoad = FALSE;
+ m_bPagesTreeLoad = FALSE;
+ m_bMainXRefLoadedOK = FALSE;
+ m_bAnnotsLoad = FALSE;
+ m_bHaveAcroForm = FALSE;
+ m_bAcroFormLoad = FALSE;
+ m_bPageLoadedOK = FALSE;
+ m_bNeedDownLoadResource = FALSE;
+ m_bLinearizedFormParamLoad = FALSE;
m_pLinearized = NULL;
m_pRoot = NULL;
m_pTrailer = NULL;
@@ -2938,10 +2938,10 @@ CPDF_DataAvail::CPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRea
m_pPageResource = NULL;
m_pageMapCheckState = NULL;
m_docStatus = PDF_DATAAVAIL_HEADER;
- m_parser.m_bOwnFileRead = false;
- m_bTotalLoadPageTree = false;
- m_bCurPageDictLoadOK = false;
- m_bLinearedDataOK = false;
+ m_parser.m_bOwnFileRead = FALSE;
+ m_bTotalLoadPageTree = FALSE;
+ m_bCurPageDictLoadOK = FALSE;
+ m_bLinearedDataOK = FALSE;
m_pagesLoadState = NULL;
}
CPDF_DataAvail::~CPDF_DataAvail()
@@ -2995,10 +2995,10 @@ FX_DWORD CPDF_DataAvail::GetObjectSize(FX_DWORD objnum, FX_FILESIZE& offset)
}
return 0;
}
-bool CPDF_DataAvail::IsObjectsAvail(CFX_PtrArray& obj_array, bool bParsePage, IFX_DownloadHints* pHints, CFX_PtrArray &ret_array)
+FX_BOOL CPDF_DataAvail::IsObjectsAvail(CFX_PtrArray& obj_array, FX_BOOL bParsePage, IFX_DownloadHints* pHints, CFX_PtrArray &ret_array)
{
if (!obj_array.GetSize()) {
- return true;
+ return TRUE;
}
FX_DWORD count = 0;
CFX_PtrArray new_obj_array;
@@ -3088,42 +3088,42 @@ bool CPDF_DataAvail::IsObjectsAvail(CFX_PtrArray& obj_array, bool bParsePage, IF
ret_array.Add(pObj);
}
}
- return false;
+ return FALSE;
}
obj_array.RemoveAll();
obj_array.Append(new_obj_array);
- return IsObjectsAvail(obj_array, false, pHints, ret_array);
+ return IsObjectsAvail(obj_array, FALSE, pHints, ret_array);
}
-bool CPDF_DataAvail::IsDocAvail(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::IsDocAvail(IFX_DownloadHints* pHints)
{
if (!m_dwFileLen && m_pFileRead) {
m_dwFileLen = (FX_DWORD)m_pFileRead->GetSize();
if (!m_dwFileLen) {
- return true;
+ return TRUE;
}
}
while (!m_bDocAvail) {
if (!CheckDocStatus(pHints)) {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckAcroFormSubObject(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckAcroFormSubObject(IFX_DownloadHints* pHints)
{
if (!m_objs_array.GetSize()) {
m_objs_array.RemoveAll();
m_objnum_array.RemoveAll();
CFX_PtrArray obj_array;
obj_array.Append(m_arrayAcroforms);
- bool bRet = IsObjectsAvail(obj_array, false, pHints, m_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(obj_array, FALSE, pHints, m_objs_array);
if (bRet) {
m_objs_array.RemoveAll();
}
return bRet;
}
CFX_PtrArray new_objs_array;
- bool bRet = IsObjectsAvail(m_objs_array, false, pHints, new_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(m_objs_array, FALSE, pHints, new_objs_array);
if (bRet) {
int32_t iSize = m_arrayAcroforms.GetSize();
for (int32_t i = 0; i < iSize; ++i) {
@@ -3136,26 +3136,26 @@ bool CPDF_DataAvail::CheckAcroFormSubObject(IFX_DownloadHints* pHints)
}
return bRet;
}
-bool CPDF_DataAvail::CheckAcroForm(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckAcroForm(IFX_DownloadHints* pHints)
{
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
m_pAcroForm = GetObject(m_dwAcroFormObjNum, pHints, &bExist);
if (!bExist) {
m_docStatus = PDF_DATAAVAIL_PAGETREE;
- return true;
+ return TRUE;
}
if (!m_pAcroForm) {
if (m_docStatus == PDF_DATAAVAIL_ERROR) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
m_arrayAcroforms.Add(m_pAcroForm);
m_docStatus = PDF_DATAAVAIL_PAGETREE;
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckDocStatus(IFX_DownloadHints *pHints)
+FX_BOOL CPDF_DataAvail::CheckDocStatus(IFX_DownloadHints *pHints)
{
switch (m_docStatus) {
case PDF_DATAAVAIL_HEADER:
@@ -3195,17 +3195,17 @@ bool CPDF_DataAvail::CheckDocStatus(IFX_DownloadHints *pHints)
return CheckPage(pHints);
}
m_docStatus = PDF_DATAAVAIL_PAGE_LATERLOAD;
- return true;
+ return TRUE;
case PDF_DATAAVAIL_ERROR:
return LoadAllFile(pHints);
case PDF_DATAAVAIL_PAGE_LATERLOAD:
m_docStatus = PDF_DATAAVAIL_PAGE;
default:
- m_bDocAvail = true;
- return true;
+ m_bDocAvail = TRUE;
+ return TRUE;
}
}
-bool CPDF_DataAvail::CheckPageStatus(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckPageStatus(IFX_DownloadHints* pHints)
{
switch (m_docStatus) {
case PDF_DATAAVAIL_PAGETREE:
@@ -3215,36 +3215,36 @@ bool CPDF_DataAvail::CheckPageStatus(IFX_DownloadHints* pHints)
case PDF_DATAAVAIL_ERROR:
return LoadAllFile(pHints);
default:
- m_bPagesTreeLoad = true;
- m_bPagesLoad = true;
- return true;
+ m_bPagesTreeLoad = TRUE;
+ m_bPagesLoad = TRUE;
+ return TRUE;
}
}
-bool CPDF_DataAvail::LoadAllFile(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::LoadAllFile(IFX_DownloadHints* pHints)
{
if (m_pFileAvail->IsDataAvail(0, (FX_DWORD)m_dwFileLen)) {
m_docStatus = PDF_DATAAVAIL_DONE;
- return true;
+ return TRUE;
}
pHints->AddSegment(0, (FX_DWORD)m_dwFileLen);
- return false;
+ return FALSE;
}
-bool CPDF_DataAvail::LoadAllXref(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::LoadAllXref(IFX_DownloadHints* pHints)
{
m_parser.m_Syntax.InitParser(m_pFileRead, (FX_DWORD)m_dwHeaderOffset);
- m_parser.m_bOwnFileRead = false;
+ m_parser.m_bOwnFileRead = FALSE;
if (!m_parser.LoadAllCrossRefV4(m_dwLastXRefOffset) && !m_parser.LoadAllCrossRefV5(m_dwLastXRefOffset)) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return false;
+ return FALSE;
}
FXSYS_qsort(m_parser.m_SortedOffset.GetData(), m_parser.m_SortedOffset.GetSize(), sizeof(FX_FILESIZE), _CompareFileSize);
m_dwRootObjNum = m_parser.GetRootObjNum();
m_dwInfoObjNum = m_parser.GetInfoObjNum();
m_pCurrentParser = &m_parser;
m_docStatus = PDF_DATAAVAIL_ROOT;
- return true;
+ return TRUE;
}
-CPDF_Object* CPDF_DataAvail::GetObject(FX_DWORD objnum, IFX_DownloadHints* pHints, bool *pExistInFile)
+CPDF_Object* CPDF_DataAvail::GetObject(FX_DWORD objnum, IFX_DownloadHints* pHints, FX_BOOL *pExistInFile)
{
CPDF_Object *pRet = NULL;
FX_DWORD original_size = 0;
@@ -3252,7 +3252,7 @@ CPDF_Object* CPDF_DataAvail::GetObject(FX_DWORD objnum, IFX_DownloadHints* pHint
CPDF_Parser *pParser = NULL;
if (pExistInFile) {
- *pExistInFile = true;
+ *pExistInFile = TRUE;
}
if (m_pDocument == NULL) {
@@ -3267,7 +3267,7 @@ CPDF_Object* CPDF_DataAvail::GetObject(FX_DWORD objnum, IFX_DownloadHints* pHint
pdfium::base::CheckedNumeric<FX_DWORD> size = original_size;
if (size.ValueOrDefault(0) == 0 || offset < 0 || offset >= m_dwFileLen) {
if (pExistInFile)
- *pExistInFile = false;
+ *pExistInFile = FALSE;
return NULL;
}
@@ -3298,15 +3298,15 @@ CPDF_Object* CPDF_DataAvail::GetObject(FX_DWORD objnum, IFX_DownloadHints* pHint
}
if (!pRet && pExistInFile) {
- *pExistInFile = false;
+ *pExistInFile = FALSE;
}
return pRet;
}
-bool CPDF_DataAvail::CheckInfo(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckInfo(IFX_DownloadHints* pHints)
{
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
CPDF_Object *pInfo = GetObject(m_dwInfoObjNum, pHints, &bExist);
if (!bExist) {
if (m_bHaveAcroForm) {
@@ -3314,17 +3314,17 @@ bool CPDF_DataAvail::CheckInfo(IFX_DownloadHints* pHints)
} else {
m_docStatus = PDF_DATAAVAIL_PAGETREE;
}
- return true;
+ return TRUE;
}
if (!pInfo) {
if (m_docStatus == PDF_DATAAVAIL_ERROR) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
if (m_Pos == m_dwFileLen) {
m_docStatus = PDF_DATAAVAIL_ERROR;
}
- return false;
+ return FALSE;
}
if (pInfo) {
pInfo->Release();
@@ -3334,37 +3334,37 @@ bool CPDF_DataAvail::CheckInfo(IFX_DownloadHints* pHints)
} else {
m_docStatus = PDF_DATAAVAIL_PAGETREE;
}
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckRoot(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckRoot(IFX_DownloadHints* pHints)
{
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
m_pRoot = GetObject(m_dwRootObjNum, pHints, &bExist);
if (!bExist) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
if (!m_pRoot) {
if (m_docStatus == PDF_DATAAVAIL_ERROR) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CPDF_Dictionary* pDict = m_pRoot->GetDict();
if (!pDict) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
CPDF_Reference* pRef = (CPDF_Reference*)pDict->GetElement(FX_BSTRC("Pages"));
if (pRef == NULL || pRef->GetType() != PDFOBJ_REFERENCE) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
m_PagesObjNum = pRef->GetRefObjNum();
CPDF_Reference* pAcroFormRef = (CPDF_Reference*)m_pRoot->GetDict()->GetElement(FX_BSTRC("AcroForm"));
if (pAcroFormRef && pAcroFormRef->GetType() == PDFOBJ_REFERENCE) {
- m_bHaveAcroForm = true;
+ m_bHaveAcroForm = TRUE;
m_dwAcroFormObjNum = pAcroFormRef->GetRefObjNum();
}
if (m_dwInfoObjNum) {
@@ -3376,22 +3376,22 @@ bool CPDF_DataAvail::CheckRoot(IFX_DownloadHints* pHints)
m_docStatus = PDF_DATAAVAIL_PAGETREE;
}
}
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::PreparePageItem()
+FX_BOOL CPDF_DataAvail::PreparePageItem()
{
CPDF_Dictionary *pRoot = m_pDocument->GetRoot();
CPDF_Reference* pRef = pRoot ? (CPDF_Reference*)pRoot->GetElement(FX_BSTRC("Pages")) : NULL;
if (pRef == NULL || pRef->GetType() != PDFOBJ_REFERENCE) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
m_PagesObjNum = pRef->GetRefObjNum();
m_pCurrentParser = (CPDF_Parser *)m_pDocument->GetParser();
m_docStatus = PDF_DATAAVAIL_PAGETREE;
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::IsFirstCheck(int iPage)
+FX_BOOL CPDF_DataAvail::IsFirstCheck(int iPage)
{
if (NULL == m_pageMapCheckState) {
m_pageMapCheckState = new CFX_CMapDWordToDWord();
@@ -3399,13 +3399,13 @@ bool CPDF_DataAvail::IsFirstCheck(int iPage)
FX_DWORD dwValue = 0;
if (!m_pageMapCheckState->Lookup(iPage, dwValue)) {
m_pageMapCheckState->SetAt(iPage, 1);
- return true;
+ return TRUE;
}
if (dwValue != 0) {
- return false;
+ return FALSE;
}
m_pageMapCheckState->SetAt(iPage, 1);
- return true;
+ return TRUE;
}
void CPDF_DataAvail::ResetFirstCheck(int iPage)
{
@@ -3418,13 +3418,13 @@ void CPDF_DataAvail::ResetFirstCheck(int iPage)
}
m_pageMapCheckState->SetAt(iPage, 0);
}
-bool CPDF_DataAvail::CheckPage(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckPage(IFX_DownloadHints* pHints)
{
FX_DWORD iPageObjs = m_PageObjList.GetSize();
CFX_DWordArray UnavailObjList;
for (FX_DWORD i = 0; i < iPageObjs; ++i) {
FX_DWORD dwPageObjNum = m_PageObjList.GetAt(i);
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
CPDF_Object *pObj = GetObject(dwPageObjNum, pHints, &bExist);
if (!pObj) {
if (bExist) {
@@ -3459,7 +3459,7 @@ bool CPDF_DataAvail::CheckPage(IFX_DownloadHints* pHints)
m_PageObjList.RemoveAll();
if (UnavailObjList.GetSize()) {
m_PageObjList.Append(UnavailObjList);
- return false;
+ return FALSE;
}
FX_DWORD iPages = m_PagesArray.GetSize();
for (FX_DWORD i = 0; i < iPages; i++) {
@@ -3475,7 +3475,7 @@ bool CPDF_DataAvail::CheckPage(IFX_DownloadHints* pHints)
}
m_PagesArray.RemoveAll();
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
pPages->Release();
}
@@ -3483,18 +3483,18 @@ bool CPDF_DataAvail::CheckPage(IFX_DownloadHints* pHints)
if (!m_PageObjList.GetSize()) {
m_docStatus = PDF_DATAAVAIL_DONE;
}
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages)
+FX_BOOL CPDF_DataAvail::GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages)
{
if (!pParser) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
CPDF_Dictionary* pDict = pPages->GetDict();
CPDF_Object *pKids = pDict ? pDict->GetElement(FX_BSTRC("Kids")) : NULL;
if (!pKids) {
- return true;
+ return TRUE;
}
switch (pKids->GetType()) {
case PDFOBJ_REFERENCE: {
@@ -3514,35 +3514,35 @@ bool CPDF_DataAvail::GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages)
break;
default:
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckPages(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckPages(IFX_DownloadHints* pHints)
{
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
CPDF_Object *pPages = GetObject(m_PagesObjNum, pHints, &bExist);
if (!bExist) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
if (!pPages) {
if (m_docStatus == PDF_DATAAVAIL_ERROR) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (!GetPageKids(m_pCurrentParser, pPages)) {
pPages->Release();
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
pPages->Release();
m_docStatus = PDF_DATAAVAIL_PAGE;
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckHeader(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckHeader(IFX_DownloadHints* pHints)
{
FX_DWORD req_size = 1024;
if ((FX_FILESIZE)req_size > m_dwFileLen) {
@@ -3555,34 +3555,34 @@ bool CPDF_DataAvail::CheckHeader(IFX_DownloadHints* pHints)
m_docStatus = PDF_DATAAVAIL_FIRSTPAGE;
} else {
if (m_docStatus == PDF_DATAAVAIL_ERROR) {
- return false;
+ return FALSE;
}
m_docStatus = PDF_DATAAVAIL_END;
}
- return true;
+ return TRUE;
}
pHints->AddSegment(0, req_size);
- return false;
+ return FALSE;
}
-bool CPDF_DataAvail::CheckFirstPage(IFX_DownloadHints *pHints)
+FX_BOOL CPDF_DataAvail::CheckFirstPage(IFX_DownloadHints *pHints)
{
CPDF_Dictionary* pDict = m_pLinearized->GetDict();
CPDF_Object *pEndOffSet = pDict ? pDict->GetElement(FX_BSTRC("E")) : NULL;
if (!pEndOffSet) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
CPDF_Object *pXRefOffset = pDict ? pDict->GetElement(FX_BSTRC("T")) : NULL;
if (!pXRefOffset) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
CPDF_Object *pFileLen = pDict ? pDict->GetElement(FX_BSTRC("L")) : NULL;
if (!pFileLen) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
- bool bNeedDownLoad = false;
+ FX_BOOL bNeedDownLoad = FALSE;
if (pEndOffSet->GetType() == PDFOBJ_NUMBER) {
FX_DWORD dwEnd = pEndOffSet->GetInteger();
dwEnd += 512;
@@ -3593,7 +3593,7 @@ bool CPDF_DataAvail::CheckFirstPage(IFX_DownloadHints *pHints)
int32_t iSize = dwEnd > 1024 ? dwEnd - 1024 : 0;
if (!m_pFileAvail->IsDataAvail(iStartPos, iSize)) {
pHints->AddSegment(iStartPos, iSize);
- bNeedDownLoad = true;
+ bNeedDownLoad = TRUE;
}
}
m_dwLastXRefOffset = 0;
@@ -3619,16 +3619,16 @@ bool CPDF_DataAvail::CheckFirstPage(IFX_DownloadHints *pHints)
}
if (!bNeedDownLoad && m_docStatus == PDF_DATAAVAIL_FIRSTPAGE_PREPARE) {
m_docStatus = PDF_DATAAVAIL_DONE;
- return true;
+ return TRUE;
}
m_docStatus = PDF_DATAAVAIL_FIRSTPAGE_PREPARE;
- return false;
+ return FALSE;
}
CPDF_Object * CPDF_DataAvail::ParseIndirectObjectAt(FX_FILESIZE pos, FX_DWORD objnum)
{
FX_FILESIZE SavedPos = m_syntaxParser.SavePos();
m_syntaxParser.RestorePos(pos);
- bool bIsNumber;
+ FX_BOOL bIsNumber;
CFX_ByteString word = m_syntaxParser.GetNextWord(bIsNumber);
if (!bIsNumber) {
return NULL;
@@ -3670,21 +3670,21 @@ int32_t CPDF_DataAvail::IsLinearizedPDF()
}
return PDF_NOT_LINEARIZED;
}
-bool CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, FX_DWORD dwLen)
+FX_BOOL CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, FX_DWORD dwLen)
{
- CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(pData, (size_t)dwLen, false));
+ CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(pData, (size_t)dwLen, FALSE));
int32_t offset = GetHeaderOffset(file.Get());
if (offset == -1) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
m_dwHeaderOffset = offset;
m_syntaxParser.InitParser(file.Get(), offset);
m_syntaxParser.RestorePos(m_syntaxParser.m_HeaderOffset + 9);
- bool bNumber = false;
+ FX_BOOL bNumber = FALSE;
CFX_ByteString wordObjNum = m_syntaxParser.GetNextWord(bNumber);
if (!bNumber) {
- return false;
+ return FALSE;
}
FX_DWORD objnum = FXSYS_atoi(wordObjNum);
if (m_pLinearized) {
@@ -3693,58 +3693,58 @@ bool CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, FX_DWORD dwLen)
}
m_pLinearized = ParseIndirectObjectAt(m_syntaxParser.m_HeaderOffset + 9, objnum);
if (!m_pLinearized) {
- return false;
+ return FALSE;
}
if (m_pLinearized->GetDict() && m_pLinearized->GetDict()->GetElement(FX_BSTRC("Linearized"))) {
CPDF_Object *pLen = m_pLinearized->GetDict()->GetElement(FX_BSTRC("L"));
if (!pLen) {
- return false;
+ return FALSE;
}
if ((FX_FILESIZE)pLen->GetInteger() != m_pFileRead->GetSize()) {
- return false;
+ return FALSE;
}
- m_bLinearized = true;
+ m_bLinearized = TRUE;
CPDF_Object *pNo = m_pLinearized->GetDict()->GetElement(FX_BSTRC("P"));
if (pNo && pNo->GetType() == PDFOBJ_NUMBER) {
m_dwFirstPageNo = pNo->GetInteger();
}
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDF_DataAvail::CheckEnd(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckEnd(IFX_DownloadHints* pHints)
{
FX_DWORD req_pos = (FX_DWORD)(m_dwFileLen > 1024 ? m_dwFileLen - 1024 : 0);
FX_DWORD dwSize = (FX_DWORD)(m_dwFileLen - req_pos);
if (m_pFileAvail->IsDataAvail(req_pos, dwSize)) {
uint8_t buffer[1024];
m_pFileRead->ReadBlock(buffer, req_pos, dwSize);
- CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(buffer, (size_t)dwSize, false));
+ CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(buffer, (size_t)dwSize, FALSE));
m_syntaxParser.InitParser(file.Get(), 0);
m_syntaxParser.RestorePos(dwSize - 1);
- if (m_syntaxParser.SearchWord(FX_BSTRC("startxref"), true, false, dwSize)) {
- bool bNumber;
+ if (m_syntaxParser.SearchWord(FX_BSTRC("startxref"), TRUE, FALSE, dwSize)) {
+ FX_BOOL bNumber;
m_syntaxParser.GetNextWord(bNumber);
CFX_ByteString xrefpos_str = m_syntaxParser.GetNextWord(bNumber);
if (!bNumber) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
m_dwXRefOffset = (FX_FILESIZE)FXSYS_atoi64(xrefpos_str);
if (!m_dwXRefOffset || m_dwXRefOffset > m_dwFileLen) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
m_dwLastXRefOffset = m_dwXRefOffset;
SetStartOffset(m_dwXRefOffset);
m_docStatus = PDF_DATAAVAIL_CROSSREF;
- return true;
+ return TRUE;
}
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
pHints->AddSegment(req_pos, dwSize);
- return false;
+ return FALSE;
}
int32_t CPDF_DataAvail::CheckCrossRefStream(IFX_DownloadHints* pHints, FX_FILESIZE &xref_offset)
{
@@ -3755,9 +3755,9 @@ int32_t CPDF_DataAvail::CheckCrossRefStream(IFX_DownloadHints* pHints, FX_FILESI
CFX_BinaryBuf buf(iSize);
uint8_t* pBuf = buf.GetBuffer();
m_pFileRead->ReadBlock(pBuf, m_dwCurrentXRefSteam, iSize);
- CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(pBuf, (size_t)iSize, false));
+ CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(pBuf, (size_t)iSize, FALSE));
m_parser.m_Syntax.InitParser(file.Get(), 0);
- bool bNumber = false;
+ FX_BOOL bNumber = FALSE;
CFX_ByteString objnum = m_parser.m_Syntax.GetNextWord(bNumber);
if (!bNumber) {
return -1;
@@ -3789,18 +3789,18 @@ inline void CPDF_DataAvail::SetStartOffset(FX_FILESIZE dwOffset)
m_Pos = dwOffset;
}
#define MAX_WORD_BUFFER 256
-bool CPDF_DataAvail::GetNextToken(CFX_ByteString &token)
+FX_BOOL CPDF_DataAvail::GetNextToken(CFX_ByteString &token)
{
m_WordSize = 0;
uint8_t ch;
if (!GetNextChar(ch)) {
- return false;
+ return FALSE;
}
uint8_t type = PDF_CharType[ch];
while (1) {
while (type == 'W') {
if (!GetNextChar(ch)) {
- return false;
+ return FALSE;
}
type = PDF_CharType[ch];
}
@@ -3809,7 +3809,7 @@ bool CPDF_DataAvail::GetNextToken(CFX_ByteString &token)
}
while (1) {
if (!GetNextChar(ch)) {
- return false;
+ return FALSE;
}
if (ch == '\r' || ch == '\n') {
break;
@@ -3822,14 +3822,14 @@ bool CPDF_DataAvail::GetNextToken(CFX_ByteString &token)
if (ch == '/') {
while (1) {
if (!GetNextChar(ch)) {
- return false;
+ return FALSE;
}
type = PDF_CharType[ch];
if (type != 'R' && type != 'N') {
m_Pos --;
CFX_ByteString ret(m_WordBuffer, m_WordSize);
token = ret;
- return true;
+ return TRUE;
}
if (m_WordSize < MAX_WORD_BUFFER) {
m_WordBuffer[m_WordSize++] = ch;
@@ -3837,7 +3837,7 @@ bool CPDF_DataAvail::GetNextToken(CFX_ByteString &token)
}
} else if (ch == '<') {
if (!GetNextChar(ch)) {
- return false;
+ return FALSE;
}
if (ch == '<') {
m_WordBuffer[m_WordSize++] = ch;
@@ -3846,7 +3846,7 @@ bool CPDF_DataAvail::GetNextToken(CFX_ByteString &token)
}
} else if (ch == '>') {
if (!GetNextChar(ch)) {
- return false;
+ return FALSE;
}
if (ch == '>') {
m_WordBuffer[m_WordSize++] = ch;
@@ -3856,14 +3856,14 @@ bool CPDF_DataAvail::GetNextToken(CFX_ByteString &token)
}
CFX_ByteString ret(m_WordBuffer, m_WordSize);
token = ret;
- return true;
+ return TRUE;
}
while (1) {
if (m_WordSize < MAX_WORD_BUFFER) {
m_WordBuffer[m_WordSize++] = ch;
}
if (!GetNextChar(ch)) {
- return false;
+ return FALSE;
}
type = PDF_CharType[ch];
if (type == 'D' || type == 'W') {
@@ -3873,13 +3873,13 @@ bool CPDF_DataAvail::GetNextToken(CFX_ByteString &token)
}
CFX_ByteString ret(m_WordBuffer, m_WordSize);
token = ret;
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::GetNextChar(uint8_t &ch)
+FX_BOOL CPDF_DataAvail::GetNextChar(uint8_t &ch)
{
FX_FILESIZE pos = m_Pos;
if (pos >= m_dwFileLen) {
- return false;
+ return FALSE;
}
if (m_bufferOffset >= pos || (FX_FILESIZE)(m_bufferOffset + m_bufferSize) <= pos) {
FX_FILESIZE read_pos = pos;
@@ -3891,16 +3891,16 @@ bool CPDF_DataAvail::GetNextChar(uint8_t &ch)
read_pos = m_dwFileLen - read_size;
}
if (!m_pFileRead->ReadBlock(m_bufferData, read_pos, read_size)) {
- return false;
+ return FALSE;
}
m_bufferOffset = read_pos;
m_bufferSize = read_size;
}
ch = m_bufferData[pos - m_bufferOffset];
m_Pos ++;
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckCrossRefItem(IFX_DownloadHints *pHints)
+FX_BOOL CPDF_DataAvail::CheckCrossRefItem(IFX_DownloadHints *pHints)
{
int32_t iSize = 0;
CFX_ByteString token;
@@ -3908,16 +3908,16 @@ bool CPDF_DataAvail::CheckCrossRefItem(IFX_DownloadHints *pHints)
if (!GetNextToken(token)) {
iSize = (int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512);
pHints->AddSegment(m_Pos, iSize);
- return false;
+ return FALSE;
}
if (token == "trailer") {
m_dwTrailerOffset = m_Pos;
m_docStatus = PDF_DATAAVAIL_TRAILER;
- return true;
+ return TRUE;
}
}
}
-bool CPDF_DataAvail::CheckAllCrossRefStream(IFX_DownloadHints *pHints)
+FX_BOOL CPDF_DataAvail::CheckAllCrossRefStream(IFX_DownloadHints *pHints)
{
FX_FILESIZE xref_offset = 0;
int32_t nRet = CheckCrossRefStream(pHints, xref_offset);
@@ -3928,21 +3928,21 @@ bool CPDF_DataAvail::CheckAllCrossRefStream(IFX_DownloadHints *pHints)
m_dwCurrentXRefSteam = xref_offset;
m_Pos = xref_offset;
}
- return true;
+ return TRUE;
}
if (nRet == -1) {
m_docStatus = PDF_DATAAVAIL_ERROR;
}
- return false;
+ return FALSE;
}
-bool CPDF_DataAvail::CheckCrossRef(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckCrossRef(IFX_DownloadHints* pHints)
{
int32_t iSize = 0;
CFX_ByteString token;
if (!GetNextToken(token)) {
iSize = (int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512);
pHints->AddSegment(m_Pos, iSize);
- return false;
+ return FALSE;
}
if (token == "xref") {
m_CrossOffset.InsertAt(0, m_dwXRefOffset);
@@ -3951,28 +3951,28 @@ bool CPDF_DataAvail::CheckCrossRef(IFX_DownloadHints* pHints)
iSize = (int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512);
pHints->AddSegment(m_Pos, iSize);
m_docStatus = PDF_DATAAVAIL_CROSSREF_ITEM;
- return false;
+ return FALSE;
}
if (token == "trailer") {
m_dwTrailerOffset = m_Pos;
m_docStatus = PDF_DATAAVAIL_TRAILER;
- return true;
+ return TRUE;
}
}
} else {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDF_DataAvail::CheckTrailerAppend(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckTrailerAppend(IFX_DownloadHints* pHints)
{
if (m_Pos < m_dwFileLen) {
FX_FILESIZE dwAppendPos = m_Pos + m_syntaxParser.SavePos();
int32_t iSize = (int32_t)(dwAppendPos + 512 > m_dwFileLen ? m_dwFileLen - dwAppendPos : 512);
if (!m_pFileAvail->IsDataAvail(dwAppendPos, iSize)) {
pHints->AddSegment(dwAppendPos, iSize);
- return false;
+ return FALSE;
}
}
if (m_dwPrevXRefOffset) {
@@ -3981,9 +3981,9 @@ bool CPDF_DataAvail::CheckTrailerAppend(IFX_DownloadHints* pHints)
} else {
m_docStatus = PDF_DATAAVAIL_LOADALLCRSOSSREF;
}
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints)
{
int32_t iTrailerSize = (int32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512);
if (m_pFileAvail->IsDataAvail(m_Pos, iTrailerSize)) {
@@ -3992,21 +3992,21 @@ bool CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints)
uint8_t* pBuf = buf.GetBuffer();
if (!pBuf) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
if (!m_pFileRead->ReadBlock(pBuf, m_dwTrailerOffset, iSize)) {
- return false;
+ return FALSE;
}
- CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(pBuf, (size_t)iSize, false));
+ CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(pBuf, (size_t)iSize, FALSE));
m_syntaxParser.InitParser(file.Get(), 0);
CPDF_Object *pTrailer = m_syntaxParser.GetObject(NULL, 0, 0, 0);
if (!pTrailer) {
m_Pos += m_syntaxParser.SavePos();
pHints->AddSegment(m_Pos, iTrailerSize);
- return false;
+ return FALSE;
}
if (pTrailer->GetType() != PDFOBJ_DICTIONARY) {
- return false;
+ return FALSE;
}
CPDF_Dictionary *pTrailerDict = pTrailer->GetDict();
if (pTrailerDict) {
@@ -4014,7 +4014,7 @@ bool CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints)
if (pEncrypt && pEncrypt->GetType() == PDFOBJ_REFERENCE) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
pTrailer->Release();
- return true;
+ return TRUE;
}
}
FX_DWORD xrefpos = GetDirectInteger(pTrailer->GetDict(), FX_BSTRC("Prev"));
@@ -4032,60 +4032,60 @@ bool CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints)
m_docStatus = PDF_DATAAVAIL_TRAILER_APPEND;
}
}
- return true;
+ return TRUE;
}
m_dwPrevXRefOffset = 0;
m_docStatus = PDF_DATAAVAIL_TRAILER_APPEND;
pTrailer->Release();
- return true;
+ return TRUE;
}
pHints->AddSegment(m_Pos, iTrailerSize);
- return false;
+ return FALSE;
}
-bool CPDF_DataAvail::CheckPage(int32_t iPage, IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckPage(int32_t iPage, IFX_DownloadHints* pHints)
{
- while (true) {
+ while (TRUE) {
switch (m_docStatus) {
case PDF_DATAAVAIL_PAGETREE:
if (!LoadDocPages(pHints)) {
- return false;
+ return FALSE;
}
break;
case PDF_DATAAVAIL_PAGE:
if (!LoadDocPage(iPage, pHints)) {
- return false;
+ return FALSE;
}
break;
case PDF_DATAAVAIL_ERROR:
return LoadAllFile(pHints);
default:
- m_bPagesTreeLoad = true;
- m_bPagesLoad = true;
- m_bCurPageDictLoadOK = true;
+ m_bPagesTreeLoad = TRUE;
+ m_bPagesLoad = TRUE;
+ m_bCurPageDictLoadOK = TRUE;
m_docStatus = PDF_DATAAVAIL_PAGE;
- return true;
+ return TRUE;
}
}
}
-bool CPDF_DataAvail::CheckArrayPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckArrayPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints)
{
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
CPDF_Object *pPages = GetObject(dwPageNo, pHints, &bExist);
if (!bExist) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
if (!pPages) {
if (m_docStatus == PDF_DATAAVAIL_ERROR) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
if (pPages->GetType() != PDFOBJ_ARRAY) {
pPages->Release();
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
pPageNode->m_type = PDF_PAGENODE_PAGES;
CPDF_Array* pArray = (CPDF_Array*)pPages;
@@ -4099,33 +4099,33 @@ bool CPDF_DataAvail::CheckArrayPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageN
pNode->m_dwPageNo = ((CPDF_Reference*)pKid)->GetRefObjNum();
}
pPages->Release();
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints)
{
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
CPDF_Object *pPage = GetObject(dwPageNo, pHints, &bExist);
if (!bExist) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
if (!pPage) {
if (m_docStatus == PDF_DATAAVAIL_ERROR) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
if (pPage->GetType() == PDFOBJ_ARRAY) {
pPageNode->m_dwPageNo = dwPageNo;
pPageNode->m_type = PDF_PAGENODE_ARRAY;
pPage->Release();
- return true;
+ return TRUE;
}
if (pPage->GetType() != PDFOBJ_DICTIONARY) {
pPage->Release();
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
pPageNode->m_dwPageNo = dwPageNo;
CPDF_Dictionary* pDict = pPage->GetDict();
@@ -4135,7 +4135,7 @@ bool CPDF_DataAvail::CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPage
CPDF_Object *pKids = pDict->GetElement(FX_BSTRC("Kids"));
if (!pKids) {
m_docStatus = PDF_DATAAVAIL_PAGE;
- return true;
+ return TRUE;
}
switch (pKids->GetType()) {
case PDFOBJ_REFERENCE: {
@@ -4166,17 +4166,17 @@ bool CPDF_DataAvail::CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPage
} else {
pPage->Release();
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
pPage->Release();
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, int32_t iPage, int32_t &iCount, IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, int32_t iPage, int32_t &iCount, IFX_DownloadHints* pHints)
{
int32_t iSize = pageNodes.m_childNode.GetSize();
if (iSize <= 0 || iPage >= iSize) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
for (int32_t i = 0; i < iSize; ++i) {
CPDF_PageNode *pNode = (CPDF_PageNode*)pageNodes.m_childNode.GetAt(i);
@@ -4186,7 +4186,7 @@ bool CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, int32_t iPage, int3
switch (pNode->m_type) {
case PDF_PAGENODE_UNKOWN:
if (!CheckUnkownPageNode(pNode->m_dwPageNo, pNode, pHints)) {
- return false;
+ return FALSE;
}
--i;
break;
@@ -4198,199 +4198,199 @@ bool CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, int32_t iPage, int3
break;
case PDF_PAGENODE_PAGES:
if (!CheckPageNode(*pNode, iPage, iCount, pHints)) {
- return false;
+ return FALSE;
}
break;
case PDF_PAGENODE_ARRAY:
if (!CheckArrayPageNode(pNode->m_dwPageNo, pNode, pHints)) {
- return false;
+ return FALSE;
}
--i;
break;
}
if (iPage == iCount) {
m_docStatus = PDF_DATAAVAIL_DONE;
- return true;
+ return TRUE;
}
}
- return true;
+ return TRUE;
}
-bool CPDF_DataAvail::LoadDocPage(int32_t iPage, IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::LoadDocPage(int32_t iPage, IFX_DownloadHints* pHints)
{
if (m_pDocument->GetPageCount() <= iPage || m_pDocument->m_PageList.GetAt(iPage)) {
m_docStatus = PDF_DATAAVAIL_DONE;
- return true;
+ return TRUE;
}
if (m_pageNodes.m_type == PDF_PAGENODE_PAGE) {
if (iPage == 0) {
m_docStatus = PDF_DATAAVAIL_DONE;
- return true;
+ return TRUE;
}
m_docStatus = PDF_DATAAVAIL_ERROR;
- return true;
+ return TRUE;
}
int32_t iCount = -1;
return CheckPageNode(m_pageNodes, iPage, iCount, pHints);
}
-bool CPDF_DataAvail::CheckPageCount(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckPageCount(IFX_DownloadHints* pHints)
{
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
CPDF_Object *pPages = GetObject(m_PagesObjNum, pHints, &bExist);
if (!bExist) {
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
if (!pPages) {
- return false;
+ return FALSE;
}
CPDF_Dictionary* pPagesDict = pPages->GetDict();
if (!pPagesDict) {
pPages->Release();
m_docStatus = PDF_DATAAVAIL_ERROR;
- return false;
+ return FALSE;
}
if (!pPagesDict->KeyExist(FX_BSTRC("Kids"))) {
pPages->Release();
- return true;
+ return TRUE;
}
int count = pPagesDict->GetInteger(FX_BSTRC("Count"));
if (count > 0) {
pPages->Release();
- return true;
+ return TRUE;
}
pPages->Release();
- return false;
+ return FALSE;
}
-bool CPDF_DataAvail::LoadDocPages(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::LoadDocPages(IFX_DownloadHints* pHints)
{
if (!CheckUnkownPageNode(m_PagesObjNum, &m_pageNodes, pHints)) {
- return false;
+ return FALSE;
}
if (CheckPageCount(pHints)) {
m_docStatus = PDF_DATAAVAIL_PAGE;
- return true;
+ return TRUE;
}
- m_bTotalLoadPageTree = true;
- return false;
+ m_bTotalLoadPageTree = TRUE;
+ return FALSE;
}
-bool CPDF_DataAvail::LoadPages(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::LoadPages(IFX_DownloadHints* pHints)
{
while (!m_bPagesTreeLoad) {
if (!CheckPageStatus(pHints)) {
- return false;
+ return FALSE;
}
}
if (m_bPagesLoad) {
- return true;
+ return TRUE;
}
m_pDocument->LoadPages();
- return false;
+ return FALSE;
}
-bool CPDF_DataAvail::CheckLinearizedData(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckLinearizedData(IFX_DownloadHints* pHints)
{
if (m_bLinearedDataOK) {
- return true;
+ return TRUE;
}
if (!m_bMainXRefLoadTried) {
FX_SAFE_DWORD data_size = m_dwFileLen;
data_size -= m_dwLastXRefOffset;
if (!data_size.IsValid()) {
- return false;
+ return FALSE;
}
if (!m_pFileAvail->IsDataAvail(m_dwLastXRefOffset, data_size.ValueOrDie())) {
pHints->AddSegment(m_dwLastXRefOffset, data_size.ValueOrDie());
- return false;
+ return FALSE;
}
FX_DWORD dwRet = ((CPDF_Parser *)m_pDocument->GetParser())->LoadLinearizedMainXRefTable();
- m_bMainXRefLoadTried = true;
+ m_bMainXRefLoadTried = TRUE;
if (dwRet != PDFPARSE_ERROR_SUCCESS) {
- return false;
+ return FALSE;
}
if (!PreparePageItem()) {
- return false;
+ return FALSE;
}
- m_bMainXRefLoadedOK = true;
- m_bLinearedDataOK = true;
+ m_bMainXRefLoadedOK = TRUE;
+ m_bLinearedDataOK = TRUE;
}
return m_bLinearedDataOK;
}
-bool CPDF_DataAvail::CheckPageAnnots(int32_t iPage, IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckPageAnnots(int32_t iPage, IFX_DownloadHints* pHints)
{
if (!m_objs_array.GetSize()) {
m_objs_array.RemoveAll();
m_objnum_array.RemoveAll();
CPDF_Dictionary *pPageDict = m_pDocument->GetPage(iPage);
if (!pPageDict) {
- return true;
+ return TRUE;
}
CPDF_Object *pAnnots = pPageDict->GetElement(FX_BSTRC("Annots"));
if (!pAnnots) {
- return true;
+ return TRUE;
}
CFX_PtrArray obj_array;
obj_array.Add(pAnnots);
- bool bRet = IsObjectsAvail(obj_array, false, pHints, m_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(obj_array, FALSE, pHints, m_objs_array);
if (bRet) {
m_objs_array.RemoveAll();
}
return bRet;
}
CFX_PtrArray new_objs_array;
- bool bRet = IsObjectsAvail(m_objs_array, false, pHints, new_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(m_objs_array, FALSE, pHints, new_objs_array);
m_objs_array.RemoveAll();
if (!bRet) {
m_objs_array.Append(new_objs_array);
}
return bRet;
}
-bool CPDF_DataAvail::CheckLinearizedFirstPage(int32_t iPage, IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckLinearizedFirstPage(int32_t iPage, IFX_DownloadHints* pHints)
{
if (!m_bAnnotsLoad) {
if (!CheckPageAnnots(iPage, pHints)) {
- return false;
+ return FALSE;
}
- m_bAnnotsLoad = true;
+ m_bAnnotsLoad = TRUE;
}
if (m_bAnnotsLoad) {
if (!CheckLinearizedData(pHints))
- return false;
+ return FALSE;
}
- m_bPageLoadedOK = false;
- return true;
+ m_bPageLoadedOK = FALSE;
+ return TRUE;
}
-bool CPDF_DataAvail::HaveResourceAncestor(CPDF_Dictionary *pDict)
+FX_BOOL CPDF_DataAvail::HaveResourceAncestor(CPDF_Dictionary *pDict)
{
CFX_AutoRestorer<int> restorer(&s_CurrentDataAvailRecursionDepth);
if (++s_CurrentDataAvailRecursionDepth > kMaxDataAvailRecursionDepth) {
- return false;
+ return FALSE;
}
CPDF_Object *pParent = pDict->GetElement("Parent");
if (!pParent) {
- return false;
+ return FALSE;
}
CPDF_Dictionary *pParentDict = pParent->GetDict();
if (!pParentDict) {
- return false;
+ return FALSE;
}
CPDF_Object *pRet = pParentDict->GetElement("Resources");
if (pRet) {
m_pPageResource = pRet;
- return true;
+ return TRUE;
}
return HaveResourceAncestor(pParentDict);
}
-bool CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints)
{
if (!m_pDocument) {
- return false;
+ return FALSE;
}
if (IsFirstCheck(iPage)) {
- m_bCurPageDictLoadOK = false;
- m_bPageLoadedOK = false;
- m_bAnnotsLoad = false;
- m_bNeedDownLoadResource = false;
+ m_bCurPageDictLoadOK = FALSE;
+ m_bPageLoadedOK = FALSE;
+ m_bAnnotsLoad = FALSE;
+ m_bNeedDownLoadResource = FALSE;
m_objs_array.RemoveAll();
m_objnum_array.RemoveAll();
}
@@ -4399,46 +4399,46 @@ bool CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints)
}
FX_DWORD dwPageLoad = 0;
if (m_pagesLoadState->Lookup(iPage, dwPageLoad) && dwPageLoad != 0) {
- return true;
+ return TRUE;
}
if (m_bLinearized) {
if ((FX_DWORD)iPage == m_dwFirstPageNo) {
- m_pagesLoadState->SetAt(iPage, true);
- return true;
+ m_pagesLoadState->SetAt(iPage, TRUE);
+ return TRUE;
}
if (!CheckLinearizedData(pHints)) {
- return false;
+ return FALSE;
}
if (m_bMainXRefLoadedOK) {
if (m_bTotalLoadPageTree) {
if (!LoadPages(pHints)) {
- return false;
+ return FALSE;
}
} else {
if (!m_bCurPageDictLoadOK && !CheckPage(iPage, pHints)) {
- return false;
+ return FALSE;
}
}
} else {
if (!LoadAllFile(pHints)) {
- return false;
+ return FALSE;
}
((CPDF_Parser *)m_pDocument->GetParser())->RebuildCrossRef();
ResetFirstCheck(iPage);
- return true;
+ return TRUE;
}
} else {
if (!m_bTotalLoadPageTree) {
if (!m_bCurPageDictLoadOK && !CheckPage(iPage, pHints)) {
- return false;
+ return FALSE;
}
}
}
if (m_bHaveAcroForm && !m_bAcroFormLoad) {
if (!CheckAcroFormSubObject(pHints)) {
- return false;
+ return FALSE;
}
- m_bAcroFormLoad = true;
+ m_bAcroFormLoad = TRUE;
}
if (!m_bPageLoadedOK) {
if (!m_objs_array.GetSize()) {
@@ -4447,23 +4447,23 @@ bool CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints)
m_pPageDict = m_pDocument->GetPage(iPage);
if (!m_pPageDict) {
ResetFirstCheck(iPage);
- return true;
+ return TRUE;
}
CFX_PtrArray obj_array;
obj_array.Add(m_pPageDict);
- bool bRet = IsObjectsAvail(obj_array, true, pHints, m_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(obj_array, TRUE, pHints, m_objs_array);
if (bRet) {
m_objs_array.RemoveAll();
- m_bPageLoadedOK = true;
+ m_bPageLoadedOK = TRUE;
} else {
return bRet;
}
} else {
CFX_PtrArray new_objs_array;
- bool bRet = IsObjectsAvail(m_objs_array, false, pHints, new_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(m_objs_array, FALSE, pHints, new_objs_array);
m_objs_array.RemoveAll();
if (bRet) {
- m_bPageLoadedOK = true;
+ m_bPageLoadedOK = TRUE;
} else {
m_objs_array.Append(new_objs_array);
return bRet;
@@ -4473,9 +4473,9 @@ bool CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints)
if (m_bPageLoadedOK) {
if (!m_bAnnotsLoad) {
if (!CheckPageAnnots(iPage, pHints)) {
- return false;
+ return FALSE;
}
- m_bAnnotsLoad = true;
+ m_bAnnotsLoad = TRUE;
}
}
if (m_pPageDict && !m_bNeedDownLoadResource) {
@@ -4483,37 +4483,37 @@ bool CPDF_DataAvail::IsPageAvail(int32_t iPage, IFX_DownloadHints* pHints)
if (!m_pPageResource) {
m_bNeedDownLoadResource = HaveResourceAncestor(m_pPageDict);
} else {
- m_bNeedDownLoadResource = true;
+ m_bNeedDownLoadResource = TRUE;
}
}
if (m_bNeedDownLoadResource) {
- bool bRet = CheckResources(pHints);
+ FX_BOOL bRet = CheckResources(pHints);
if (!bRet) {
- return false;
+ return FALSE;
}
- m_bNeedDownLoadResource = false;
+ m_bNeedDownLoadResource = FALSE;
}
- m_bPageLoadedOK = false;
- m_bAnnotsLoad = false;
- m_bCurPageDictLoadOK = false;
+ m_bPageLoadedOK = FALSE;
+ m_bAnnotsLoad = FALSE;
+ m_bCurPageDictLoadOK = FALSE;
ResetFirstCheck(iPage);
- m_pagesLoadState->SetAt(iPage, true);
- return true;
+ m_pagesLoadState->SetAt(iPage, TRUE);
+ return TRUE;
}
-bool CPDF_DataAvail::CheckResources(IFX_DownloadHints* pHints)
+FX_BOOL CPDF_DataAvail::CheckResources(IFX_DownloadHints* pHints)
{
if (!m_objs_array.GetSize()) {
m_objs_array.RemoveAll();
CFX_PtrArray obj_array;
obj_array.Add(m_pPageResource);
- bool bRet = IsObjectsAvail(obj_array, true, pHints, m_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(obj_array, TRUE, pHints, m_objs_array);
if (bRet) {
m_objs_array.RemoveAll();
}
return bRet;
}
CFX_PtrArray new_objs_array;
- bool bRet = IsObjectsAvail(m_objs_array, false, pHints, new_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(m_objs_array, FALSE, pHints, new_objs_array);
m_objs_array.RemoveAll();
if (!bRet) {
m_objs_array.Append(new_objs_array);
@@ -4549,10 +4549,10 @@ int32_t CPDF_DataAvail::IsFormAvail(IFX_DownloadHints *pHints)
if (!m_objs_array.GetSize()) {
m_objs_array.Add(pAcroForm->GetDict());
}
- m_bLinearizedFormParamLoad = true;
+ m_bLinearizedFormParamLoad = TRUE;
}
CFX_PtrArray new_objs_array;
- bool bRet = IsObjectsAvail(m_objs_array, false, pHints, new_objs_array);
+ FX_BOOL bRet = IsObjectsAvail(m_objs_array, FALSE, pHints, new_objs_array);
m_objs_array.RemoveAll();
if (!bRet) {
m_objs_array.Append(new_objs_array);
@@ -4568,12 +4568,12 @@ void CPDF_SortObjNumArray::AddObjNum(FX_DWORD dwObjNum)
}
m_number_array.InsertAt(iNext, dwObjNum);
}
-bool CPDF_SortObjNumArray::Find(FX_DWORD dwObjNum)
+FX_BOOL CPDF_SortObjNumArray::Find(FX_DWORD dwObjNum)
{
int32_t iNext = 0;
return BinarySearch(dwObjNum, iNext);
}
-bool CPDF_SortObjNumArray::BinarySearch(FX_DWORD value, int32_t &iNext)
+FX_BOOL CPDF_SortObjNumArray::BinarySearch(FX_DWORD value, int32_t &iNext)
{
int32_t iLow = 0;
int32_t iHigh = m_number_array.GetSize() - 1;
@@ -4581,7 +4581,7 @@ bool CPDF_SortObjNumArray::BinarySearch(FX_DWORD value, int32_t &iNext)
int32_t iMid = (iLow + iHigh) / 2;
if (m_number_array.GetAt(iMid) == value) {
iNext = iMid;
- return true;
+ return TRUE;
}
if (m_number_array.GetAt(iMid) > value) {
iHigh = iMid - 1;
@@ -4590,7 +4590,7 @@ bool CPDF_SortObjNumArray::BinarySearch(FX_DWORD value, int32_t &iNext)
}
}
iNext = iLow;
- return false;
+ return FALSE;
}
CPDF_PageNode::~CPDF_PageNode()
{
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index 76e245ad92..4903312645 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -195,7 +195,7 @@ CFX_ByteStringC CPDF_SimpleParser::GetWord()
}
return CFX_ByteStringC(pStart, dwSize);
}
-bool CPDF_SimpleParser::SearchToken(const CFX_ByteStringC& token)
+FX_BOOL CPDF_SimpleParser::SearchToken(const CFX_ByteStringC& token)
{
int token_len = token.GetLength();
while (m_dwCurPos < m_dwSize - token_len) {
@@ -205,30 +205,30 @@ bool CPDF_SimpleParser::SearchToken(const CFX_ByteStringC& token)
m_dwCurPos ++;
}
if (m_dwCurPos == m_dwSize - token_len) {
- return false;
+ return FALSE;
}
m_dwCurPos += token_len;
- return true;
+ return TRUE;
}
-bool CPDF_SimpleParser::SkipWord(const CFX_ByteStringC& token)
+FX_BOOL CPDF_SimpleParser::SkipWord(const CFX_ByteStringC& token)
{
while (1) {
CFX_ByteStringC word = GetWord();
if (word.IsEmpty()) {
- return false;
+ return FALSE;
}
if (word == token) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_SimpleParser::FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token,
+FX_BOOL CPDF_SimpleParser::FindTagPair(const CFX_ByteStringC& start_token, const CFX_ByteStringC& end_token,
FX_DWORD& start_pos, FX_DWORD& end_pos)
{
if (!start_token.IsEmpty()) {
if (!SkipWord(start_token)) {
- return false;
+ return FALSE;
}
start_pos = m_dwCurPos;
}
@@ -236,15 +236,15 @@ bool CPDF_SimpleParser::FindTagPair(const CFX_ByteStringC& start_token, const CF
end_pos = m_dwCurPos;
CFX_ByteStringC word = GetWord();
if (word.IsEmpty()) {
- return false;
+ return FALSE;
}
if (word == end_token) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_SimpleParser::FindTagParam(const CFX_ByteStringC& token, int nParams)
+FX_BOOL CPDF_SimpleParser::FindTagParam(const CFX_ByteStringC& token, int nParams)
{
nParams ++;
FX_DWORD* pBuf = FX_Alloc(FX_DWORD, nParams);
@@ -262,7 +262,7 @@ bool CPDF_SimpleParser::FindTagParam(const CFX_ByteStringC& token, int nParams)
CFX_ByteStringC word = GetWord();
if (word.IsEmpty()) {
FX_Free(pBuf);
- return false;
+ return FALSE;
}
if (word == token) {
if (buf_count < nParams) {
@@ -270,10 +270,10 @@ bool CPDF_SimpleParser::FindTagParam(const CFX_ByteStringC& token, int nParams)
}
m_dwCurPos = pBuf[buf_index];
FX_Free(pBuf);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
static int _hex2dec(char ch)
{
@@ -368,7 +368,7 @@ CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& buf, const CPDF_Object* pObj)
break;
case PDFOBJ_STRING: {
CFX_ByteString str = pObj->GetString();
- bool bHex = ((CPDF_String*)pObj)->IsHex();
+ FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
buf << PDF_EncodeString(str, bHex);
break;
}
@@ -417,13 +417,13 @@ CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& buf, const CPDF_Object* pObj)
CPDF_Stream* p = (CPDF_Stream*)pObj;
buf << p->GetDict() << FX_BSTRC("stream\r\n");
CPDF_StreamAcc acc;
- acc.LoadAllData(p, true);
+ acc.LoadAllData(p, TRUE);
buf.AppendBlock(acc.GetData(), acc.GetSize());
buf << FX_BSTRC("\r\nendstream");
break;
}
default:
- ASSERT(false);
+ ASSERT(FALSE);
break;
}
return buf;
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index a70f5bfdf9..f8b59913e4 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -18,10 +18,10 @@ CPDF_DocRenderData::CPDF_DocRenderData(CPDF_Document* pPDFDoc)
CPDF_DocRenderData::~CPDF_DocRenderData()
{
- Clear(true);
+ Clear(TRUE);
}
-void CPDF_DocRenderData::Clear(bool bRelease)
+void CPDF_DocRenderData::Clear(FX_BOOL bRelease)
{
for (auto it = m_Type3FaceMap.begin(); it != m_Type3FaceMap.end();) {
auto curr_it = it++;
@@ -48,7 +48,7 @@ void CPDF_DocRenderData::Clear(bool bRelease)
delete m_pFontCache;
m_pFontCache = NULL;
} else {
- m_pFontCache->FreeCache(false);
+ m_pFontCache->FreeCache(FALSE);
}
}
}
@@ -118,7 +118,7 @@ void CPDF_RenderModule::DestroyDocData(CPDF_DocRenderData* pDocData)
void CPDF_RenderModule::ClearDocData(CPDF_DocRenderData* p)
{
if (p) {
- p->Clear(false);
+ p->Clear(FALSE);
}
}
void CPDF_RenderModule::DestroyPageCache(CPDF_PageRenderCache* pCache)
@@ -180,19 +180,19 @@ int CPDF_RenderStatus::s_CurrentRecursionDepth = 0;
CPDF_RenderStatus::CPDF_RenderStatus()
{
m_pContext = NULL;
- m_bStopped = false;
+ m_bStopped = FALSE;
m_pDevice = NULL;
m_pCurObj = NULL;
m_pStopObj = NULL;
m_HalftoneLimit = 0;
m_pObjectRenderer = NULL;
- m_bPrint = false;
+ m_bPrint = FALSE;
m_Transparency = 0;
m_DitherBits = 0;
- m_bDropObjects = false;
- m_bStdCS = false;
+ m_bDropObjects = FALSE;
+ m_bStdCS = FALSE;
m_GroupFamily = 0;
- m_bLoadMask = false;
+ m_bLoadMask = FALSE;
m_pType3Char = NULL;
m_T3FillColor = 0;
m_pFormResource = NULL;
@@ -205,13 +205,13 @@ CPDF_RenderStatus::~CPDF_RenderStatus()
delete m_pObjectRenderer;
}
-bool CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
+FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
const CFX_AffineMatrix* pDeviceMatrix, const CPDF_PageObject* pStopObj,
const CPDF_RenderStatus* pParentState, const CPDF_GraphicStates* pInitialStates,
- const CPDF_RenderOptions* pOptions, int transparency, bool bDropObjects,
- CPDF_Dictionary* pFormResource, bool bStdCS, CPDF_Type3Char* pType3Char,
+ const CPDF_RenderOptions* pOptions, int transparency, FX_BOOL bDropObjects,
+ CPDF_Dictionary* pFormResource, FX_BOOL bStdCS, CPDF_Type3Char* pType3Char,
FX_ARGB fill_color, FX_DWORD GroupFamily,
- bool bLoadMask)
+ FX_BOOL bLoadMask)
{
m_pContext = pContext;
m_pDevice = pDevice;
@@ -253,7 +253,7 @@ bool CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevic
}
m_pObjectRenderer = NULL;
m_Transparency = transparency;
- return true;
+ return TRUE;
}
void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device)
{
@@ -267,7 +267,7 @@ void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs, const CF
index ++;
CPDF_PageObject* pCurObj = pObjs->GetNextObject(pos);
if (pCurObj == m_pStopObj) {
- m_bStopped = true;
+ m_bStopped = TRUE;
return;
}
if (!pCurObj) {
@@ -301,42 +301,42 @@ void CPDF_RenderStatus::RenderSingleObject(const CPDF_PageObject* pObj, const CF
}
ProcessObjectNoClip(pObj, pObj2Device);
}
-bool CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause)
+FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause)
{
if (m_pObjectRenderer) {
if (m_pObjectRenderer->Continue(pPause)) {
- return true;
+ return TRUE;
}
if (!m_pObjectRenderer->m_Result) {
DrawObjWithBackground(pObj, pObj2Device);
}
delete m_pObjectRenderer;
m_pObjectRenderer = NULL;
- return false;
+ return FALSE;
}
m_pCurObj = pObj;
if (m_Options.m_pOCContext && pObj->m_ContentMark.NotNull())
if (!m_Options.m_pOCContext->CheckObjectVisible(pObj)) {
- return false;
+ return FALSE;
}
ProcessClipPath(pObj->m_ClipPath, pObj2Device);
if (ProcessTransparency(pObj, pObj2Device)) {
- return false;
+ return FALSE;
}
if (pObj->m_Type == PDFPAGE_IMAGE) {
m_pObjectRenderer = IPDF_ObjectRenderer::Create(pObj->m_Type);
- if (!m_pObjectRenderer->Start(this, pObj, pObj2Device, false)) {
+ if (!m_pObjectRenderer->Start(this, pObj, pObj2Device, FALSE)) {
if (!m_pObjectRenderer->m_Result) {
DrawObjWithBackground(pObj, pObj2Device);
}
delete m_pObjectRenderer;
m_pObjectRenderer = NULL;
- return false;
+ return FALSE;
}
return ContinueSingleObject(pObj, pObj2Device, pPause);
}
ProcessObjectNoClip(pObj, pObj2Device);
- return false;
+ return FALSE;
}
IPDF_ObjectRenderer* IPDF_ObjectRenderer::Create(int type)
{
@@ -345,7 +345,7 @@ IPDF_ObjectRenderer* IPDF_ObjectRenderer::Create(int type)
}
return new CPDF_ImageRenderer;
}
-bool CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bLogical, FX_RECT &rect) const
+FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const
{
rect = pObj->GetBBox(pObj2Device);
FX_RECT rtClip = m_pDevice->GetClipBox();
@@ -370,7 +370,7 @@ void CPDF_RenderStatus::DitherObjectArea(const CPDF_PageObject* pObj, const CFX_
return;
}
FX_RECT rect;
- if (GetObjectClippedRect(pObj, pObj2Device, false, rect)) {
+ if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) {
return;
}
if (m_DitherBits == 2) {
@@ -386,7 +386,7 @@ void CPDF_RenderStatus::DitherObjectArea(const CPDF_PageObject* pObj, const CFX_
}
void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
{
- bool bRet = false;
+ FX_BOOL bRet = FALSE;
switch (pObj->m_Type) {
case PDFPAGE_TEXT:
bRet = ProcessText((CPDF_TextObject*)pObj, pObj2Device, NULL);
@@ -408,9 +408,9 @@ void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, const C
DrawObjWithBackground(pObj, pObj2Device);
}
}
-bool CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
{
- bool bRet = false;
+ FX_BOOL bRet = FALSE;
switch (pObj->m_Type) {
case PDFPAGE_PATH:
bRet = ProcessPath((CPDF_PathObject*)pObj, pObj2Device);
@@ -433,7 +433,7 @@ void CPDF_RenderStatus::GetScaledMatrix(CFX_Matrix &matrix) const
void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
{
FX_RECT rect;
- if (GetObjectClippedRect(pObj, pObj2Device, false, rect)) {
+ if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) {
return;
}
int res = 300;
@@ -459,11 +459,11 @@ void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, const
status.RenderSingleObject(pObj, &matrix);
buffer.OutputToDevice();
}
-bool CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device)
{
CPDF_Dictionary* pOC = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("OC"));
if (pOC && m_Options.m_pOCContext && !m_Options.m_pOCContext->CheckOCGVisible(pOC)) {
- return true;
+ return TRUE;
}
CFX_AffineMatrix matrix = pFormObj->m_FormMatrix;
matrix.Concat(*pObj2Device);
@@ -473,15 +473,15 @@ bool CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineM
}
CPDF_RenderStatus status;
status.Initialize(m_pContext, m_pDevice, NULL, m_pStopObj,
- this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, false);
+ this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, FALSE);
status.m_curBlend = m_curBlend;
m_pDevice->SaveState();
status.RenderObjectList(pFormObj->m_pForm, &matrix);
m_bStopped = status.m_bStopped;
m_pDevice->RestoreState();
- return true;
+ return TRUE;
}
-bool IsAvailableMatrix(const CFX_AffineMatrix& matrix)
+FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix)
{
if (matrix.a == 0 || matrix.d == 0) {
return matrix.b != 0 && matrix.c != 0;
@@ -489,15 +489,15 @@ bool IsAvailableMatrix(const CFX_AffineMatrix& matrix)
if (matrix.b == 0 || matrix.c == 0) {
return matrix.a != 0 && matrix.d != 0;
}
- return true;
+ return TRUE;
}
-bool CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device)
{
int FillType = pPathObj->m_FillType;
- bool bStroke = pPathObj->m_bStroke;
+ FX_BOOL bStroke = pPathObj->m_bStroke;
ProcessPathPattern(pPathObj, pObj2Device, FillType, bStroke);
if (FillType == 0 && !bStroke) {
- return true;
+ return TRUE;
}
FX_DWORD fill_argb = 0;
if (FillType) {
@@ -510,7 +510,7 @@ bool CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineM
CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
path_matrix.Concat(*pObj2Device);
if (!IsAvailableMatrix(path_matrix)) {
- return true;
+ return TRUE;
}
if (FillType && (m_Options.m_Flags & RENDER_RECT_AA)) {
FillType |= FXFILL_RECT_AA;
@@ -546,7 +546,7 @@ CPDF_TransferFunc* CPDF_RenderStatus::GetTransferFunc(CPDF_Object* pObj) const
}
return pDocCache->GetTransferFunc(pObj);
}
-FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, bool bType3) const
+FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3) const
{
CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState;
if (m_pType3Char && !bType3 && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_FillColor.IsNull())))) {
@@ -612,7 +612,7 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_Affine
if (m_LastClipPath.IsNull()) {
return;
}
- m_pDevice->RestoreState(true);
+ m_pDevice->RestoreState(TRUE);
m_LastClipPath.SetNull();
return;
}
@@ -620,7 +620,7 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_Affine
return;
}
m_LastClipPath = ClipPath;
- m_pDevice->RestoreState(true);
+ m_pDevice->RestoreState(TRUE);
int nClipPath = ClipPath.GetPathCount();
int i;
for (i = 0; i < nClipPath; i++) {
@@ -690,7 +690,7 @@ void CPDF_RenderStatus::DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMat
m_pDevice->DrawPath(pPathData, pObj2Device, &stroke_state, 0, 0xffff0000, fill_mode);
}
}
-bool CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, bool bStroke)
+FX_BOOL CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
{
CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
path_matrix.Concat(*pObj2Device);
@@ -707,12 +707,12 @@ bool CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_Affi
}
return m_pDevice->SetClip_PathFill(pPathObj->m_Path, &path_matrix, fill_mode);
}
-bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device)
{
const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
if (blend_type == FXDIB_BLEND_UNSUPPORTED) {
- return true;
+ return TRUE;
}
CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL;
if (pSMaskDict) {
@@ -724,7 +724,7 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
CPDF_Dictionary* pFormResource = NULL;
FX_FLOAT group_alpha = 1.0f;
int Transparency = m_Transparency;
- bool bGroupTransparent = false;
+ FX_BOOL bGroupTransparent = FALSE;
if (pPageObj->m_Type == PDFPAGE_FORM) {
CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
const CPDF_GeneralStateData *pStateData = pFormObj->m_GeneralState.GetObject();
@@ -732,15 +732,15 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
group_alpha = pStateData->m_FillAlpha;
}
Transparency = pFormObj->m_pForm->m_Transparency;
- bGroupTransparent = Transparency & PDFTRANS_ISOLATED ? true : false;
+ bGroupTransparent = Transparency & PDFTRANS_ISOLATED ? TRUE : FALSE;
if (pFormObj->m_pForm->m_pFormDict) {
pFormResource = pFormObj->m_pForm->m_pFormDict->GetDict("Resources");
}
}
- bool bTextClip = false;
+ FX_BOOL bTextClip = FALSE;
if (pPageObj->m_ClipPath.NotNull() && pPageObj->m_ClipPath.GetTextCount() &&
m_pDevice->GetDeviceClass() == FXDC_DISPLAY && !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
- bTextClip = true;
+ bTextClip = TRUE;
}
if ((m_Options.m_Flags & RENDER_OVERPRINT) && pPageObj->m_Type == PDFPAGE_IMAGE && pGeneralState && pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) {
CPDF_Document* pDocument = NULL;
@@ -763,11 +763,11 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
}
}
if (pSMaskDict == NULL && group_alpha == 1.0f && blend_type == FXDIB_BLEND_NORMAL && !bTextClip && !bGroupTransparent) {
- return false;
+ return FALSE;
}
- bool isolated = Transparency & PDFTRANS_ISOLATED;
+ FX_BOOL isolated = Transparency & PDFTRANS_ISOLATED;
if (m_bPrint) {
- bool bRet = false;
+ FX_BOOL bRet = FALSE;
int rendCaps = m_pDevice->GetRenderCaps();
if (!((Transparency & PDFTRANS_ISOLATED) || pSMaskDict || bTextClip) && (rendCaps & FXRC_BLEND_MODE)) {
int oldBlend = m_curBlend;
@@ -778,12 +778,12 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
if (!bRet) {
DrawObjWithBackground(pPageObj, pObj2Device);
}
- return true;
+ return TRUE;
}
FX_RECT rect = pPageObj->GetBBox(pObj2Device);
rect.Intersect(m_pDevice->GetClipBox());
if (rect.IsEmpty()) {
- return true;
+ return TRUE;
}
CFX_Matrix deviceCTM = m_pDevice->GetCTM();
FX_FLOAT scaleX = FXSYS_fabs(deviceCTM.a);
@@ -795,12 +795,12 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
if (!isolated && (m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) {
oriDevice = new CFX_DIBitmap;
if (!m_pDevice->CreateCompatibleBitmap(oriDevice, width, height)) {
- return true;
+ return TRUE;
}
m_pDevice->GetDIBits(oriDevice, rect.left, rect.top);
}
if (!bitmap_device.Create(width, height, FXDIB_Argb, 0, oriDevice)) {
- return true;
+ return TRUE;
}
CFX_DIBitmap* bitmap = bitmap_device.GetBitmap();
bitmap->Clear(0);
@@ -812,7 +812,7 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
pTextMask = new CFX_DIBitmap;
if (!pTextMask->Create(width, height, FXDIB_8bppMask)) {
delete pTextMask;
- return true;
+ return TRUE;
}
pTextMask->Clear(0);
CFX_FxgeDevice text_device;
@@ -831,7 +831,7 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
}
CPDF_RenderStatus bitmap_render;
bitmap_render.Initialize(m_pContext, &bitmap_device, NULL,
- m_pStopObj, NULL, NULL, &m_Options, 0, m_bDropObjects, pFormResource, true);
+ m_pStopObj, NULL, NULL, &m_Options, 0, m_bDropObjects, pFormResource, TRUE);
bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix);
m_bStopped = bitmap_render.m_bStopped;
if (pSMaskDict) {
@@ -858,10 +858,10 @@ bool CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, con
}
CompositeDIBitmap(bitmap, rect.left, rect.top, 0, 255, blend_type, Transparency);
delete oriDevice;
- return true;
+ return TRUE;
}
CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top,
- bool bBackAlphaRequired)
+ FX_BOOL bBackAlphaRequired)
{
FX_RECT bbox = rect;
bbox.Intersect(m_pDevice->GetClipBox());
@@ -882,7 +882,7 @@ CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj, const
delete pBackdrop;
return NULL;
}
- bool bNeedDraw;
+ FX_BOOL bNeedDraw;
if (pBackdrop->HasAlpha()) {
bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT);
} else {
@@ -911,7 +911,7 @@ void CPDF_RenderContext::GetBackground(CFX_DIBitmap* pBuffer, const CPDF_PageObj
device.FillRect(&rect, 0xffffffff);
Render(&device, pObj, pOptions, pFinalMatrix);
}
-CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(const CPDF_GraphicStates* pSrcStates, bool bStroke)
+CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(const CPDF_GraphicStates* pSrcStates, FX_BOOL bStroke)
{
if (!pSrcStates) {
return NULL;
@@ -932,14 +932,14 @@ CPDF_RenderContext::CPDF_RenderContext()
{
}
void CPDF_RenderContext::Create(CPDF_Document* pDoc, CPDF_PageRenderCache* pPageCache,
- CPDF_Dictionary* pPageResources, bool bFirstLayer)
+ CPDF_Dictionary* pPageResources, FX_BOOL bFirstLayer)
{
m_pDocument = pDoc;
m_pPageResources = pPageResources;
m_pPageCache = pPageCache;
m_bFirstLayer = bFirstLayer;
}
-void CPDF_RenderContext::Create(CPDF_Page* pPage, bool bFirstLayer)
+void CPDF_RenderContext::Create(CPDF_Page* pPage, FX_BOOL bFirstLayer)
{
m_pDocument = pPage->m_pDocument;
m_pPageResources = pPage->m_pPageResources;
@@ -954,7 +954,7 @@ void CPDF_RenderContext::Clear()
m_pDocument = NULL;
m_pPageResources = NULL;
m_pPageCache = NULL;
- m_bFirstLayer = true;
+ m_bFirstLayer = TRUE;
m_ContentList.RemoveAll();
}
void CPDF_RenderContext::AppendObjectList(CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObject2Device)
@@ -984,7 +984,7 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_PageObject
FinalMatrix.Concat(*pLastMatrix);
CPDF_RenderStatus status;
status.Initialize(this, pDevice, pLastMatrix, pStopObj, NULL, NULL, pOptions,
- pItem->m_pObjectList->m_Transparency, false, NULL);
+ pItem->m_pObjectList->m_Transparency, FALSE, NULL);
status.RenderObjectList(pItem->m_pObjectList, &FinalMatrix);
if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize);
@@ -996,7 +996,7 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_PageObject
} else {
CPDF_RenderStatus status;
status.Initialize(this, pDevice, NULL, pStopObj, NULL, NULL, pOptions,
- pItem->m_pObjectList->m_Transparency, false, NULL);
+ pItem->m_pObjectList->m_Transparency, FALSE, NULL);
status.RenderObjectList(pItem->m_pObjectList, &pItem->m_Matrix);
if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize);
@@ -1090,7 +1090,7 @@ void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause)
m_pRenderStatus.reset(new CPDF_RenderStatus());
m_pRenderStatus->Initialize(
m_pContext, m_pDevice, NULL, NULL, NULL, NULL, m_pOptions,
- pItem->m_pObjectList->m_Transparency, false, NULL);
+ pItem->m_pObjectList->m_Transparency, FALSE, NULL);
m_pDevice->SaveState();
m_ClipRect = m_pDevice->GetClipBox();
CFX_AffineMatrix device2object;
@@ -1171,10 +1171,10 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj)
}
CPDF_Function* pFuncs[3] = { nullptr, nullptr, nullptr };
- bool bUniTransfer = true;
- bool bIdentity = true;
+ FX_BOOL bUniTransfer = TRUE;
+ FX_BOOL bIdentity = TRUE;
if (pObj->GetType() == PDFOBJ_ARRAY) {
- bUniTransfer = false;
+ bUniTransfer = FALSE;
CPDF_Array* pArray = (CPDF_Array*)pObj;
if (pArray->GetCount() < 3)
return nullptr;
@@ -1208,7 +1208,7 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj)
pFuncs[0]->Call(&input, 1, output, noutput);
int o = FXSYS_round(output[0] * 255);
if (o != v)
- bIdentity = false;
+ bIdentity = FALSE;
for (int i = 0; i < 3; ++i) {
pTransfer->m_Samples[i * 256 + v] = o;
}
@@ -1218,7 +1218,7 @@ CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj)
pFuncs[i]->Call(&input, 1, output, noutput);
int o = FXSYS_round(output[0] * 255);
if (o != v)
- bIdentity = false;
+ bIdentity = FALSE;
pTransfer->m_Samples[i * 256 + v] = o;
} else {
pTransfer->m_Samples[i * 256 + v] = v;
@@ -1258,7 +1258,7 @@ CPDF_DeviceBuffer::~CPDF_DeviceBuffer()
{
delete m_pBitmap;
}
-bool CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+FX_BOOL CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
const CPDF_PageObject* pObj, int max_dpi)
{
m_pDevice = pDevice;
@@ -1289,7 +1289,7 @@ bool CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevic
FX_RECT bitmap_rect = rect.GetOutterRect();
m_pBitmap = new CFX_DIBitmap;
m_pBitmap->Create(bitmap_rect.Width(), bitmap_rect.Height(), FXDIB_Argb);
- return true;
+ return TRUE;
}
void CPDF_DeviceBuffer::OutputToDevice()
{
@@ -1316,13 +1316,13 @@ CPDF_ScaledRenderBuffer::~CPDF_ScaledRenderBuffer()
delete m_pBitmapDevice;
}
#define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024)
-bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
const CPDF_PageObject* pObj, const CPDF_RenderOptions *pOptions, int max_dpi)
{
FXSYS_assert(pRect != NULL);
m_pDevice = pDevice;
if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_GET_BITS) {
- return true;
+ return TRUE;
}
m_pContext = pContext;
m_Rect = *pRect;
@@ -1357,7 +1357,7 @@ bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_Rende
iHeight = bitmap_rect.Height();
iPitch = (iWidth * bpp + 31) / 32 * 4;
if (iWidth * iHeight < 1) {
- return false;
+ return FALSE;
}
if (iPitch * iHeight <= _FPDFAPI_IMAGESIZE_LIMIT_ &&
m_pBitmapDevice->Create(iWidth, iHeight, dibFormat)) {
@@ -1366,7 +1366,7 @@ bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_Rende
m_Matrix.Scale(0.5f, 0.5f);
}
m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions, &m_Matrix);
- return true;
+ return TRUE;
}
void CPDF_ScaledRenderBuffer::OutputToDevice()
{
@@ -1374,7 +1374,7 @@ void CPDF_ScaledRenderBuffer::OutputToDevice()
m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
}
}
-bool IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj)
+FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj)
{
const CPDF_ContentMarkData* pData = pObj->m_ContentMark;
int nItems = pData->CountItems();
@@ -1383,9 +1383,9 @@ bool IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj)
if (item.GetName() == FX_BSTRC("OC") && item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) {
CPDF_Dictionary* pOCG = (CPDF_Dictionary*)item.GetParam();
if (!CheckOCGVisible(pOCG)) {
- return false;
+ return FALSE;
}
}
}
- return true;
+ return TRUE;
}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index d9767b4817..cdbecd65ea 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
@@ -108,16 +108,16 @@ FX_DWORD CPDF_PageRenderCache::GetCachedSize(CPDF_Stream* pStream) const
return pImageCache->EstimateSize();
}
void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor,
- bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus,
+ FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
int32_t downsampleWidth, int32_t downsampleHeight)
{
CPDF_ImageCache* pImageCache;
- bool bFind = m_ImageCaches.Lookup(pStream, (void*&)pImageCache);
+ FX_BOOL bFind = m_ImageCaches.Lookup(pStream, (void*&)pImageCache);
if (!bFind) {
pImageCache = new CPDF_ImageCache(m_pPage->m_pDocument, pStream);
}
m_nTimeCount ++;
- bool bCached = pImageCache->GetCachedBitmap(pBitmap, pMask, MatteColor, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight);
+ FX_BOOL bCached = pImageCache->GetCachedBitmap(pBitmap, pMask, MatteColor, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight);
if (!bFind) {
m_ImageCaches.SetAt(pStream, pImageCache);
}
@@ -125,7 +125,7 @@ void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*&
m_nCacheSize += pImageCache->EstimateSize();
}
}
-bool CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight)
+FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t downsampleWidth, int32_t downsampleHeight)
{
m_bCurFindCache = m_ImageCaches.Lookup(pStream, (void*&)m_pCurImageCache);
if (!m_bCurFindCache) {
@@ -133,7 +133,7 @@ bool CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdC
}
int ret = m_pCurImageCache->StartGetCachedBitmap(pRenderStatus->m_pFormResource, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight);
if (ret == 2) {
- return true;
+ return TRUE;
}
m_nTimeCount ++;
if (!m_bCurFindCache) {
@@ -142,13 +142,13 @@ bool CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, bool bStdC
if (!ret) {
m_nCacheSize += m_pCurImageCache->EstimateSize();
}
- return false;
+ return FALSE;
}
-bool CPDF_PageRenderCache::Continue(IFX_Pause* pPause)
+FX_BOOL CPDF_PageRenderCache::Continue(IFX_Pause* pPause)
{
int ret = m_pCurImageCache->Continue(pPause);
if (ret == 2) {
- return true;
+ return TRUE;
}
m_nTimeCount ++;
if (!m_bCurFindCache) {
@@ -157,7 +157,7 @@ bool CPDF_PageRenderCache::Continue(IFX_Pause* pPause)
if (!ret) {
m_nCacheSize += m_pCurImageCache->EstimateSize();
}
- return false;
+ return FALSE;
}
void CPDF_PageRenderCache::ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap)
{
@@ -222,18 +222,18 @@ static FX_DWORD FPDF_ImageCache_EstimateImageSize(const CFX_DIBSource* pDIB)
{
return pDIB && pDIB->GetBuffer() ? (FX_DWORD)pDIB->GetHeight() * pDIB->GetPitch() + (FX_DWORD)pDIB->GetPaletteSize() * 4 : 0;
}
-bool CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
- bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus,
+FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
+ FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
int32_t downsampleWidth, int32_t downsampleHeight)
{
if (m_pCachedBitmap) {
pBitmap = m_pCachedBitmap;
pMask = m_pCachedMask;
MatteColor = m_MatteColor;
- return true;
+ return TRUE;
}
if (!pRenderStatus) {
- return false;
+ return FALSE;
}
CPDF_RenderContext*pContext = pRenderStatus->GetContext();
CPDF_PageRenderCache* pPageRenderCache = pContext->m_pPageCache;
@@ -243,7 +243,7 @@ bool CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& p
if (!pSrc->Load(m_pDocument, m_pStream, &pMaskSrc, &MatteColor, pRenderStatus->m_pFormResource, pPageResources, bStdCS, GroupFamily, bLoadMask)) {
delete pSrc;
pBitmap = NULL;
- return false;
+ return FALSE;
}
m_MatteColor = MatteColor;
if (pSrc->GetPitch() * pSrc->GetHeight() < FPDF_HUGE_IMAGE_SIZE) {
@@ -260,7 +260,7 @@ bool CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& p
pBitmap = m_pCachedBitmap;
pMask = m_pCachedMask;
CalcSize();
- return false;
+ return FALSE;
}
CFX_DIBSource* CPDF_ImageCache::DetachBitmap()
{
@@ -274,8 +274,8 @@ CFX_DIBSource* CPDF_ImageCache::DetachMask()
m_pCurMask = NULL;
return pDIBSource;
}
-int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, bool bStdCS,
- FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus,
+int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS,
+ FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
int32_t downsampleWidth, int32_t downsampleHeight)
{
if (m_pCachedBitmap) {
@@ -288,7 +288,7 @@ int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_
}
m_pRenderStatus = pRenderStatus;
m_pCurBitmap = new CPDF_DIBSource;
- int ret = ((CPDF_DIBSource*)m_pCurBitmap)->StartLoadDIBSource(m_pDocument, m_pStream, true, pFormResources, pPageResources, bStdCS, GroupFamily, bLoadMask);
+ int ret = ((CPDF_DIBSource*)m_pCurBitmap)->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResources, pPageResources, bStdCS, GroupFamily, bLoadMask);
if (ret == 2) {
return ret;
}
@@ -347,7 +347,7 @@ void CPDF_Document::ClearRenderFont()
if (m_pDocRender) {
CFX_FontCache* pCache = m_pDocRender->GetFontCache();
if (pCache) {
- pCache->FreeCache(false);
+ pCache->FreeCache(FALSE);
}
}
}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 258ad111fa..fa9325a4d2 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -13,7 +13,7 @@
#include "../fpdf_page/pageint.h"
#include "render_int.h"
-bool CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device)
{
CPDF_ImageRenderer render;
if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) {
@@ -27,8 +27,8 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int
if (pDIBitmap == NULL) {
return;
}
- bool bIsolated = Transparency & PDFTRANS_ISOLATED;
- bool bGroup = Transparency & PDFTRANS_GROUP;
+ FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED;
+ FX_BOOL bGroup = Transparency & PDFTRANS_GROUP;
if (blend_mode == FXDIB_BLEND_NORMAL) {
if (!pDIBitmap->IsAlphaMask()) {
if (bitmap_alpha < 255) {
@@ -47,8 +47,8 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int
}
}
}
- bool bBackAlphaRequired = blend_mode && bIsolated && !m_bDropObjects;
- bool bGetBackGround = ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) ||
+ FX_BOOL bBackAlphaRequired = blend_mode && bIsolated && !m_bDropObjects;
+ FX_BOOL bGetBackGround = ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) ||
(!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) && (m_pDevice->GetRenderCaps()
& FXRC_GET_BITS) && !bBackAlphaRequired);
if (bGetBackGround) {
@@ -61,9 +61,9 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int
FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight());
rect.Intersect(m_pDevice->GetClipBox());
CFX_DIBitmap* pClone = NULL;
- bool bClone = false;
+ FX_BOOL bClone = FALSE;
if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) {
- bClone = true;
+ bClone = TRUE;
pClone = m_pDevice->GetBackDrop()->Clone(&rect);
CFX_DIBitmap *pForeBitmap = m_pDevice->GetBitmap();
pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), pForeBitmap, rect.left, rect.top);
@@ -118,7 +118,7 @@ FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF rgb)
return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], m_Samples[256 + FXSYS_GetGValue(rgb)],
m_Samples[512 + FXSYS_GetBValue(rgb)]);
}
-CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, bool bAutoDropSrc)
+CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
{
CPDF_DIBTransferFunc* pDest = new CPDF_DIBTransferFunc(this);
pDest->LoadSrc(pSrc, bAutoDropSrc);
@@ -144,7 +144,7 @@ CPDF_DIBTransferFunc::CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFun
void CPDF_DIBTransferFunc::TranslateScanline(uint8_t* dest_buf, const uint8_t* src_buf) const
{
int i;
- bool bSkip = false;
+ FX_BOOL bSkip = FALSE;
switch (m_pSrc->GetFormat()) {
case FXDIB_1bppRgb: {
int r0 = m_RampR[0], g0 = m_RampG[0], b0 = m_RampB[0];
@@ -213,7 +213,7 @@ void CPDF_DIBTransferFunc::TranslateScanline(uint8_t* dest_buf, const uint8_t* s
}
break;
case FXDIB_Rgb32:
- bSkip = true;
+ bSkip = TRUE;
case FXDIB_Argb:
for (i = 0; i < m_Width; i ++) {
*dest_buf++ = m_RampB[*(src_buf++)];
@@ -266,31 +266,31 @@ void CPDF_DIBTransferFunc::TranslateDownSamples(uint8_t* dest_buf, const uint8_t
}
}
}
-static bool _IsSupported(CPDF_ColorSpace* pCS)
+static FX_BOOL _IsSupported(CPDF_ColorSpace* pCS)
{
if (pCS->GetFamily() == PDFCS_DEVICERGB || pCS->GetFamily() == PDFCS_DEVICEGRAY ||
pCS->GetFamily() == PDFCS_DEVICECMYK || pCS->GetFamily() == PDFCS_CALGRAY ||
pCS->GetFamily() == PDFCS_CALRGB) {
- return true;
+ return TRUE;
}
if (pCS->GetFamily() == PDFCS_INDEXED && _IsSupported(pCS->GetBaseCS())) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CPDF_ImageRenderer::CPDF_ImageRenderer()
{
m_pRenderStatus = NULL;
m_pImageObject = NULL;
- m_Result = true;
+ m_Result = TRUE;
m_Status = 0;
m_pQuickStretcher = NULL;
m_pTransformer = NULL;
m_DeviceHandle = NULL;
m_LoadHandle = NULL;
m_pClone = NULL;
- m_bStdCS = false;
- m_bPatternColor = false;
+ m_bStdCS = FALSE;
+ m_bPatternColor = FALSE;
m_BlendType = FXDIB_BLEND_NORMAL;
m_pPattern = NULL;
m_pObj2Device = NULL;
@@ -305,7 +305,7 @@ CPDF_ImageRenderer::~CPDF_ImageRenderer()
delete (CPDF_ProgressiveImageLoaderHandle*)m_LoadHandle;
delete m_pClone;
}
-bool CPDF_ImageRenderer::StartLoadDIBSource()
+FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource()
{
CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
FX_RECT image_rect = image_rect_f.GetOutterRect();
@@ -321,16 +321,16 @@ bool CPDF_ImageRenderer::StartLoadDIBSource()
m_pRenderStatus->m_GroupFamily, m_pRenderStatus->m_bLoadMask, m_pRenderStatus, dest_width, dest_height)) {
if (m_LoadHandle != NULL) {
m_Status = 4;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
-bool CPDF_ImageRenderer::StartRenderDIBSource()
+FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource()
{
if (m_Loader.m_pBitmap == NULL) {
- return false;
+ return FALSE;
}
m_BitmapAlpha = 255;
const CPDF_GeneralStateData* pGeneralState = m_pImageObject->m_GeneralState;
@@ -350,18 +350,18 @@ bool CPDF_ImageRenderer::StartRenderDIBSource()
if (m_Loader.m_bCached && m_Loader.m_pMask) {
m_Loader.m_pMask = m_Loader.m_pMask->Clone();
}
- m_Loader.m_bCached = false;
+ m_Loader.m_bCached = FALSE;
}
}
m_FillArgb = 0;
- m_bPatternColor = false;
+ m_bPatternColor = FALSE;
m_pPattern = NULL;
if (m_pDIBSource->IsAlphaMask()) {
CPDF_Color* pColor = m_pImageObject->m_ColorState.GetFillColor();
if (pColor && pColor->IsPattern()) {
m_pPattern = pColor->GetPattern();
if (m_pPattern != NULL) {
- m_bPatternColor = true;
+ m_bPatternColor = TRUE;
}
}
m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject);
@@ -430,7 +430,7 @@ bool CPDF_ImageRenderer::StartRenderDIBSource()
}
return StartDIBSource();
}
-bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bStdCS, int blendType)
+FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType)
{
m_pRenderStatus = pStatus;
m_bStdCS = bStdCS;
@@ -439,17 +439,17 @@ bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject
m_pObj2Device = pObj2Device;
CPDF_Dictionary* pOC = m_pImageObject->m_pImage->GetOC();
if (pOC && m_pRenderStatus->m_Options.m_pOCContext && !m_pRenderStatus->m_Options.m_pOCContext->CheckOCGVisible(pOC)) {
- return false;
+ return FALSE;
}
m_ImageMatrix = m_pImageObject->m_Matrix;
m_ImageMatrix.Concat(*pObj2Device);
if (StartLoadDIBSource()) {
- return true;
+ return TRUE;
}
return StartRenderDIBSource();
}
-bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb,
- int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, bool bStdCS, int blendType)
+FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb,
+ int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, FX_BOOL bStdCS, int blendType)
{
m_pRenderStatus = pStatus;
m_pDIBSource = pDIBSource;
@@ -461,16 +461,16 @@ bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource*
m_BlendType = blendType;
return StartDIBSource();
}
-bool CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device)
+FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device)
{
if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = false;
- return false;
+ m_Result = FALSE;
+ return FALSE;
}
FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOutterRect();
rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
if (rect.IsEmpty()) {
- return false;
+ return FALSE;
}
CFX_AffineMatrix new_matrix = m_ImageMatrix;
new_matrix.TranslateI(-rect.left, -rect.top);
@@ -478,32 +478,32 @@ bool CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device)
int height = rect.Height();
CFX_FxgeDevice bitmap_device1;
if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Rgb32)) {
- return true;
+ return TRUE;
}
bitmap_device1.GetBitmap()->Clear(0xffffff);
{
CPDF_RenderStatus bitmap_render;
bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device1, NULL, NULL,
- NULL, NULL, &m_pRenderStatus->m_Options, 0, m_pRenderStatus->m_bDropObjects, NULL, true);
+ NULL, NULL, &m_pRenderStatus->m_Options, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
CFX_Matrix patternDevice = *pObj2Device;
patternDevice.Translate((FX_FLOAT) - rect.left, (FX_FLOAT) - rect.top);
if(m_pPattern->m_PatternType == PATTERN_TILING) {
- bitmap_render.DrawTilingPattern((CPDF_TilingPattern*)m_pPattern, m_pImageObject, &patternDevice, false);
+ bitmap_render.DrawTilingPattern((CPDF_TilingPattern*)m_pPattern, m_pImageObject, &patternDevice, FALSE);
} else {
- bitmap_render.DrawShadingPattern((CPDF_ShadingPattern*)m_pPattern, m_pImageObject, &patternDevice, false);
+ bitmap_render.DrawShadingPattern((CPDF_ShadingPattern*)m_pPattern, m_pImageObject, &patternDevice, FALSE);
}
}
{
CFX_FxgeDevice bitmap_device2;
if (!bitmap_device2.Create(rect.Width(), rect.Height(), FXDIB_8bppRgb)) {
- return true;
+ return TRUE;
}
bitmap_device2.GetBitmap()->Clear(0);
CPDF_RenderStatus bitmap_render;
bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device2, NULL, NULL,
- NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, true);
+ NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
CPDF_ImageRenderer image_render;
- if (image_render.Start(&bitmap_render, m_pDIBSource, 0xffffffff, 255, &new_matrix, m_Flags, true)) {
+ if (image_render.Start(&bitmap_render, m_pDIBSource, 0xffffffff, 255, &new_matrix, m_Flags, TRUE)) {
image_render.Continue(NULL);
}
if (m_Loader.m_MatteColor != 0xffffffff) {
@@ -549,18 +549,18 @@ bool CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device)
bitmap_device1.GetBitmap()->MultiplyAlpha(255);
}
m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
- return false;
+ return FALSE;
}
-bool CPDF_ImageRenderer::DrawMaskedImage()
+FX_BOOL CPDF_ImageRenderer::DrawMaskedImage()
{
if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = false;
- return false;
+ m_Result = FALSE;
+ return FALSE;
}
FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOutterRect();
rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
if (rect.IsEmpty()) {
- return false;
+ return FALSE;
}
CFX_AffineMatrix new_matrix = m_ImageMatrix;
new_matrix.TranslateI(-rect.left, -rect.top);
@@ -568,29 +568,29 @@ bool CPDF_ImageRenderer::DrawMaskedImage()
int height = rect.Height();
CFX_FxgeDevice bitmap_device1;
if (!bitmap_device1.Create(width, height, FXDIB_Rgb32)) {
- return true;
+ return TRUE;
}
bitmap_device1.GetBitmap()->Clear(0xffffff);
{
CPDF_RenderStatus bitmap_render;
bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device1, NULL, NULL,
- NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, true);
+ NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
CPDF_ImageRenderer image_render;
- if (image_render.Start(&bitmap_render, m_pDIBSource, 0, 255, &new_matrix, m_Flags, true)) {
+ if (image_render.Start(&bitmap_render, m_pDIBSource, 0, 255, &new_matrix, m_Flags, TRUE)) {
image_render.Continue(NULL);
}
}
{
CFX_FxgeDevice bitmap_device2;
if (!bitmap_device2.Create(width, height, FXDIB_8bppRgb)) {
- return true;
+ return TRUE;
}
bitmap_device2.GetBitmap()->Clear(0);
CPDF_RenderStatus bitmap_render;
bitmap_render.Initialize(m_pRenderStatus->m_pContext, &bitmap_device2, NULL, NULL,
- NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, true);
+ NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
CPDF_ImageRenderer image_render;
- if (image_render.Start(&bitmap_render, m_Loader.m_pMask, 0xffffffff, 255, &new_matrix, m_Flags, true)) {
+ if (image_render.Start(&bitmap_render, m_Loader.m_pMask, 0xffffffff, 255, &new_matrix, m_Flags, TRUE)) {
image_render.Continue(NULL);
}
if (m_Loader.m_MatteColor != 0xffffffff) {
@@ -638,9 +638,9 @@ bool CPDF_ImageRenderer::DrawMaskedImage()
}
}
m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
- return false;
+ return FALSE;
}
-bool CPDF_ImageRenderer::StartDIBSource()
+FX_BOOL CPDF_ImageRenderer::StartDIBSource()
{
if (!(m_Flags & RENDER_FORCE_DOWNSAMPLE) && m_pDIBSource->GetBPP() > 1) {
int image_size = m_pDIBSource->GetBPP() / 8 * m_pDIBSource->GetWidth() * m_pDIBSource->GetHeight();
@@ -652,9 +652,9 @@ bool CPDF_ImageRenderer::StartDIBSource()
&m_ImageMatrix, m_Flags, m_DeviceHandle, 0, NULL, m_BlendType)) {
if (m_DeviceHandle != NULL) {
m_Status = 3;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
FX_RECT image_rect = image_rect_f.GetOutterRect();
@@ -663,15 +663,15 @@ bool CPDF_ImageRenderer::StartDIBSource()
if ((FXSYS_fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) ||
(FXSYS_fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0) ) {
if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = false;
- return false;
+ m_Result = FALSE;
+ return FALSE;
}
FX_RECT clip_box = m_pRenderStatus->m_pDevice->GetClipBox();
clip_box.Intersect(image_rect);
m_Status = 2;
m_pTransformer = new CFX_ImageTransformer;
m_pTransformer->Start(m_pDIBSource, &m_ImageMatrix, m_Flags, &clip_box);
- return true;
+ return TRUE;
}
if (m_ImageMatrix.a < 0) {
dest_width = -dest_width;
@@ -685,7 +685,7 @@ bool CPDF_ImageRenderer::StartDIBSource()
if (m_pDIBSource->IsOpaqueImage() && m_BitmapAlpha == 255) {
if (m_pRenderStatus->m_pDevice->StretchDIBits(m_pDIBSource, dest_left, dest_top,
dest_width, dest_height, m_Flags, NULL, m_BlendType)) {
- return false;
+ return FALSE;
}
}
if (m_pDIBSource->IsAlphaMask()) {
@@ -693,12 +693,12 @@ bool CPDF_ImageRenderer::StartDIBSource()
m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
}
if (m_pRenderStatus->m_pDevice->StretchBitMask(m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_FillArgb, m_Flags)) {
- return false;
+ return FALSE;
}
}
if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = false;
- return true;
+ m_Result = FALSE;
+ return TRUE;
}
FX_RECT clip_box = m_pRenderStatus->m_pDevice->GetClipBox();
FX_RECT dest_rect = clip_box;
@@ -708,13 +708,13 @@ bool CPDF_ImageRenderer::StartDIBSource()
CFX_DIBitmap* pStretched = m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip);
if (pStretched) {
m_pRenderStatus->CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_FillArgb,
- m_BitmapAlpha, m_BlendType, false);
+ m_BitmapAlpha, m_BlendType, FALSE);
delete pStretched;
pStretched = NULL;
}
- return false;
+ return FALSE;
}
-bool CPDF_ImageRenderer::StartBitmapAlpha()
+FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha()
{
if (m_pDIBSource->IsOpaqueImage()) {
CFX_PathData path;
@@ -728,7 +728,7 @@ bool CPDF_ImageRenderer::StartBitmapAlpha()
int left, top;
CFX_DIBitmap* pTransformed = pAlphaMask->TransformTo(&m_ImageMatrix, left, top);
if (pTransformed == NULL) {
- return true;
+ return TRUE;
}
m_pRenderStatus->m_pDevice->SetBitMask(pTransformed, left, top, ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
delete pTransformed;
@@ -746,13 +746,13 @@ bool CPDF_ImageRenderer::StartBitmapAlpha()
delete pAlphaMask;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
+FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
{
if (m_Status == 1) {
if (m_pQuickStretcher->Continue(pPause)) {
- return true;
+ return TRUE;
}
if (m_pQuickStretcher->m_pBitmap->IsAlphaMask())
m_pRenderStatus->m_pDevice->SetBitMask(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
@@ -760,15 +760,15 @@ bool CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
else
m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
m_pQuickStretcher->m_ResultTop, m_BlendType);
- return false;
+ return FALSE;
}
if (m_Status == 2) {
if (m_pTransformer->Continue(pPause)) {
- return true;
+ return TRUE;
}
CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
if (pBitmap->IsAlphaMask()) {
if (m_BitmapAlpha != 255) {
@@ -784,20 +784,20 @@ bool CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop, m_BlendType);
}
delete pBitmap;
- return false;
+ return FALSE;
}
if (m_Status == 3) {
return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause);
}
if (m_Status == 4) {
if (m_Loader.Continue(m_LoadHandle, pPause)) {
- return true;
+ return TRUE;
}
if (StartRenderDIBSource()) {
return Continue(pPause);
}
}
- return false;
+ return FALSE;
}
CPDF_QuickStretcher::CPDF_QuickStretcher()
{
@@ -815,10 +815,10 @@ CPDF_QuickStretcher::~CPDF_QuickStretcher()
}
ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc, const CPDF_Dictionary* pParams);
-bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox)
+FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox)
{
if (FXSYS_fabs(pImage2Device->a) < FXSYS_fabs(pImage2Device->b) * 10 && FXSYS_fabs(pImage2Device->d) < FXSYS_fabs(pImage2Device->c) * 10) {
- return false;
+ return FALSE;
}
CFX_FloatRect image_rect_f = pImage2Device->GetUnitRect();
FX_RECT image_rect = image_rect_f.GetOutterRect();
@@ -829,7 +829,7 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
FX_RECT result_rect = *pClipBox;
result_rect.Intersect(image_rect);
if (result_rect.IsEmpty()) {
- return false;
+ return FALSE;
}
m_ResultWidth = result_rect.Width();
m_ResultHeight = result_rect.Height();
@@ -839,10 +839,10 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
m_ClipTop = result_rect.top - image_rect.top;
CPDF_Dictionary* pDict = pImageObj->m_pImage->GetDict();
if (pDict->GetInteger(FX_BSTRC("BitsPerComponent")) != 8) {
- return false;
+ return FALSE;
}
if (pDict->KeyExist(FX_BSTRC("SMask")) || pDict->KeyExist(FX_BSTRC("Mask"))) {
- return false;
+ return FALSE;
}
m_SrcWidth = pDict->GetInteger(FX_BSTRC("Width"));
m_SrcHeight = pDict->GetInteger(FX_BSTRC("Height"));
@@ -850,14 +850,14 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
m_Bpp = 3;
CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
if (pCSObj == NULL) {
- return false;
+ return FALSE;
}
m_pCS = CPDF_ColorSpace::Load(pImageObj->m_pImage->GetDocument(), pCSObj);
if (m_pCS == NULL) {
- return false;
+ return FALSE;
}
if (!_IsSupported(m_pCS)) {
- return false;
+ return FALSE;
}
m_Bpp = m_pCS->CountComponents();
if (m_pCS->sRGB()) {
@@ -865,7 +865,7 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
m_pCS = NULL;
}
CPDF_Stream* pStream = pImageObj->m_pImage->GetStream();
- m_StreamAcc.LoadAllData(pStream, false, m_SrcWidth * m_SrcHeight * m_Bpp, true);
+ m_StreamAcc.LoadAllData(pStream, FALSE, m_SrcWidth * m_SrcHeight * m_Bpp, TRUE);
m_pDecoder = NULL;
if (!m_StreamAcc.GetImageDecoder().IsEmpty()) {
if (m_StreamAcc.GetImageDecoder() == FX_BSTRC("DCTDecode")) {
@@ -878,7 +878,7 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
m_StreamAcc.GetData(), m_StreamAcc.GetSize(), m_SrcWidth, m_SrcHeight, m_Bpp, 8,
m_StreamAcc.GetImageParam());
} else {
- return false;
+ return FALSE;
}
m_pDecoder->DownScale(m_DestWidth, m_DestHeight);
}
@@ -889,9 +889,9 @@ bool CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* p
m_pBitmap->Create(m_ResultWidth, m_ResultHeight, FXDIB_Rgb);
#endif
m_LineIndex = 0;
- return true;
+ return TRUE;
}
-bool CPDF_QuickStretcher::Continue(IFX_Pause* pPause)
+FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause)
{
uint8_t* result_buf = m_pBitmap->GetBuffer();
int src_width = m_pDecoder ? m_pDecoder->GetWidth() : m_SrcWidth;
@@ -945,10 +945,10 @@ bool CPDF_QuickStretcher::Continue(IFX_Pause* pPause)
}
m_LineIndex ++;
if (pPause && pPause->NeedToPauseNow()) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
FX_RECT* pClipRect, const CFX_AffineMatrix* pMatrix)
@@ -959,7 +959,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
CFX_DIBitmap* pMask = NULL;
int width = pClipRect->right - pClipRect->left;
int height = pClipRect->bottom - pClipRect->top;
- bool bLuminosity = false;
+ FX_BOOL bLuminosity = FALSE;
bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha");
CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G"));
if (pGroup == NULL) {
@@ -1032,7 +1032,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
options.m_ColorMode = bLuminosity ? RENDER_COLOR_NORMAL : RENDER_COLOR_ALPHA;
CPDF_RenderStatus status;
status.Initialize(m_pContext, &bitmap_device, NULL, NULL, NULL, NULL,
- &options, 0, m_bDropObjects, pFormResource, true, NULL, 0, pCS ? pCS->GetFamily() : 0, bLuminosity);
+ &options, 0, m_bDropObjects, pFormResource, TRUE, NULL, 0, pCS ? pCS->GetFamily() : 0, bLuminosity);
status.RenderObjectList(&form, &matrix);
pMask = new CFX_DIBitmap;
if (!pMask->Create(width, height, FXDIB_8bppMask)) {
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 0861048eb7..7d17e78e24 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -105,7 +105,7 @@ class JpxBitMapContext
} // namespace
-CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask, FX_DWORD* pMatteColor, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask) const
+CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask, FX_DWORD* pMatteColor, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask) const
{
CPDF_DIBSource* pSource = new CPDF_DIBSource;
if (pSource->Load(m_pDocument, m_pStream, (CPDF_DIBSource**)ppMask, pMatteColor, NULL, NULL, bStdCS, GroupFamily, bLoadMask)) {
@@ -126,36 +126,36 @@ CFX_DIBSource* CPDF_Image::DetachMask()
m_pMask = NULL;
return pBitmap;
}
-bool CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask)
+FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
{
m_pDIBSource = new CPDF_DIBSource;
- int ret = ((CPDF_DIBSource*)m_pDIBSource)->StartLoadDIBSource(m_pDocument, m_pStream, true, pFormResource, pPageResource, bStdCS, GroupFamily, bLoadMask);
+ int ret = ((CPDF_DIBSource*)m_pDIBSource)->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResource, pPageResource, bStdCS, GroupFamily, bLoadMask);
if (ret == 2) {
- return true;
+ return TRUE;
}
if (!ret) {
delete m_pDIBSource;
m_pDIBSource = NULL;
- return false;
+ return FALSE;
}
m_pMask = ((CPDF_DIBSource*)m_pDIBSource)->DetachMask();
m_MatteColor = ((CPDF_DIBSource*)m_pDIBSource)->m_MatteColor;
- return false;
+ return FALSE;
}
-bool CPDF_Image::Continue(IFX_Pause* pPause)
+FX_BOOL CPDF_Image::Continue(IFX_Pause* pPause)
{
int ret = ((CPDF_DIBSource*)m_pDIBSource)->ContinueLoadDIBSource(pPause);
if (ret == 2) {
- return true;
+ return TRUE;
}
if (!ret) {
delete m_pDIBSource;
m_pDIBSource = NULL;
- return false;
+ return FALSE;
}
m_pMask = ((CPDF_DIBSource*)m_pDIBSource)->DetachMask();
m_MatteColor = ((CPDF_DIBSource*)m_pDIBSource)->m_MatteColor;
- return false;
+ return FALSE;
}
CPDF_DIBSource::CPDF_DIBSource()
{
@@ -165,26 +165,26 @@ CPDF_DIBSource::CPDF_DIBSource()
m_bpp = 0;
m_Width = m_Height = 0;
m_pColorSpace = NULL;
- m_bDefaultDecode = true;
- m_bImageMask = false;
- m_bDoBpcCheck = true;
+ m_bDefaultDecode = TRUE;
+ m_bImageMask = FALSE;
+ m_bDoBpcCheck = TRUE;
m_pPalette = NULL;
m_pCompData = NULL;
- m_bColorKey = false;
+ m_bColorKey = FALSE;
m_pMaskedLine = m_pLineBuf = NULL;
m_pDecoder = NULL;
m_nComponents = 0;
m_bpc = 0;
- m_bLoadMask = false;
+ m_bLoadMask = FALSE;
m_Family = 0;
m_pMask = NULL;
m_MatteColor = 0;
m_pJbig2Context = NULL;
m_pGlobalStream = NULL;
- m_bStdCS = false;
+ m_bStdCS = FALSE;
m_pMaskStream = NULL;
m_Status = 0;
- m_bHasMask = false;
+ m_bHasMask = FALSE;
}
CPDF_DIBSource::~CPDF_DIBSource()
{
@@ -220,43 +220,43 @@ void CPDF_DIBSource::ReleaseBitmap(CFX_DIBitmap* pBitmap) const
delete pBitmap;
}
}
-bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_DIBSource** ppMask,
- FX_DWORD* pMatteColor, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask)
+FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_DIBSource** ppMask,
+ FX_DWORD* pMatteColor, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
{
if (pStream == NULL) {
- return false;
+ return FALSE;
}
m_pDocument = pDoc;
m_pDict = pStream->GetDict();
if (m_pDict == NULL) {
- return false;
+ return FALSE;
}
m_pStream = pStream;
m_Width = m_pDict->GetInteger(FX_BSTRC("Width"));
m_Height = m_pDict->GetInteger(FX_BSTRC("Height"));
if (m_Width <= 0 || m_Height <= 0 || m_Width > 0x01ffff || m_Height > 0x01ffff) {
- return false;
+ return FALSE;
}
m_GroupFamily = GroupFamily;
m_bLoadMask = bLoadMask;
if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, pPageResources)) {
- return false;
+ return FALSE;
}
if (m_bDoBpcCheck && (m_bpc == 0 || m_nComponents == 0)) {
- return false;
+ return FALSE;
}
FX_SAFE_DWORD src_pitch =
CalculatePitch8(m_bpc, m_nComponents, m_Width, m_Height);
if (!src_pitch.IsValid()) {
- return false;
+ return FALSE;
}
m_pStreamAcc = new CPDF_StreamAcc;
- m_pStreamAcc->LoadAllData(pStream, false, src_pitch.ValueOrDie(), true);
+ m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE);
if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
- return false;
+ return FALSE;
}
if (!CreateDecoder()) {
- return false;
+ return FALSE;
}
if (m_bImageMask) {
m_bpp = 1;
@@ -272,11 +272,11 @@ bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_
}
FX_SAFE_DWORD pitch = CalculatePitch32(m_bpp, m_Width);
if (!pitch.IsValid()) {
- return false;
+ return FALSE;
}
m_pLineBuf = FX_Alloc(uint8_t, pitch.ValueOrDie());
if (m_pColorSpace && bStdCS) {
- m_pColorSpace->EnableStdConversion(true);
+ m_pColorSpace->EnableStdConversion(TRUE);
}
LoadPalette();
if (m_bColorKey) {
@@ -284,7 +284,7 @@ bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_
m_AlphaFlag = 2;
pitch = CalculatePitch32(m_bpp, m_Width);
if (!pitch.IsValid()) {
- return false;
+ return FALSE;
}
m_pMaskedLine = FX_Alloc(uint8_t, pitch.ValueOrDie());
}
@@ -293,9 +293,9 @@ bool CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_
*ppMask = LoadMask(*pMatteColor);
}
if (m_pColorSpace && bStdCS) {
- m_pColorSpace->EnableStdConversion(false);
+ m_pColorSpace->EnableStdConversion(FALSE);
}
- return true;
+ return TRUE;
}
int CPDF_DIBSource::ContinueToLoadMask()
{
@@ -320,7 +320,7 @@ int CPDF_DIBSource::ContinueToLoadMask()
}
m_pLineBuf = FX_Alloc(uint8_t, pitch.ValueOrDie());
if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(true);
+ m_pColorSpace->EnableStdConversion(TRUE);
}
LoadPalette();
if (m_bColorKey) {
@@ -335,9 +335,9 @@ int CPDF_DIBSource::ContinueToLoadMask()
m_Pitch = pitch.ValueOrDie();
return 1;
}
-int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, bool bHasMask,
+int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask)
+ FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
{
if (pStream == NULL) {
return 0;
@@ -366,7 +366,7 @@ int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* p
return 0;
}
m_pStreamAcc = new CPDF_StreamAcc;
- m_pStreamAcc->LoadAllData(pStream, false, src_pitch.ValueOrDie(), true);
+ m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE);
if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
return 0;
}
@@ -393,7 +393,7 @@ int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* p
return ret;
}
if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(false);
+ m_pColorSpace->EnableStdConversion(FALSE);
}
return ret;
}
@@ -412,7 +412,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause)
CPDF_Stream* pGlobals = m_pStreamAcc->GetImageParam()->GetStream(FX_BSTRC("JBIG2Globals"));
if (pGlobals) {
m_pGlobalStream = new CPDF_StreamAcc;
- m_pGlobalStream->LoadAllData(pGlobals, false);
+ m_pGlobalStream->LoadAllData(pGlobals, FALSE);
}
}
ret = pJbig2Module->StartDecode(m_pJbig2Context, m_Width, m_Height, m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(),
@@ -438,7 +438,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause)
return ret1;
}
if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(false);
+ m_pColorSpace->EnableStdConversion(FALSE);
}
return ret1;
}
@@ -463,7 +463,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause)
return ret1;
}
if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(false);
+ m_pColorSpace->EnableStdConversion(FALSE);
}
return ret1;
}
@@ -472,11 +472,11 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause)
}
return 0;
}
-bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources)
+FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources)
{
m_bpc_orig = m_pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
if (m_pDict->GetInteger("ImageMask")) {
- m_bImageMask = true;
+ m_bImageMask = TRUE;
}
if (m_bImageMask || !m_pDict->KeyExist(FX_BSTRC("ColorSpace"))) {
if (!m_bImageMask) {
@@ -486,27 +486,27 @@ bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Diction
if (pFilter->GetType() == PDFOBJ_NAME) {
filter = pFilter->GetString();
if (filter == FX_BSTRC("JPXDecode")) {
- m_bDoBpcCheck = false;
- return true;
+ m_bDoBpcCheck = FALSE;
+ return TRUE;
}
} else if (pFilter->GetType() == PDFOBJ_ARRAY) {
CPDF_Array* pArray = (CPDF_Array*)pFilter;
if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("JPXDecode")) {
- m_bDoBpcCheck = false;
- return true;
+ m_bDoBpcCheck = FALSE;
+ return TRUE;
}
}
}
}
- m_bImageMask = true;
+ m_bImageMask = TRUE;
m_bpc = m_nComponents = 1;
CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode"));
m_bDefaultDecode = pDecode == NULL || pDecode->GetInteger(0) == 0;
- return true;
+ return TRUE;
}
CPDF_Object* pCSObj = m_pDict->GetElementValue(FX_BSTRC("ColorSpace"));
if (pCSObj == NULL) {
- return false;
+ return FALSE;
}
CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData();
if (pFormResources) {
@@ -516,7 +516,7 @@ bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Diction
m_pColorSpace = pDocPageData->GetColorSpace(pCSObj, pPageResources);
}
if (m_pColorSpace == NULL) {
- return false;
+ return FALSE;
}
m_Family = m_pColorSpace->GetFamily();
m_nComponents = m_pColorSpace->CountComponents();
@@ -533,11 +533,11 @@ bool CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Diction
ValidateDictParam();
m_pCompData = GetDecodeAndMaskArray(m_bDefaultDecode, m_bColorKey);
if (m_pCompData == NULL) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(bool& bDefaultDecode, bool& bColorKey)
+DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX_BOOL& bColorKey)
{
if (m_pColorSpace == NULL) {
return NULL;
@@ -556,7 +556,7 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(bool& bDefaultDecode, bool&
def_max = (FX_FLOAT)max_data;
}
if (def_min != pCompData[i].m_DecodeMin || def_max != max) {
- bDefaultDecode = false;
+ bDefaultDecode = FALSE;
}
}
} else {
@@ -584,7 +584,7 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(bool& bDefaultDecode, bool&
pCompData[i].m_ColorKeyMax = FX_MIN(max_num, max_data);
}
}
- bColorKey = true;
+ bColorKey = TRUE;
}
}
return pCompData;
@@ -612,7 +612,7 @@ int CPDF_DIBSource::CreateDecoder()
src_data, src_size, m_Width, m_Height, m_nComponents,
pParams ? pParams->GetInteger("ColorTransform", 1) : 1);
if (!m_pDecoder) {
- bool bTransform = false;
+ FX_BOOL bTransform = FALSE;
int comps, bpc;
ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule();
if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps, bpc, bTransform)) {
@@ -693,29 +693,29 @@ void CPDF_DIBSource::LoadJpxBitmap()
return;
int output_nComps;
- bool bTranslateColor;
- bool bSwapRGB = false;
+ FX_BOOL bTranslateColor;
+ FX_BOOL bSwapRGB = FALSE;
if (m_pColorSpace) {
if (codestream_nComps != (FX_DWORD)m_pColorSpace->CountComponents())
return;
output_nComps = codestream_nComps;
- bTranslateColor = false;
+ bTranslateColor = FALSE;
if (m_pColorSpace == CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB)) {
- bSwapRGB = true;
+ bSwapRGB = TRUE;
m_pColorSpace = nullptr;
}
} else {
- bTranslateColor = true;
+ bTranslateColor = TRUE;
if (image_nComps) {
output_nComps = image_nComps;
} else {
output_nComps = codestream_nComps;
}
if (output_nComps == 3) {
- bSwapRGB = true;
+ bSwapRGB = TRUE;
} else if (output_nComps == 4) {
m_pColorSpace = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
- bTranslateColor = false;
+ bTranslateColor = FALSE;
}
m_nComponents = output_nComps;
}
@@ -829,7 +829,7 @@ int CPDF_DIBSource::ContinueLoadMaskDIB(IFX_Pause* pPause)
return ret;
}
if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(false);
+ m_pColorSpace->EnableStdConversion(FALSE);
}
if (!ret) {
delete m_pMask;
@@ -847,7 +847,7 @@ CPDF_DIBSource* CPDF_DIBSource::DetachMask()
CPDF_DIBSource* CPDF_DIBSource::LoadMaskDIB(CPDF_Stream* pMask)
{
CPDF_DIBSource* pMaskSource = new CPDF_DIBSource;
- if (!pMaskSource->Load(m_pDocument, pMask, NULL, NULL, NULL, NULL, true)) {
+ if (!pMaskSource->Load(m_pDocument, pMask, NULL, NULL, NULL, NULL, TRUE)) {
delete pMaskSource;
return NULL;
}
@@ -856,7 +856,7 @@ CPDF_DIBSource* CPDF_DIBSource::LoadMaskDIB(CPDF_Stream* pMask)
int CPDF_DIBSource::StartLoadMaskDIB()
{
m_pMask = new CPDF_DIBSource;
- int ret = m_pMask->StartLoadDIBSource(m_pDocument, (CPDF_Stream*)m_pMaskStream, false, NULL, NULL, true);
+ int ret = m_pMask->StartLoadDIBSource(m_pDocument, (CPDF_Stream*)m_pMaskStream, FALSE, NULL, NULL, TRUE);
if (ret == 2) {
if (m_Status == 0) {
m_Status = 2;
@@ -1209,15 +1209,15 @@ const uint8_t* CPDF_DIBSource::GetScanline(int line) const
}
return pSrcLine;
}
-bool CPDF_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const
+FX_BOOL CPDF_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const
{
if (m_pDecoder) {
return m_pDecoder->SkipToScanline(line, pPause);
}
- return false;
+ return FALSE;
}
void CPDF_DIBSource::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
{
if (line < 0 || dest_scan == NULL || dest_bpp <= 0 ||
dest_width <= 0 || clip_left < 0 || clip_width <= 0) {
@@ -1480,26 +1480,26 @@ CPDF_ProgressiveImageLoaderHandle::CPDF_ProgressiveImageLoaderHandle()
CPDF_ProgressiveImageLoaderHandle::~CPDF_ProgressiveImageLoaderHandle()
{
}
-bool CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight)
+FX_BOOL CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight)
{
m_pImageLoader = pImageLoader;
m_pCache = pCache;
m_pImage = (CPDF_ImageObject*)pImage;
m_nDownsampleWidth = nDownsampleWidth;
m_nDownsampleHeight = nDownsampleHeight;
- bool ret;
+ FX_BOOL ret;
if (pCache) {
ret = pCache->StartGetCachedBitmap(pImage->m_pImage->GetStream(), bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
- if (ret == false) {
- m_pImageLoader->m_bCached = true;
+ if (ret == FALSE) {
+ m_pImageLoader->m_bCached = TRUE;
m_pImageLoader->m_pBitmap = pCache->m_pCurImageCache->DetachBitmap();
m_pImageLoader->m_pMask = pCache->m_pCurImageCache->DetachMask();
m_pImageLoader->m_MatteColor = pCache->m_pCurImageCache->m_MatteColor;
}
} else {
ret = pImage->m_pImage->StartLoadDIBSource(pRenderStatus->m_pFormResource, pRenderStatus->m_pPageResource, bStdCS, GroupFamily, bLoadMask);
- if (ret == false) {
- m_pImageLoader->m_bCached = false;
+ if (ret == FALSE) {
+ m_pImageLoader->m_bCached = FALSE;
m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap();
m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask();
m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor;
@@ -1507,21 +1507,21 @@ bool CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, co
}
return ret;
}
-bool CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause)
+FX_BOOL CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause)
{
- bool ret;
+ FX_BOOL ret;
if (m_pCache) {
ret = m_pCache->Continue(pPause);
- if (ret == false) {
- m_pImageLoader->m_bCached = true;
+ if (ret == FALSE) {
+ m_pImageLoader->m_bCached = TRUE;
m_pImageLoader->m_pBitmap = m_pCache->m_pCurImageCache->DetachBitmap();
m_pImageLoader->m_pMask = m_pCache->m_pCurImageCache->DetachMask();
m_pImageLoader->m_MatteColor = m_pCache->m_pCurImageCache->m_MatteColor;
}
} else {
ret = m_pImage->m_pImage->Continue(pPause);
- if (ret == false) {
- m_pImageLoader->m_bCached = false;
+ if (ret == FALSE) {
+ m_pImageLoader->m_bCached = FALSE;
m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap();
m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask();
m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor;
@@ -1529,30 +1529,30 @@ bool CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause)
}
return ret;
}
-bool CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus)
+FX_BOOL CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus)
{
if (pImage == NULL) {
- return false;
+ return FALSE;
}
if (pCache) {
pCache->GetCachedBitmap(pImage->m_pImage->GetStream(), m_pBitmap, m_pMask, m_MatteColor, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
- m_bCached = true;
+ m_bCached = TRUE;
} else {
m_pBitmap = pImage->m_pImage->LoadDIBSource(&m_pMask, &m_MatteColor, bStdCS, GroupFamily, bLoadMask);
- m_bCached = false;
+ m_bCached = FALSE;
}
- return false;
+ return FALSE;
}
-bool CPDF_ImageLoader::StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, void*& LoadHandle, bool bStdCS, FX_DWORD GroupFamily, bool bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight)
+FX_BOOL CPDF_ImageLoader::StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, void*& LoadHandle, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, int32_t nDownsampleWidth, int32_t nDownsampleHeight)
{
m_nDownsampleWidth = nDownsampleWidth;
m_nDownsampleHeight = nDownsampleHeight;
CPDF_ProgressiveImageLoaderHandle* pLoaderHandle = new CPDF_ProgressiveImageLoaderHandle;
- bool ret = pLoaderHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
+ FX_BOOL ret = pLoaderHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
LoadHandle = pLoaderHandle;
return ret;
}
-bool CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause)
+FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause)
{
return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause);
}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index e08649062c..3ee2222d8b 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -29,7 +29,7 @@ static void _DrawAxialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2B
t_min = pArray->GetNumber(0);
t_max = pArray->GetNumber(1);
}
- bool bStartExtend = false, bEndExtend = false;
+ FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
pArray = pDict->GetArray(FX_BSTRC("Extend"));
if (pArray) {
bStartExtend = pArray->GetInteger(0);
@@ -116,7 +116,7 @@ static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2
t_min = pArray->GetNumber(0);
t_max = pArray->GetNumber(1);
}
- bool bStartExtend = false, bEndExtend = false;
+ FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
pArray = pDict->GetArray(FX_BSTRC("Extend"));
if (pArray) {
bStartExtend = pArray->GetInteger(0);
@@ -155,11 +155,11 @@ static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
int pitch = pBitmap->GetPitch();
- bool bDecreasing = false;
+ FX_BOOL bDecreasing = FALSE;
if (start_r > end_r) {
int length = (int)FXSYS_sqrt((FXSYS_Mul(start_x - end_x, start_x - end_x) + FXSYS_Mul(start_y - end_y, start_y - end_y)));
if (length < start_r - end_r) {
- bDecreasing = true;
+ bDecreasing = TRUE;
}
}
for (int row = 0; row < height; row ++) {
@@ -281,22 +281,22 @@ static void _DrawFuncShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bi
}
}
}
-bool _GetScanlineIntersect(int y, FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_FLOAT& x)
+FX_BOOL _GetScanlineIntersect(int y, FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_FLOAT& x)
{
if (y1 == y2) {
- return false;
+ return FALSE;
}
if (y1 < y2) {
if (y < y1 || y > y2) {
- return false;
+ return FALSE;
}
} else {
if (y < y2 || y > y1) {
- return false;
+ return FALSE;
}
}
x = x1 + FXSYS_MulDiv(x2 - x1, y - y1, y2 - y1);
- return true;
+ return TRUE;
}
static void _DrawGouraud(CFX_DIBitmap* pBitmap, int alpha, CPDF_MeshVertex triangle[3])
{
@@ -325,7 +325,7 @@ static void _DrawGouraud(CFX_DIBitmap* pBitmap, int alpha, CPDF_MeshVertex trian
for (int i = 0; i < 3; i ++) {
CPDF_MeshVertex& vertex1 = triangle[i];
CPDF_MeshVertex& vertex2 = triangle[(i + 1) % 3];
- bool bIntersect = _GetScanlineIntersect(y, vertex1.x, vertex1.y,
+ FX_BOOL bIntersect = _GetScanlineIntersect(y, vertex1.x, vertex1.y,
vertex2.x, vertex2.y, inter_x[nIntersects]);
if (!bIntersect) {
continue;
@@ -601,7 +601,7 @@ struct CPDF_PatchDrawer {
int alpha;
void Draw(int x_scale, int y_scale, int left, int bottom, Coon_Bezier C1, Coon_Bezier C2, Coon_Bezier D1, Coon_Bezier D2)
{
- bool bSmall = C1.Distance() < 2 && C2.Distance() < 2 && D1.Distance() < 2 && D2.Distance() < 2;
+ FX_BOOL bSmall = C1.Distance() < 2 && C2.Distance() < 2 && D1.Distance() < 2 && D2.Distance() < 2;
Coon_Color div_colors[4];
int d_bottom, d_left, d_top, d_right;
div_colors[0].BiInterpol(patch_colors, left, bottom, x_scale, y_scale);
@@ -663,9 +663,9 @@ struct CPDF_PatchDrawer {
}
};
-bool _CheckCoonTensorPara(const CPDF_MeshStream &stream)
+FX_BOOL _CheckCoonTensorPara(const CPDF_MeshStream &stream)
{
- bool bCoorBits = ( stream.m_nCoordBits== 1 ||
+ FX_BOOL bCoorBits = ( stream.m_nCoordBits== 1 ||
stream.m_nCoordBits == 2 ||
stream.m_nCoordBits == 4 ||
stream.m_nCoordBits == 8 ||
@@ -674,21 +674,21 @@ bool _CheckCoonTensorPara(const CPDF_MeshStream &stream)
stream.m_nCoordBits == 24 ||
stream.m_nCoordBits == 32 );
- bool bCompBits = ( stream.m_nCompBits == 1 ||
+ FX_BOOL bCompBits = ( stream.m_nCompBits == 1 ||
stream.m_nCompBits == 2 ||
stream.m_nCompBits == 4 ||
stream.m_nCompBits == 8 ||
stream.m_nCompBits == 12 ||
stream.m_nCompBits == 16 );
- bool bFlagBits = ( stream.m_nFlagBits == 2 ||
+ FX_BOOL bFlagBits = ( stream.m_nFlagBits == 2 ||
stream.m_nFlagBits == 4 ||
stream.m_nFlagBits == 8 );
return bCoorBits && bCompBits && bFlagBits;
}
-static void _DrawCoonPatchMeshes(bool bTensor, CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
+static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs,
CPDF_ColorSpace* pCS, int fill_mode, int alpha)
{
@@ -768,7 +768,7 @@ static void _DrawCoonPatchMeshes(bool bTensor, CFX_DIBitmap* pBitmap, CFX_Affine
}
}
void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix,
- FX_RECT& clip_rect, int alpha, bool bAlphaMode)
+ FX_RECT& clip_rect, int alpha, FX_BOOL bAlphaMode)
{
CPDF_Function** pFuncs = pPattern->m_pFunctions;
int nFuncs = pPattern->m_nFuncs;
@@ -840,7 +840,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMat
}
buffer.OutputToDevice();
}
-void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, bool bStroke)
+void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
{
if (!pattern->Load()) {
return;
@@ -858,7 +858,7 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_Pa
return;
}
FX_RECT rect;
- if (GetObjectClippedRect(pPageObj, pObj2Device, false, rect)) {
+ if (GetObjectClippedRect(pPageObj, pObj2Device, FALSE, rect)) {
m_pDevice->RestoreState();
return;
}
@@ -869,19 +869,19 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_Pa
DrawShading(pattern, &matrix, rect, alpha, m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
m_pDevice->RestoreState();
}
-bool CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device)
{
FX_RECT rect = pShadingObj->GetBBox(pObj2Device);
FX_RECT clip_box = m_pDevice->GetClipBox();
rect.Intersect(clip_box);
if (rect.IsEmpty()) {
- return true;
+ return TRUE;
}
CFX_AffineMatrix matrix = pShadingObj->m_Matrix;
matrix.Concat(*pObj2Device);
- DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralState.GetAlpha(false),
+ DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralState.GetAlpha(FALSE),
m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
- return true;
+ return TRUE;
}
static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache* pCache,
CPDF_TilingPattern* pPattern, const CFX_AffineMatrix* pObject2Device,
@@ -914,7 +914,7 @@ static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache
context.DrawObjectList(&bitmap_device, pPattern->m_pForm, &mtPattern2Bitmap, &options);
return pBitmap;
}
-void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, bool bStroke)
+void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
{
if (!pPattern->Load()) {
return;
@@ -944,11 +944,11 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_Pag
CFX_AffineMatrix mtPattern2Device = pPattern->m_Pattern2Form;
mtPattern2Device.Concat(*pObj2Device);
GetScaledMatrix(mtPattern2Device);
- bool bAligned = false;
+ FX_BOOL bAligned = FALSE;
if (pPattern->m_BBox.left == 0 && pPattern->m_BBox.bottom == 0 &&
pPattern->m_BBox.right == pPattern->m_XStep && pPattern->m_BBox.top == pPattern->m_YStep &&
(mtPattern2Device.IsScaled() || mtPattern2Device.Is90Rotated())) {
- bAligned = true;
+ bAligned = TRUE;
}
CFX_FloatRect cell_bbox = pPattern->m_BBox;
mtPattern2Device.TransformRect(cell_bbox);
@@ -1075,11 +1075,11 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_Pag
}
}
}
- CompositeDIBitmap(&screen, clip_box.left, clip_box.top, 0, 255, FXDIB_BLEND_NORMAL, false);
+ CompositeDIBitmap(&screen, clip_box.left, clip_box.top, 0, 255, FXDIB_BLEND_NORMAL, FALSE);
m_pDevice->RestoreState();
delete pPatternBitmap;
}
-void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, bool bStroke)
+void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_BOOL bStroke)
{
CPDF_Pattern* pattern = pColor->GetPattern();
if (pattern == NULL) {
@@ -1091,20 +1091,20 @@ void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX
DrawShadingPattern((CPDF_ShadingPattern*)pattern, pPathObj, pObj2Device, bStroke);
}
}
-void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, bool& bStroke)
+void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_BOOL& bStroke)
{
if(filltype) {
CPDF_Color& FillColor = *pPathObj->m_ColorState.GetFillColor();
if(FillColor.m_pCS && FillColor.m_pCS->GetFamily() == PDFCS_PATTERN) {
- DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, false);
+ DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, FALSE);
filltype = 0;
}
}
if(bStroke) {
CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor();
if(StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) {
- DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, true);
- bStroke = false;
+ DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE);
+ bStroke = FALSE;
}
}
}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 26138a9fbf..ad5dc58a1c 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -9,7 +9,7 @@
#include "../../../include/fpdfapi/fpdf_pageobj.h"
#include "../fpdf_page/pageint.h"
#include "render_int.h"
-extern bool IsAvailableMatrix(const CFX_AffineMatrix& matrix);
+extern FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix);
CPDF_Type3Cache::~CPDF_Type3Cache()
{
FX_POSITION pos = m_SizeMap.GetStartPosition();
@@ -76,28 +76,28 @@ void CPDF_Type3Glyphs::AdjustBlue(FX_FLOAT top, FX_FLOAT bottom, int& top_line,
top_line = _AdjustBlue(top, m_TopBlueCount, m_TopBlue);
bottom_line = _AdjustBlue(bottom, m_BottomBlueCount, m_BottomBlue);
}
-static bool _IsScanLine1bpp(uint8_t* pBuf, int width)
+static FX_BOOL _IsScanLine1bpp(uint8_t* pBuf, int width)
{
int size = width / 8;
for (int i = 0; i < size; i ++)
if (pBuf[i]) {
- return true;
+ return TRUE;
}
if (width % 8)
if (pBuf[width / 8] & (0xff << (8 - width % 8))) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-static bool _IsScanLine8bpp(uint8_t* pBuf, int width)
+static FX_BOOL _IsScanLine8bpp(uint8_t* pBuf, int width)
{
for (int i = 0; i < width; i ++)
if (pBuf[i] > 0x40) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, bool bFirst)
+static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, FX_BOOL bFirst)
{
int height = pBitmap->GetHeight(), pitch = pBitmap->GetPitch(), width = pBitmap->GetWidth();
int bpp = pBitmap->GetBPP();
@@ -137,12 +137,12 @@ CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize, FX_DWORD
int left, top;
if (FXSYS_fabs(image_matrix.b) < FXSYS_fabs(image_matrix.a) / 100 && FXSYS_fabs(image_matrix.c) < FXSYS_fabs(image_matrix.d) / 100) {
int top_line, bottom_line;
- top_line = _DetectFirstLastScan(pBitmap, true);
- bottom_line = _DetectFirstLastScan(pBitmap, false);
+ top_line = _DetectFirstLastScan(pBitmap, TRUE);
+ bottom_line = _DetectFirstLastScan(pBitmap, FALSE);
if (top_line == 0 && bottom_line == pBitmap->GetHeight() - 1) {
FX_FLOAT top_y = image_matrix.d + image_matrix.f;
FX_FLOAT bottom_y = image_matrix.f;
- bool bFlipped = top_y > bottom_y;
+ FX_BOOL bFlipped = top_y > bottom_y;
if (bFlipped) {
FX_FLOAT temp = top_y;
top_y = bottom_y;
@@ -185,76 +185,76 @@ void _CPDF_UniqueKeyGen::Generate(int count, ...)
va_end(argList);
m_KeyLen = count * sizeof(FX_DWORD);
}
-bool CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath)
+FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath)
{
if(textobj->m_nChars == 0) {
- return true;
+ return TRUE;
}
int text_render_mode = textobj->m_TextState.GetObject()->m_TextMode;
if (text_render_mode == 3) {
- return true;
+ return TRUE;
}
CPDF_Font* pFont = textobj->m_TextState.GetFont();
if (pFont->GetFontType() == PDFFONT_TYPE3) {
return ProcessType3Text(textobj, pObj2Device);
}
- bool bFill = false, bStroke = false, bClip = false;
+ FX_BOOL bFill = FALSE, bStroke = FALSE, bClip = FALSE;
if (pClippingPath) {
- bClip = true;
+ bClip = TRUE;
} else {
switch (text_render_mode) {
case 0:
case 4:
- bFill = true;
+ bFill = TRUE;
break;
case 1:
case 5:
if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
- bFill = true;
+ bFill = TRUE;
} else {
- bStroke = true;
+ bStroke = TRUE;
}
break;
case 2:
case 6:
if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
- bFill = true;
+ bFill = TRUE;
} else {
- bFill = bStroke = true;
+ bFill = bStroke = TRUE;
}
break;
case 3:
case 7:
- return true;
+ return TRUE;
default:
- bFill = true;
+ bFill = TRUE;
}
}
FX_ARGB stroke_argb = 0, fill_argb = 0;
- bool bPattern = false;
+ FX_BOOL bPattern = FALSE;
if (bStroke) {
if (textobj->m_ColorState.GetStrokeColor()->IsPattern()) {
- bPattern = true;
+ bPattern = TRUE;
} else {
stroke_argb = GetStrokeArgb(textobj);
}
}
if (bFill) {
if (textobj->m_ColorState.GetFillColor()->IsPattern()) {
- bPattern = true;
+ bPattern = TRUE;
} else {
fill_argb = GetFillArgb(textobj);
}
}
CFX_AffineMatrix text_matrix;
textobj->GetTextMatrix(&text_matrix);
- if(IsAvailableMatrix(text_matrix) == false) {
- return true;
+ if(IsAvailableMatrix(text_matrix) == FALSE) {
+ return TRUE;
}
FX_FLOAT font_size = textobj->m_TextState.GetFontSize();
if (bPattern) {
DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, &text_matrix, bFill, bStroke);
- return true;
+ return TRUE;
}
if (bClip || bStroke) {
const CFX_AffineMatrix* pDeviceMatrix = pObj2Device;
@@ -293,7 +293,7 @@ CPDF_Type3Cache* CPDF_RenderStatus::GetCachedType3(CPDF_Type3Font* pFont)
if (pFont->m_pDocument == NULL) {
return NULL;
}
- pFont->m_pDocument->GetPageData()->GetFont(pFont->GetFontDict(), false);
+ pFont->m_pDocument->GetPageData()->GetFont(pFont->GetFontDict(), FALSE);
return pFont->m_pDocument->GetRenderData()->GetCachedType3(pFont);
}
static void ReleaseCachedType3(CPDF_Type3Font* pFont)
@@ -304,10 +304,10 @@ static void ReleaseCachedType3(CPDF_Type3Font* pFont)
pFont->m_pDocument->GetRenderData()->ReleaseCachedType3(pFont);
pFont->m_pDocument->GetPageData()->ReleaseFont(pFont->GetFontDict());
}
-bool CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext)
+FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext)
{
if (m_pBitmap != NULL || m_pForm == NULL) {
- return true;
+ return TRUE;
}
if (m_pForm->CountObjects() == 1 && !m_bColored) {
CPDF_PageObject *pPageObj = m_pForm->GetObjectAt(m_pForm->GetFirstObjectPosition());
@@ -321,10 +321,10 @@ bool CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext)
}
delete m_pForm;
m_pForm = NULL;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
class CPDF_RefType3Cache
{
@@ -343,12 +343,12 @@ public:
FX_DWORD m_dwCount;
CPDF_Type3Font* m_pType3Font;
};
-bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device)
+FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device)
{
CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->GetType3Font();
for (int j = 0; j < m_Type3FontCache.GetSize(); j++)
if ((CPDF_Type3Font*)m_Type3FontCache.GetAt(j) == pType3Font) {
- return true;
+ return TRUE;
}
CFX_Matrix dCTM = m_pDevice->GetCTM();
FX_FLOAT sa = FXSYS_fabs(dCTM.a);
@@ -358,14 +358,14 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
CFX_AffineMatrix char_matrix = pType3Font->GetFontMatrix();
FX_FLOAT font_size = textobj->m_TextState.GetFontSize();
char_matrix.Scale(font_size, font_size);
- FX_ARGB fill_argb = GetFillArgb(textobj, true);
+ FX_ARGB fill_argb = GetFillArgb(textobj, TRUE);
int fill_alpha = FXARGB_A(fill_argb);
int device_class = m_pDevice->GetDeviceClass();
FXTEXT_GLYPHPOS* pGlyphAndPos = NULL;
if (device_class == FXDC_DISPLAY) {
pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, textobj->m_nChars);
} else if (fill_alpha < 255) {
- return false;
+ return FALSE;
}
CPDF_RefType3Cache refTypeCache(pType3Font);
FX_DWORD *pChars = textobj->m_pCharCodes;
@@ -399,7 +399,7 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
FX_Free(pGlyphAndPos);
pGlyphAndPos = NULL;
}
- CPDF_GraphicStates* pStates = CloneObjStates(textobj, false);
+ CPDF_GraphicStates* pStates = CloneObjStates(textobj, FALSE);
CPDF_RenderOptions Options = m_Options;
Options.m_Flags |= RENDER_FORCE_HALFTONE | RENDER_RECT_AA;
Options.m_Flags &= ~RENDER_FORCE_DOWNSAMPLE;
@@ -410,7 +410,7 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
if (fill_alpha == 255) {
CPDF_RenderStatus status;
status.Initialize(m_pContext, m_pDevice, NULL, NULL, this, pStates, &Options,
- pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, false, pType3Char, fill_argb);
+ pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, FALSE, pType3Char, fill_argb);
status.m_Type3FontCache.Append(m_Type3FontCache);
status.m_Type3FontCache.Add(pType3Font);
m_pDevice->SaveState();
@@ -422,12 +422,12 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
FX_RECT rect = rect_f.GetOutterRect();
CFX_FxgeDevice bitmap_device;
if (!bitmap_device.Create((int)(rect.Width() * sa), (int)(rect.Height() * sd), FXDIB_Argb)) {
- return true;
+ return TRUE;
}
bitmap_device.GetBitmap()->Clear(0);
CPDF_RenderStatus status;
status.Initialize(m_pContext, &bitmap_device, NULL, NULL, this, pStates, &Options,
- pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, false, pType3Char, fill_argb);
+ pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, FALSE, pType3Char, fill_argb);
status.m_Type3FontCache.Append(m_Type3FontCache);
status.m_Type3FontCache.Add(pType3Font);
matrix.TranslateI(-rect.left, -rect.top);
@@ -457,11 +457,11 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
CFX_AffineMatrix image_matrix = pType3Char->m_ImageMatrix;
image_matrix.Concat(matrix);
CPDF_ImageRenderer renderer;
- if (renderer.Start(this, pType3Char->m_pBitmap, fill_argb, 255, &image_matrix, 0, false)) {
+ if (renderer.Start(this, pType3Char->m_pBitmap, fill_argb, 255, &image_matrix, 0, FALSE)) {
renderer.Continue(NULL);
}
if (!renderer.m_Result) {
- return false;
+ return FALSE;
}
}
}
@@ -471,7 +471,7 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
CFX_DIBitmap bitmap;
if (!bitmap.Create((int)(rect.Width() * sa), (int)(rect.Height() * sd), FXDIB_8bppMask)) {
FX_Free(pGlyphAndPos);
- return true;
+ return TRUE;
}
bitmap.Clear(0);
for (int iChar = 0; iChar < textobj->m_nChars; iChar ++) {
@@ -487,7 +487,7 @@ bool CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const C
m_pDevice->SetBitMask(&bitmap, rect.left, rect.top, fill_argb);
FX_Free(pGlyphAndPos);
}
- return true;
+ return TRUE;
}
class CPDF_CharPosList
{
@@ -515,13 +515,13 @@ void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos
m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, nChars);
m_nChars = 0;
CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
- bool bVertWriting = pCIDFont && pCIDFont->IsVertWriting();
+ FX_BOOL bVertWriting = pCIDFont && pCIDFont->IsVertWriting();
for (int iChar = 0; iChar < nChars; iChar ++) {
FX_DWORD CharCode = nChars == 1 ? (FX_DWORD)(uintptr_t)pCharCodes : pCharCodes[iChar];
if (CharCode == (FX_DWORD) - 1) {
continue;
}
- bool bVert = false;
+ FX_BOOL bVert = FALSE;
FXTEXT_CHARPOS& charpos = m_pCharPos[m_nChars++];
if (pCIDFont) {
charpos.m_bFontStyle = pCIDFont->IsFontStyleFromCharCode(CharCode);
@@ -537,7 +537,7 @@ void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos
}
charpos.m_OriginX = iChar ? pCharPos[iChar - 1] : 0;
charpos.m_OriginY = 0;
- charpos.m_bGlyphAdjust = false;
+ charpos.m_bGlyphAdjust = FALSE;
if (pCIDFont == NULL) {
continue;
}
@@ -558,11 +558,11 @@ void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos
charpos.m_AdjustMatrix[3] = _CIDTransformToFloat(pTransform[3]);
charpos.m_OriginX += _CIDTransformToFloat(pTransform[4]) * FontSize;
charpos.m_OriginY += _CIDTransformToFloat(pTransform[5]) * FontSize;
- charpos.m_bGlyphAdjust = true;
+ charpos.m_bGlyphAdjust = TRUE;
}
}
}
-bool CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+FX_BOOL CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
CPDF_Font* pFont, FX_FLOAT font_size,
const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device,
const CFX_GraphStateData* pGraphState,
@@ -632,7 +632,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, FX_FLOAT origi
FX_Free(pCharPos);
}
}
-bool CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+FX_BOOL CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
CPDF_Font* pFont, FX_FLOAT font_size,
const CFX_AffineMatrix* pText2Device,
FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions)
@@ -671,13 +671,13 @@ bool CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX
}
void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device,
CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pTextMatrix, bool bFill, bool bStroke)
+ const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke)
{
if (!bStroke) {
CPDF_PathObject path;
CPDF_TextObject* pCopy = new CPDF_TextObject;
pCopy->Copy(textobj);
- path.m_bStroke = false;
+ path.m_bStroke = FALSE;
path.m_FillType = FXFILL_WINDING;
path.m_ClipPath.AppendTexts(&pCopy, 1);
path.m_ColorState = textobj->m_ColorState;
diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h
index c9c8944a0b..e5fb831a63 100644
--- a/core/src/fpdfapi/fpdf_render/render_int.h
+++ b/core/src/fpdfapi/fpdf_render/render_int.h
@@ -49,9 +49,9 @@ class CPDF_TransferFunc
public:
CPDF_Document* m_pPDFDoc;
uint8_t m_Samples[256 * 3];
- bool m_bIdentity;
+ FX_BOOL m_bIdentity;
- CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, bool bAutoDropSrc);
+ CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc);
FX_COLORREF TranslateColor(FX_COLORREF src);
};
@@ -66,7 +66,7 @@ public:
{
return m_pFontCache;
}
- void Clear(bool bRelease = false);
+ void Clear(FX_BOOL bRelease = FALSE);
void ReleaseCachedType3(CPDF_Type3Font* pFont);
void ReleaseTransferFunc(CPDF_Object* pObj);
private:
@@ -91,24 +91,24 @@ class IPDF_ObjectRenderer
public:
static IPDF_ObjectRenderer* Create(int type);
virtual ~IPDF_ObjectRenderer() {}
- virtual bool Start(CPDF_RenderStatus* pRenderStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bStdCS, int blendType = FXDIB_BLEND_NORMAL) = 0;
- virtual bool Continue(IFX_Pause* pPause) = 0;
- bool m_Result;
+ virtual FX_BOOL Start(CPDF_RenderStatus* pRenderStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL) = 0;
+ virtual FX_BOOL Continue(IFX_Pause* pPause) = 0;
+ FX_BOOL m_Result;
};
class CPDF_RenderStatus
{
public:
CPDF_RenderStatus();
~CPDF_RenderStatus();
- bool Initialize(class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix,
+ FX_BOOL Initialize(class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix,
const CPDF_PageObject* pStopObj, const CPDF_RenderStatus* pParentStatus,
const CPDF_GraphicStates* pInitialStates, const CPDF_RenderOptions* pOptions,
- int transparency, bool bDropObjects, CPDF_Dictionary* pFormResource = NULL,
- bool bStdCS = false, CPDF_Type3Char* pType3Char = NULL, FX_ARGB fill_color = 0,
- FX_DWORD GroupFamily = 0, bool bLoadMask = false);
+ int transparency, FX_BOOL bDropObjects, CPDF_Dictionary* pFormResource = NULL,
+ FX_BOOL bStdCS = FALSE, CPDF_Type3Char* pType3Char = NULL, FX_ARGB fill_color = 0,
+ FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
void RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device);
void RenderSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- bool ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause);
+ FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause);
CPDF_RenderOptions m_Options;
CPDF_Dictionary* m_pFormResource;
CPDF_Dictionary* m_pPageResource;
@@ -122,45 +122,45 @@ protected:
friend class CPDF_RenderContext;
void ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device);
void DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device);
- bool ProcessTransparency(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessTransparency(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device);
void ProcessObjectNoClip(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device);
void DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- bool DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- bool ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device);
- void ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, bool& bStroke);
- void DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, bool bStroke);
- void DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, bool bStroke);
- void DrawShadingPattern(CPDF_ShadingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, bool bStroke);
- bool SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, bool bStroke);
- bool ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device);
- bool OutputBitmapAlpha(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device);
- bool OutputImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device);
- bool OutputDIBSource(const CFX_DIBSource* pOutputBitmap, FX_ARGB fill_argb, int bitmap_alpha,
+ FX_BOOL DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device);
+ void ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_BOOL& bStroke);
+ void DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_BOOL bStroke);
+ void DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
+ void DrawShadingPattern(CPDF_ShadingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
+ FX_BOOL SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
+ FX_BOOL ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device);
+ FX_BOOL OutputImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device);
+ FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap, FX_ARGB fill_argb, int bitmap_alpha,
const CFX_AffineMatrix* pImage2Device, CPDF_ImageCache* pImageCache, FX_DWORD flags);
void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int top, FX_ARGB mask_argb,
int bitmap_alpha, int blend_mode, int bIsolated);
- bool ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device);
void DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix, FX_RECT& clip_rect,
- int alpha, bool bAlphaMode);
- bool ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device);
- bool ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath);
+ int alpha, FX_BOOL bAlphaMode);
+ FX_BOOL ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath);
void DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device,
CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pTextMatrix, bool bFill, bool bStroke);
- bool ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device);
+ const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke);
+ FX_BOOL ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device);
CFX_DIBitmap* GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top,
- bool bBackAlphaRequired);
+ FX_BOOL bBackAlphaRequired);
CFX_DIBitmap* LoadSMask(CPDF_Dictionary* pSMaskDict, FX_RECT* pClipRect, const CFX_AffineMatrix* pMatrix);
void Init(CPDF_RenderContext* pParent);
static class CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont);
- static CPDF_GraphicStates* CloneObjStates(const CPDF_GraphicStates* pPathObj, bool bStroke);
+ static CPDF_GraphicStates* CloneObjStates(const CPDF_GraphicStates* pPathObj, FX_BOOL bStroke);
CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObject) const;
- FX_ARGB GetFillArgb(const CPDF_PageObject* pObj, bool bType3 = false) const;
+ FX_ARGB GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3 = FALSE) const;
FX_ARGB GetStrokeArgb(const CPDF_PageObject* pObj) const;
CPDF_RenderContext* m_pContext;
- bool m_bStopped;
+ FX_BOOL m_bStopped;
void DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- bool GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bLogical, FX_RECT &rect) const;
+ FX_BOOL GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const;
void GetScaledMatrix(CFX_Matrix &matrix) const;
protected:
@@ -175,13 +175,13 @@ protected:
CPDF_GraphicStates m_InitialStates;
int m_HalftoneLimit;
IPDF_ObjectRenderer* m_pObjectRenderer;
- bool m_bPrint;
+ FX_BOOL m_bPrint;
int m_Transparency;
int m_DitherBits;
- bool m_bDropObjects;
- bool m_bStdCS;
+ FX_BOOL m_bDropObjects;
+ FX_BOOL m_bStdCS;
FX_DWORD m_GroupFamily;
- bool m_bLoadMask;
+ FX_BOOL m_bLoadMask;
CPDF_Type3Char * m_pType3Char;
FX_ARGB m_T3FillColor;
int m_curBlend;
@@ -194,20 +194,20 @@ public:
m_pBitmap = NULL;
m_pMask = NULL;
m_MatteColor = 0;
- m_bCached = false;
+ m_bCached = FALSE;
m_nDownsampleWidth = 0;
m_nDownsampleHeight = 0;
}
- bool Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL);
+ FX_BOOL Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL);
- bool StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, void*& LoadHandle, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0);
- bool Continue(void* LoadHandle, IFX_Pause* pPause);
+ FX_BOOL StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, void*& LoadHandle, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0);
+ FX_BOOL Continue(void* LoadHandle, IFX_Pause* pPause);
~CPDF_ImageLoader();
CFX_DIBSource* m_pBitmap;
CFX_DIBSource* m_pMask;
FX_DWORD m_MatteColor;
- bool m_bCached;
+ FX_BOOL m_bCached;
protected:
int32_t m_nDownsampleWidth;
int32_t m_nDownsampleHeight;
@@ -218,8 +218,8 @@ public:
CPDF_ProgressiveImageLoaderHandle();
~CPDF_ProgressiveImageLoaderHandle();
- bool Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0);
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t nDownsampleWidth = 0, int32_t nDownsampleHeight = 0);
+ FX_BOOL Continue(IFX_Pause* pPause);
protected:
CPDF_ImageLoader* m_pImageLoader;
CPDF_PageRenderCache* m_pCache;
@@ -233,10 +233,10 @@ class CPDF_ImageRenderer : public IPDF_ObjectRenderer
public:
CPDF_ImageRenderer();
~CPDF_ImageRenderer();
- bool Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, bool bStdCS, int blendType = FXDIB_BLEND_NORMAL);
- bool Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb,
- int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, bool bStdCS, int blendType = FXDIB_BLEND_NORMAL);
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL);
+ FX_BOOL Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb,
+ int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL);
+ FX_BOOL Continue(IFX_Pause* pPause);
protected:
CPDF_RenderStatus* m_pRenderStatus;
CPDF_ImageObject* m_pImageObject;
@@ -247,7 +247,7 @@ protected:
const CFX_DIBSource* m_pDIBSource;
CFX_DIBitmap* m_pClone;
int m_BitmapAlpha;
- bool m_bPatternColor;
+ FX_BOOL m_bPatternColor;
CPDF_Pattern* m_pPattern;
FX_ARGB m_FillArgb;
FX_DWORD m_Flags;
@@ -255,21 +255,21 @@ protected:
CFX_ImageTransformer* m_pTransformer;
void* m_DeviceHandle;
void* m_LoadHandle;
- bool m_bStdCS;
+ FX_BOOL m_bStdCS;
int m_BlendType;
- bool StartBitmapAlpha();
- bool StartDIBSource();
- bool StartRenderDIBSource();
- bool StartLoadDIBSource();
- bool DrawMaskedImage();
- bool DrawPatternImage(const CFX_Matrix* pObj2Device);
+ FX_BOOL StartBitmapAlpha();
+ FX_BOOL StartDIBSource();
+ FX_BOOL StartRenderDIBSource();
+ FX_BOOL StartLoadDIBSource();
+ FX_BOOL DrawMaskedImage();
+ FX_BOOL DrawPatternImage(const CFX_Matrix* pObj2Device);
};
class CPDF_ScaledRenderBuffer
{
public:
CPDF_ScaledRenderBuffer();
~CPDF_ScaledRenderBuffer();
- bool Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+ FX_BOOL Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
const CPDF_PageObject* pObj, const CPDF_RenderOptions *pOptions = NULL, int max_dpi = 0);
CFX_RenderDevice* GetDevice()
{
@@ -294,13 +294,13 @@ class CPDF_QuickStretcher
public:
CPDF_QuickStretcher();
~CPDF_QuickStretcher();
- bool Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox);
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox);
+ FX_BOOL Continue(IFX_Pause* pPause);
CFX_DIBitmap* m_pBitmap;
int m_ResultLeft, m_ResultTop, m_ClipLeft, m_ClipTop;
int m_DestWidth, m_DestHeight, m_ResultWidth, m_ResultHeight;
int m_Bpp, m_SrcWidth, m_SrcHeight;
- bool m_bFlipX, m_bFlipY;
+ FX_BOOL m_bFlipX, m_bFlipY;
CPDF_ColorSpace* m_pCS;
ICodec_ScanlineDecoder* m_pDecoder;
CPDF_StreamAcc m_StreamAcc;
@@ -311,7 +311,7 @@ class CPDF_DeviceBuffer
public:
CPDF_DeviceBuffer();
~CPDF_DeviceBuffer();
- bool Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+ FX_BOOL Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
const CPDF_PageObject* pObj, int max_dpi = 0);
void OutputToDevice();
CFX_DIBitmap* GetBitmap() const
@@ -337,8 +337,8 @@ public:
~CPDF_ImageCache();
void ClearImageData();
void Reset(const CFX_DIBitmap* pBitmap);
- bool GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
- bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false,
+ FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE,
CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0);
FX_DWORD EstimateSize() const
{
@@ -359,8 +359,8 @@ public:
int m_dwTimeCount;
public:
int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- bool bStdCS = false, FX_DWORD GroupFamily = 0,
- bool bLoadMask = false, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0);
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0,
+ FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, int32_t downsampleWidth = 0, int32_t downsampleHeight = 0);
int Continue(IFX_Pause* pPause);
int ContinueGetCachedBitmap();
CFX_DIBSource* DetachBitmap();
@@ -388,23 +388,23 @@ class CPDF_DIBSource : public CFX_DIBSource
public:
CPDF_DIBSource();
virtual ~CPDF_DIBSource();
- bool Load(CPDF_Document* pDoc, const CPDF_Stream* pStream,
+ FX_BOOL Load(CPDF_Document* pDoc, const CPDF_Stream* pStream,
CPDF_DIBSource** ppMask, FX_DWORD* pMatteColor,
CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false);
- virtual bool SkipToScanline(int line, IFX_Pause* pPause) const;
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
+ virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const;
virtual uint8_t* GetBuffer() const;
virtual const uint8_t* GetScanline(int line) const;
virtual void DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const;
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
virtual void SetDownSampleSize(int dest_width, int dest_height) const;
CFX_DIBitmap* GetBitmap() const;
void ReleaseBitmap(CFX_DIBitmap*) const;
void ClearImageData();
public:
- int StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, bool bHasMask,
+ int StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- bool bStdCS = false, FX_DWORD GroupFamily = 0, bool bLoadMask = false);
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
int ContinueLoadDIBSource(IFX_Pause* pPause);
int StratLoadMask();
int StartLoadMaskDIB();
@@ -415,13 +415,13 @@ public:
FX_DWORD m_MatteColor;
void* m_pJbig2Context;
CPDF_StreamAcc* m_pGlobalStream;
- bool m_bStdCS;
+ FX_BOOL m_bStdCS;
int m_Status;
CPDF_Object* m_pMaskStream;
- bool m_bHasMask;
+ FX_BOOL m_bHasMask;
protected:
- bool LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources);
- DIB_COMP_DATA* GetDecodeAndMaskArray(bool& bDefaultDecode, bool& bColorKey);
+ FX_BOOL LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources);
+ DIB_COMP_DATA* GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX_BOOL& bColorKey);
CPDF_DIBSource* LoadMask(FX_DWORD& MatteColor);
CPDF_DIBSource* LoadMaskDIB(CPDF_Stream* pMask);
void LoadJpxBitmap();
@@ -439,11 +439,11 @@ protected:
FX_DWORD m_bpc_orig;
FX_DWORD m_nComponents;
FX_DWORD m_GroupFamily;
- bool m_bLoadMask;
- bool m_bDefaultDecode;
- bool m_bImageMask;
- bool m_bDoBpcCheck;
- bool m_bColorKey;
+ FX_BOOL m_bLoadMask;
+ FX_BOOL m_bDefaultDecode;
+ FX_BOOL m_bImageMask;
+ FX_BOOL m_bDoBpcCheck;
+ FX_BOOL m_bColorKey;
DIB_COMP_DATA* m_pCompData;
uint8_t* m_pLineBuf;
uint8_t* m_pMaskedLine;
diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp
index e7a339ce36..851b2d6709 100644
--- a/core/src/fpdfdoc/doc_action.cpp
+++ b/core/src/fpdfdoc/doc_action.cpp
@@ -289,10 +289,10 @@ const FX_CHAR* g_sAATypes[] = {"E", "X", "D", "U", "Fo", "Bl", "PO", "PC", "PV",
"WC", "WS", "DS", "WP", "DP",
""
};
-bool CPDF_AAction::ActionExist(AActionType eType) const
+FX_BOOL CPDF_AAction::ActionExist(AActionType eType) const
{
if (m_pDict == NULL) {
- return false;
+ return FALSE;
}
return m_pDict->KeyExist(g_sAATypes[(int)eType]);
}
diff --git a/core/src/fpdfdoc/doc_annot.cpp b/core/src/fpdfdoc/doc_annot.cpp
index 5430079abc..0a746190c0 100644
--- a/core/src/fpdfdoc/doc_annot.cpp
+++ b/core/src/fpdfdoc/doc_annot.cpp
@@ -22,7 +22,7 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
}
CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
- bool bRegenerateAP = pAcroForm && pAcroForm->GetBoolean("NeedAppearances");
+ FX_BOOL bRegenerateAP = pAcroForm && pAcroForm->GetBoolean("NeedAppearances");
for (FX_DWORD i = 0; i < pAnnots->GetCount(); ++i) {
CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
if (pDict == NULL || pDict->GetType() != PDFOBJ_DICTIONARY) {
@@ -55,12 +55,12 @@ CPDF_AnnotList::~CPDF_AnnotList()
}
}
void CPDF_AnnotList::DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
- CPDF_RenderContext* pContext, bool bPrinting, CFX_AffineMatrix* pMatrix,
- bool bWidgetPass, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect)
+ CPDF_RenderContext* pContext, FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix,
+ FX_BOOL bWidgetPass, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect)
{
for (int i = 0; i < m_AnnotList.GetSize(); ++i) {
CPDF_Annot* pAnnot = (CPDF_Annot*)m_AnnotList[i];
- bool bWidget = pAnnot->GetSubType() == "Widget";
+ FX_BOOL bWidget = pAnnot->GetSubType() == "Widget";
if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) {
continue;
}
@@ -103,24 +103,24 @@ void CPDF_AnnotList::DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevi
}
void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
CFX_AffineMatrix* pUser2Device,
- bool bShowWidget, CPDF_RenderOptions* pOptions)
+ FX_BOOL bShowWidget, CPDF_RenderOptions* pOptions)
{
FX_RECT clip_rect;
if (pDevice) {
clip_rect = pDevice->GetClipBox();
}
- bool bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
+ FX_BOOL bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
DisplayAnnots(pPage, pDevice, NULL, bPrinting, pUser2Device, bShowWidget ? 3 : 1, pOptions, &clip_rect);
}
void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext,
- bool bPrinting, CFX_AffineMatrix* pUser2Device, FX_DWORD dwAnnotFlags,
+ FX_BOOL bPrinting, CFX_AffineMatrix* pUser2Device, FX_DWORD dwAnnotFlags,
CPDF_RenderOptions* pOptions, FX_RECT* pClipRect)
{
if (dwAnnotFlags & 0x01) {
- DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, false, pOptions, pClipRect);
+ DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, FALSE, pOptions, pClipRect);
}
if (dwAnnotFlags & 0x02) {
- DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, true, pOptions, pClipRect);
+ DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, TRUE, pOptions, pClipRect);
}
}
int CPDF_AnnotList::GetIndex(CPDF_Annot* pAnnot)
@@ -246,28 +246,28 @@ static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage, CPDF_Annot* pA
matrix.Concat(*pUser2Device);
return pForm;
}
-bool CPDF_Annot::DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device,
+FX_BOOL CPDF_Annot::DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device,
AppearanceMode mode, const CPDF_RenderOptions* pOptions)
{
CFX_Matrix matrix;
CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix);
if (!pForm) {
- return false;
+ return FALSE;
}
CPDF_RenderContext context;
context.Create((CPDF_Page*)pPage);
context.DrawObjectList(pDevice, pForm, &matrix, pOptions);
- return true;
+ return TRUE;
}
-bool CPDF_Annot::DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode)
+FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode)
{
CFX_Matrix matrix;
CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix);
if (!pForm) {
- return false;
+ return FALSE;
}
((CPDF_RenderContext*)pContext)->AppendObjectList(pForm, &matrix);
- return true;
+ return TRUE;
}
void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, const CPDF_RenderOptions* pOptions)
{
@@ -278,7 +278,7 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* p
if (annot_flags & ANNOTFLAG_HIDDEN) {
return;
}
- bool bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
+ FX_BOOL bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) {
return;
}
diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp
index 4f3f178007..f94a4d60e0 100644
--- a/core/src/fpdfdoc/doc_ap.cpp
+++ b/core/src/fpdfdoc/doc_ap.cpp
@@ -8,10 +8,10 @@
#include "../../include/fpdfdoc/fpdf_vt.h"
#include "pdf_vt.h"
#include "../../include/fpdfdoc/fpdf_ap.h"
-bool FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
+FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
{
if (!pAnnotDict || pAnnotDict->GetConstString("Subtype") != FX_BSTRC("Widget")) {
- return false;
+ return FALSE;
}
CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString();
FX_DWORD flags = FPDF_GetFieldAttr(pAnnotDict, "Ff")? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger() : 0;
@@ -34,7 +34,7 @@ bool FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
}
}
}
- return false;
+ return FALSE;
}
class CPVT_FontMap : public IPVT_FontMap
{
@@ -154,12 +154,12 @@ int32_t CPVT_Provider::GetWordFontIndex(FX_WORD word, int32_t charset, int32_t n
}
return -1;
}
-bool CPVT_Provider::IsLatinWord(FX_WORD word)
+FX_BOOL CPVT_Provider::IsLatinWord(FX_WORD word)
{
if ((word >= 0x61 && word <= 0x7A) || (word >= 0x41 && word <= 0x5A) || word == 0x2D || word == 0x27) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
int32_t CPVT_Provider::GetDefaultFontIndex()
{
@@ -244,14 +244,14 @@ static CPVT_Color ParseColor(const CPDF_Array & array)
}
return rt;
}
-static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const int32_t & nWidgetType)
+static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const int32_t & nWidgetType)
{
CPDF_Dictionary* pFormDict = NULL;
if (CPDF_Dictionary * pRootDict = pDoc->GetRoot()) {
pFormDict = pRootDict->GetDict("AcroForm");
}
if (!pFormDict) {
- return false;
+ return FALSE;
}
CFX_ByteString DA;
if (CPDF_Object* pDAObj = FPDF_GetFieldAttr(pAnnotDict, "DA")) {
@@ -261,23 +261,23 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
DA = pFormDict->GetString("DA");
}
if (DA.IsEmpty()) {
- return false;
+ return FALSE;
}
CPDF_SimpleParser syntax(DA);
syntax.FindTagParam("Tf", 2);
CFX_ByteString sFontName = syntax.GetWord();
sFontName = PDF_NameDecode(sFontName);
if (sFontName.IsEmpty()) {
- return false;
+ return FALSE;
}
FX_FLOAT fFontSize = FX_atof(syntax.GetWord());
CPVT_Color crText = ParseColor(DA);
- bool bUseFormRes = false;
+ FX_BOOL bUseFormRes = FALSE;
CPDF_Dictionary * pFontDict = NULL;
CPDF_Dictionary* pDRDict = pAnnotDict->GetDict(FX_BSTRC("DR"));
if (pDRDict == NULL) {
pDRDict = pFormDict->GetDict(FX_BSTRC("DR"));
- bUseFormRes = true;
+ bUseFormRes = TRUE;
}
CPDF_Dictionary * pDRFontDict = NULL;
if (pDRDict && (pDRFontDict = pDRDict->GetDict("Font"))) {
@@ -291,12 +291,12 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
}
}
if (!pDRFontDict) {
- return false;
+ return FALSE;
}
if (!pFontDict) {
pFontDict = CPDF_Dictionary::Create();
if (pFontDict == NULL) {
- return false;
+ return FALSE;
}
pFontDict->SetAtName(FX_BSTRC("Type"), "Font");
pFontDict->SetAtName(FX_BSTRC("Subtype"), "Type1");
@@ -307,7 +307,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
}
CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict);
if (!pDefFont) {
- return false;
+ return FALSE;
}
CPDF_Rect rcAnnot = pAnnotDict->GetRect("Rect");
int32_t nRotate = 0;
@@ -378,7 +378,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
}
}
CFX_ByteTextBuf sAppStream;
- CFX_ByteString sBG = CPVT_GenerateAP::GenerateColorAP(crBG, true);
+ CFX_ByteString sBG = CPVT_GenerateAP::GenerateColorAP(crBG, TRUE);
if (sBG.GetLength() > 0) {
sAppStream << "q\n" << sBG << rcBBox.left << " " << rcBBox.bottom << " "
<< rcBBox.Width() << " " << rcBBox.Height() << " re f\n" << "Q\n";
@@ -395,7 +395,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
if (pAPDict == NULL) {
pAPDict = CPDF_Dictionary::Create();
if (pAPDict == NULL) {
- return false;
+ return FALSE;
}
pAnnotDict->SetAt("AP", pAPDict);
}
@@ -403,7 +403,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
if (pNormalStream == NULL) {
pNormalStream = CPDF_Stream::Create(NULL, 0, NULL);
if (pNormalStream == NULL) {
- return false;
+ return FALSE;
}
int32_t objnum = pDoc->AddIndirectObject(pNormalStream);
pAnnotDict->GetDict("AP")->SetAtReference("N", pDoc, objnum);
@@ -418,7 +418,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
if (!pStreamResFontList) {
pStreamResFontList = CPDF_Dictionary::Create();
if (pStreamResFontList == NULL) {
- return false;
+ return FALSE;
}
pStreamResList->SetAt("Font", pStreamResFontList);
}
@@ -443,21 +443,21 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
vt.SetPlateRect(rcBody);
vt.SetAlignment(nAlign);
if (IsFloatZero(fFontSize)) {
- vt.SetAutoFontSize(true);
+ vt.SetAutoFontSize(TRUE);
} else {
vt.SetFontSize(fFontSize);
}
- bool bMultiLine = (dwFlags >> 12) & 1;
+ FX_BOOL bMultiLine = (dwFlags >> 12) & 1;
if (bMultiLine) {
- vt.SetMultiLine(true);
- vt.SetAutoReturn(true);
+ vt.SetMultiLine(TRUE);
+ vt.SetAutoReturn(TRUE);
}
FX_WORD subWord = 0;
if ((dwFlags >> 13) & 1) {
subWord = '*';
vt.SetPasswordChar(subWord);
}
- bool bCharArray = (dwFlags >> 24) & 1;
+ FX_BOOL bCharArray = (dwFlags >> 24) & 1;
if (bCharArray) {
vt.SetCharArray(dwMaxLen);
} else {
@@ -479,7 +479,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
sAppStream << rcBody.left << " " << rcBody.bottom << " "
<< rcBody.Width() << " " << rcBody.Height() << " re\nW\nn\n";
}
- sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, true) << sBody << "ET\n" << "Q\nEMC\n";
+ sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << sBody << "ET\n" << "Q\nEMC\n";
}
}
break;
@@ -497,7 +497,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
rcEdit.Normalize();
vt.SetPlateRect(rcEdit);
if (IsFloatZero(fFontSize)) {
- vt.SetAutoFontSize(true);
+ vt.SetAutoFontSize(TRUE);
} else {
vt.SetFontSize(fFontSize);
}
@@ -506,14 +506,14 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
vt.RearrangeAll();
CPDF_Rect rcContent = vt.GetContentRect();
CPDF_Point ptOffset = CPDF_Point(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f);
- CFX_ByteString sEdit = CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), ptOffset, true, 0);
+ CFX_ByteString sEdit = CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), ptOffset, TRUE, 0);
if (sEdit.GetLength() > 0) {
sAppStream << "/Tx BMC\n" << "q\n";
sAppStream << rcEdit.left << " " << rcEdit.bottom << " "
<< rcEdit.Width() << " " << rcEdit.Height() << " re\nW\nn\n";
- sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, true) << sEdit << "ET\n" << "Q\nEMC\n";
+ sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << sEdit << "ET\n" << "Q\nEMC\n";
}
- CFX_ByteString sButton = CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 220.0f / 255.0f, 220.0f / 255.0f, 220.0f / 255.0f), true);
+ CFX_ByteString sButton = CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 220.0f / 255.0f, 220.0f / 255.0f, 220.0f / 255.0f), TRUE);
if (sButton.GetLength() > 0 && !rcButton.IsEmpty()) {
sAppStream << "q\n" << sButton;
sAppStream << rcButton.left << " " << rcButton.bottom << " "
@@ -555,11 +555,11 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
} else if (pOpt->GetType() == PDFOBJ_ARRAY) {
swItem = ((CPDF_Array*)pOpt)->GetElementValue(1)->GetUnicodeText();
}
- bool bSelected = false;
+ FX_BOOL bSelected = FALSE;
if (pSels) {
for (FX_DWORD s = 0, ssz = pSels->GetCount(); s < ssz; s++) {
if (i == pSels->GetInteger(s)) {
- bSelected = true;
+ bSelected = TRUE;
break;
}
}
@@ -578,11 +578,11 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
FX_FLOAT fItemHeight = vt.GetContentRect().Height();
if (bSelected) {
CPDF_Rect rcItem = CPDF_Rect(rcBody.left, fy - fItemHeight, rcBody.right, fy);
- sBody << "q\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 0, 51.0f / 255.0f, 113.0f / 255.0f), true)
+ sBody << "q\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 0, 51.0f / 255.0f, 113.0f / 255.0f), TRUE)
<< rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n";
- sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_GRAY, 1), true) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), true, 0) << "ET\n";
+ sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_GRAY, 1), TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n";
} else {
- sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, true) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), true, 0) << "ET\n";
+ sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n";
}
fy -= fItemHeight;
}
@@ -598,7 +598,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
break;
}
if (pNormalStream) {
- pNormalStream->SetData((uint8_t*)sAppStream.GetBuffer(), sAppStream.GetSize(), false, false);
+ pNormalStream->SetData((uint8_t*)sAppStream.GetBuffer(), sAppStream.GetSize(), FALSE, FALSE);
pStreamDict = pNormalStream->GetDict();
if (pStreamDict) {
pStreamDict->SetAtMatrix("Matrix", matrix);
@@ -609,7 +609,7 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
if (!pStreamResFontList) {
pStreamResFontList = CPDF_Dictionary::Create();
if (pStreamResFontList == NULL) {
- return false;
+ return FALSE;
}
pStreamResList->SetAt("Font", pStreamResFontList);
}
@@ -622,21 +622,21 @@ static bool GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, c
}
}
}
- return true;
+ return TRUE;
}
-bool CPVT_GenerateAP::GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
+FX_BOOL CPVT_GenerateAP::GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
{
return GenerateWidgetAP(pDoc, pAnnotDict, 0);
}
-bool CPVT_GenerateAP::GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
+FX_BOOL CPVT_GenerateAP::GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
{
return GenerateWidgetAP(pDoc, pAnnotDict, 1);
}
-bool CPVT_GenerateAP::GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
+FX_BOOL CPVT_GenerateAP::GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
{
return GenerateWidgetAP(pDoc, pAnnotDict, 2);
}
-CFX_ByteString CPVT_GenerateAP::GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator* pIterator, const CPDF_Point & ptOffset, bool bContinuous, FX_WORD SubWord, const CPVT_WordRange * pVisible)
+CFX_ByteString CPVT_GenerateAP::GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator* pIterator, const CPDF_Point & ptOffset, FX_BOOL bContinuous, FX_WORD SubWord, const CPVT_WordRange * pVisible)
{
CFX_ByteTextBuf sEditStream, sLineStream, sWords;
CPDF_Point ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f);
@@ -726,7 +726,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA
switch (nStyle) {
default:
case PBS_SOLID:
- sColor = GenerateColorAP(color, true);
+ sColor = GenerateColorAP(color, TRUE);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
@@ -736,7 +736,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA
}
break;
case PBS_DASH:
- sColor = GenerateColorAP(color, false);
+ sColor = GenerateColorAP(color, FALSE);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fWidth << " w" << " [" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n";
@@ -749,7 +749,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA
break;
case PBS_BEVELED:
case PBS_INSET:
- sColor = GenerateColorAP(crLeftTop, true);
+ sColor = GenerateColorAP(crLeftTop, TRUE);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " m\n";
@@ -759,7 +759,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA
sAppStream << fLeft + fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n";
}
- sColor = GenerateColorAP(crRightBottom, true);
+ sColor = GenerateColorAP(crRightBottom, TRUE);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " m\n";
@@ -769,7 +769,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA
sAppStream << fRight - fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n";
}
- sColor = GenerateColorAP(color, true);
+ sColor = GenerateColorAP(color, TRUE);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
@@ -778,7 +778,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA
}
break;
case PBS_UNDERLINED:
- sColor = GenerateColorAP(color, false);
+ sColor = GenerateColorAP(color, FALSE);
if (sColor.GetLength() > 0) {
sAppStream << sColor;
sAppStream << fWidth << " w\n";
@@ -790,7 +790,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOA
}
return sAppStream.GetByteString();
}
-CFX_ByteString CPVT_GenerateAP::GenerateColorAP(const CPVT_Color & color, const bool & bFillOrStroke)
+CFX_ByteString CPVT_GenerateAP::GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke)
{
CFX_ByteTextBuf sColorStream;
switch (color.nColorType) {
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index 647b7cb718..3ba109b016 100644
--- a/core/src/fpdfdoc/doc_basic.cpp
+++ b/core/src/fpdfdoc/doc_basic.cpp
@@ -313,10 +313,10 @@ static CFX_WideString FILESPEC_DecodeFileName(const CFX_WideStringC& filepath)
return filepath;
#endif
}
-bool CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const
+FX_BOOL CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const
{
if (m_pObj == NULL) {
- return false;
+ return FALSE;
}
if (m_pObj->GetType() == PDFOBJ_DICTIONARY) {
CPDF_Dictionary* pDict = (CPDF_Dictionary*)m_pObj;
@@ -325,7 +325,7 @@ bool CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const
csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
}
if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
- return true;
+ return TRUE;
}
if (csFileName.IsEmpty()) {
if (pDict->KeyExist(FX_BSTRC("DOS"))) {
@@ -335,14 +335,14 @@ bool CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const
} else if (pDict->KeyExist(FX_BSTRC("Unix"))) {
csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Unix")));
} else {
- return false;
+ return FALSE;
}
}
} else {
csFileName = CFX_WideString::FromLocal(m_pObj->GetString());
}
csFileName = FILESPEC_DecodeFileName(csFileName);
- return true;
+ return TRUE;
}
CPDF_FileSpec::CPDF_FileSpec()
{
@@ -351,13 +351,13 @@ CPDF_FileSpec::CPDF_FileSpec()
((CPDF_Dictionary*)m_pObj)->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Filespec"));
}
}
-bool CPDF_FileSpec::IsURL() const
+FX_BOOL CPDF_FileSpec::IsURL() const
{
if (m_pObj == NULL) {
- return false;
+ return FALSE;
}
if (m_pObj->GetType() != PDFOBJ_DICTIONARY) {
- return false;
+ return FALSE;
}
return ((CPDF_Dictionary*)m_pObj)->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL");
}
@@ -416,7 +416,7 @@ CPDF_Stream* CPDF_FileSpec::GetFileStream() const
}
return NULL;
}
-static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, const CFX_WideStringC& wsFileName, bool bURL)
+static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, const CFX_WideStringC& wsFileName, FX_BOOL bURL)
{
ASSERT(pObj != NULL);
CFX_WideString wsStr;
@@ -434,7 +434,7 @@ static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, const CFX_WideString
pDict->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(wsStr));
}
}
-void CPDF_FileSpec::SetFileName(const CFX_WideStringC& wsFileName, bool bURL)
+void CPDF_FileSpec::SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL)
{
ASSERT(m_pObj != NULL);
if (m_pObj->GetType() == PDFOBJ_DICTIONARY && bURL) {
diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp
index 6057f56437..735231cc1d 100644
--- a/core/src/fpdfdoc/doc_form.cpp
+++ b/core/src/fpdfdoc/doc_form.cpp
@@ -241,12 +241,12 @@ CFieldTree::_Node *CFieldTree::FindNode(const CFX_WideString& full_name)
}
return pNode;
}
-CPDF_InterForm::CPDF_InterForm(CPDF_Document* pDocument, bool bGenerateAP) : CFX_PrivateData()
+CPDF_InterForm::CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bGenerateAP) : CFX_PrivateData()
{
m_pDocument = pDocument;
m_bGenerateAP = bGenerateAP;
m_pFormNotify = NULL;
- m_bUpdated = false;
+ m_bUpdated = FALSE;
m_pFieldTree = new CFieldTree;
CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
m_pFormDict = pRoot->GetDict("AcroForm");
@@ -280,12 +280,12 @@ CPDF_InterForm::~CPDF_InterForm()
delete m_pFieldTree;
}
}
-bool CPDF_InterForm::m_bUpdateAP = true;
-bool CPDF_InterForm::UpdatingAPEnabled()
+FX_BOOL CPDF_InterForm::m_bUpdateAP = TRUE;
+FX_BOOL CPDF_InterForm::UpdatingAPEnabled()
{
return m_bUpdateAP;
}
-void CPDF_InterForm::EnableUpdateAP(bool bUpdateAP)
+void CPDF_InterForm::EnableUpdateAP(FX_BOOL bUpdateAP)
{
m_bUpdateAP = bUpdateAP;
}
@@ -328,7 +328,7 @@ CFX_ByteString CPDF_InterForm::GenerateNewResourceName(const CPDF_Dictionary* pR
}
int num = 0;
CFX_ByteString bsNum;
- while (true) {
+ while (TRUE) {
if (!pDict->KeyExist(csTmp + bsNum)) {
return csTmp + bsNum;
}
@@ -343,7 +343,7 @@ CFX_ByteString CPDF_InterForm::GenerateNewResourceName(const CPDF_Dictionary* pR
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
typedef struct _PDF_FONTDATA {
- bool bFind;
+ FX_BOOL bFind;
LOGFONTA lf;
} PDF_FONTDATA, FAR* LPDF_FONTDATA;
static int CALLBACK EnumFontFamExProc( ENUMLOGFONTEXA *lpelfe,
@@ -357,10 +357,10 @@ static int CALLBACK EnumFontFamExProc( ENUMLOGFONTEXA *lpelfe,
}
LPDF_FONTDATA pData = (LPDF_FONTDATA)lParam;
memcpy(&pData->lf, &lpelfe->elfLogFont, sizeof(LOGFONTA));
- pData->bFind = true;
+ pData->bFind = TRUE;
return 0;
}
-static bool RetrieveSpecificFont(LOGFONTA& lf)
+static FX_BOOL RetrieveSpecificFont(LOGFONTA& lf)
{
PDF_FONTDATA fd;
memset(&fd, 0, sizeof(PDF_FONTDATA));
@@ -372,7 +372,7 @@ static bool RetrieveSpecificFont(LOGFONTA& lf)
}
return fd.bFind;
}
-static bool RetrieveSpecificFont(uint8_t charSet, uint8_t pitchAndFamily, LPCSTR pcsFontName, LOGFONTA& lf)
+static FX_BOOL RetrieveSpecificFont(uint8_t charSet, uint8_t pitchAndFamily, LPCSTR pcsFontName, LOGFONTA& lf)
{
memset(&lf, 0, sizeof(LOGFONTA));
lf.lfCharSet = charSet;
@@ -382,7 +382,7 @@ static bool RetrieveSpecificFont(uint8_t charSet, uint8_t pitchAndFamily, LPCSTR
}
return RetrieveSpecificFont(lf);
}
-static bool RetrieveStockFont(int iFontObject, uint8_t charSet, LOGFONTA& lf)
+static FX_BOOL RetrieveStockFont(int iFontObject, uint8_t charSet, LOGFONTA& lf)
{
HFONT hFont = (HFONT)::GetStockObject(iFontObject);
if (hFont != NULL) {
@@ -392,7 +392,7 @@ static bool RetrieveStockFont(int iFontObject, uint8_t charSet, LOGFONTA& lf)
return RetrieveSpecificFont(lf);
}
}
- return false;
+ return FALSE;
}
#endif
CPDF_Font* CPDF_InterForm::AddSystemDefaultFont(const CPDF_Document* pDocument)
@@ -403,13 +403,13 @@ CPDF_Font* CPDF_InterForm::AddSystemDefaultFont(const CPDF_Document* pDocument)
CPDF_Font* pFont = NULL;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
LOGFONTA lf;
- bool bRet;
+ FX_BOOL bRet;
bRet = RetrieveStockFont(DEFAULT_GUI_FONT, 255, lf);
if (!bRet) {
bRet = RetrieveStockFont(SYSTEM_FONT, 255, lf);
}
if (bRet) {
- pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, false, true);
+ pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
}
#endif
return pFont;
@@ -430,7 +430,7 @@ CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Byt
::GetObjectA(hFont, sizeof(LOGFONTA), &lf);
::DeleteObject(hFont);
if (strlen(lf.lfFaceName) > 0) {
- return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, false, true);
+ return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
}
}
#endif
@@ -452,7 +452,7 @@ CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Wid
::GetObject(hFont, sizeof(LOGFONTA), &lf);
::DeleteObject(hFont);
if (strlen(lf.lfFaceName) > 0) {
- return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, false, true);
+ return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
}
}
#endif
@@ -477,12 +477,12 @@ CFX_ByteString CPDF_InterForm::GetNativeFont(uint8_t charSet, void* pLogFont)
CFX_ByteString csFontName;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
LOGFONTA lf;
- bool bRet;
+ FX_BOOL bRet;
if (charSet == ANSI_CHARSET) {
csFontName = "Helvetica";
return csFontName;
}
- bRet = false;
+ bRet = FALSE;
if (charSet == SHIFTJIS_CHARSET) {
bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "MS Mincho", lf);
} else if (charSet == GB2312_CHARSET) {
@@ -591,7 +591,7 @@ CPDF_Font* CPDF_InterForm::AddNativeFont(uint8_t charSet, const CPDF_Document* p
if (csFontName == "Helvetica") {
pFont = AddStandardFont(pDocument, csFontName);
} else {
- pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, false, true);
+ pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
}
}
#endif
@@ -607,15 +607,15 @@ CPDF_Font* CPDF_InterForm::AddNativeFont(const CPDF_Document* pDocument)
pFont = AddNativeFont(charSet, pDocument);
return pFont;
}
-bool CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl)
+FX_BOOL CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl)
{
if (csNewFieldName.IsEmpty()) {
- return false;
+ return FALSE;
}
int iPos = 0;
int iLength = csNewFieldName.GetLength();
CFX_WideString csSub;
- while (true) {
+ while (TRUE) {
while (iPos < iLength && (csNewFieldName[iPos] == L'.' || csNewFieldName[iPos] == L' ')) {
iPos ++;
}
@@ -651,15 +651,15 @@ bool CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType
int iRet = CompareFieldName(csSub, csFullName);
if (iRet == 1) {
if (pField->GetFieldType() != iType) {
- return false;
+ return FALSE;
}
} else if (iRet == 2 && csSub == csNewFieldName) {
if (csFullName[iPos] == L'.') {
- return false;
+ return FALSE;
}
} else if (iRet == 3 && csSub == csNewFieldName) {
if (csNewFieldName[csFullName.GetLength()] == L'.') {
- return false;
+ return FALSE;
}
}
}
@@ -668,26 +668,26 @@ bool CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType
}
}
if (csSub.IsEmpty()) {
- return false;
+ return FALSE;
}
csNewFieldName = csSub;
- return true;
+ return TRUE;
}
-bool CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType)
+FX_BOOL CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType)
{
return ValidateFieldName(csNewFieldName, iType, NULL, NULL);
}
-bool CPDF_InterForm::ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName)
+FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName)
{
if (pField == NULL || csNewFieldName.IsEmpty()) {
- return false;
+ return FALSE;
}
return ValidateFieldName(csNewFieldName, ((CPDF_FormField*)pField)->GetFieldType(), pField, NULL);
}
-bool CPDF_InterForm::ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName)
+FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName)
{
if (pControl == NULL || csNewFieldName.IsEmpty()) {
- return false;
+ return FALSE;
}
CPDF_FormField* pField = ((CPDF_FormControl*)pControl)->GetField();
return ValidateFieldName(csNewFieldName, pField->GetFieldType(), pField, pControl);
@@ -764,19 +764,19 @@ void CPDF_InterForm::GetAllFieldNames(CFX_WideStringArray& allFieldNames)
}
}
}
-bool CPDF_InterForm::IsValidFormField(const void* pField)
+FX_BOOL CPDF_InterForm::IsValidFormField(const void* pField)
{
if (pField == NULL) {
- return false;
+ return FALSE;
}
int nCount = m_pFieldTree->m_Root.CountFields();
for (int i = 0; i < nCount; i++) {
CPDF_FormField *pFormField = m_pFieldTree->m_Root.GetField(i);
if (pField == pFormField) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
CPDF_FormField* CPDF_InterForm::GetFieldByDict(CPDF_Dictionary* pFieldDict) const
{
@@ -808,10 +808,10 @@ CPDF_FormControl* CPDF_InterForm::GetControl(FX_DWORD index, CFX_WideString csFi
}
return NULL;
}
-bool CPDF_InterForm::IsValidFormControl(const void* pControl)
+FX_BOOL CPDF_InterForm::IsValidFormControl(const void* pControl)
{
if (pControl == NULL) {
- return false;
+ return FALSE;
}
FX_POSITION pos = m_ControlMap.GetStartPosition();
while (pos) {
@@ -819,10 +819,10 @@ bool CPDF_InterForm::IsValidFormControl(const void* pControl)
void* pFormControl = NULL;
m_ControlMap.GetNextAssoc(pos, (void*&)pWidgetDict, pFormControl);
if (pControl == pFormControl) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
int CPDF_InterForm::CountPageControls(CPDF_Page* pPage) const
{
@@ -919,7 +919,7 @@ FX_DWORD CPDF_InterForm::CountInternalFields(const CFX_WideString& csFieldName)
csSub += csFieldName[iPos ++];
}
int iCount = pArray->GetCount();
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
for (int i = 0; i < iCount; i ++) {
pDict = pArray->GetDict(i);
if (pDict == NULL) {
@@ -927,7 +927,7 @@ FX_DWORD CPDF_InterForm::CountInternalFields(const CFX_WideString& csFieldName)
}
CFX_WideString csT = pDict->GetUnicodeText("T");
if (csT == csSub) {
- bFind = true;
+ bFind = TRUE;
break;
}
}
@@ -970,7 +970,7 @@ CPDF_Dictionary* CPDF_InterForm::GetInternalField(FX_DWORD index, const CFX_Wide
csSub += csFieldName[iPos ++];
}
int iCount = pArray->GetCount();
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
for (int i = 0; i < iCount; i ++) {
pDict = pArray->GetDict(i);
if (pDict == NULL) {
@@ -978,7 +978,7 @@ CPDF_Dictionary* CPDF_InterForm::GetInternalField(FX_DWORD index, const CFX_Wide
}
CFX_WideString csT = pDict->GetUnicodeText("T");
if (csT == csSub) {
- bFind = true;
+ bFind = TRUE;
break;
}
}
@@ -996,14 +996,14 @@ CPDF_Dictionary* CPDF_InterForm::GetInternalField(FX_DWORD index, const CFX_Wide
pArray = pDict->GetArray("Kids");
return pArray ? pArray->GetDict(index) : pDict;
}
-bool CPDF_InterForm::NeedConstructAP()
+FX_BOOL CPDF_InterForm::NeedConstructAP()
{
if (m_pFormDict == NULL) {
- return false;
+ return FALSE;
}
return m_pFormDict->GetBoolean("NeedAppearances");
}
-void CPDF_InterForm::NeedConstructAP(bool bNeedAP)
+void CPDF_InterForm::NeedConstructAP(FX_BOOL bNeedAP)
{
if (m_pFormDict == NULL) {
InitInterFormDict(m_pFormDict, m_pDocument);
@@ -1078,37 +1078,37 @@ CPDF_Font* CPDF_InterForm::GetNativeFormFont(CFX_ByteString& csNameTag)
{
return GetNativeInterFormFont(m_pFormDict, m_pDocument, csNameTag);
}
-bool CPDF_InterForm::FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag)
+FX_BOOL CPDF_InterForm::FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag)
{
return FindInterFormFont(m_pFormDict, pFont, csNameTag);
}
-bool CPDF_InterForm::FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
+FX_BOOL CPDF_InterForm::FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
{
return FindInterFormFont(m_pFormDict, m_pDocument, csFontName, pFont, csNameTag);
}
void CPDF_InterForm::AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag)
{
AddInterFormFont(m_pFormDict, m_pDocument, pFont, csNameTag);
- m_bUpdated = true;
+ m_bUpdated = TRUE;
}
CPDF_Font* CPDF_InterForm::AddNativeFormFont(uint8_t charSet, CFX_ByteString& csNameTag)
{
- m_bUpdated = true;
+ m_bUpdated = TRUE;
return AddNativeInterFormFont(m_pFormDict, m_pDocument, charSet, csNameTag);
}
CPDF_Font* CPDF_InterForm::AddNativeFormFont(CFX_ByteString& csNameTag)
{
- m_bUpdated = true;
+ m_bUpdated = TRUE;
return AddNativeInterFormFont(m_pFormDict, m_pDocument, csNameTag);
}
void CPDF_InterForm::RemoveFormFont(const CPDF_Font* pFont)
{
- m_bUpdated = true;
+ m_bUpdated = TRUE;
RemoveInterFormFont(m_pFormDict, pFont);
}
void CPDF_InterForm::RemoveFormFont(CFX_ByteString csNameTag)
{
- m_bUpdated = true;
+ m_bUpdated = TRUE;
RemoveInterFormFont(m_pFormDict, csNameTag);
}
CPDF_DefaultAppearance CPDF_InterForm::GetDefaultAppearance()
@@ -1131,12 +1131,12 @@ int CPDF_InterForm::GetFormAlignment()
}
return m_pFormDict->GetInteger("Q", 0);
}
-bool CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclude, bool bNotify)
+FX_BOOL CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bNotify)
{
if (bNotify && m_pFormNotify != NULL) {
int iRet = m_pFormNotify->BeforeFormReset(this);
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
int nCount = m_pFieldTree->m_Root.CountFields();
@@ -1145,11 +1145,11 @@ bool CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclud
if (pField == NULL) {
continue;
}
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
int iCount = fields.GetSize();
for (int i = 0; i < iCount; i ++) {
if (pField == (CPDF_FormField*)fields[i]) {
- bFind = true;
+ bFind = TRUE;
break;
}
}
@@ -1160,14 +1160,14 @@ bool CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclud
if (bNotify && m_pFormNotify != NULL) {
m_pFormNotify->AfterFormReset(this);
}
- return true;
+ return TRUE;
}
-bool CPDF_InterForm::ResetForm(bool bNotify)
+FX_BOOL CPDF_InterForm::ResetForm(FX_BOOL bNotify)
{
if (bNotify && m_pFormNotify != NULL) {
int iRet = m_pFormNotify->BeforeFormReset(this);
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
int nCount = m_pFieldTree->m_Root.CountFields();
@@ -1181,7 +1181,7 @@ bool CPDF_InterForm::ResetForm(bool bNotify)
if (bNotify && m_pFormNotify != NULL) {
m_pFormNotify->AfterFormReset(this);
}
- return true;
+ return TRUE;
}
void CPDF_InterForm::ReloadForm()
{
@@ -1242,7 +1242,7 @@ void CPDF_InterForm::LoadField(CPDF_Dictionary* pFieldDict, int nLevel)
AddTerminalField(pFieldDict);
}
}
-bool CPDF_InterForm::HasXFAForm() const
+FX_BOOL CPDF_InterForm::HasXFAForm() const
{
return m_pFormDict && m_pFormDict->GetArray(FX_BSTRC("XFA")) != NULL;
}
@@ -1303,7 +1303,7 @@ CPDF_FormField* CPDF_InterForm::AddTerminalField(const CPDF_Dictionary* pFieldDi
pField = new CPDF_FormField(this, pParent);
CPDF_Object* pTObj = pDict->GetElement("T");
if (pTObj && pTObj->GetType() == PDFOBJ_REFERENCE) {
- CPDF_Object* pClone = pTObj->Clone(true);
+ CPDF_Object* pClone = pTObj->Clone(TRUE);
if (pClone) {
pDict->SetAt("T", pClone);
} else {
@@ -1342,7 +1342,7 @@ CPDF_FormControl* CPDF_InterForm::AddControl(const CPDF_FormField* pField, const
((CPDF_FormField*)pField)->m_ControlList.Add(pControl);
return pControl;
}
-CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, bool bIncludeOrExclude) const
+CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, FX_BOOL bIncludeOrExclude) const
{
int nCount = m_pFieldTree->m_Root.CountFields();
for (int i = 0; i < nCount; i++) {
@@ -1358,7 +1358,7 @@ CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields,
if (dwFlags & 0x04) {
continue;
}
- bool bFind = true;
+ FX_BOOL bFind = TRUE;
if (fields != NULL) {
bFind = fields->Find(pField, 0) >= 0;
}
@@ -1371,7 +1371,7 @@ CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields,
}
return NULL;
}
-CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, bool bSimpleFileSpec) const
+CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, FX_BOOL bSimpleFileSpec) const
{
CFX_PtrArray fields;
int nCount = m_pFieldTree->m_Root.CountFields();
@@ -1379,10 +1379,10 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, bool
CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
fields.Add(pField);
}
- return ExportToFDF(pdf_path, fields, true, bSimpleFileSpec);
+ return ExportToFDF(pdf_path, fields, TRUE, bSimpleFileSpec);
}
CFX_WideString FILESPEC_EncodeFileName(const CFX_WideStringC& filepath);
-CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, bool bIncludeOrExclude, bool bSimpleFileSpec) const
+CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bSimpleFileSpec) const
{
CFDF_Document* pDoc = CFDF_Document::CreateNewDoc();
if (pDoc == NULL) {
@@ -1415,7 +1415,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_
if (dwFlags & 0x04) {
continue;
}
- bool bFind = fields.Find(pField, 0) >= 0;
+ FX_BOOL bFind = fields.Find(pField, 0) >= 0;
if ((bIncludeOrExclude && bFind) || (!bIncludeOrExclude && !bFind)) {
if ((dwFlags & 0x02) != 0 && pField->m_pDict->GetString("V").IsEmpty()) {
continue;
@@ -1432,7 +1432,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_
}
pFieldDict->SetAt("T", pString);
if (pField->GetType() == CPDF_FormField::CheckBox || pField->GetType() == CPDF_FormField::RadioButton) {
- CFX_WideString csExport = pField->GetCheckValue(false);
+ CFX_WideString csExport = pField->GetCheckValue(FALSE);
CFX_ByteString csBExport = PDF_EncodeText(csExport);
CPDF_Object* pOpt = FPDF_GetFieldAttr(pField->m_pDict, "Opt");
if (pOpt == NULL) {
@@ -1443,7 +1443,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(const CFX_WideStringC& pdf_path, CFX_
} else {
CPDF_Object* pV = FPDF_GetFieldAttr(pField->m_pDict, "V");
if (pV != NULL) {
- pFieldDict->SetAt("V", pV->Clone(true));
+ pFieldDict->SetAt("V", pV->Clone(TRUE));
}
}
pFields->Add(pFieldDict);
@@ -1483,7 +1483,7 @@ static void FPDFDOC_FDF_GetFieldValue(CPDF_Dictionary *pFieldDict, CFX_WideStrin
csValue = CFX_WideString::FromLocal(csBValue);
}
}
-void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_WideString& parent_name, bool bNotify, int nLevel)
+void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_WideString& parent_name, FX_BOOL bNotify, int nLevel)
{
CFX_WideString name;
if (!parent_name.IsEmpty()) {
@@ -1531,7 +1531,7 @@ void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_Wide
pField->SetValue(csWValue);
CPDF_FormField::Type eType = pField->GetType();
if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) && pFieldDict->KeyExist("Opt")) {
- pField->m_pDict->SetAt("Opt", pFieldDict->GetElementValue("Opt")->Clone(true));
+ pField->m_pDict->SetAt("Opt", pFieldDict->GetElementValue("Opt")->Clone(TRUE));
}
if (bNotify && m_pFormNotify != NULL) {
if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) {
@@ -1546,24 +1546,24 @@ void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_Wide
pField->UpdateAP(NULL);
}
}
-bool CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF, bool bNotify)
+FX_BOOL CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF, FX_BOOL bNotify)
{
if (pFDF == NULL) {
- return false;
+ return FALSE;
}
CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
if (pMainDict == NULL) {
- return false;
+ return FALSE;
}
CPDF_Array* pFields = pMainDict->GetArray("Fields");
if (pFields == NULL) {
- return false;
+ return FALSE;
}
m_bsEncoding = pMainDict->GetString(FX_BSTRC("Encoding"));
if (bNotify && m_pFormNotify != NULL) {
int iRet = m_pFormNotify->BeforeFormImportData(this);
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
for (FX_DWORD i = 0; i < pFields->GetCount(); i ++) {
@@ -1576,13 +1576,13 @@ bool CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF, bool bNotify)
if (bNotify && m_pFormNotify != NULL) {
m_pFormNotify->AfterFormImportData(this);
}
- return true;
+ return TRUE;
}
void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify)
{
m_pFormNotify = (CPDF_FormNotify*)pNotify;
}
-int CPDF_InterForm::GetPageWithWidget(int iCurPage, bool bNext)
+int CPDF_InterForm::GetPageWithWidget(int iCurPage, FX_BOOL bNext)
{
if (iCurPage < 0) {
return -1;
@@ -1622,6 +1622,6 @@ int CPDF_InterForm::GetPageWithWidget(int iCurPage, bool bNext)
return iNewPage;
}
}
- } while (true);
+ } while (TRUE);
return -1;
}
diff --git a/core/src/fpdfdoc/doc_formcontrol.cpp b/core/src/fpdfdoc/doc_formcontrol.cpp
index 62eb591f94..87eee92c2e 100644
--- a/core/src/fpdfdoc/doc_formcontrol.cpp
+++ b/core/src/fpdfdoc/doc_formcontrol.cpp
@@ -113,25 +113,25 @@ CFX_WideString CPDF_FormControl::GetExportValue()
CFX_WideString csWOn = PDF_DecodeText(csOn);
return csWOn;
}
-bool CPDF_FormControl::IsChecked()
+FX_BOOL CPDF_FormControl::IsChecked()
{
ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
CFX_ByteString csOn = GetOnStateName();
CFX_ByteString csAS = m_pWidgetDict->GetString("AS");
return csAS == csOn;
}
-bool CPDF_FormControl::IsDefaultChecked()
+FX_BOOL CPDF_FormControl::IsDefaultChecked()
{
ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
CPDF_Object* pDV = FPDF_GetFieldAttr(m_pField->m_pDict, "DV");
if (pDV == NULL) {
- return false;
+ return FALSE;
}
CFX_ByteString csDV = pDV->GetString();
CFX_ByteString csOn = GetOnStateName();
return (csDV == csOn);
}
-void CPDF_FormControl::CheckControl(bool bChecked)
+void CPDF_FormControl::CheckControl(FX_BOOL bChecked)
{
ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
CFX_ByteString csOn = GetOnStateName();
@@ -144,7 +144,7 @@ void CPDF_FormControl::CheckControl(bool bChecked)
return;
}
m_pWidgetDict->SetAtName("AS", csAS);
- m_pForm->m_bUpdated = true;
+ m_pForm->m_bUpdated = TRUE;
}
CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Annot::AppearanceMode mode);
void CPDF_FormControl::DrawControl(CFX_RenderDevice* pDevice, CFX_AffineMatrix* pMatrix, CPDF_Page* pPage,
@@ -186,7 +186,7 @@ CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode()
}
return Invert;
}
-CPDF_ApSettings CPDF_FormControl::GetMK(bool bCreate)
+CPDF_ApSettings CPDF_FormControl::GetMK(FX_BOOL bCreate)
{
if (!m_pWidgetDict) {
return NULL;
@@ -201,49 +201,49 @@ CPDF_ApSettings CPDF_FormControl::GetMK(bool bCreate)
}
return mk;
}
-bool CPDF_FormControl::HasMKEntry(CFX_ByteString csEntry)
+FX_BOOL CPDF_FormControl::HasMKEntry(CFX_ByteString csEntry)
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
return mk.HasMKEntry(csEntry);
}
int CPDF_FormControl::GetRotation()
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
return mk.GetRotation();
}
FX_ARGB CPDF_FormControl::GetColor(int& iColorType, CFX_ByteString csEntry)
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
return mk.GetColor(iColorType, csEntry);
}
FX_FLOAT CPDF_FormControl::GetOriginalColor(int index, CFX_ByteString csEntry)
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
return mk.GetOriginalColor(index, csEntry);
}
void CPDF_FormControl::GetOriginalColor(int& iColorType, FX_FLOAT fc[4], CFX_ByteString csEntry)
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
mk.GetOriginalColor(iColorType, fc, csEntry);
}
CFX_WideString CPDF_FormControl::GetCaption(CFX_ByteString csEntry)
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
return mk.GetCaption(csEntry);
}
CPDF_Stream* CPDF_FormControl::GetIcon(CFX_ByteString csEntry)
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
return mk.GetIcon(csEntry);
}
CPDF_IconFit CPDF_FormControl::GetIconFit()
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
return mk.GetIconFit();
}
int CPDF_FormControl::GetTextPosition()
{
- CPDF_ApSettings mk = GetMK(false);
+ CPDF_ApSettings mk = GetMK(FALSE);
return mk.GetTextPosition();
}
CPDF_Action CPDF_FormControl::GetAction()
@@ -343,10 +343,10 @@ int CPDF_FormControl::GetControlAlignment()
}
return pObj->GetInteger();
}
-bool CPDF_ApSettings::HasMKEntry(const CFX_ByteStringC& csEntry)
+FX_BOOL CPDF_ApSettings::HasMKEntry(const CFX_ByteStringC& csEntry)
{
if (m_pDict == NULL) {
- return false;
+ return FALSE;
}
return m_pDict->KeyExist(csEntry);
}
diff --git a/core/src/fpdfdoc/doc_formfield.cpp b/core/src/fpdfdoc/doc_formfield.cpp
index 8d9887e796..087eba8aa4 100644
--- a/core/src/fpdfdoc/doc_formfield.cpp
+++ b/core/src/fpdfdoc/doc_formfield.cpp
@@ -7,11 +7,11 @@
#include "../../include/fpdfdoc/fpdf_doc.h"
#include "doc_utils.h"
-bool PDF_FormField_IsUnison(CPDF_FormField *pField)
+FX_BOOL PDF_FormField_IsUnison(CPDF_FormField *pField)
{
- bool bUnison = false;
+ FX_BOOL bUnison = FALSE;
if (pField->GetType() == CPDF_FormField::CheckBox) {
- bUnison = true;
+ bUnison = TRUE;
} else {
FX_DWORD dwFlags = pField->GetFieldFlags();
bUnison = ((dwFlags & 0x2000000) != 0);
@@ -100,7 +100,7 @@ CFX_WideString CPDF_FormField::GetFullName()
{
return ::GetFullName(m_pDict);
}
-bool CPDF_FormField::ResetField(bool bNotify)
+FX_BOOL CPDF_FormField::ResetField(FX_BOOL bNotify)
{
switch (m_Type) {
case CPDF_FormField::CheckBox:
@@ -113,13 +113,13 @@ bool CPDF_FormField::ResetField(bool bNotify)
if (iCount) {
if (PDF_FormField_IsUnison(this)) {
for(int i = 0; i < iCount; i++) {
- CheckControl(i, GetControl(i)->IsDefaultChecked(), false);
+ CheckControl(i, GetControl(i)->IsDefaultChecked(), FALSE);
}
} else {
for (int i = 0; i < iCount; i ++) {
CPDF_FormControl* pControl = GetControl(i);
- bool bChecked = pControl->IsDefaultChecked();
- CheckControl(i, bChecked, false);
+ FX_BOOL bChecked = pControl->IsDefaultChecked();
+ CheckControl(i, bChecked, FALSE);
}
}
}
@@ -138,10 +138,10 @@ bool CPDF_FormField::ResetField(bool bNotify)
if (bNotify && m_pForm->m_pFormNotify != NULL) {
int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
- SetItemSelection(iIndex, true);
+ SetItemSelection(iIndex, TRUE);
if (bNotify && m_pForm->m_pFormNotify != NULL) {
m_pForm->m_pFormNotify->AfterValueChange(this);
}
@@ -157,10 +157,10 @@ bool CPDF_FormField::ResetField(bool bNotify)
if (bNotify && m_pForm->m_pFormNotify != NULL) {
int iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
- SetItemSelection(iIndex, true);
+ SetItemSelection(iIndex, TRUE);
if (bNotify && m_pForm->m_pFormNotify != NULL) {
m_pForm->m_pFormNotify->AfterSelectionChange(this);
}
@@ -182,12 +182,12 @@ bool CPDF_FormField::ResetField(bool bNotify)
}
CPDF_Object* pRV = FPDF_GetFieldAttr(m_pDict, "RV");
if (!pRV && (csDValue == csValue)) {
- return false;
+ return FALSE;
}
if (bNotify && m_pForm->m_pFormNotify != NULL) {
int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csDValue);
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
if (pDV == NULL) {
@@ -196,7 +196,7 @@ bool CPDF_FormField::ResetField(bool bNotify)
} else {
CPDF_Object* pClone = pDV->Clone();
if (pClone == NULL) {
- return false;
+ return FALSE;
}
m_pDict->SetAt("V", pClone);
if(pRV) {
@@ -207,11 +207,11 @@ bool CPDF_FormField::ResetField(bool bNotify)
if (bNotify && m_pForm->m_pFormNotify != NULL) {
m_pForm->m_pFormNotify->AfterValueChange(this);
}
- m_pForm->m_bUpdated = true;
+ m_pForm->m_bUpdated = TRUE;
}
break;
}
- return true;
+ return TRUE;
}
int CPDF_FormField::GetControlIndex(const CPDF_FormControl* pControl)
{
@@ -299,7 +299,7 @@ CFX_WideString CPDF_FormField::GetRichTextString()
}
return pObj->GetUnicodeText();
}
-CFX_WideString CPDF_FormField::GetValue(bool bDefault)
+CFX_WideString CPDF_FormField::GetValue(FX_BOOL bDefault)
{
if (GetType() == CheckBox || GetType() == RadioButton) {
return GetCheckValue(bDefault);
@@ -333,19 +333,19 @@ CFX_WideString CPDF_FormField::GetValue(bool bDefault)
}
CFX_WideString CPDF_FormField::GetValue()
{
- return GetValue(false);
+ return GetValue(FALSE);
}
CFX_WideString CPDF_FormField::GetDefaultValue()
{
- return GetValue(true);
+ return GetValue(TRUE);
}
-bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bDefault, bool bNotify)
+FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify)
{
switch (m_Type) {
case CheckBox:
case RadioButton: {
SetCheckValue(value, bDefault, bNotify);
- return true;
+ return TRUE;
}
case File:
case RichText:
@@ -355,7 +355,7 @@ bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bDefault, bool b
if (bNotify && m_pForm->m_pFormNotify != NULL) {
int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
int iIndex = FindOptionValue(csValue);
@@ -371,39 +371,39 @@ bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bDefault, bool b
if (bDefault) {
} else {
ClearSelection();
- SetItemSelection(iIndex, true);
+ SetItemSelection(iIndex, TRUE);
}
}
if (bNotify && m_pForm->m_pFormNotify != NULL) {
m_pForm->m_pFormNotify->AfterValueChange(this);
}
- m_pForm->m_bUpdated = true;
+ m_pForm->m_bUpdated = TRUE;
}
break;
case ListBox: {
int iIndex = FindOptionValue(value);
if (iIndex < 0) {
- return false;
+ return FALSE;
}
if (bDefault && iIndex == GetDefaultSelectedItem()) {
- return false;
+ return FALSE;
}
if (bNotify && m_pForm->m_pFormNotify != NULL) {
CFX_WideString csValue = value;
int iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
if (bDefault) {
} else {
ClearSelection();
- SetItemSelection(iIndex, true);
+ SetItemSelection(iIndex, TRUE);
}
if (bNotify && m_pForm->m_pFormNotify != NULL) {
m_pForm->m_pFormNotify->AfterSelectionChange(this);
}
- m_pForm->m_bUpdated = true;
+ m_pForm->m_bUpdated = TRUE;
break;
}
default:
@@ -412,11 +412,11 @@ bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bDefault, bool b
if (CPDF_InterForm::m_bUpdateAP) {
UpdateAP(NULL);
}
- return true;
+ return TRUE;
}
-bool CPDF_FormField::SetValue(const CFX_WideString& value, bool bNotify)
+FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, FX_BOOL bNotify)
{
- return SetValue(value, false, bNotify);
+ return SetValue(value, FALSE, bNotify);
}
int CPDF_FormField::GetMaxLen()
{
@@ -506,7 +506,7 @@ int CPDF_FormField::GetSelectedIndex(int index)
}
return -1;
}
-bool CPDF_FormField::ClearSelection(bool bNotify)
+FX_BOOL CPDF_FormField::ClearSelection(FX_BOOL bNotify)
{
if (bNotify && m_pForm->m_pFormNotify != NULL) {
int iRet = 0;
@@ -522,7 +522,7 @@ bool CPDF_FormField::ClearSelection(bool bNotify)
iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
}
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
m_pDict->RemoveAt("V");
@@ -538,43 +538,43 @@ bool CPDF_FormField::ClearSelection(bool bNotify)
if (CPDF_InterForm::m_bUpdateAP) {
UpdateAP(NULL);
}
- m_pForm->m_bUpdated = true;
- return true;
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
}
-bool CPDF_FormField::IsItemSelected(int index)
+FX_BOOL CPDF_FormField::IsItemSelected(int index)
{
ASSERT(GetType() == ComboBox || GetType() == ListBox);
if (index < 0 || index >= CountOptions()) {
- return false;
+ return FALSE;
}
if (IsOptionSelected(index)) {
- return true;
+ return TRUE;
}
CFX_WideString opt_value = GetOptionValue(index);
CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
if (pValue == NULL) {
pValue = FPDF_GetFieldAttr(m_pDict, "I");
if (pValue == NULL) {
- return false;
+ return FALSE;
}
}
if (pValue->GetType() == PDFOBJ_STRING) {
if (pValue->GetUnicodeText() == opt_value) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (pValue->GetType() == PDFOBJ_NUMBER) {
if (pValue->GetString().IsEmpty()) {
- return false;
+ return FALSE;
}
if (pValue->GetInteger() == index) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (pValue->GetType() != PDFOBJ_ARRAY) {
- return false;
+ return FALSE;
}
CPDF_Array* pArray = (CPDF_Array*)pValue;
int iPos = -1;
@@ -586,15 +586,15 @@ bool CPDF_FormField::IsItemSelected(int index)
}
for (FX_DWORD i = 0; i < pArray->GetCount(); i ++)
if (pArray->GetElementValue(i)->GetUnicodeText() == opt_value && (int)i == iPos) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify)
+FX_BOOL CPDF_FormField::SetItemSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify)
{
ASSERT(GetType() == ComboBox || GetType() == ListBox);
if (index < 0 || index >= CountOptions()) {
- return false;
+ return FALSE;
}
CFX_WideString opt_value = GetOptionValue(index);
if (bNotify && m_pForm->m_pFormNotify != NULL) {
@@ -606,14 +606,14 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify)
iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, opt_value);
}
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
if (!bSelected) {
CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
if (pValue != NULL) {
if (m_Type == ListBox) {
- SelectOption(index, false);
+ SelectOption(index, FALSE);
if (pValue->GetType() == PDFOBJ_STRING) {
if (pValue->GetUnicodeText() == opt_value) {
m_pDict->RemoveAt("V");
@@ -621,7 +621,7 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify)
} else if (pValue->GetType() == PDFOBJ_ARRAY) {
CPDF_Array* pArray = CPDF_Array::Create();
if (pArray == NULL) {
- return false;
+ return FALSE;
}
int iCount = CountOptions();
for (int i = 0; i < iCount; i ++) {
@@ -645,21 +645,21 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify)
}
} else {
if (m_Type == ListBox) {
- SelectOption(index, true);
+ SelectOption(index, TRUE);
if (!(m_Flags & FORMLIST_MULTISELECT)) {
m_pDict->SetAtString("V", PDF_EncodeText(opt_value));
} else {
CPDF_Array* pArray = CPDF_Array::Create();
if (pArray == NULL) {
- return false;
+ return FALSE;
}
- bool bSelected;
+ FX_BOOL bSelected;
int iCount = CountOptions();
for (int i = 0; i < iCount; i ++) {
if (i != index) {
bSelected = IsItemSelected(i);
} else {
- bSelected = true;
+ bSelected = TRUE;
}
if (bSelected) {
opt_value = GetOptionValue(i);
@@ -672,7 +672,7 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify)
m_pDict->SetAtString("V", PDF_EncodeText(opt_value));
CPDF_Array* pI = CPDF_Array::Create();
if (pI == NULL) {
- return false;
+ return FALSE;
}
pI->AddInteger(index);
m_pDict->SetAt("I", pI);
@@ -689,18 +689,18 @@ bool CPDF_FormField::SetItemSelection(int index, bool bSelected, bool bNotify)
if (CPDF_InterForm::m_bUpdateAP) {
UpdateAP(NULL);
}
- m_pForm->m_bUpdated = true;
- return true;
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
}
-bool CPDF_FormField::IsItemDefaultSelected(int index)
+FX_BOOL CPDF_FormField::IsItemDefaultSelected(int index)
{
ASSERT(GetType() == ComboBox || GetType() == ListBox);
if (index < 0 || index >= CountOptions()) {
- return false;
+ return FALSE;
}
int iDVIndex = GetDefaultSelectedItem();
if (iDVIndex < 0) {
- return false;
+ return FALSE;
}
return (iDVIndex == index);
}
@@ -798,15 +798,15 @@ int CPDF_FormField::FindOptionValue(const CFX_WideString& csOptValue, int iStart
}
return -1;
}
-bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify)
+FX_BOOL CPDF_FormField::CheckControl(int iControlIndex, FX_BOOL bChecked, FX_BOOL bNotify)
{
ASSERT(GetType() == CheckBox || GetType() == RadioButton);
CPDF_FormControl* pControl = GetControl(iControlIndex);
if (pControl == NULL) {
- return false;
+ return FALSE;
}
if (!bChecked && pControl->IsChecked() == bChecked) {
- return false;
+ return FALSE;
}
CFX_ByteArray statusArray;
if (bNotify && m_pForm->m_pFormNotify != NULL) {
@@ -815,7 +815,7 @@ bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify
CFX_WideString csWExport = pControl->GetExportValue();
CFX_ByteString csBExport = PDF_EncodeText(csWExport);
int iCount = CountControls();
- bool bUnison = PDF_FormField_IsUnison(this);
+ FX_BOOL bUnison = PDF_FormField_IsUnison(this);
for (int i = 0; i < iCount; i ++) {
CPDF_FormControl* pCtrl = GetControl(i);
if (bUnison) {
@@ -824,16 +824,16 @@ bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify
if (pCtrl->GetOnStateName() == pControl->GetOnStateName()) {
pCtrl->CheckControl(bChecked);
} else if (bChecked) {
- pCtrl->CheckControl(false);
+ pCtrl->CheckControl(FALSE);
}
} else if (bChecked) {
- pCtrl->CheckControl(false);
+ pCtrl->CheckControl(FALSE);
}
} else {
if (i == iControlIndex) {
pCtrl->CheckControl(bChecked);
} else if (bChecked) {
- pCtrl->CheckControl(false);
+ pCtrl->CheckControl(FALSE);
}
}
}
@@ -859,14 +859,14 @@ bool CPDF_FormField::CheckControl(int iControlIndex, bool bChecked, bool bNotify
if (bNotify && m_pForm->m_pFormNotify != NULL) {
m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray);
}
- m_pForm->m_bUpdated = true;
- return true;
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
}
-CFX_WideString CPDF_FormField::GetCheckValue(bool bDefault)
+CFX_WideString CPDF_FormField::GetCheckValue(FX_BOOL bDefault)
{
ASSERT(GetType() == CheckBox || GetType() == RadioButton);
CFX_WideString csExport = L"Off";
- bool bChecked;
+ FX_BOOL bChecked;
int iCount = CountControls();
for (int i = 0; i < iCount; i ++) {
CPDF_FormControl* pControl = GetControl(i);
@@ -882,7 +882,7 @@ CFX_WideString CPDF_FormField::GetCheckValue(bool bDefault)
}
return csExport;
}
-bool CPDF_FormField::SetCheckValue(const CFX_WideString& value, bool bDefault, bool bNotify)
+FX_BOOL CPDF_FormField::SetCheckValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify)
{
ASSERT(GetType() == CheckBox || GetType() == RadioButton);
CFX_ByteArray statusArray;
@@ -896,21 +896,21 @@ bool CPDF_FormField::SetCheckValue(const CFX_WideString& value, bool bDefault, b
if (csExport == value) {
if (bDefault) {
} else {
- CheckControl(GetControlIndex(pControl), true);
+ CheckControl(GetControlIndex(pControl), TRUE);
}
break;
} else {
if (bDefault) {
} else {
- CheckControl(GetControlIndex(pControl), false);
+ CheckControl(GetControlIndex(pControl), FALSE);
}
}
}
if (bNotify && m_pForm->m_pFormNotify != NULL) {
m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray);
}
- m_pForm->m_bUpdated = true;
- return true;
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
}
int CPDF_FormField::GetTopVisibleIndex()
{
@@ -948,43 +948,43 @@ int CPDF_FormField::GetSelectedOptionIndex(int index)
}
return -1;
}
-bool CPDF_FormField::IsOptionSelected(int iOptIndex)
+FX_BOOL CPDF_FormField::IsOptionSelected(int iOptIndex)
{
CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "I");
if (pObj == NULL) {
- return false;
+ return FALSE;
}
CPDF_Array* pArray = pObj->GetArray();
if (pArray == NULL) {
- return false;
+ return FALSE;
}
int iCount = (int)pArray->GetCount();
for (int i = 0; i < iCount; i ++) {
if (pArray->GetInteger(i) == iOptIndex) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify)
+FX_BOOL CPDF_FormField::SelectOption(int iOptIndex, FX_BOOL bSelected, FX_BOOL bNotify)
{
CPDF_Array* pArray = m_pDict->GetArray("I");
if (pArray == NULL) {
if (!bSelected) {
- return true;
+ return TRUE;
}
pArray = CPDF_Array::Create();
if (pArray == NULL) {
- return false;
+ return FALSE;
}
m_pDict->SetAt("I", pArray);
}
- bool bReturn = false;
+ FX_BOOL bReturn = FALSE;
for (int i = 0; i < (int)pArray->GetCount(); i ++) {
int iFind = pArray->GetInteger(i);
if (iFind == iOptIndex) {
if (bSelected) {
- return true;
+ return TRUE;
}
if (bNotify && m_pForm->m_pFormNotify != NULL) {
int iRet = 0;
@@ -996,11 +996,11 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify)
iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
}
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
pArray->RemoveAt(i);
- bReturn = true;
+ bReturn = TRUE;
break;
} else if (iFind > iOptIndex) {
if (!bSelected) {
@@ -1016,15 +1016,15 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify)
iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
}
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
CPDF_Number* pNum = CPDF_Number::Create(iOptIndex);
if (pNum == NULL) {
- return false;
+ return FALSE;
}
pArray->InsertAt(i, pNum);
- bReturn = true;
+ bReturn = TRUE;
break;
}
}
@@ -1044,10 +1044,10 @@ bool CPDF_FormField::SelectOption(int iOptIndex, bool bSelected, bool bNotify)
m_pForm->m_pFormNotify->AfterValueChange(this);
}
}
- m_pForm->m_bUpdated = true;
- return true;
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
}
-bool CPDF_FormField::ClearSelectedOptions(bool bNotify)
+FX_BOOL CPDF_FormField::ClearSelectedOptions(FX_BOOL bNotify)
{
if (bNotify && m_pForm->m_pFormNotify != NULL) {
int iRet = 0;
@@ -1063,7 +1063,7 @@ bool CPDF_FormField::ClearSelectedOptions(bool bNotify)
iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
}
if (iRet < 0) {
- return false;
+ return FALSE;
}
}
m_pDict->RemoveAt("I");
@@ -1075,8 +1075,8 @@ bool CPDF_FormField::ClearSelectedOptions(bool bNotify)
m_pForm->m_pFormNotify->AfterValueChange(this);
}
}
- m_pForm->m_bUpdated = true;
- return true;
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
}
void CPDF_FormField::LoadDA()
{
diff --git a/core/src/fpdfdoc/doc_metadata.cpp b/core/src/fpdfdoc/doc_metadata.cpp
index 33e1e23d0f..aeeb1d1f60 100644
--- a/core/src/fpdfdoc/doc_metadata.cpp
+++ b/core/src/fpdfdoc/doc_metadata.cpp
@@ -58,7 +58,7 @@ void CPDF_Metadata::LoadDoc(CPDF_Document *pDoc)
return;
}
CPDF_StreamAcc acc;
- acc.LoadAllData(pStream, false);
+ acc.LoadAllData(pStream, FALSE);
int size = acc.GetSize();
const uint8_t* pBuf = acc.GetData();
CXML_Element *&pXmlElmnt = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
diff --git a/core/src/fpdfdoc/doc_ocg.cpp b/core/src/fpdfdoc/doc_ocg.cpp
index 6e88309fee..d525227219 100644
--- a/core/src/fpdfdoc/doc_ocg.cpp
+++ b/core/src/fpdfdoc/doc_ocg.cpp
@@ -25,7 +25,7 @@ static int32_t FPDFDOC_OCG_FindGroup(const CPDF_Object *pObject, const CPDF_Dict
}
return -1;
}
-static bool FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, const CFX_ByteStringC& csElement, const CFX_ByteStringC& csDef = FX_BSTRC(""))
+static FX_BOOL FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, const CFX_ByteStringC& csElement, const CFX_ByteStringC& csDef = FX_BSTRC(""))
{
FXSYS_assert(pDict != NULL);
CPDF_Object *pIntent = pDict->GetElementValue(FX_BSTRC("Intent"));
@@ -38,10 +38,10 @@ static bool FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, const CFX_ByteSt
for (FX_DWORD i = 0; i < dwCount; i++) {
bsIntent = ((CPDF_Array*)pIntent)->GetString(i);
if (bsIntent == FX_BSTRC("All") || bsIntent == csElement) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
bsIntent = pIntent->GetString();
return bsIntent == FX_BSTRC("All") || bsIntent == csElement;
@@ -101,24 +101,24 @@ CPDF_OCContext::~CPDF_OCContext()
{
m_OCGStates.clear();
}
-bool CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, bool &bValidConfig) const
+FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, FX_BOOL &bValidConfig) const
{
CPDF_Dictionary *pConfig = FPDFDOC_OCG_GetConfig(m_pDocument, pOCGDict, csConfig);
if (!pConfig) {
- return true;
+ return TRUE;
}
- bValidConfig = true;
- bool bState = pConfig->GetString(FX_BSTRC("BaseState"), FX_BSTRC("ON")) != FX_BSTRC("OFF");
+ bValidConfig = TRUE;
+ FX_BOOL bState = pConfig->GetString(FX_BSTRC("BaseState"), FX_BSTRC("ON")) != FX_BSTRC("OFF");
CPDF_Array *pArray = pConfig->GetArray(FX_BSTRC("ON"));
if (pArray) {
if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
- bState = true;
+ bState = TRUE;
}
}
pArray = pConfig->GetArray(FX_BSTRC("OFF"));
if (pArray) {
if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
- bState = false;
+ bState = FALSE;
}
}
pArray = pConfig->GetArray(FX_BSTRC("AS"));
@@ -149,10 +149,10 @@ bool CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, con
}
return bState;
}
-bool CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const
+FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const
{
if (!FPDFDOC_OCG_HasIntent(pOCGDict, FX_BSTRC("View"), FX_BSTRC("View"))) {
- return true;
+ return TRUE;
}
CFX_ByteString csState = FPDFDOC_OCG_GetUsageTypeString(m_eUsageType);
CPDF_Dictionary *pUsage = pOCGDict->GetDict(FX_BSTRC("Usage"));
@@ -171,31 +171,31 @@ bool CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const
}
}
}
- bool bDefValid = false;
+ FX_BOOL bDefValid = FALSE;
return LoadOCGStateFromConfig(csState, pOCGDict, bDefValid);
}
-bool CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary* pOCGDict)
+FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary* pOCGDict)
{
if (!pOCGDict)
- return false;
+ return FALSE;
const auto it = m_OCGStates.find(pOCGDict);
if (it != m_OCGStates.end())
return it->second;
- bool bState = LoadOCGState(pOCGDict);
+ FX_BOOL bState = LoadOCGState(pOCGDict);
m_OCGStates[pOCGDict] = bState;
return bState;
}
-bool CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLevel)
+FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel)
{
if (nLevel > 32) {
- return false;
+ return FALSE;
}
if (pExpression == NULL) {
- return false;
+ return FALSE;
}
int32_t iCount = pExpression->GetCount();
CPDF_Object *pOCGObj;
@@ -203,7 +203,7 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLe
if (csOperator == FX_BSTRC("Not")) {
pOCGObj = pExpression->GetElementValue(1);
if (pOCGObj == NULL) {
- return false;
+ return FALSE;
}
if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
return !(bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj));
@@ -211,16 +211,16 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLe
if (pOCGObj->GetType() == PDFOBJ_ARRAY) {
return !GetOCGVE((CPDF_Array*)pOCGObj, bFromConfig, nLevel + 1);
}
- return false;
+ return FALSE;
}
if (csOperator == FX_BSTRC("Or") || csOperator == FX_BSTRC("And")) {
- bool bValue = false;
+ FX_BOOL bValue = FALSE;
for (int32_t i = 1; i < iCount; i ++) {
pOCGObj = pExpression->GetElementValue(1);
if (pOCGObj == NULL) {
continue;
}
- bool bItem = false;
+ FX_BOOL bItem = FALSE;
if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
bItem = bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj);
} else if (pOCGObj->GetType() == PDFOBJ_ARRAY) {
@@ -238,9 +238,9 @@ bool CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLe
}
return bValue;
}
- return false;
+ return FALSE;
}
-bool CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, bool bFromConfig)
+FX_BOOL CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig)
{
FXSYS_assert(pOCMDDict != NULL);
CPDF_Array *pVE = pOCMDDict->GetArray(FX_BSTRC("VE"));
@@ -250,50 +250,50 @@ bool CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, bool bFromC
CFX_ByteString csP = pOCMDDict->GetString(FX_BSTRC("P"), FX_BSTRC("AnyOn"));
CPDF_Object *pOCGObj = pOCMDDict->GetElementValue(FX_BSTRC("OCGs"));
if (pOCGObj == NULL) {
- return true;
+ return TRUE;
}
if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
return bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj);
}
if (pOCGObj->GetType() != PDFOBJ_ARRAY) {
- return true;
+ return TRUE;
}
- bool bState = false;
+ FX_BOOL bState = FALSE;
if (csP == FX_BSTRC("AllOn") || csP == FX_BSTRC("AllOff")) {
- bState = true;
+ bState = TRUE;
}
int32_t iCount = ((CPDF_Array*)pOCGObj)->GetCount();
for (int32_t i = 0; i < iCount; i ++) {
- bool bItem = true;
+ FX_BOOL bItem = TRUE;
CPDF_Dictionary* pItemDict = ((CPDF_Array*)pOCGObj)->GetDict(i);
if (pItemDict) {
bItem = bFromConfig ? LoadOCGState(pItemDict) : GetOCGVisible(pItemDict);
}
if (csP == FX_BSTRC("AnyOn") && bItem) {
- return true;
+ return TRUE;
}
if (csP == FX_BSTRC("AnyOff") && !bItem) {
- return true;
+ return TRUE;
}
if (csP == FX_BSTRC("AllOn") && !bItem) {
- return false;
+ return FALSE;
}
if (csP == FX_BSTRC("AllOff") && bItem) {
- return false;
+ return FALSE;
}
}
return bState;
}
-bool CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary *pOCGDict)
+FX_BOOL CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary *pOCGDict)
{
if (!pOCGDict) {
- return true;
+ return TRUE;
}
CFX_ByteString csType = pOCGDict->GetString(FX_BSTRC("Type"), FX_BSTRC("OCG"));
if (csType == FX_BSTRC("OCG")) {
return GetOCGVisible(pOCGDict);
}
- return LoadOCMDState(pOCGDict, false);
+ return LoadOCMDState(pOCGDict, FALSE);
}
void CPDF_OCContext::ResetOCContext()
{
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp
index 3e44b1ac9b..e9f0c55e2b 100644
--- a/core/src/fpdfdoc/doc_tagged.cpp
+++ b/core/src/fpdfdoc/doc_tagged.cpp
@@ -9,7 +9,7 @@
#include "../../include/fpdfdoc/fpdf_tagged.h"
#include "tagged_int.h"
const int nMaxRecursion = 32;
-static bool IsTagged(const CPDF_Document* pDoc)
+static FX_BOOL IsTagged(const CPDF_Document* pDoc)
{
CPDF_Dictionary* pCatalog = pDoc->GetRoot();
CPDF_Dictionary* pMarkInfo = pCatalog->GetDict(FX_BSTRC("MarkInfo"));
@@ -138,7 +138,7 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict,
}
} else {
CPDF_StructElementImpl* pParentElement = AddPageNode(pParent, map, nLevel + 1);
- bool bSave = false;
+ FX_BOOL bSave = FALSE;
for (int i = 0; i < pParentElement->m_Kids.GetSize(); i ++) {
if (pParentElement->m_Kids[i].m_Type != CPDF_StructKid::Element) {
continue;
@@ -147,7 +147,7 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict,
continue;
}
pParentElement->m_Kids[i].m_Element.m_pElement = pElement->Retain();
- bSave = true;
+ bSave = TRUE;
}
if (!bSave) {
pElement->Release();
@@ -156,11 +156,11 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict,
}
return pElement;
}
-bool CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement)
+FX_BOOL CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement)
{
CPDF_Object *pObj = m_pTreeRoot->GetElementValue(FX_BSTRC("K"));
if (!pObj) {
- return false;
+ return FALSE;
}
if (pObj->GetType() == PDFOBJ_DICTIONARY) {
if (pObj->GetObjNum() == pDict->GetObjNum()) {
@@ -169,13 +169,13 @@ bool CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructEle
}
m_Kids[0] = pElement->Retain();
} else {
- return false;
+ return FALSE;
}
}
if (pObj->GetType() == PDFOBJ_ARRAY) {
CPDF_Array* pTopKids = (CPDF_Array*)pObj;
FX_DWORD i;
- bool bSave = false;
+ FX_BOOL bSave = FALSE;
for (i = 0; i < pTopKids->GetCount(); i ++) {
CPDF_Object* pKidRef = pTopKids->GetElement(i);
if (pKidRef == NULL || pKidRef->GetType() != PDFOBJ_REFERENCE) {
@@ -188,13 +188,13 @@ bool CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructEle
m_Kids[i]->Release();
}
m_Kids[i] = pElement->Retain();
- bSave = true;
+ bSave = TRUE;
}
if (!bSave) {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
CPDF_StructElementImpl::CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict)
: m_RefCount(0)
@@ -340,20 +340,20 @@ static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, const CFX_ByteStringC&
}
return NULL;
}
-CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable, FX_FLOAT fLevel)
+CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable, FX_FLOAT fLevel)
{
if (fLevel > nMaxRecursion) {
return NULL;
}
if (bInheritable) {
- CPDF_Object* pAttr = GetAttr(owner, name, false);
+ CPDF_Object* pAttr = GetAttr(owner, name, FALSE);
if (pAttr) {
return pAttr;
}
if (m_pParent == NULL) {
return NULL;
}
- return m_pParent->GetAttr(owner, name, true, fLevel + 1);
+ return m_pParent->GetAttr(owner, name, TRUE, fLevel + 1);
}
CPDF_Object* pA = m_pDict->GetElementValue(FX_BSTRC("A"));
if (pA) {
@@ -391,7 +391,7 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const
}
return NULL;
}
-CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable, int subindex)
+CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable, int subindex)
{
CPDF_Object* pAttr = GetAttr(owner, name, bInheritable);
if (pAttr == NULL || subindex == -1 || pAttr->GetType() != PDFOBJ_ARRAY) {
@@ -403,7 +403,7 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const
}
return pArray->GetElementValue(subindex);
}
-CFX_ByteString CPDF_StructElementImpl::GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, bool bInheritable, int subindex)
+CFX_ByteString CPDF_StructElementImpl::GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, FX_BOOL bInheritable, int subindex)
{
CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NAME) {
@@ -411,7 +411,7 @@ CFX_ByteString CPDF_StructElementImpl::GetName(const CFX_ByteStringC& owner, con
}
return pAttr->GetString();
}
-FX_ARGB CPDF_StructElementImpl::GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, bool bInheritable, int subindex)
+FX_ARGB CPDF_StructElementImpl::GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, FX_BOOL bInheritable, int subindex)
{
CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
if (pAttr == NULL || pAttr->GetType() != PDFOBJ_ARRAY) {
@@ -420,7 +420,7 @@ FX_ARGB CPDF_StructElementImpl::GetColor(const CFX_ByteStringC& owner, const CFX
CPDF_Array* pArray = (CPDF_Array*)pAttr;
return 0xff000000 | ((int)(pArray->GetNumber(0) * 255) << 16) | ((int)(pArray->GetNumber(1) * 255) << 8) | (int)(pArray->GetNumber(2) * 255);
}
-FX_FLOAT CPDF_StructElementImpl::GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, bool bInheritable, int subindex)
+FX_FLOAT CPDF_StructElementImpl::GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, FX_BOOL bInheritable, int subindex)
{
CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NUMBER) {
@@ -428,7 +428,7 @@ FX_FLOAT CPDF_StructElementImpl::GetNumber(const CFX_ByteStringC& owner, const C
}
return pAttr->GetNumber();
}
-int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, bool bInheritable, int subindex)
+int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, FX_BOOL bInheritable, int subindex)
{
CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NUMBER) {
diff --git a/core/src/fpdfdoc/doc_utils.cpp b/core/src/fpdfdoc/doc_utils.cpp
index 26c93f1791..96d2ccf689 100644
--- a/core/src/fpdfdoc/doc_utils.cpp
+++ b/core/src/fpdfdoc/doc_utils.cpp
@@ -26,10 +26,10 @@ CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict)
}
return full_name;
}
-bool CPDF_DefaultAppearance::HasFont()
+FX_BOOL CPDF_DefaultAppearance::HasFont()
{
if (m_csDA.IsEmpty()) {
- return false;
+ return FALSE;
}
CPDF_SimpleParser syntax(m_csDA);
return syntax.FindTagParam("Tf", 2);
@@ -65,23 +65,23 @@ void CPDF_DefaultAppearance::GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fF
}
csFontNameTag = PDF_NameDecode(csFontNameTag);
}
-bool CPDF_DefaultAppearance::HasColor(bool bStrokingOperation)
+FX_BOOL CPDF_DefaultAppearance::HasColor(FX_BOOL bStrokingOperation)
{
if (m_csDA.IsEmpty()) {
- return false;
+ return FALSE;
}
CPDF_SimpleParser syntax(m_csDA);
if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
- return true;
+ return TRUE;
}
syntax.SetPos(0);
if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
- return true;
+ return TRUE;
}
syntax.SetPos(0);
return syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4);
}
-CFX_ByteString CPDF_DefaultAppearance::GetColorString(bool bStrokingOperation)
+CFX_ByteString CPDF_DefaultAppearance::GetColorString(FX_BOOL bStrokingOperation)
{
CFX_ByteString csColor;
if (m_csDA.IsEmpty()) {
@@ -119,7 +119,7 @@ CFX_ByteString CPDF_DefaultAppearance::GetColorString(bool bStrokingOperation)
}
return csColor;
}
-void CPDF_DefaultAppearance::GetColor(int& iColorType, FX_FLOAT fc[4], bool bStrokingOperation)
+void CPDF_DefaultAppearance::GetColor(int& iColorType, FX_FLOAT fc[4], FX_BOOL bStrokingOperation)
{
iColorType = COLORTYPE_TRANSPARENT;
for (int c = 0; c < 4; c ++) {
@@ -151,7 +151,7 @@ void CPDF_DefaultAppearance::GetColor(int& iColorType, FX_FLOAT fc[4], bool bStr
fc[3] = FX_atof((CFX_ByteString)syntax.GetWord());
}
}
-void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, int& iColorType, bool bStrokingOperation)
+void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, int& iColorType, FX_BOOL bStrokingOperation)
{
color = 0;
iColorType = COLORTYPE_TRANSPARENT;
@@ -187,10 +187,10 @@ void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, int& iColorType, bool bStr
color = ArgbEncode(255, (int)(r * 255 + 0.5f), (int)(g * 255 + 0.5f), (int)(b * 255 + 0.5f));
}
}
-bool CPDF_DefaultAppearance::HasTextMatrix()
+FX_BOOL CPDF_DefaultAppearance::HasTextMatrix()
{
if (m_csDA.IsEmpty()) {
- return false;
+ return FALSE;
}
CPDF_SimpleParser syntax(m_csDA);
return syntax.FindTagParam("Tm", 6);
@@ -468,18 +468,18 @@ CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDo
}
return GetNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag);
}
-bool FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag)
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag)
{
if (pFormDict == NULL || pFont == NULL) {
- return false;
+ return FALSE;
}
CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
if (pDR == NULL) {
- return false;
+ return FALSE;
}
CPDF_Dictionary* pFonts = pDR->GetDict("Font");
if (pFonts == NULL) {
- return false;
+ return FALSE;
}
FX_POSITION pos = pFonts->GetStartPos();
while (pos) {
@@ -499,23 +499,23 @@ bool FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_B
}
if (pFont->GetFontDict() == pElement) {
csNameTag = csKey;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
{
if (pFormDict == NULL) {
- return false;
+ return FALSE;
}
CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
if (pDR == NULL) {
- return false;
+ return FALSE;
}
CPDF_Dictionary* pFonts = pDR->GetDict("Font");
if (pFonts == NULL) {
- return false;
+ return FALSE;
}
if (csFontName.GetLength() > 0) {
csFontName.Remove(' ');
@@ -545,10 +545,10 @@ bool FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX
csBaseFont.Remove(' ');
if (csBaseFont == csFontName) {
csNameTag = csKey;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag)
{
@@ -670,10 +670,10 @@ CPDF_IconFit::ScaleMethod CPDF_IconFit::GetScaleMethod()
}
return Always;
}
-bool CPDF_IconFit::IsProportionalScale()
+FX_BOOL CPDF_IconFit::IsProportionalScale()
{
if (m_pDict == NULL) {
- return true;
+ return TRUE;
}
return m_pDict->GetString("S", "P") != "A";
}
@@ -694,10 +694,10 @@ void CPDF_IconFit::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom)
}
}
}
-bool CPDF_IconFit::GetFittingBounds()
+FX_BOOL CPDF_IconFit::GetFittingBounds()
{
if (m_pDict == NULL) {
- return false;
+ return FALSE;
}
return m_pDict->GetBoolean("FB");
}
diff --git a/core/src/fpdfdoc/doc_utils.h b/core/src/fpdfdoc/doc_utils.h
index 6dcf5b0d28..6bb1d30dbb 100644
--- a/core/src/fpdfdoc/doc_utils.h
+++ b/core/src/fpdfdoc/doc_utils.h
@@ -15,8 +15,8 @@ CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocumen
CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag);
CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, uint8_t charSet, CFX_ByteString& csNameTag);
CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
-bool FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
-bool FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, uint8_t charSet, CFX_ByteString& csNameTag);
CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
@@ -25,8 +25,8 @@ void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag)
CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument);
void SetDefaultInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont);
void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray);
-bool NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName);
-bool NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0);
+FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName);
+FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0);
void EncodeFieldName(const CFX_WideString& csName, CFX_ByteString& csT);
void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int nLevel = 0);
diff --git a/core/src/fpdfdoc/doc_viewerPreferences.cpp b/core/src/fpdfdoc/doc_viewerPreferences.cpp
index 1c014dbd38..eb824eb5a4 100644
--- a/core/src/fpdfdoc/doc_viewerPreferences.cpp
+++ b/core/src/fpdfdoc/doc_viewerPreferences.cpp
@@ -11,21 +11,21 @@ CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc
CPDF_ViewerPreferences::~CPDF_ViewerPreferences()
{
}
-bool CPDF_ViewerPreferences::IsDirectionR2L() const
+FX_BOOL CPDF_ViewerPreferences::IsDirectionR2L() const
{
CPDF_Dictionary *pDict = m_pDoc->GetRoot();
pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
if (!pDict) {
- return false;
+ return FALSE;
}
return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction"));
}
-bool CPDF_ViewerPreferences::PrintScaling() const
+FX_BOOL CPDF_ViewerPreferences::PrintScaling() const
{
CPDF_Dictionary *pDict = m_pDoc->GetRoot();
pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
if (!pDict) {
- return true;
+ return TRUE;
}
return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling"));
}
diff --git a/core/src/fpdfdoc/doc_vt.cpp b/core/src/fpdfdoc/doc_vt.cpp
index 8cc6b7c9f5..230ba764e4 100644
--- a/core/src/fpdfdoc/doc_vt.cpp
+++ b/core/src/fpdfdoc/doc_vt.cpp
@@ -183,8 +183,8 @@ CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point & point) const
{
ASSERT(m_pVT != NULL);
CPVT_WordPlace place = GetBeginWordPlace();
- bool bUp = true;
- bool bDown = true;
+ FX_BOOL bUp = TRUE;
+ FX_BOOL bDown = TRUE;
int32_t nLeft = 0;
int32_t nRight = m_LineArray.GetSize() - 1;
int32_t nMid = m_LineArray.GetSize() / 2;
@@ -195,10 +195,10 @@ CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point & point) const
fTop = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineAscent - m_pVT->GetLineLeading(m_SecInfo);
fBottom = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineDescent;
if (IsFloatBigger(point.y, fTop)) {
- bUp = false;
+ bUp = FALSE;
}
if (IsFloatSmaller(point.y, fBottom)) {
- bDown = false;
+ bDown = FALSE;
}
if (IsFloatSmaller(point.y, fTop)) {
nRight = nMid - 1;
@@ -394,7 +394,7 @@ CPVT_Size CTypeset::GetEditSize(FX_FLOAT fFontSize)
{
ASSERT(m_pSection != NULL);
ASSERT(m_pVT != NULL);
- SplitLines(false, fFontSize);
+ SplitLines(FALSE, fFontSize);
return CPVT_Size(m_rcRet.Width(), m_rcRet.Height());
}
CPVT_FloatRect CTypeset::Typeset()
@@ -402,7 +402,7 @@ CPVT_FloatRect CTypeset::Typeset()
ASSERT(m_pSection != NULL);
ASSERT(m_pVT != NULL);
m_pSection->m_LineArray.Empty();
- SplitLines(true, 0.0f);
+ SplitLines(TRUE, 0.0f);
m_pSection->m_LineArray.Clear();
OutputLines();
return m_rcRet;
@@ -425,11 +425,11 @@ static int special_chars[128] = {
0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
0x0001, 0x0001, 0x0001, 0x000C, 0x0000, 0x0008, 0x0000, 0x0000,
};
-static bool IsLatin(FX_WORD word)
+static FX_BOOL IsLatin(FX_WORD word)
{
if (word <= 0x007F) {
if (special_chars[word] & 0x0001) {
- return true;
+ return TRUE;
}
}
if ((word >= 0x00C0 && word <= 0x00FF) ||
@@ -439,15 +439,15 @@ static bool IsLatin(FX_WORD word)
(word >= 0xA720 && word <= 0xA7FF) ||
(word >= 0xFF21 && word <= 0xFF3A) ||
(word >= 0xFF41 && word <= 0xFF5A)) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-static bool IsDigit(FX_DWORD word)
+static FX_BOOL IsDigit(FX_DWORD word)
{
- return (word >= 0x0030 && word <= 0x0039) ? true : false;
+ return (word >= 0x0030 && word <= 0x0039) ? TRUE : FALSE;
}
-static bool IsCJK(FX_DWORD word)
+static FX_BOOL IsCJK(FX_DWORD word)
{
if ((word >= 0x1100 && word <= 0x11FF) ||
(word >= 0x2E80 && word <= 0x2FFF) ||
@@ -457,33 +457,33 @@ static bool IsCJK(FX_DWORD word)
(word >= 0xFE30 && word <= 0xFE4F) ||
(word >= 0x20000 && word <= 0x2A6DF) ||
(word >= 0x2F800 && word <= 0x2FA1F)) {
- return true;
+ return TRUE;
}
if (word >= 0x3000 && word <= 0x303F) {
if (word == 0x3005 || word == 0x3006 || word == 0x3021 || word == 0x3022 ||
word == 0x3023 || word == 0x3024 || word == 0x3025 || word == 0x3026 ||
word == 0x3027 || word == 0x3028 || word == 0x3029 || word == 0x3031 ||
word == 0x3032 || word == 0x3033 || word == 0x3034 || word == 0x3035) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
if (word >= 0xFF66 && word <= 0xFF9D) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-static bool IsPunctuation(FX_DWORD word)
+static FX_BOOL IsPunctuation(FX_DWORD word)
{
if (word <= 0x007F) {
if ((special_chars[word] >> 3) & 1) {
- return true;
+ return TRUE;
}
} else if (word >= 0x0080 && word <= 0x00FF) {
if (word == 0x0082 || word == 0x0084 || word == 0x0085 || word == 0x0091 ||
word == 0x0092 || word == 0x0093 || word <= 0x0094 || word == 0x0096 ||
word == 0x00B4 || word == 0x00B8) {
- return true;
+ return TRUE;
}
} else if (word >= 0x2000 && word <= 0x206F) {
if (word == 0x2010 || word == 0x2011 || word == 0x2012 || word == 0x2013 ||
@@ -492,7 +492,7 @@ static bool IsPunctuation(FX_DWORD word)
word == 0x2032 || word == 0x2033 || word == 0x2034 || word == 0x2035 ||
word == 0x2036 || word == 0x2037 || word == 0x203C || word == 0x203D ||
word == 0x203E || word == 0x2044) {
- return true;
+ return TRUE;
}
} else if (word >= 0x3000 && word <= 0x303F) {
if (word == 0x3001 || word == 0x3002 || word == 0x3003 || word == 0x3005 ||
@@ -501,11 +501,11 @@ static bool IsPunctuation(FX_DWORD word)
word == 0x3011 || word == 0x3014 || word == 0x3015 || word == 0x3016 ||
word == 0x3017 || word == 0x3018 || word == 0x3019 || word == 0x301A ||
word == 0x301B || word == 0x301D || word == 0x301E || word == 0x301F) {
- return true;
+ return TRUE;
}
} else if (word >= 0xFE50 && word <= 0xFE6F) {
if ((word >= 0xFE50 && word <= 0xFE5E) || word == 0xFE63) {
- return true;
+ return TRUE;
}
} else if (word >= 0xFF00 && word <= 0xFFEF) {
if (word == 0xFF01 || word == 0xFF02 || word == 0xFF07 || word == 0xFF08 ||
@@ -514,83 +514,83 @@ static bool IsPunctuation(FX_DWORD word)
word == 0xFF3D || word == 0xFF40 || word == 0xFF5B || word == 0xFF5C ||
word == 0xFF5D || word == 0xFF61 || word == 0xFF62 || word == 0xFF63 ||
word == 0xFF64 || word == 0xFF65 || word == 0xFF9E || word == 0xFF9F) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-static bool IsConnectiveSymbol(FX_DWORD word)
+static FX_BOOL IsConnectiveSymbol(FX_DWORD word)
{
if (word <= 0x007F) {
if ((special_chars[word] >> 5) & 1) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-static bool IsOpenStylePunctuation(FX_DWORD word)
+static FX_BOOL IsOpenStylePunctuation(FX_DWORD word)
{
if (word <= 0x007F) {
if ((special_chars[word] >> 2) & 1) {
- return true;
+ return TRUE;
}
} else if (word == 0x300A || word == 0x300C || word == 0x300E || word == 0x3010 ||
word == 0x3014 || word == 0x3016 || word == 0x3018 || word == 0x301A ||
word == 0xFF08 || word == 0xFF3B || word == 0xFF5B || word == 0xFF62) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-static bool IsCurrencySymbol(FX_WORD word)
+static FX_BOOL IsCurrencySymbol(FX_WORD word)
{
if (word == 0x0024 || word == 0x0080 || word == 0x00A2 || word == 0x00A3 ||
word == 0x00A4 || word == 0x00A5 || (word >= 0x20A0 && word <= 0x20CF) ||
word == 0xFE69 || word == 0xFF04 || word == 0xFFE0 || word == 0xFFE1 ||
word == 0xFFE5 || word == 0xFFE6) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-static bool IsPrefixSymbol(FX_WORD word)
+static FX_BOOL IsPrefixSymbol(FX_WORD word)
{
if (IsCurrencySymbol(word)) {
- return true;
+ return TRUE;
}
if (word == 0x2116) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-static bool IsSpace(FX_WORD word)
+static FX_BOOL IsSpace(FX_WORD word)
{
- return (word == 0x0020 || word == 0x3000) ? true : false;
+ return (word == 0x0020 || word == 0x3000) ? TRUE : FALSE;
}
-static bool NeedDivision(FX_WORD prevWord, FX_WORD curWord)
+static FX_BOOL NeedDivision(FX_WORD prevWord, FX_WORD curWord)
{
if ((IsLatin(prevWord) || IsDigit(prevWord)) && (IsLatin(curWord) || IsDigit(curWord))) {
- return false;
+ return FALSE;
}
if (IsSpace(curWord) || IsPunctuation(curWord)) {
- return false;
+ return FALSE;
}
if (IsConnectiveSymbol(prevWord) || IsConnectiveSymbol(curWord)) {
- return false;
+ return FALSE;
}
if (IsSpace(prevWord) || IsPunctuation(prevWord)) {
- return true;
+ return TRUE;
}
if (IsPrefixSymbol(prevWord)) {
- return false;
+ return FALSE;
}
if (IsPrefixSymbol(curWord) || IsCJK(curWord)) {
- return true;
+ return TRUE;
}
if (IsCJK(prevWord)) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize)
+void CTypeset::SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize)
{
ASSERT(m_pVT != NULL);
ASSERT(m_pSection != NULL);
@@ -601,14 +601,14 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize)
FX_FLOAT fLineAscent = 0.0f, fBackupLineAscent = 0.0f;
FX_FLOAT fLineDescent = 0.0f, fBackupLineDescent = 0.0f;
int32_t nWordStartPos = 0;
- bool bFullWord = false;
+ FX_BOOL bFullWord = FALSE;
int32_t nLineFullWordIndex = 0;
int32_t nCharIndex = 0;
CPVT_LineInfo line;
FX_FLOAT fWordWidth = 0;
FX_FLOAT fTypesetWidth = FPDF_MAX(m_pVT->GetPlateWidth() - m_pVT->GetLineIndent(m_pSection->m_SecInfo), 0.0f);
int32_t nTotalWords = m_pSection->m_WordArray.GetSize();
- bool bOpened = false;
+ FX_BOOL bOpened = FALSE;
if (nTotalWords > 0) {
int32_t i = 0;
while (i < nTotalWords) {
@@ -619,8 +619,8 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize)
}
if (pWord) {
if (bTypeset) {
- fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, true));
- fLineDescent = FPDF_MIN(fLineDescent, m_pVT->GetWordDescent(*pWord, true));
+ fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, TRUE));
+ fLineDescent = FPDF_MIN(fLineDescent, m_pVT->GetWordDescent(*pWord, TRUE));
fWordWidth = m_pVT->GetWordWidth(*pWord);
} else {
fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, fFontSize));
@@ -636,20 +636,20 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize)
}
if (!bOpened) {
if (IsOpenStylePunctuation(pWord->Word)) {
- bOpened = true;
- bFullWord = true;
+ bOpened = TRUE;
+ bFullWord = TRUE;
} else if (pOldWord != NULL) {
if (NeedDivision(pOldWord->Word, pWord->Word)) {
- bFullWord = true;
+ bFullWord = TRUE;
}
}
} else {
if (!IsSpace(pWord->Word) && !IsOpenStylePunctuation(pWord->Word)) {
- bOpened = false;
+ bOpened = FALSE;
}
}
if (bFullWord) {
- bFullWord = false;
+ bFullWord = FALSE;
if (nCharIndex > 0) {
nLineFullWordIndex ++;
}
@@ -691,7 +691,7 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize)
fLineDescent = 0.0f;
nCharIndex = 0;
nLineFullWordIndex = 0;
- bFullWord = false;
+ bFullWord = FALSE;
} else {
fLineWidth += fWordWidth;
i++;
@@ -809,17 +809,17 @@ void CTypeset::OutputLines()
CPDF_VariableText::CPDF_VariableText() :
m_nLimitChar(0),
m_nCharArray(0),
- m_bMultiLine(false),
- m_bLimitWidth(false),
- m_bAutoFontSize(false),
+ m_bMultiLine(FALSE),
+ m_bLimitWidth(FALSE),
+ m_bAutoFontSize(FALSE),
m_nAlignment(0),
m_fLineLeading(0.0f),
m_fCharSpace(0.0f),
m_nHorzScale(100),
m_wSubWord(0),
m_fFontSize(0.0f),
- m_bInitial(false),
- m_bRichText(false),
+ m_bInitial(FALSE),
+ m_bRichText(FALSE),
m_pVTProvider(NULL),
m_pVTIterator(NULL)
{
@@ -848,12 +848,12 @@ void CPDF_VariableText::Initialize()
if (CSection * pSection = m_SectionArray.GetAt(0)) {
pSection->ResetLinePlace();
}
- m_bInitial = true;
+ m_bInitial = TRUE;
}
}
void CPDF_VariableText::ResetAll()
{
- m_bInitial = false;
+ m_bInitial = FALSE;
ResetSectionArray();
}
CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset,
@@ -956,7 +956,7 @@ CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace & place, const
}
CPVT_WordPlace CPDF_VariableText::DeleteWords(const CPVT_WordRange & PlaceRange)
{
- bool bLastSecPos = false;
+ FX_BOOL bLastSecPos = FALSE;
if (CSection * pSection = m_SectionArray.GetAt(PlaceRange.EndPos.nSecIndex)) {
bLastSecPos = (PlaceRange.EndPos == pSection->GetEndWordPlace());
}
@@ -971,11 +971,11 @@ CPVT_WordPlace CPDF_VariableText::DeleteWords(const CPVT_WordRange & PlaceRange)
}
CPVT_WordPlace CPDF_VariableText::DeleteWord(const CPVT_WordPlace & place)
{
- return ClearRightWord(AjustLineHeader(place, true));
+ return ClearRightWord(AjustLineHeader(place, TRUE));
}
CPVT_WordPlace CPDF_VariableText::BackSpaceWord(const CPVT_WordPlace & place)
{
- return ClearLeftWord(AjustLineHeader(place, true));
+ return ClearLeftWord(AjustLineHeader(place, TRUE));
}
void CPDF_VariableText::SetText(const FX_WCHAR* text, int32_t charset, const CPVT_SecProps * pSecProps,
const CPVT_WordProps * pWordProps)
@@ -1044,7 +1044,7 @@ void CPDF_VariableText::UpdateWordPlace(CPVT_WordPlace & place) const
if (place.nSecIndex >= m_SectionArray.GetSize()) {
place = GetEndWordPlace();
}
- place = AjustLineHeader(place, true);
+ place = AjustLineHeader(place, TRUE);
if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
pSection->UpdateWordPlace(place);
}
@@ -1073,19 +1073,19 @@ CPVT_WordPlace CPDF_VariableText::WordIndexToWordPlace(int32_t index) const
{
CPVT_WordPlace place = GetBeginWordPlace();
int32_t nOldIndex = 0 , nIndex = 0;
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
for (int32_t i = 0, sz = m_SectionArray.GetSize(); i < sz; i++) {
if (CSection * pSection = m_SectionArray.GetAt(i)) {
nIndex += pSection->m_WordArray.GetSize();
if (nIndex == index) {
place = pSection->GetEndWordPlace();
- bFind = true;
+ bFind = TRUE;
break;
} else if (nIndex > index) {
place.nSecIndex = i;
place.nWordIndex = index - nOldIndex - 1;
pSection->UpdateWordPlace(place);
- bFind = true;
+ bFind = TRUE;
break;
}
if (i != m_SectionArray.GetSize() - 1) {
@@ -1155,15 +1155,15 @@ CPVT_WordPlace CPDF_VariableText::SearchWordPlace(const CPDF_Point & point) cons
int32_t nLeft = 0;
int32_t nRight = m_SectionArray.GetSize() - 1;
int32_t nMid = m_SectionArray.GetSize() / 2;
- bool bUp = true;
- bool bDown = true;
+ FX_BOOL bUp = TRUE;
+ FX_BOOL bDown = TRUE;
while (nLeft <= nRight) {
if (CSection * pSection = m_SectionArray.GetAt(nMid)) {
if (IsFloatBigger(pt.y, pSection->m_SecInfo.rcSection.top)) {
- bUp = false;
+ bUp = FALSE;
}
if (IsFloatBigger(pSection->m_SecInfo.rcSection.bottom, pt.y)) {
- bDown = false;
+ bDown = FALSE;
}
if (IsFloatSmaller(pt.y, pSection->m_SecInfo.rcSection.top)) {
nRight = nMid - 1;
@@ -1303,49 +1303,49 @@ CPVT_WordPlace CPDF_VariableText::AddWord(const CPVT_WordPlace & place, const CP
}
return place;
}
-bool CPDF_VariableText::GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo)
+FX_BOOL CPDF_VariableText::GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo)
{
if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(place.nWordIndex)) {
wordinfo = *pWord;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText::SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
+FX_BOOL CPDF_VariableText::SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
{
if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(place.nWordIndex)) {
*pWord = wordinfo;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText::GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo)
+FX_BOOL CPDF_VariableText::GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo)
{
if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
if (CLine * pLine = pSection->m_LineArray.GetAt(place.nLineIndex)) {
lineinfo = pLine->m_LineInfo;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo)
+FX_BOOL CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo)
{
if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
secinfo = pSection->m_SecInfo;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CPDF_Rect CPDF_VariableText::GetContentRect() const
{
return InToOut(CPDF_EditContainer::GetContentRect());
}
-FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo & WordInfo, bool bFactFontSize)
+FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
{
return m_bRichText && WordInfo.pWordProps ? (WordInfo.pWordProps->nScriptType == PVTWORD_SCRIPT_NORMAL || bFactFontSize ? WordInfo.pWordProps->fFontSize : WordInfo.pWordProps->fFontSize * PVT_HALF) : GetFontSize();
}
@@ -1391,11 +1391,11 @@ FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FL
{
return GetFontDescent(GetWordFontIndex(WordInfo), fFontSize);
}
-FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo & WordInfo, bool bFactFontSize)
+FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
{
return GetFontAscent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo, bFactFontSize));
}
-FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, bool bFactFontSize)
+FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
{
return GetFontDescent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo, bFactFontSize));
}
@@ -1421,7 +1421,7 @@ int32_t CPDF_VariableText::GetHorzScale(const CPVT_WordInfo & WordInfo)
}
void CPDF_VariableText::ClearSectionRightWords(const CPVT_WordPlace & place)
{
- CPVT_WordPlace wordplace = AjustLineHeader(place, true);
+ CPVT_WordPlace wordplace = AjustLineHeader(place, TRUE);
if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
for (int32_t w = pSection->m_WordArray.GetSize() - 1; w > wordplace.nWordIndex; w--) {
delete pSection->m_WordArray.GetAt(w);
@@ -1429,26 +1429,26 @@ void CPDF_VariableText::ClearSectionRightWords(const CPVT_WordPlace & place)
}
}
}
-CPVT_WordPlace CPDF_VariableText::AjustLineHeader(const CPVT_WordPlace & place, bool bPrevOrNext) const
+CPVT_WordPlace CPDF_VariableText::AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const
{
if (place.nWordIndex < 0 && place.nLineIndex > 0) {
return bPrevOrNext ? GetPrevWordPlace(place) : GetNextWordPlace(place);
}
return place;
}
-bool CPDF_VariableText::ClearEmptySection(const CPVT_WordPlace & place)
+FX_BOOL CPDF_VariableText::ClearEmptySection(const CPVT_WordPlace & place)
{
if (place.nSecIndex == 0 && m_SectionArray.GetSize() == 1) {
- return false;
+ return FALSE;
}
if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
if (pSection->m_WordArray.GetSize() == 0) {
delete pSection;
m_SectionArray.RemoveAt(place.nSecIndex);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
void CPDF_VariableText::ClearEmptySections(const CPVT_WordRange & PlaceRange)
{
@@ -1460,7 +1460,7 @@ void CPDF_VariableText::ClearEmptySections(const CPVT_WordRange & PlaceRange)
}
void CPDF_VariableText::LinkLatterSection(const CPVT_WordPlace & place)
{
- CPVT_WordPlace oldplace = AjustLineHeader(place, true);
+ CPVT_WordPlace oldplace = AjustLineHeader(place, TRUE);
if (CSection * pNextSection = m_SectionArray.GetAt(place.nSecIndex + 1)) {
if (CSection * pSection = m_SectionArray.GetAt(oldplace.nSecIndex)) {
for (int32_t w = 0, sz = pNextSection->m_WordArray.GetSize(); w < sz; w++) {
@@ -1477,8 +1477,8 @@ void CPDF_VariableText::LinkLatterSection(const CPVT_WordPlace & place)
void CPDF_VariableText::ClearWords(const CPVT_WordRange & PlaceRange)
{
CPVT_WordRange NewRange;
- NewRange.BeginPos = AjustLineHeader(PlaceRange.BeginPos, true);
- NewRange.EndPos = AjustLineHeader(PlaceRange.EndPos, true);
+ NewRange.BeginPos = AjustLineHeader(PlaceRange.BeginPos, TRUE);
+ NewRange.EndPos = AjustLineHeader(PlaceRange.EndPos, TRUE);
for (int32_t s = NewRange.EndPos.nSecIndex; s >= NewRange.BeginPos.nSecIndex; s--) {
if (CSection * pSection = m_SectionArray.GetAt(s)) {
pSection->ClearWords(NewRange);
@@ -1507,7 +1507,7 @@ CPVT_WordPlace CPDF_VariableText::ClearLeftWord(const CPVT_WordPlace & place)
CPVT_WordPlace CPDF_VariableText::ClearRightWord(const CPVT_WordPlace & place)
{
if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- CPVT_WordPlace rightplace = AjustLineHeader(GetNextWordPlace(place), false);
+ CPVT_WordPlace rightplace = AjustLineHeader(GetNextWordPlace(place), FALSE);
if (rightplace != place) {
if(rightplace.nSecIndex != place.nSecIndex) {
LinkLatterSection(place);
@@ -1568,9 +1568,9 @@ FX_FLOAT CPDF_VariableText::GetAutoFontSize()
}
return (FX_FLOAT)gFontSizeSteps[nMid];
}
-bool CPDF_VariableText::IsBigger(FX_FLOAT fFontSize)
+FX_BOOL CPDF_VariableText::IsBigger(FX_FLOAT fFontSize)
{
- bool bBigger = false;
+ FX_BOOL bBigger = FALSE;
CPVT_Size szTotal;
for (int32_t s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) {
if (CSection * pSection = m_SectionArray.GetAt(s)) {
@@ -1580,7 +1580,7 @@ bool CPDF_VariableText::IsBigger(FX_FLOAT fFontSize)
if (IsFloatBigger(szTotal.x, GetPlateWidth())
|| IsFloatBigger(szTotal.y, GetPlateHeight())
) {
- bBigger = true;
+ bBigger = TRUE;
break;
}
}
@@ -1652,9 +1652,9 @@ int32_t CPDF_VariableText::GetDefaultFontIndex()
{
return m_pVTProvider ? m_pVTProvider->GetDefaultFontIndex() : -1;
}
-bool CPDF_VariableText::IsLatinWord(FX_WORD word)
+FX_BOOL CPDF_VariableText::IsLatinWord(FX_WORD word)
{
- return m_pVTProvider ? m_pVTProvider->IsLatinWord(word) : false;
+ return m_pVTProvider ? m_pVTProvider->IsLatinWord(word) : FALSE;
}
IPDF_VariableText_Iterator * CPDF_VariableText::GetIterator()
{
@@ -1687,70 +1687,70 @@ void CPDF_VariableText_Iterator::SetAt(const CPVT_WordPlace & place)
ASSERT(m_pVT != NULL);
m_CurPos = place;
}
-bool CPDF_VariableText_Iterator::NextWord()
+FX_BOOL CPDF_VariableText_Iterator::NextWord()
{
if (m_CurPos == m_pVT->GetEndWordPlace()) {
- return false;
+ return FALSE;
}
m_CurPos = m_pVT->GetNextWordPlace(m_CurPos);
- return true;
+ return TRUE;
}
-bool CPDF_VariableText_Iterator::PrevWord()
+FX_BOOL CPDF_VariableText_Iterator::PrevWord()
{
if (m_CurPos == m_pVT->GetBeginWordPlace()) {
- return false;
+ return FALSE;
}
m_CurPos = m_pVT->GetPrevWordPlace(m_CurPos);
- return true;
+ return TRUE;
}
-bool CPDF_VariableText_Iterator::NextLine()
+FX_BOOL CPDF_VariableText_Iterator::NextLine()
{
if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
if (m_CurPos.nLineIndex < pSection->m_LineArray.GetSize() - 1) {
m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex + 1, -1);
- return true;
+ return TRUE;
}
if (m_CurPos.nSecIndex < m_pVT->m_SectionArray.GetSize() - 1) {
m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText_Iterator::PrevLine()
+FX_BOOL CPDF_VariableText_Iterator::PrevLine()
{
if (m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
if (m_CurPos.nLineIndex > 0) {
m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex - 1, -1);
- return true;
+ return TRUE;
}
if (m_CurPos.nSecIndex > 0) {
if (CSection * pLastSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex - 1)) {
m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, pLastSection->m_LineArray.GetSize() - 1, -1);
- return true;
+ return TRUE;
}
}
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText_Iterator::NextSection()
+FX_BOOL CPDF_VariableText_Iterator::NextSection()
{
if (m_CurPos.nSecIndex < m_pVT->m_SectionArray.GetSize() - 1) {
m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText_Iterator::PrevSection()
+FX_BOOL CPDF_VariableText_Iterator::PrevSection()
{
ASSERT(m_pVT != NULL);
if (m_CurPos.nSecIndex > 0) {
m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, 0, -1);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const
+FX_BOOL CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const
{
ASSERT(m_pVT != NULL);
word.WordPlace = m_CurPos;
@@ -1770,13 +1770,13 @@ bool CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const
}
word.nFontIndex = m_pVT->GetWordFontIndex(*pWord);
word.fFontSize = m_pVT->GetWordFontSize(*pWord);
- return true;
+ return TRUE;
}
}
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText_Iterator::SetWord(const CPVT_Word & word)
+FX_BOOL CPDF_VariableText_Iterator::SetWord(const CPVT_Word & word)
{
ASSERT(m_pVT != NULL);
if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
@@ -1784,12 +1784,12 @@ bool CPDF_VariableText_Iterator::SetWord(const CPVT_Word & word)
if (pWord->pWordProps) {
*pWord->pWordProps = word.WordProps;
}
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText_Iterator::GetLine(CPVT_Line & line) const
+FX_BOOL CPDF_VariableText_Iterator::GetLine(CPVT_Line & line) const
{
ASSERT(m_pVT != NULL);
line.lineplace = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex, -1);
@@ -1802,12 +1802,12 @@ bool CPDF_VariableText_Iterator::GetLine(CPVT_Line & line) const
line.fLineAscent = pLine->m_LineInfo.fLineAscent;
line.fLineDescent = pLine->m_LineInfo.fLineDescent;
line.lineEnd = pLine->GetEndWordPlace();
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText_Iterator::GetSection(CPVT_Section & section) const
+FX_BOOL CPDF_VariableText_Iterator::GetSection(CPVT_Section & section) const
{
ASSERT(m_pVT != NULL);
section.secplace = CPVT_WordPlace(m_CurPos.nSecIndex, 0, -1);
@@ -1819,11 +1819,11 @@ bool CPDF_VariableText_Iterator::GetSection(CPVT_Section & section) const
if (pSection->m_SecInfo.pWordProps) {
section.WordProps = *pSection->m_SecInfo.pWordProps;
}
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDF_VariableText_Iterator::SetSection(const CPVT_Section & section)
+FX_BOOL CPDF_VariableText_Iterator::SetSection(const CPVT_Section & section)
{
ASSERT(m_pVT != NULL);
if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
@@ -1833,7 +1833,7 @@ bool CPDF_VariableText_Iterator::SetSection(const CPVT_Section & section)
if (pSection->m_SecInfo.pWordProps) {
*pSection->m_SecInfo.pWordProps = section.WordProps;
}
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
diff --git a/core/src/fpdfdoc/pdf_vt.h b/core/src/fpdfdoc/pdf_vt.h
index fb7910bff5..a75490fcd5 100644
--- a/core/src/fpdfdoc/pdf_vt.h
+++ b/core/src/fpdfdoc/pdf_vt.h
@@ -191,7 +191,7 @@ struct CPVT_FloatRange {
template<class TYPE> class CPVT_ArrayTemplate : public CFX_ArrayTemplate<TYPE>
{
public:
- bool IsEmpty()
+ FX_BOOL IsEmpty()
{
return CFX_ArrayTemplate<TYPE>::GetSize() <= 0;
}
@@ -316,7 +316,7 @@ public:
CPVT_FloatRect Typeset();
CPVT_FloatRect CharArray();
private:
- void SplitLines(bool bTypeset, FX_FLOAT fFontSize);
+ void SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize);
void OutputLines();
CPVT_FloatRect m_rcRet;
@@ -423,11 +423,11 @@ public:
{
m_nHorzScale = nHorzScale;
}
- void SetMultiLine(bool bMultiLine = true)
+ void SetMultiLine(FX_BOOL bMultiLine = TRUE)
{
m_bMultiLine = bMultiLine;
}
- void SetAutoReturn(bool bAuto = true)
+ void SetAutoReturn(FX_BOOL bAuto = TRUE)
{
m_bLimitWidth = bAuto;
}
@@ -439,11 +439,11 @@ public:
{
m_nCharArray = nCharArray;
}
- void SetAutoFontSize(bool bAuto = true)
+ void SetAutoFontSize(FX_BOOL bAuto = TRUE)
{
m_bAutoFontSize = bAuto;
}
- void SetRichText(bool bRichText)
+ void SetRichText(FX_BOOL bRichText)
{
m_bRichText = bRichText;
}
@@ -452,11 +452,11 @@ public:
m_fLineLeading = fLineLeading;
}
void Initialize();
- bool IsValid() const
+ FX_BOOL IsValid() const
{
return m_bInitial;
}
- bool IsRichText() const
+ FX_BOOL IsRichText() const
{
return m_bRichText;
}
@@ -496,7 +496,7 @@ public:
{
return m_nLimitChar;
}
- bool IsMultiLine() const
+ FX_BOOL IsMultiLine() const
{
return m_bMultiLine;
}
@@ -537,25 +537,25 @@ private:
int32_t GetTypeDescent(int32_t nFontIndex);
int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex);
int32_t GetDefaultFontIndex();
- bool IsLatinWord(FX_WORD word);
+ FX_BOOL IsLatinWord(FX_WORD word);
private:
CPVT_WordPlace AddSection(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo);
CPVT_WordPlace AddLine(const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo);
CPVT_WordPlace AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
- bool GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo);
- bool SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
- bool GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo);
- bool GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo);
- FX_FLOAT GetWordFontSize(const CPVT_WordInfo & WordInfo, bool bFactFontSize = false);
+ FX_BOOL GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo);
+ FX_BOOL SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
+ FX_BOOL GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo);
+ FX_BOOL GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo);
+ FX_FLOAT GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
FX_FLOAT GetWordWidth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord,
FX_FLOAT fCharSpace, int32_t nHorzScale,
FX_FLOAT fFontSize, FX_FLOAT fWordTail, int32_t nWordStyle);
FX_FLOAT GetWordWidth(const CPVT_WordInfo & WordInfo);
FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize);
FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize);
- FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, bool bFactFontSize = false);
- FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, bool bFactFontSize = false);
+ FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
+ FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
FX_FLOAT GetLineAscent(const CPVT_SectionInfo & SecInfo);
FX_FLOAT GetLineDescent(const CPVT_SectionInfo & SecInfo);
FX_FLOAT GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize);
@@ -568,8 +568,8 @@ private:
int32_t GetAlignment(const CPVT_SectionInfo& SecInfo);
void ClearSectionRightWords(const CPVT_WordPlace & place);
- CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, bool bPrevOrNext) const;
- bool ClearEmptySection(const CPVT_WordPlace & place);
+ CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const;
+ FX_BOOL ClearEmptySection(const CPVT_WordPlace & place);
void ClearEmptySections(const CPVT_WordRange & PlaceRange);
void LinkLatterSection(const CPVT_WordPlace & place);
void ClearWords(const CPVT_WordRange & PlaceRange);
@@ -578,7 +578,7 @@ private:
private:
CPVT_FloatRect Rearrange(const CPVT_WordRange & PlaceRange);
FX_FLOAT GetAutoFontSize();
- bool IsBigger(FX_FLOAT fFontSize);
+ FX_BOOL IsBigger(FX_FLOAT fFontSize);
CPVT_FloatRect RearrangeSections(const CPVT_WordRange & PlaceRange);
private:
void ResetSectionArray();
@@ -586,9 +586,9 @@ private:
CPVT_ArrayTemplate<CSection*> m_SectionArray;
int32_t m_nLimitChar;
int32_t m_nCharArray;
- bool m_bMultiLine;
- bool m_bLimitWidth;
- bool m_bAutoFontSize;
+ FX_BOOL m_bMultiLine;
+ FX_BOOL m_bLimitWidth;
+ FX_BOOL m_bAutoFontSize;
int32_t m_nAlignment;
FX_FLOAT m_fLineLeading;
FX_FLOAT m_fCharSpace;
@@ -597,8 +597,8 @@ private:
FX_FLOAT m_fFontSize;
private:
- bool m_bInitial;
- bool m_bRichText;
+ FX_BOOL m_bInitial;
+ FX_BOOL m_bRichText;
IPDF_VariableText_Provider * m_pVTProvider;
CPDF_VariableText_Iterator * m_pVTIterator;
};
@@ -607,17 +607,17 @@ class CPDF_VariableText_Iterator : public IPDF_VariableText_Iterator
public:
CPDF_VariableText_Iterator(CPDF_VariableText * pVT);
virtual ~CPDF_VariableText_Iterator();
- bool NextWord();
- bool PrevWord();
- bool NextLine();
- bool PrevLine();
- bool NextSection();
- bool PrevSection();
- bool SetWord(const CPVT_Word & word);
- bool GetWord(CPVT_Word & word) const;
- bool GetLine(CPVT_Line & line) const;
- bool GetSection(CPVT_Section & section) const;
- bool SetSection(const CPVT_Section & section);
+ FX_BOOL NextWord();
+ FX_BOOL PrevWord();
+ FX_BOOL NextLine();
+ FX_BOOL PrevLine();
+ FX_BOOL NextSection();
+ FX_BOOL PrevSection();
+ FX_BOOL SetWord(const CPVT_Word & word);
+ FX_BOOL GetWord(CPVT_Word & word) const;
+ FX_BOOL GetLine(CPVT_Line & line) const;
+ FX_BOOL GetSection(CPVT_Section & section) const;
+ FX_BOOL SetSection(const CPVT_Section & section);
void SetAt(int32_t nWordIndex);
void SetAt(const CPVT_WordPlace & place);
const CPVT_WordPlace & GetAt() const
diff --git a/core/src/fpdfdoc/tagged_int.h b/core/src/fpdfdoc/tagged_int.h
index 1279617681..9c643a6d6b 100644
--- a/core/src/fpdfdoc/tagged_int.h
+++ b/core/src/fpdfdoc/tagged_int.h
@@ -26,7 +26,7 @@ public:
void LoadDocTree();
void LoadPageTree(const CPDF_Dictionary* pPageDict);
CPDF_StructElementImpl* AddPageNode(CPDF_Dictionary* pElement, CFX_MapPtrToPtr& map, int nLevel = 0);
- bool AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement);
+ FX_BOOL AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement);
protected:
const CPDF_Dictionary* m_pTreeRoot;
const CPDF_Dictionary* m_pRoleMap;
@@ -67,16 +67,16 @@ public:
return &m_ObjectArray;
}
- CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable = false, FX_FLOAT fLevel = 0.0F);
+ CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F);
- CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, bool bInheritable = false, int subindex = -1);
- FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, bool bInheritable = false, int subindex = -1);
- FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, bool bInheritable = false, int subindex = -1);
- int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, bool bInheritable = false, int subindex = -1);
+ CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
+ FX_ARGB GetColor(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
+ FX_FLOAT GetNumber(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
+ int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
CFX_PtrArray m_ObjectArray;
void LoadKids(CPDF_Dictionary* pDict);
void LoadKid(FX_DWORD PageObjNum, CPDF_Object* pObj, CPDF_StructKid* pKid);
- CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable, int subindex);
+ CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, FX_BOOL bInheritable, int subindex);
CPDF_StructElementImpl* Retain();
void Release();
protected:
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp
index 7d728a8ae7..7203a694ab 100644
--- a/core/src/fpdftext/fpdf_text.cpp
+++ b/core/src/fpdftext/fpdf_text.cpp
@@ -289,7 +289,7 @@ void CTextPage::WriteOutput(CFX_WideStringArray& lines, int iMinWidth)
}
void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest)
{
- wChar = FX_GetMirrorChar(wChar, true, false);
+ wChar = FX_GetMirrorChar(wChar, TRUE, FALSE);
FX_WCHAR* pDst = NULL;
FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
if (nCount < 1 ) {
@@ -311,7 +311,7 @@ void NormalizeString(CFX_WideString& str)
CFX_WideString sBuffer;
nonstd::unique_ptr<IFX_BidiChar> pBidiChar(IFX_BidiChar::Create());
CFX_WordArray order;
- bool bR2L = false;
+ FX_BOOL bR2L = FALSE;
int32_t start = 0, count = 0, i = 0;
int nR2L = 0, nL2R = 0;
for (i = 0; i < str.GetLength(); i++) {
@@ -343,7 +343,7 @@ void NormalizeString(CFX_WideString& str)
}
}
if(nR2L > 0 && nR2L >= nL2R) {
- bR2L = true;
+ bR2L = TRUE;
}
if(bR2L) {
int count = order.GetSize();
@@ -357,7 +357,7 @@ void NormalizeString(CFX_WideString& str)
}
} else {
i = j;
- bool bSymbol = false;
+ FX_BOOL bSymbol = FALSE;
while(i > 0 && order.GetAt(i) != 2) {
bSymbol = !order.GetAt(i);
i -= 3;
@@ -389,7 +389,7 @@ void NormalizeString(CFX_WideString& str)
}
} else {
int count = order.GetSize();
- bool bL2R = false;
+ FX_BOOL bL2R = FALSE;
for(int j = 0; j < count; j += 3) {
int ret = order.GetAt(j + 2);
int start = order.GetAt(j);
@@ -405,7 +405,7 @@ void NormalizeString(CFX_WideString& str)
}
if(i == 3) {
j = -3;
- bL2R = true;
+ bL2R = TRUE;
continue;
}
int end = str.GetLength() - 1;
@@ -427,15 +427,15 @@ void NormalizeString(CFX_WideString& str)
str.Empty();
str += sBuffer;
}
-static bool IsNumber(CFX_WideString& str)
+static FX_BOOL IsNumber(CFX_WideString& str)
{
for (int i = 0; i < str.GetLength(); i ++) {
FX_WCHAR ch = str[i];
if ((ch < '0' || ch > '9') && ch != '-' && ch != '+' && ch != '.' && ch != ' ') {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
void CTextPage::FindColumns()
{
@@ -534,18 +534,18 @@ void CTextBaseLine::InsertTextBox(FX_FLOAT leftx, FX_FLOAT rightx, FX_FLOAT topy
pText->m_pColumn = NULL;
m_TextList.InsertAt(i, pText);
}
-bool GetIntersection(FX_FLOAT low1, FX_FLOAT high1, FX_FLOAT low2, FX_FLOAT high2,
+FX_BOOL GetIntersection(FX_FLOAT low1, FX_FLOAT high1, FX_FLOAT low2, FX_FLOAT high2,
FX_FLOAT& interlow, FX_FLOAT& interhigh);
-bool CTextBaseLine::CanMerge(CTextBaseLine* pOther)
+FX_BOOL CTextBaseLine::CanMerge(CTextBaseLine* pOther)
{
FX_FLOAT inter_top, inter_bottom;
if (!GetIntersection(m_Bottom, m_Top, pOther->m_Bottom, pOther->m_Top,
inter_bottom, inter_top)) {
- return false;
+ return FALSE;
}
FX_FLOAT inter_h = inter_top - inter_bottom;
if (inter_h < (m_Top - m_Bottom) / 2 && inter_h < (pOther->m_Top - pOther->m_Bottom) / 2) {
- return false;
+ return FALSE;
}
FX_FLOAT dy = (FX_FLOAT)FXSYS_fabs(m_BaseLine - pOther->m_BaseLine);
for (int i = 0; i < m_TextList.GetSize(); i ++) {
@@ -563,11 +563,11 @@ bool CTextBaseLine::CanMerge(CTextBaseLine* pOther)
}
if (dy >= (pText->m_Bottom - pText->m_Top) / 2 ||
dy >= (pOtherText->m_Bottom - pOtherText->m_Top) / 2) {
- return false;
+ return FALSE;
}
}
}
- return true;
+ return TRUE;
}
void CTextBaseLine::Merge(CTextBaseLine* pOther)
{
@@ -577,7 +577,7 @@ void CTextBaseLine::Merge(CTextBaseLine* pOther)
pText->m_SpaceWidth, pText->m_FontSizeV, pText->m_Text);
}
}
-bool CTextBaseLine::GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx)
+FX_BOOL CTextBaseLine::GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx)
{
int i;
for (i = 0; i < m_TextList.GetSize(); i ++) {
@@ -587,7 +587,7 @@ bool CTextBaseLine::GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx)
}
}
if (i == m_TextList.GetSize()) {
- return false;
+ return FALSE;
}
CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
leftx = pText->m_Left;
@@ -599,7 +599,7 @@ bool CTextBaseLine::GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx)
}
pText = (CTextBox*)m_TextList.GetAt(i);
rightx = pText->m_Right;
- return true;
+ return TRUE;
}
void CTextBaseLine::MergeBoxes()
{
@@ -724,8 +724,8 @@ void PDF_GetPageText_Unicode(CFX_WideStringArray& lines, CPDF_Document* pDoc, CP
CPDF_Page page;
page.Load(pDoc, pPage);
CPDF_ParseOptions options;
- options.m_bTextOnly = true;
- options.m_bSeparateForm = false;
+ options.m_bTextOnly = TRUE;
+ options.m_bSeparateForm = FALSE;
page.ParseContent(&options);
CFX_FloatRect page_bbox = page.GetPageBBox();
if (flags & PDF2TXT_AUTO_ROTATE) {
@@ -734,7 +734,7 @@ void PDF_GetPageText_Unicode(CFX_WideStringArray& lines, CPDF_Document* pDoc, CP
CTextPage texts;
texts.m_bAutoWidth = flags & PDF2TXT_AUTO_WIDTH;
texts.m_bKeepColumn = flags & PDF2TXT_KEEP_COLUMN;
- texts.m_bBreakSpace = true;
+ texts.m_bBreakSpace = TRUE;
FX_POSITION pos = page.GetFirstObjectPosition();
while (pos) {
CPDF_PageObject* pObject = page.GetNextObject(pos);
@@ -763,7 +763,7 @@ void PDF_GetPageText(CFX_ByteStringArray& lines, CPDF_Document* pDoc, CPDF_Dicti
lines.Add(str);
}
}
-extern void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage, bool bUseLF,
+extern void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage, FX_BOOL bUseLF,
CFX_PtrArray* pObjArray);
void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_Document* pDoc, CPDF_Dictionary* pPage, FX_DWORD flags)
{
@@ -771,8 +771,8 @@ void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_Document* pDoc, CPD
CPDF_Page page;
page.Load(pDoc, pPage);
CPDF_ParseOptions options;
- options.m_bTextOnly = true;
- options.m_bSeparateForm = false;
+ options.m_bTextOnly = TRUE;
+ options.m_bSeparateForm = FALSE;
page.ParseContent(&options);
- _PDF_GetTextStream_Unicode(buffer, &page, true, NULL);
+ _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL);
}
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index f777a3d90b..c1aaad8b5c 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -19,10 +19,10 @@
namespace {
-bool _IsIgnoreSpaceCharacter(FX_WCHAR curChar)
+FX_BOOL _IsIgnoreSpaceCharacter(FX_WCHAR curChar)
{
if(curChar < 255 ) {
- return false;
+ return FALSE;
}
if ( (curChar >= 0x0600 && curChar <= 0x06FF)
|| (curChar >= 0xFE70 && curChar <= 0xFEFF)
@@ -33,9 +33,9 @@ bool _IsIgnoreSpaceCharacter(FX_WCHAR curChar)
|| (curChar >= 0x2DE0 && curChar <= 0x2DFF)
|| curChar == 8467
|| (curChar >= 0x2000 && curChar <= 0x206F)) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
FX_FLOAT _NormalizeThreshold(FX_FLOAT threshold)
@@ -58,7 +58,7 @@ FX_FLOAT _CalculateBaseSpace(const CPDF_TextObject* pTextObj,
FX_FLOAT baseSpace = 0.0;
const int nItems = pTextObj->CountItems();
if (pTextObj->m_TextState.GetObject()->m_CharSpace && nItems >= 3) {
- bool bAllChar = true;
+ FX_BOOL bAllChar = TRUE;
FX_FLOAT spacing = matrix.TransformDistance(
pTextObj->m_TextState.GetObject()->m_CharSpace);
baseSpace = spacing;
@@ -69,7 +69,7 @@ FX_FLOAT _CalculateBaseSpace(const CPDF_TextObject* pTextObj,
FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
FX_FLOAT kerning = -fontsize_h * item.m_OriginX / 1000;
baseSpace = std::min(baseSpace, kerning + spacing);
- bAllChar = false;
+ bAllChar = FALSE;
}
}
if (baseSpace < 0.0 || (nItems == 3 && !bAllChar)) {
@@ -82,7 +82,7 @@ FX_FLOAT _CalculateBaseSpace(const CPDF_TextObject* pTextObj,
} // namespace
CPDFText_ParseOptions::CPDFText_ParseOptions()
- : m_bGetCharCodeOnly(false), m_bNormalizeObjs(true), m_bOutputHyphen(false)
+ : m_bGetCharCodeOnly(FALSE), m_bNormalizeObjs(TRUE), m_bOutputHyphen(FALSE)
{
}
IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions)
@@ -120,7 +120,7 @@ CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, int flags)
: m_charList(512),
m_TempCharList(50),
m_pPreTextObj(NULL),
- m_IsParsered(false),
+ m_IsParsered(FALSE),
m_TextlineDir(-1),
m_CurlineRect(0, 0, 0, 0)
{
@@ -134,7 +134,7 @@ CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, CPDFText_ParseOptions Parse
, m_charList(512)
, m_TempCharList(50)
, m_pPreTextObj(NULL)
- , m_IsParsered(false)
+ , m_IsParsered(FALSE)
, m_TextlineDir(-1)
, m_CurlineRect(0, 0, 0, 0)
{
@@ -147,7 +147,7 @@ CPDF_TextPage::CPDF_TextPage(const CPDF_PageObjects* pPage, int flags)
: m_charList(512),
m_TempCharList(50),
m_pPreTextObj(NULL),
- m_IsParsered(false),
+ m_IsParsered(FALSE),
m_TextlineDir(-1),
m_CurlineRect(0, 0, 0, 0)
{
@@ -157,7 +157,7 @@ CPDF_TextPage::CPDF_TextPage(const CPDF_PageObjects* pPage, int flags)
CFX_FloatRect pageRect = pPage->CalcBoundingBox();
m_DisplayMatrix = CFX_AffineMatrix(1, 0, 0, -1, pageRect.right, pageRect.top);
}
-void CPDF_TextPage::NormalizeObjects(bool bNormalize)
+void CPDF_TextPage::NormalizeObjects(FX_BOOL bNormalize)
{
m_ParseOptions.m_bNormalizeObjs = bNormalize;
}
@@ -177,18 +177,18 @@ bool CPDF_TextPage::IsControlChar(const PAGECHAR_INFO& charInfo)
return false;
}
}
-bool CPDF_TextPage::ParseTextPage()
+FX_BOOL CPDF_TextPage::ParseTextPage()
{
if (!m_pPage) {
- m_IsParsered = false;
- return false;
+ m_IsParsered = FALSE;
+ return FALSE;
}
- m_IsParsered = false;
+ m_IsParsered = FALSE;
m_TextBuf.Clear();
m_charList.RemoveAll();
m_pPreTextObj = NULL;
ProcessObject();
- m_IsParsered = true;
+ m_IsParsered = TRUE;
if(!m_ParseOptions.m_bGetCharCodeOnly) {
m_CharIndex.RemoveAll();
int nCount = m_charList.GetSize();
@@ -197,15 +197,15 @@ bool CPDF_TextPage::ParseTextPage()
}
for(int i = 0; i < nCount; i++) {
int indexSize = m_CharIndex.GetSize();
- bool bNormal = false;
+ FX_BOOL bNormal = FALSE;
PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(i);
if(charinfo.m_Flag == FPDFTEXT_CHAR_GENERATED) {
- bNormal = true;
+ bNormal = TRUE;
}
else if(charinfo.m_Unicode == 0 || IsControlChar(charinfo))
- bNormal = false;
+ bNormal = FALSE;
else {
- bNormal = true;
+ bNormal = TRUE;
}
if(bNormal) {
if(indexSize % 2) {
@@ -232,7 +232,7 @@ bool CPDF_TextPage::ParseTextPage()
m_CharIndex.RemoveAt(indexSize - 1);
}
}
- return true;
+ return TRUE;
}
int CPDF_TextPage::CountChars() const
{
@@ -283,7 +283,7 @@ void CPDF_TextPage::GetRectArray(int start, int nCount, CFX_RectArray& rectArray
CPDF_TextObject* pCurObj = NULL;
CFX_FloatRect rect;
int curPos = start;
- bool flagNewRect = true;
+ FX_BOOL flagNewRect = TRUE;
if (nCount + start > m_charList.GetSize() || nCount == -1) {
nCount = m_charList.GetSize() - start;
}
@@ -301,7 +301,7 @@ void CPDF_TextPage::GetRectArray(int start, int nCount, CFX_RectArray& rectArray
if (pCurObj != info_curchar.m_pTextObj) {
rectArray.Add(rect);
pCurObj = info_curchar.m_pTextObj;
- flagNewRect = true;
+ flagNewRect = TRUE;
}
if (flagNewRect) {
FX_FLOAT orgX = info_curchar.m_OriginX, orgY = info_curchar.m_OriginY;
@@ -326,7 +326,7 @@ void CPDF_TextPage::GetRectArray(int start, int nCount, CFX_RectArray& rectArray
} else {
rect.top = info_curchar.m_CharBox.top;
}
- flagNewRect = false;
+ flagNewRect = FALSE;
rect = info_curchar.m_CharBox;
rect.Normalize();
} else {
@@ -399,8 +399,8 @@ CFX_WideString CPDF_TextPage::GetTextByRect(const CFX_FloatRect& rect) const
int nCount = m_charList.GetSize();
int pos = 0;
FX_FLOAT posy = 0;
- bool IsContainPreChar = false;
- bool ISAddLineFeed = false;
+ FX_BOOL IsContainPreChar = FALSE;
+ FX_BOOL ISAddLineFeed = FALSE;
while (pos < nCount) {
PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos++);
if (IsRectIntersect(rect, charinfo.m_CharBox)) {
@@ -410,20 +410,20 @@ CFX_WideString CPDF_TextPage::GetTextByRect(const CFX_FloatRect& rect) const
strText += L"\r\n";
}
}
- IsContainPreChar = true;
- ISAddLineFeed = false;
+ IsContainPreChar = TRUE;
+ ISAddLineFeed = FALSE;
if (charinfo.m_Unicode) {
strText += charinfo.m_Unicode;
}
} else if (charinfo.m_Unicode == 32) {
if (IsContainPreChar && charinfo.m_Unicode) {
strText += charinfo.m_Unicode;
- IsContainPreChar = false;
- ISAddLineFeed = false;
+ IsContainPreChar = FALSE;
+ ISAddLineFeed = FALSE;
}
} else {
- IsContainPreChar = false;
- ISAddLineFeed = true;
+ IsContainPreChar = FALSE;
+ ISAddLineFeed = TRUE;
}
}
return strText;
@@ -437,7 +437,7 @@ void CPDF_TextPage::GetRectsArrayByRect(const CFX_FloatRect& rect, CFX_RectArray
return;
}
CFX_FloatRect curRect;
- bool flagNewRect = true;
+ FX_BOOL flagNewRect = TRUE;
CPDF_TextObject* pCurObj = NULL;
int nCount = m_charList.GetSize();
int pos = 0;
@@ -453,11 +453,11 @@ void CPDF_TextPage::GetRectsArrayByRect(const CFX_FloatRect& rect, CFX_RectArray
if (pCurObj != info_curchar.m_pTextObj) {
resRectArray.Add(curRect);
pCurObj = info_curchar.m_pTextObj;
- flagNewRect = true;
+ flagNewRect = TRUE;
}
if (flagNewRect) {
curRect = info_curchar.m_CharBox;
- flagNewRect = false;
+ flagNewRect = FALSE;
curRect.Normalize();
} else {
info_curchar.m_CharBox.Normalize();
@@ -626,13 +626,13 @@ void CPDF_TextPage::GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top, FX_FLO
right = m_SelRects.GetAt(rectIndex).right;
bottom = m_SelRects.GetAt(rectIndex).bottom;
}
-bool CPDF_TextPage::GetBaselineRotate(int start, int end, int& Rotate)
+FX_BOOL CPDF_TextPage::GetBaselineRotate(int start, int end, int& Rotate)
{
if(m_ParseOptions.m_bGetCharCodeOnly) {
- return false;
+ return FALSE;
}
if(end == start) {
- return false;
+ return FALSE;
}
FX_FLOAT dx, dy;
FPDF_CHAR_INFO info1, info2;
@@ -641,7 +641,7 @@ bool CPDF_TextPage::GetBaselineRotate(int start, int end, int& Rotate)
while(info2.m_CharBox.Width() == 0 || info2.m_CharBox.Height() == 0) {
end--;
if(end <= start) {
- return false;
+ return FALSE;
}
GetCharInfo(end, info2);
}
@@ -664,16 +664,16 @@ bool CPDF_TextPage::GetBaselineRotate(int start, int end, int& Rotate)
} else if(Rotate > 0) {
Rotate = 360 - Rotate;
}
- return true;
+ return TRUE;
}
-bool CPDF_TextPage::GetBaselineRotate(const CFX_FloatRect& rect , int& Rotate)
+FX_BOOL CPDF_TextPage::GetBaselineRotate(const CFX_FloatRect& rect , int& Rotate)
{
if(m_ParseOptions.m_bGetCharCodeOnly) {
- return false;
+ return FALSE;
}
- int start, end, count, n = CountBoundedSegments(rect.left, rect.top, rect.right, rect.bottom, true);
+ int start, end, count, n = CountBoundedSegments(rect.left, rect.top, rect.right, rect.bottom, TRUE);
if(n < 1) {
- return false;
+ return FALSE;
}
if(n > 1) {
GetBoundedSegment(n - 1, start, count);
@@ -685,18 +685,18 @@ bool CPDF_TextPage::GetBaselineRotate(const CFX_FloatRect& rect , int& Rotate)
}
return GetBaselineRotate(start, end, Rotate);
}
-bool CPDF_TextPage::GetBaselineRotate(int rectIndex, int& Rotate)
+FX_BOOL CPDF_TextPage::GetBaselineRotate(int rectIndex, int& Rotate)
{
if(m_ParseOptions.m_bGetCharCodeOnly) {
- return false;
+ return FALSE;
}
if (!m_IsParsered || rectIndex < 0 || rectIndex > m_SelRects.GetSize()) {
- return false;
+ return FALSE;
}
CFX_FloatRect rect = m_SelRects.GetAt(rectIndex);
return GetBaselineRotate(rect , Rotate);
}
-int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, bool bContains )
+int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains )
{
if(m_ParseOptions.m_bGetCharCodeOnly) {
return -1;
@@ -712,8 +712,8 @@ int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT ri
FPDF_SEGMENT segment;
segment.m_Start = 0;
segment.m_nCount = 0;
- bool segmentStatus = 0;
- bool IsContainPreChar = false;
+ FX_BOOL segmentStatus = 0;
+ FX_BOOL IsContainPreChar = FALSE;
while (pos < nCount) {
PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos);
if(bContains && rect.Contains(charinfo.m_CharBox)) {
@@ -724,7 +724,7 @@ int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT ri
} else if (segmentStatus == 1) {
segment.m_nCount++;
}
- IsContainPreChar = true;
+ IsContainPreChar = TRUE;
} else if (!bContains && (IsRectIntersect(rect, charinfo.m_CharBox) || rect.Contains(charinfo.m_OriginX, charinfo.m_OriginY))) {
if (segmentStatus == 0 || segmentStatus == 2) {
segment.m_Start = pos;
@@ -733,9 +733,9 @@ int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT ri
} else if (segmentStatus == 1) {
segment.m_nCount++;
}
- IsContainPreChar = true;
+ IsContainPreChar = TRUE;
} else if (charinfo.m_Unicode == 32) {
- if (IsContainPreChar == true) {
+ if (IsContainPreChar == TRUE) {
if (segmentStatus == 0 || segmentStatus == 2) {
segment.m_Start = pos;
segment.m_nCount = 1;
@@ -743,7 +743,7 @@ int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT ri
} else if (segmentStatus == 1) {
segment.m_nCount++;
}
- IsContainPreChar = false;
+ IsContainPreChar = FALSE;
} else {
if (segmentStatus == 1) {
segmentStatus = 2;
@@ -759,7 +759,7 @@ int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT ri
segment.m_Start = 0;
segment.m_nCount = 0;
}
- IsContainPreChar = false;
+ IsContainPreChar = FALSE;
}
pos++;
}
@@ -1053,7 +1053,7 @@ void CPDF_TextPage::AddCharInfoByRLDirection(CFX_WideString& str, int i)
PAGECHAR_INFO Info = *(PAGECHAR_INFO*)m_TempCharList.GetAt(i);
if(!IsControlChar(Info)) {
Info.m_Index = m_TextBuf.GetLength();
- FX_WCHAR wChar = FX_GetMirrorChar(str.GetAt(i), true, false);
+ FX_WCHAR wChar = FX_GetMirrorChar(str.GetAt(i), TRUE, FALSE);
FX_WCHAR* pDst = NULL;
FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
if (nCount >= 1) {
@@ -1089,10 +1089,10 @@ void CPDF_TextPage::CloseTempLine()
nonstd::unique_ptr<IFX_BidiChar> pBidiChar(IFX_BidiChar::Create());
CFX_WideString str = m_TempTextBuf.GetWideString();
CFX_WordArray order;
- bool bR2L = false;
+ FX_BOOL bR2L = FALSE;
int32_t start = 0, count = 0;
int nR2L = 0, nL2R = 0;
- bool bPrevSpace = false;
+ FX_BOOL bPrevSpace = FALSE;
for (int i = 0; i < str.GetLength(); i++) {
if(str.GetAt(i) == 32) {
if(bPrevSpace) {
@@ -1103,9 +1103,9 @@ void CPDF_TextPage::CloseTempLine()
i--;
continue;
}
- bPrevSpace = true;
+ bPrevSpace = TRUE;
} else {
- bPrevSpace = false;
+ bPrevSpace = FALSE;
}
if(pBidiChar->AppendChar(str.GetAt(i))) {
int32_t ret = pBidiChar->GetBidiInfo(start, count);
@@ -1135,7 +1135,7 @@ void CPDF_TextPage::CloseTempLine()
}
}
if(nR2L > 0 && nR2L >= nL2R) {
- bR2L = true;
+ bR2L = TRUE;
}
if (m_parserflag == FPDFTEXT_RLTB || bR2L) {
int count = order.GetSize();
@@ -1149,7 +1149,7 @@ void CPDF_TextPage::CloseTempLine()
}
} else {
int j = i;
- bool bSymbol = false;
+ FX_BOOL bSymbol = FALSE;
while(j > 0 && order.GetAt(j) != 2) {
bSymbol = !order.GetAt(j);
j -= 3;
@@ -1181,7 +1181,7 @@ void CPDF_TextPage::CloseTempLine()
}
} else {
int count = order.GetSize();
- bool bL2R = false;
+ FX_BOOL bL2R = FALSE;
for(int i = 0; i < count; i += 3) {
int ret = order.GetAt(i + 2);
int start = order.GetAt(i);
@@ -1197,7 +1197,7 @@ void CPDF_TextPage::CloseTempLine()
}
if(j == 3) {
i = -3;
- bL2R = true;
+ bL2R = TRUE;
continue;
}
int end = m_TempCharList.GetSize() - 1;
@@ -1307,7 +1307,7 @@ int32_t CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj)
return FPDFTEXT_MC_PASS;
}
CFX_WideString actText;
- bool bExist = false;
+ FX_BOOL bExist = FALSE;
CPDF_Dictionary* pDict = NULL;
int n = 0;
for (n = 0; n < nContentMark; n++) {
@@ -1316,7 +1316,7 @@ int32_t CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj)
pDict = (CPDF_Dictionary*)item.GetParam();
CPDF_String* temp = (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) : NULL);
if (temp) {
- bExist = true;
+ bExist = TRUE;
actText = temp->GetUnicodeText();
}
}
@@ -1338,24 +1338,24 @@ int32_t CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj)
if (nItems < 1) {
return FPDFTEXT_MC_PASS;
}
- bExist = false;
+ bExist = FALSE;
for (FX_STRSIZE i = 0; i < nItems; i++) {
FX_WCHAR wChar = actText.GetAt(i);
if (-1 == pFont->CharCodeFromUnicode(wChar)) {
continue;
} else {
- bExist = true;
+ bExist = TRUE;
break;
}
}
if (!bExist) {
return FPDFTEXT_MC_PASS;
}
- bExist = false;
+ bExist = FALSE;
for (FX_STRSIZE i = 0; i < nItems; i++) {
FX_WCHAR wChar = actText.GetAt(i);
if ((wChar > 0x80 && wChar < 0xFFFD) || (wChar <= 0x80 && isprint(wChar))) {
- bExist = true;
+ bExist = TRUE;
break;
}
}
@@ -1539,8 +1539,8 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj)
int nItems = pTextObj->CountItems();
FX_FLOAT baseSpace = _CalculateBaseSpace(pTextObj, matrix);
- const bool bR2L = IsRightToLeft(pTextObj, pFont, nItems);
- const bool bIsBidiAndMirrorInverse =
+ const FX_BOOL bR2L = IsRightToLeft(pTextObj, pFont, nItems);
+ const FX_BOOL bIsBidiAndMirrorInverse =
bR2L && (matrix.a * matrix.d - matrix.b * matrix.c) < 0;
int32_t iBufStartAppend = m_TempTextBuf.GetLength();
int32_t iCharListStartAppend = m_TempCharList.GetSize();
@@ -1609,7 +1609,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj)
}
spacing = 0;
CFX_WideString wstrItem = pFont->UnicodeFromCharCode(item.m_CharCode);
- bool bNoUnicode = false;
+ FX_BOOL bNoUnicode = FALSE;
FX_WCHAR wChar = wstrItem.GetAt(0);
if ((wstrItem.IsEmpty() || wChar == 0) && item.m_CharCode) {
if(wstrItem.IsEmpty()) {
@@ -1617,7 +1617,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj)
} else {
wstrItem.SetAt(0, (FX_WCHAR)item.m_CharCode);
}
- bNoUnicode = true;
+ bNoUnicode = TRUE;
}
charinfo.m_Index = -1;
charinfo.m_CharCode = item.m_CharCode;
@@ -1651,7 +1651,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj)
continue;
} else {
int nTotal = wstrItem.GetLength();
- bool bDel = false;
+ FX_BOOL bDel = FALSE;
const int count = std::min(m_TempCharList.GetSize(), 7);
FX_FLOAT threshold = charinfo.m_Matrix.TransformXDistance((FX_FLOAT)TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize());
for (int n = m_TempCharList.GetSize();
@@ -1662,7 +1662,7 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj)
charinfo1->m_pTextObj->GetFont() == charinfo.m_pTextObj->GetFont() &&
FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) < threshold &&
FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) < threshold) {
- bDel = true;
+ bDel = TRUE;
break;
}
}
@@ -1707,7 +1707,7 @@ void CPDF_TextPage::SwapTempTextBuf(int32_t iCharListStartAppend,
std::swap(pTempBuffer[i], pTempBuffer[j]);
}
}
-bool CPDF_TextPage::IsRightToLeft(const CPDF_TextObject* pTextObj,
+FX_BOOL CPDF_TextPage::IsRightToLeft(const CPDF_TextObject* pTextObj,
const CPDF_Font* pFont,
int nItems) const
{
@@ -1779,7 +1779,7 @@ int32_t CPDF_TextPage::GetTextObjectWritingMode(const CPDF_TextObject* pTextObj)
}
return m_TextlineDir;
}
-bool CPDF_TextPage::IsHyphen(FX_WCHAR curChar)
+FX_BOOL CPDF_TextPage::IsHyphen(FX_WCHAR curChar)
{
CFX_WideString strCurText = m_TempTextBuf.GetWideString();
if(strCurText.GetLength() == 0) {
@@ -1796,7 +1796,7 @@ bool CPDF_TextPage::IsHyphen(FX_WCHAR curChar)
FX_WCHAR preChar = strCurText.GetAt((nIndex));
if (((preChar >= L'A' && preChar <= L'Z') || (preChar >= L'a' && preChar <= L'z'))
&& ((curChar >= L'A' && curChar <= L'Z') || (curChar >= L'a' && curChar <= L'z'))) {
- return true;
+ return TRUE;
}
}
int size = m_TempCharList.GetSize();
@@ -1806,21 +1806,21 @@ bool CPDF_TextPage::IsHyphen(FX_WCHAR curChar)
} else {
size = m_charList.GetSize();
if(size == 0) {
- return false;
+ return FALSE;
}
preChar = (PAGECHAR_INFO)m_charList[size - 1];
}
if (FPDFTEXT_CHAR_PIECE == preChar.m_Flag)
if (0xAD == preChar.m_Unicode || 0x2D == preChar.m_Unicode) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj, const CFX_AffineMatrix& formMatrix)
{
FindPreviousTextObject();
- bool bNewline = false;
+ FX_BOOL bNewline = FALSE;
int WritingMode = GetTextObjectWritingMode(pObj);
if(WritingMode == -1) {
WritingMode = GetTextObjectWritingMode(m_pPreTextObj);
@@ -1884,8 +1884,8 @@ int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj, const CFX_Af
rect1.Intersect(rect2);
if (WritingMode == 0) {
if ((rect1.IsEmpty() && rect2.Height() > 5 && rect3.Height() > 5)
- || ((y > threshold * 2 || y < threshold * -3) && (FXSYS_fabs(y) < 1 ? FXSYS_fabs(x) < FXSYS_fabs(y) : true))) {
- bNewline = true;
+ || ((y > threshold * 2 || y < threshold * -3) && (FXSYS_fabs(y) < 1 ? FXSYS_fabs(x) < FXSYS_fabs(y) : TRUE))) {
+ bNewline = TRUE;
if(nItem > 1 ) {
CPDF_TextObjectItem tempItem;
m_pPreTextObj->GetItemInfo(0, &tempItem);
@@ -1897,11 +1897,11 @@ int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj, const CFX_Af
&& m.b < 0.1 && m.c < 0.1 ) {
CFX_FloatRect re(0, m_pPreTextObj->m_Bottom, 1000, m_pPreTextObj->m_Top);
if(re.Contains(pObj->GetPosX(), pObj->GetPosY())) {
- bNewline = false;
+ bNewline = FALSE;
} else {
CFX_FloatRect re(0, pObj->m_Bottom, 1000, pObj->m_Top);
if(re.Contains(m_pPreTextObj->GetPosX(), m_pPreTextObj->GetPosY())) {
- bNewline = false;
+ bNewline = FALSE;
}
}
}
@@ -1952,10 +1952,10 @@ int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj, const CFX_Af
}
return 0;
}
-bool CPDF_TextPage::IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2)
+FX_BOOL CPDF_TextPage::IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2)
{
if (!pTextObj1 || !pTextObj2) {
- return false;
+ return FALSE;
}
CFX_FloatRect rcPreObj(pTextObj2->m_Left, pTextObj2->m_Bottom, pTextObj2->m_Right, pTextObj2->m_Top);
CFX_FloatRect rcCurObj(pTextObj1->m_Left, pTextObj1->m_Bottom, pTextObj1->m_Right, pTextObj1->m_Top);
@@ -1966,46 +1966,46 @@ bool CPDF_TextPage::IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject
PAGECHAR_INFO perCharTemp = (PAGECHAR_INFO)m_charList[nCount - 2];
FX_FLOAT dbSpace = perCharTemp.m_CharBox.Width();
if (dbXdif > dbSpace) {
- return false;
+ return FALSE;
}
}
}
if (!rcPreObj.IsEmpty() || !rcCurObj.IsEmpty()) {
rcPreObj.Intersect(rcCurObj);
if (rcPreObj.IsEmpty()) {
- return false;
+ return FALSE;
}
if (FXSYS_fabs(rcPreObj.Width() - rcCurObj.Width()) > rcCurObj.Width() / 2) {
- return false;
+ return FALSE;
}
if (pTextObj2->GetFontSize() != pTextObj1->GetFontSize()) {
- return false;
+ return FALSE;
}
}
int nPreCount = pTextObj2->CountItems();
int nCurCount = pTextObj1->CountItems();
if (nPreCount != nCurCount) {
- return false;
+ return FALSE;
}
CPDF_TextObjectItem itemPer, itemCur;
for (int i = 0; i < nPreCount; i++) {
pTextObj2->GetItemInfo(i, &itemPer);
pTextObj1->GetItemInfo(i, &itemCur);
if (itemCur.m_CharCode != itemPer.m_CharCode) {
- return false;
+ return FALSE;
}
}
if(FXSYS_fabs(pTextObj1->GetPosX() - pTextObj2->GetPosX()) > GetCharWidth(itemPer.m_CharCode, pTextObj2->GetFont())*pTextObj2->GetFontSize() / 1000 * 0.9 ||
FXSYS_fabs(pTextObj1->GetPosY() - pTextObj2->GetPosY()) >
FX_MAX(FX_MAX(rcPreObj.Height() , rcPreObj.Width()), pTextObj2->GetFontSize()) / 8) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDF_TextPage::IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos)
+FX_BOOL CPDF_TextPage::IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos)
{
if (!pTextObj) {
- return false;
+ return FALSE;
}
int i = 0;
if (!ObjPos) {
@@ -2021,13 +2021,13 @@ bool CPDF_TextPage::IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION
continue;
}
if(IsSameTextObject((CPDF_TextObject*)pObj, pTextObj)) {
- return true;
+ return TRUE;
}
i++;
}
- return false;
+ return FALSE;
}
-bool CPDF_TextPage::GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info)
+FX_BOOL CPDF_TextPage::GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info)
{
int size = m_TempCharList.GetSize();
PAGECHAR_INFO preChar;
@@ -2036,7 +2036,7 @@ bool CPDF_TextPage::GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info)
} else {
size = m_charList.GetSize();
if(size == 0) {
- return false;
+ return FALSE;
}
preChar = (PAGECHAR_INFO)m_charList[size - 1];
}
@@ -2061,37 +2061,37 @@ bool CPDF_TextPage::GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info)
info.m_OriginX = preChar.m_OriginX + preWidth * (fs) / 1000;
info.m_OriginY = preChar.m_OriginY;
info.m_CharBox = CFX_FloatRect(info.m_OriginX, info.m_OriginY, info.m_OriginX, info.m_OriginY);
- return true;
+ return TRUE;
}
-bool CPDF_TextPage::IsRectIntersect(const CFX_FloatRect& rect1, const CFX_FloatRect& rect2)
+FX_BOOL CPDF_TextPage::IsRectIntersect(const CFX_FloatRect& rect1, const CFX_FloatRect& rect2)
{
CFX_FloatRect rect = rect1;
rect.Intersect(rect2);
return !rect.IsEmpty();
}
-bool CPDF_TextPage::IsLetter(FX_WCHAR unicode)
+FX_BOOL CPDF_TextPage::IsLetter(FX_WCHAR unicode)
{
if (unicode < L'A') {
- return false;
+ return FALSE;
}
if (unicode > L'Z' && unicode < L'a') {
- return false;
+ return FALSE;
}
if (unicode > L'z') {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
CPDF_TextPageFind::CPDF_TextPageFind(const IPDF_TextPage* pTextPage)
: m_pTextPage(pTextPage),
m_flags(0),
m_findNextStart(-1),
m_findPreStart(-1),
- m_bMatchCase(false),
- m_bMatchWholeWord(false),
+ m_bMatchCase(FALSE),
+ m_bMatchWholeWord(FALSE),
m_resStart(0),
m_resEnd(-1),
- m_IsFind(false)
+ m_IsFind(FALSE)
{
m_strText = m_pTextPage->GetPageText();
int nCount = pTextPage->CountChars();
@@ -2140,10 +2140,10 @@ int CPDF_TextPageFind::GetCharIndex(int index) const
}
return -1;
}
-bool CPDF_TextPageFind::FindFirst(const CFX_WideString& findwhat, int flags, int startPos)
+FX_BOOL CPDF_TextPageFind::FindFirst(const CFX_WideString& findwhat, int flags, int startPos)
{
if (!m_pTextPage) {
- return false;
+ return FALSE;
}
if (m_strText.IsEmpty() || m_bMatchCase != (flags & FPDFTEXT_MATCHCASE)) {
m_strText = m_pTextPage->GetPageText();
@@ -2153,8 +2153,8 @@ bool CPDF_TextPageFind::FindFirst(const CFX_WideString& findwhat, int flags, int
m_flags = flags;
m_bMatchCase = flags & FPDFTEXT_MATCHCASE;
if (m_strText.IsEmpty()) {
- m_IsFind = false;
- return true;
+ m_IsFind = FALSE;
+ return TRUE;
}
FX_STRSIZE len = findwhatStr.GetLength();
if (!m_bMatchCase) {
@@ -2182,36 +2182,36 @@ bool CPDF_TextPageFind::FindFirst(const CFX_WideString& findwhat, int flags, int
m_csFindWhatArray.Add(findwhatStr);
}
if(m_csFindWhatArray.GetSize() <= 0) {
- return false;
+ return FALSE;
}
- m_IsFind = true;
+ m_IsFind = TRUE;
m_resStart = 0;
m_resEnd = -1;
- return true;
+ return TRUE;
}
-bool CPDF_TextPageFind::FindNext()
+FX_BOOL CPDF_TextPageFind::FindNext()
{
if (!m_pTextPage) {
- return false;
+ return FALSE;
}
m_resArray.RemoveAll();
if(m_findNextStart == -1) {
- return false;
+ return FALSE;
}
if(m_strText.IsEmpty()) {
- m_IsFind = false;
+ m_IsFind = FALSE;
return m_IsFind;
}
int strLen = m_strText.GetLength();
if (m_findNextStart > strLen - 1) {
- m_IsFind = false;
+ m_IsFind = FALSE;
return m_IsFind;
}
int nCount = m_csFindWhatArray.GetSize();
int nResultPos = 0;
int nStartPos = 0;
nStartPos = m_findNextStart;
- bool bSpaceStart = false;
+ FX_BOOL bSpaceStart = FALSE;
for(int iWord = 0; iWord < nCount; iWord++) {
CFX_WideString csWord = m_csFindWhatArray[iWord];
if(csWord.IsEmpty()) {
@@ -2223,33 +2223,33 @@ bool CPDF_TextPageFind::FindNext()
}
iWord = -1;
} else if(iWord == 0) {
- bSpaceStart = true;
+ bSpaceStart = TRUE;
}
continue;
}
int endIndex;
nResultPos = m_strText.Find(csWord.c_str(), nStartPos);
if (nResultPos == -1) {
- m_IsFind = false;
+ m_IsFind = FALSE;
return m_IsFind;
}
endIndex = nResultPos + csWord.GetLength() - 1;
if(iWord == 0) {
m_resStart = nResultPos;
}
- bool bMatch = true;
+ FX_BOOL bMatch = TRUE;
if(iWord != 0 && !bSpaceStart) {
int PreResEndPos = nStartPos;
int curChar = csWord.GetAt(0);
CFX_WideString lastWord = m_csFindWhatArray[iWord - 1];
int lastChar = lastWord.GetAt(lastWord.GetLength() - 1);
if(nStartPos == nResultPos && !(_IsIgnoreSpaceCharacter(lastChar) || _IsIgnoreSpaceCharacter(curChar))) {
- bMatch = false;
+ bMatch = FALSE;
}
for(int d = PreResEndPos; d < nResultPos; d++) {
FX_WCHAR strInsert = m_strText.GetAt(d);
if(strInsert != TEXT_LINEFEED_CHAR && strInsert != TEXT_BLANK_CHAR && strInsert != TEXT_RETURN_CHAR && strInsert != 160) {
- bMatch = false;
+ bMatch = FALSE;
break;
}
}
@@ -2257,7 +2257,7 @@ bool CPDF_TextPageFind::FindNext()
if(nResultPos > 0) {
FX_WCHAR strInsert = m_strText.GetAt(nResultPos - 1);
if(strInsert != TEXT_LINEFEED_CHAR && strInsert != TEXT_BLANK_CHAR && strInsert != TEXT_RETURN_CHAR && strInsert != 160) {
- bMatch = false;
+ bMatch = FALSE;
m_resStart = nResultPos;
} else {
m_resStart = nResultPos - 1;
@@ -2278,7 +2278,7 @@ bool CPDF_TextPageFind::FindNext()
}
}
m_resEnd = nResultPos + m_csFindWhatArray[m_csFindWhatArray.GetSize() - 1].GetLength() - 1;
- m_IsFind = true;
+ m_IsFind = TRUE;
int resStart = GetCharIndex(m_resStart);
int resEnd = GetCharIndex(m_resEnd);
m_pTextPage->GetRectArray(resStart, resEnd - resStart + 1, m_resArray);
@@ -2291,20 +2291,20 @@ bool CPDF_TextPageFind::FindNext()
}
return m_IsFind;
}
-bool CPDF_TextPageFind::FindPrev()
+FX_BOOL CPDF_TextPageFind::FindPrev()
{
if (!m_pTextPage) {
- return false;
+ return FALSE;
}
m_resArray.RemoveAll();
if(m_strText.IsEmpty() || m_findPreStart < 0) {
- m_IsFind = false;
+ m_IsFind = FALSE;
return m_IsFind;
}
CPDF_TextPageFind findEngine(m_pTextPage);
- bool ret = findEngine.FindFirst(m_findWhat, m_flags);
+ FX_BOOL ret = findEngine.FindFirst(m_findWhat, m_flags);
if(!ret) {
- m_IsFind = false;
+ m_IsFind = FALSE;
return m_IsFind;
}
int order = -1, MatchedCount = 0;
@@ -2321,12 +2321,12 @@ bool CPDF_TextPageFind::FindPrev()
}
}
if(order == -1) {
- m_IsFind = false;
+ m_IsFind = FALSE;
return m_IsFind;
}
m_resStart = m_pTextPage->TextIndexFromCharIndex(order);
m_resEnd = m_pTextPage->TextIndexFromCharIndex(order + MatchedCount - 1);
- m_IsFind = true;
+ m_IsFind = TRUE;
m_pTextPage->GetRectArray(order, MatchedCount, m_resArray);
if(m_flags & FPDFTEXT_CONSECUTIVE) {
m_findNextStart = m_resStart + 1;
@@ -2385,16 +2385,16 @@ void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat)
index++;
}
}
-bool CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText, int startPos, int endPos)
+FX_BOOL CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText, int startPos, int endPos)
{
int char_left = 0;
int char_right = 0;
int char_count = endPos - startPos + 1;
if(char_count < 1) {
- return false;
+ return FALSE;
}
if (char_count == 1 && csPageText.GetAt(startPos) > 255) {
- return true;
+ return TRUE;
}
if(startPos - 1 >= 0 ) {
char_left = csPageText.GetAt(startPos - 1);
@@ -2404,33 +2404,33 @@ bool CPDF_TextPageFind::IsMatchWholeWord(const CFX_WideString& csPageText, int s
}
if ((char_left > 'A' && char_left < 'a') || (char_left > 'a' && char_left < 'z') || (char_left > 0xfb00 && char_left < 0xfb06) || (char_left >= '0' && char_left <= '9') ||
(char_right > 'A' && char_right < 'a') || (char_right > 'a' && char_right < 'z') || (char_right > 0xfb00 && char_right < 0xfb06) || (char_right >= '0' && char_right <= '9')) {
- return false;
+ return FALSE;
}
if(!(('A' > char_left || char_left > 'Z') && ('a' > char_left || char_left > 'z')
&& ('A' > char_right || char_right > 'Z') && ('a' > char_right || char_right > 'z'))) {
- return false;
+ return FALSE;
}
if (char_count > 0) {
if (csPageText.GetAt(startPos) >= L'0' && csPageText.GetAt(startPos) <= L'9' && char_left >= L'0' && char_left <= L'9') {
- return false;
+ return FALSE;
}
if (csPageText.GetAt(endPos) >= L'0' && csPageText.GetAt(endPos) <= L'9' && char_right >= L'0' && char_right <= L'9') {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
-bool CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, const FX_WCHAR* lpszFullString,
+FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, const FX_WCHAR* lpszFullString,
int iSubString, FX_WCHAR chSep)
{
if (lpszFullString == NULL) {
- return false;
+ return FALSE;
}
while (iSubString--) {
lpszFullString = FXSYS_wcschr(lpszFullString, chSep);
if (lpszFullString == NULL) {
rString.Empty();
- return false;
+ return FALSE;
}
lpszFullString++;
while(*lpszFullString == chSep) {
@@ -2443,7 +2443,7 @@ bool CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, const FX_WCHAR
ASSERT(nLen >= 0);
FXSYS_memcpy(rString.GetBuffer(nLen), lpszFullString, nLen * sizeof(FX_WCHAR));
rString.ReleaseBuffer();
- return true;
+ return TRUE;
}
CFX_WideString CPDF_TextPageFind::MakeReverse(const CFX_WideString& str)
{
@@ -2471,27 +2471,27 @@ int CPDF_TextPageFind::GetMatchedCount()const
}
CPDF_LinkExtract::CPDF_LinkExtract()
: m_pTextPage(NULL),
- m_IsParserd(false)
+ m_IsParserd(FALSE)
{
}
CPDF_LinkExtract::~CPDF_LinkExtract()
{
DeleteLinkList();
}
-bool CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage)
+FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage)
{
if (!pTextPage || !pTextPage->IsParsered()) {
- return false;
+ return FALSE;
}
m_pTextPage = (const CPDF_TextPage*)pTextPage;
m_strPageText = m_pTextPage->GetPageText(0, -1);
DeleteLinkList();
if (m_strPageText.IsEmpty()) {
- return false;
+ return FALSE;
}
parserLink();
- m_IsParserd = true;
- return true;
+ m_IsParserd = TRUE;
+ return TRUE;
}
void CPDF_LinkExtract::DeleteLinkList()
{
@@ -2546,42 +2546,42 @@ void CPDF_LinkExtract::parserLink()
}
}
}
-bool CPDF_LinkExtract::CheckWebLink(CFX_WideString& strBeCheck)
+FX_BOOL CPDF_LinkExtract::CheckWebLink(CFX_WideString& strBeCheck)
{
CFX_WideString str = strBeCheck;
str.MakeLower();
if (str.Find(L"http://www.") != -1) {
strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"http://www."));
- return true;
+ return TRUE;
}
if (str.Find(L"http://") != -1) {
strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"http://"));
- return true;
+ return TRUE;
}
if (str.Find(L"https://www.") != -1) {
strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"https://www."));
- return true;
+ return TRUE;
}
if (str.Find(L"https://") != -1) {
strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"https://"));
- return true;
+ return TRUE;
}
if (str.Find(L"www.") != -1) {
strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"www."));
strBeCheck = L"http://" + strBeCheck;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDF_LinkExtract::CheckMailLink(CFX_WideString& str)
+FX_BOOL CPDF_LinkExtract::CheckMailLink(CFX_WideString& str)
{
str.MakeLower();
int aPos = str.Find(L'@');
if (aPos < 1) {
- return false;
+ return FALSE;
}
if (str.GetAt(aPos - 1) == L'.' || str.GetAt(aPos - 1) == L'_') {
- return false;
+ return FALSE;
}
int i;
for (i = aPos - 1; i >= 0; i--) {
@@ -2590,7 +2590,7 @@ bool CPDF_LinkExtract::CheckMailLink(CFX_WideString& str)
continue;
} else {
if (i == aPos - 1) {
- return false;
+ return FALSE;
}
str = str.Right(str.GetLength() - i - 1);
break;
@@ -2598,7 +2598,7 @@ bool CPDF_LinkExtract::CheckMailLink(CFX_WideString& str)
}
aPos = str.Find(L'@');
if (aPos < 1) {
- return false;
+ return FALSE;
}
CFX_WideString strtemp = L"";
for (i = 0; i < aPos; i++) {
@@ -2614,13 +2614,13 @@ bool CPDF_LinkExtract::CheckMailLink(CFX_WideString& str)
}
aPos = str.Find(L'@');
if (aPos < 1) {
- return false;
+ return FALSE;
}
str.TrimRight(L'.');
strtemp = str;
int ePos = str.Find(L'.');
if (ePos == -1) {
- return false;
+ return FALSE;
}
while (ePos != -1) {
strtemp = strtemp.Right(strtemp.GetLength() - ePos - 1);
@@ -2643,22 +2643,22 @@ bool CPDF_LinkExtract::CheckMailLink(CFX_WideString& str)
if (wch == L'-' || wch == L'.' || (wch >= L'a' && wch <= L'z') || (wch >= L'0' && wch <= L'9')) {
continue;
} else {
- return false;
+ return FALSE;
}
}
if (str.Find(L"mailto:") == -1) {
str = L"mailto:" + str;
}
- return true;
+ return TRUE;
}
-bool CPDF_LinkExtract::AppendToLinkList(int start, int count, const CFX_WideString& strUrl)
+FX_BOOL CPDF_LinkExtract::AppendToLinkList(int start, int count, const CFX_WideString& strUrl)
{
CPDF_LinkExt* linkInfo = new CPDF_LinkExt;
linkInfo->m_strUrl = strUrl;
linkInfo->m_Start = start;
linkInfo->m_Count = count;
m_LinkList.Add(linkInfo);
- return true;
+ return TRUE;
}
CFX_WideString CPDF_LinkExtract::GetURL(int index) const
{
diff --git a/core/src/fpdftext/fpdf_text_search.cpp b/core/src/fpdftext/fpdf_text_search.cpp
index d88e9e1760..21a2564ae6 100644
--- a/core/src/fpdftext/fpdf_text_search.cpp
+++ b/core/src/fpdftext/fpdf_text_search.cpp
@@ -9,56 +9,56 @@
class CPDF_TextStream
{
public:
- CPDF_TextStream(CFX_WideTextBuf& buffer, bool bUseLF, CFX_PtrArray* pObjArray);
+ CPDF_TextStream(CFX_WideTextBuf& buffer, FX_BOOL bUseLF, CFX_PtrArray* pObjArray);
~CPDF_TextStream() {}
- bool ProcessObject(const CPDF_TextObject* pObj, bool bFirstLine);
+ FX_BOOL ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFirstLine);
CFX_WideTextBuf& m_Buffer;
- bool m_bUseLF;
+ FX_BOOL m_bUseLF;
CFX_PtrArray* m_pObjArray;
const CPDF_TextObject* m_pLastObj;
};
-CPDF_TextStream::CPDF_TextStream(CFX_WideTextBuf& buffer, bool bUseLF, CFX_PtrArray* pObjArray) : m_Buffer(buffer)
+CPDF_TextStream::CPDF_TextStream(CFX_WideTextBuf& buffer, FX_BOOL bUseLF, CFX_PtrArray* pObjArray) : m_Buffer(buffer)
{
m_pLastObj = NULL;
m_bUseLF = bUseLF;
m_pObjArray = pObjArray;
}
-bool FPDFText_IsSameTextObject(const CPDF_TextObject* pTextObj1, const CPDF_TextObject* pTextObj2)
+FX_BOOL FPDFText_IsSameTextObject(const CPDF_TextObject* pTextObj1, const CPDF_TextObject* pTextObj2)
{
if (!pTextObj1 || !pTextObj2) {
- return false;
+ return FALSE;
}
CFX_FloatRect rcPreObj(pTextObj2->m_Left, pTextObj2->m_Bottom, pTextObj2->m_Right, pTextObj2->m_Top);
CFX_FloatRect rcCurObj(pTextObj1->m_Left, pTextObj1->m_Bottom, pTextObj1->m_Right, pTextObj1->m_Top);
if (rcPreObj.IsEmpty() && rcCurObj.IsEmpty()) {
- return true;
+ return TRUE;
}
if (!rcPreObj.IsEmpty() || !rcCurObj.IsEmpty()) {
rcPreObj.Intersect(rcCurObj);
if (rcPreObj.IsEmpty()) {
- return false;
+ return FALSE;
}
if (FXSYS_fabs(rcPreObj.Width() - rcCurObj.Width()) > rcCurObj.Width() / 2) {
- return false;
+ return FALSE;
}
if (pTextObj2->GetFontSize() != pTextObj1->GetFontSize()) {
- return false;
+ return FALSE;
}
}
int nPreCount = pTextObj2->CountItems();
int nCurCount = pTextObj1->CountItems();
if (nPreCount != nCurCount) {
- return false;
+ return FALSE;
}
for (int i = 0; i < nPreCount; i++) {
CPDF_TextObjectItem itemPer, itemCur;
pTextObj2->GetItemInfo(i, &itemPer);
pTextObj1->GetItemInfo(i, &itemCur);
if (itemCur.m_CharCode != itemPer.m_CharCode) {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont)
{
@@ -133,7 +133,7 @@ int FPDFText_ProcessInterObj(const CPDF_TextObject* pPrevObj, const CPDF_TextObj
}
return 0;
}
-bool CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, bool bFirstLine)
+FX_BOOL CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFirstLine)
{
CPDF_Font* pFont = pObj->GetFont();
CFX_AffineMatrix matrix;
@@ -150,7 +150,7 @@ bool CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, bool bFirstLine
}
} else {
if (bFirstLine) {
- return true;
+ return TRUE;
}
if (m_bUseLF) {
m_Buffer.AppendChar(L'\r');
@@ -176,7 +176,7 @@ bool CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, bool bFirstLine
}
} else if (result == -1) {
m_pLastObj = pObj;
- return false;
+ return FALSE;
} else if (result == 3) {
item_index = 1;
}
@@ -277,9 +277,9 @@ bool CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, bool bFirstLine
}
}
}
- return false;
+ return FALSE;
}
-void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage, bool bUseLF,
+void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage, FX_BOOL bUseLF,
CFX_PtrArray* pObjArray)
{
CPDF_TextStream textstream(buffer, bUseLF, pObjArray);
@@ -292,7 +292,7 @@ void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage
if (pObject->m_Type != PDFPAGE_TEXT) {
continue;
}
- textstream.ProcessObject((CPDF_TextObject*)pObject, false);
+ textstream.ProcessObject((CPDF_TextObject*)pObject, FALSE);
}
}
CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary* pPage)
@@ -302,17 +302,17 @@ CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary
CPDF_Page page;
page.Load(pDoc, pPage);
CPDF_ParseOptions options;
- options.m_bTextOnly = true;
- options.m_bSeparateForm = false;
+ options.m_bTextOnly = TRUE;
+ options.m_bSeparateForm = FALSE;
page.ParseContent(&options);
- CPDF_TextStream textstream(buffer, false, NULL);
+ CPDF_TextStream textstream(buffer, FALSE, NULL);
FX_POSITION pos = page.GetFirstObjectPosition();
while (pos) {
CPDF_PageObject* pObject = page.GetNextObject(pos);
if (pObject->m_Type != PDFPAGE_TEXT) {
continue;
}
- if (textstream.ProcessObject((CPDF_TextObject*)pObject, true)) {
+ if (textstream.ProcessObject((CPDF_TextObject*)pObject, TRUE)) {
break;
}
}
diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h
index bcacc57863..ce52371df0 100644
--- a/core/src/fpdftext/text_int.h
+++ b/core/src/fpdftext/text_int.h
@@ -48,9 +48,9 @@ public:
CPDF_TextPage(const CPDF_Page* pPage, int flags = 0);
CPDF_TextPage(const CPDF_PageObjects* pPage, int flags = 0);
CPDF_TextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions);
- virtual bool ParseTextPage();
- virtual void NormalizeObjects(bool bNormalize);
- virtual bool IsParsered() const
+ virtual FX_BOOL ParseTextPage();
+ virtual void NormalizeObjects(FX_BOOL bNormalize);
+ virtual FX_BOOL IsParsered() const
{
return m_IsParsered;
}
@@ -71,10 +71,10 @@ public:
virtual int CountRects(int start, int nCount);
virtual void GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top
, FX_FLOAT& right, FX_FLOAT &bottom) const;
- virtual bool GetBaselineRotate(int rectIndex, int& Rotate);
- virtual bool GetBaselineRotate(const CFX_FloatRect& rect, int& Rotate);
+ virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate);
+ virtual FX_BOOL GetBaselineRotate(const CFX_FloatRect& rect, int& Rotate);
virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top,
- FX_FLOAT right, FX_FLOAT bottom, bool bContains = false);
+ FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE);
virtual void GetBoundedSegment(int index, int& start, int& count) const;
virtual int GetWordBreak(int index, int direction) const;
public:
@@ -82,20 +82,20 @@ public:
{
return &m_charList;
}
- static bool IsRectIntersect(const CFX_FloatRect& rect1, const CFX_FloatRect& rect2);
- static bool IsLetter(FX_WCHAR unicode);
+ static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, const CFX_FloatRect& rect2);
+ static FX_BOOL IsLetter(FX_WCHAR unicode);
private:
- bool IsHyphen(FX_WCHAR curChar);
+ FX_BOOL IsHyphen(FX_WCHAR curChar);
bool IsControlChar(const PAGECHAR_INFO& charInfo);
- bool GetBaselineRotate(int start, int end, int& Rotate);
+ FX_BOOL GetBaselineRotate(int start, int end, int& Rotate);
void ProcessObject();
void ProcessFormObject(CPDF_FormObject* pFormObj, const CFX_AffineMatrix& formMatrix);
void ProcessTextObject(PDFTEXT_Obj pObj);
void ProcessTextObject(CPDF_TextObject* pTextObj, const CFX_AffineMatrix& formMatrix, FX_POSITION ObjPos);
int ProcessInsertObject(const CPDF_TextObject* pObj, const CFX_AffineMatrix& formMatrix);
- bool GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info);
- bool IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos);
- bool IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2);
+ FX_BOOL GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info);
+ FX_BOOL IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos);
+ FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2);
int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const;
void CloseTempLine();
void OnPiece(IFX_BidiChar* pBidi, CFX_WideString& str);
@@ -109,7 +109,7 @@ private:
int32_t FindTextlineFlowDirection();
void SwapTempTextBuf(int32_t iCharListStartAppend,
int32_t iBufStartAppend);
- bool IsRightToLeft(const CPDF_TextObject* pTextObj,
+ FX_BOOL IsRightToLeft(const CPDF_TextObject* pTextObj,
const CPDF_Font* pFont,
int nItems) const;
protected:
@@ -123,13 +123,13 @@ protected:
int m_parserflag;
CPDF_TextObject* m_pPreTextObj;
CFX_AffineMatrix m_perMatrix;
- bool m_IsParsered;
+ FX_BOOL m_IsParsered;
CFX_AffineMatrix m_DisplayMatrix;
SEGMENT_Array m_Segment;
CFX_RectArray m_SelRects;
LINEOBJ m_LineObj;
- bool m_TextlineDir;
+ FX_BOOL m_TextlineDir;
CFX_FloatRect m_CurlineRect;
};
class CPDF_TextPageFind: public IPDF_TextPageFind
@@ -138,17 +138,17 @@ public:
CPDF_TextPageFind(const IPDF_TextPage* pTextPage);
virtual ~CPDF_TextPageFind() {};
public:
- virtual bool FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0);
- virtual bool FindNext();
- virtual bool FindPrev();
+ virtual FX_BOOL FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0);
+ virtual FX_BOOL FindNext();
+ virtual FX_BOOL FindPrev();
virtual void GetRectArray(CFX_RectArray& rects) const;
virtual int GetCurOrder() const;
virtual int GetMatchedCount()const;
protected:
void ExtractFindWhat(const CFX_WideString& findwhat);
- bool IsMatchWholeWord(const CFX_WideString& csPageText, int startPos, int endPos);
- bool ExtractSubString(CFX_WideString& rString, const FX_WCHAR* lpszFullString,
+ FX_BOOL IsMatchWholeWord(const CFX_WideString& csPageText, int startPos, int endPos);
+ FX_BOOL ExtractSubString(CFX_WideString& rString, const FX_WCHAR* lpszFullString,
int iSubString, FX_WCHAR chSep);
CFX_WideString MakeReverse(const CFX_WideString& str);
int ReverseFind(const CFX_WideString& csPageText, const CFX_WideString& csWord, int nStartPos, int& WordLength);
@@ -162,12 +162,12 @@ private:
CFX_WideStringArray m_csFindWhatArray;
int m_findNextStart;
int m_findPreStart;
- bool m_bMatchCase;
- bool m_bMatchWholeWord;
+ FX_BOOL m_bMatchCase;
+ FX_BOOL m_bMatchWholeWord;
int m_resStart;
int m_resEnd;
CFX_RectArray m_resArray;
- bool m_IsFind;
+ FX_BOOL m_IsFind;
};
class CPDF_LinkExt
{
@@ -184,8 +184,8 @@ class CPDF_LinkExtract: public IPDF_LinkExtract
public:
CPDF_LinkExtract();
virtual ~CPDF_LinkExtract();
- virtual bool ExtractLinks(const IPDF_TextPage* pTextPage);
- virtual bool IsExtract() const
+ virtual FX_BOOL ExtractLinks(const IPDF_TextPage* pTextPage);
+ virtual FX_BOOL IsExtract() const
{
return m_IsParserd;
}
@@ -197,14 +197,14 @@ public:
protected:
void parserLink();
void DeleteLinkList();
- bool CheckWebLink(CFX_WideString& strBeCheck);
- bool CheckMailLink(CFX_WideString& str);
- bool AppendToLinkList(int start, int count, const CFX_WideString& strUrl);
+ FX_BOOL CheckWebLink(CFX_WideString& strBeCheck);
+ FX_BOOL CheckMailLink(CFX_WideString& str);
+ FX_BOOL AppendToLinkList(int start, int count, const CFX_WideString& strUrl);
private:
LINK_InfoArray m_LinkList;
const CPDF_TextPage* m_pTextPage;
CFX_WideString m_strPageText;
- bool m_IsParserd;
+ FX_BOOL m_IsParserd;
};
FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_WCHAR* pDst);
void NormalizeString(CFX_WideString& str);
diff --git a/core/src/fpdftext/txtproc.h b/core/src/fpdftext/txtproc.h
index efe9ff9082..275aabd53b 100644
--- a/core/src/fpdftext/txtproc.h
+++ b/core/src/fpdftext/txtproc.h
@@ -33,8 +33,8 @@ public:
~CTextBaseLine();
void InsertTextBox(FX_FLOAT leftx, FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy,
FX_FLOAT spacew, FX_FLOAT fontsize_v, const CFX_WideString& str);
- bool GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx);
- bool CanMerge(CTextBaseLine* pOther);
+ FX_BOOL GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx);
+ FX_BOOL CanMerge(CTextBaseLine* pOther);
void Merge(CTextBaseLine* pOther);
void MergeBoxes();
void CountChars(int& count, FX_FLOAT& width, int& minchars);
@@ -57,9 +57,9 @@ public:
FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy, FX_FLOAT spacew, FX_FLOAT fontsize_v,
CFX_ByteString& str, CPDF_Font* pFont);
void WriteOutput(CFX_WideStringArray& lines, int iMinWidth);
- bool m_bAutoWidth;
- bool m_bKeepColumn;
- bool m_bBreakSpace;
+ FX_BOOL m_bAutoWidth;
+ FX_BOOL m_bKeepColumn;
+ FX_BOOL m_bBreakSpace;
private:
CFX_PtrArray m_BaseLines;
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
index dc64748e83..7668f84a20 100644
--- a/core/src/fxcodec/codec/codec_int.h
+++ b/core/src/fxcodec/codec/codec_int.h
@@ -17,9 +17,9 @@
class CCodec_BasicModule : public ICodec_BasicModule
{
public:
- virtual bool RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
+ virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size);
- virtual bool A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
+ virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size);
virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc);
@@ -46,7 +46,7 @@ public:
uint8_t* GetScanline(int line);
- bool SkipToScanline(int line, IFX_Pause* pPause);
+ FX_BOOL SkipToScanline(int line, IFX_Pause* pPause);
int GetWidth()
{
@@ -68,7 +68,7 @@ public:
return m_bpc;
}
- bool IsColorTransformed()
+ FX_BOOL IsColorTransformed()
{
return m_bColorTransformed;
}
@@ -98,11 +98,11 @@ protected:
int m_Pitch;
- bool m_bColorTransformed;
+ FX_BOOL m_bColorTransformed;
uint8_t* ReadNextLine();
- virtual bool v_Rewind() = 0;
+ virtual FX_BOOL v_Rewind() = 0;
virtual uint8_t* v_GetNextLine() = 0;
@@ -118,21 +118,21 @@ class CCodec_FaxModule : public ICodec_FaxModule
{
public:
virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
- int K, bool EndOfLine, bool EncodedByteAlign, bool BlackIs1, int Columns, int Rows);
- bool Encode(const uint8_t* src_buf, int width, int height, int pitch, uint8_t*& dest_buf, FX_DWORD& dest_size);
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows);
+ FX_BOOL Encode(const uint8_t* src_buf, int width, int height, int pitch, uint8_t*& dest_buf, FX_DWORD& dest_size);
};
class CCodec_FlateModule : public ICodec_FlateModule
{
public:
virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns);
- virtual FX_DWORD FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf, FX_DWORD src_size, bool bEarlyChange,
+ virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
int predictor, int Colors, int BitsPerComponent, int Columns,
FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
- virtual bool Encode(const uint8_t* src_buf, FX_DWORD src_size,
+ virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size,
int predictor, int Colors, int BitsPerComponent, int Columns,
uint8_t*& dest_buf, FX_DWORD& dest_size);
- virtual bool Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
+ virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
};
class CCodec_JpegModule : public ICodec_JpegModule
{
@@ -143,17 +143,17 @@ public:
m_pExtProvider = pJP;
}
ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size,
- int width, int height, int nComps, bool ColorTransform);
- bool LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, bool& color_transform,
+ int width, int height, int nComps, FX_BOOL ColorTransform);
+ FX_BOOL LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
uint8_t** icc_buf_ptr, FX_DWORD* icc_length);
- bool Encode(const CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality, const uint8_t* icc_buf, FX_DWORD icc_length);
+ FX_BOOL Encode(const CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality, const uint8_t* icc_buf, FX_DWORD icc_length);
virtual void* Start();
virtual void Finish(void* pContext);
virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size);
virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps);
virtual int StartScanline(void* pContext, int down_scale);
- virtual bool ReadScanline(void* pContext, uint8_t* dest_buf);
+ virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf);
virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr);
protected:
IFX_JpegProvider* m_pExtProvider;
@@ -199,10 +199,10 @@ class CCodec_JpxModule : public ICodec_JpxModule
{
public:
CCodec_JpxModule();
- void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, bool useColorSpace = false);
+ void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE);
void GetImageInfo(void* ctx, FX_DWORD& width, FX_DWORD& height,
FX_DWORD& codestream_nComps, FX_DWORD& output_nComps);
- bool Decode(void* ctx, uint8_t* dest_data, int pitch, bool bTranslateColor, uint8_t* offsets);
+ FX_BOOL Decode(void* ctx, uint8_t* dest_data, int pitch, FX_BOOL bTranslateColor, uint8_t* offsets);
void DestroyDecoder(void* ctx);
};
class CPDF_Jbig2Interface : public CJBig2_Module
@@ -253,7 +253,7 @@ public:
FX_DWORD m_global_size;
uint8_t* m_dest_buf;
FX_DWORD m_dest_pitch;
- bool m_bFileReader;
+ FX_BOOL m_bFileReader;
IFX_Pause* m_pPause;
CJBig2_Context* m_pContext;
CJBig2_Image* m_dest_image;
@@ -263,9 +263,9 @@ class CCodec_Jbig2Module : public ICodec_Jbig2Module
public:
CCodec_Jbig2Module() {};
~CCodec_Jbig2Module();
- bool Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
+ FX_BOOL Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
const uint8_t* global_data, FX_DWORD global_size, uint8_t* dest_buf, FX_DWORD dest_pitch);
- bool Decode(IFX_FileRead* file_ptr,
+ FX_BOOL Decode(IFX_FileRead* file_ptr,
FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, uint8_t*& dest_buf);
void* CreateJbig2Context();
FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
diff --git a/core/src/fxcodec/codec/fx_codec.cpp b/core/src/fxcodec/codec/fx_codec.cpp
index 8edfde5319..9bbcce105f 100644
--- a/core/src/fxcodec/codec/fx_codec.cpp
+++ b/core/src/fxcodec/codec/fx_codec.cpp
@@ -49,13 +49,13 @@ uint8_t* CCodec_ScanlineDecoder::GetScanline(int line)
m_NextLine ++;
return m_pLastScanline;
}
-bool CCodec_ScanlineDecoder::SkipToScanline(int line, IFX_Pause* pPause)
+FX_BOOL CCodec_ScanlineDecoder::SkipToScanline(int line, IFX_Pause* pPause)
{
if (m_pDataCache && line < m_pDataCache->m_nCachedLines) {
- return false;
+ return FALSE;
}
if (m_NextLine == line || m_NextLine == line + 1) {
- return false;
+ return FALSE;
}
if (m_NextLine < 0 || m_NextLine > line) {
v_Rewind();
@@ -66,10 +66,10 @@ bool CCodec_ScanlineDecoder::SkipToScanline(int line, IFX_Pause* pPause)
m_pLastScanline = ReadNextLine();
m_NextLine ++;
if (pPause && pPause->NeedToPauseNow()) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
uint8_t* CCodec_ScanlineDecoder::ReadNextLine()
{
@@ -107,10 +107,10 @@ void CCodec_ScanlineDecoder::DownScale(int dest_width, int dest_height)
m_pDataCache->m_Width = m_OutputWidth;
m_pDataCache->m_nCachedLines = 0;
}
-bool CCodec_BasicModule::RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
+FX_BOOL CCodec_BasicModule::RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size)
{
- return false;
+ return FALSE;
}
extern "C" double FXstrtod(const char* nptr, char** endptr)
{
@@ -216,26 +216,26 @@ extern "C" double FXstrtod(const char* nptr, char** endptr)
}
return is_negative ? -ret : ret;
}
-bool CCodec_BasicModule::A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
+FX_BOOL CCodec_BasicModule::A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size)
{
- return false;
+ return FALSE;
}
class CCodec_RLScanlineDecoder : public CCodec_ScanlineDecoder
{
public:
CCodec_RLScanlineDecoder();
virtual ~CCodec_RLScanlineDecoder();
- bool Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc);
+ FX_BOOL Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc);
virtual void v_DownScale(int dest_width, int dest_height) {}
- virtual bool v_Rewind();
+ virtual FX_BOOL v_Rewind();
virtual uint8_t* v_GetNextLine();
virtual FX_DWORD GetSrcOffset()
{
return m_SrcOffset;
}
protected:
- bool CheckDestSize();
+ FX_BOOL CheckDestSize();
void GetNextOperator();
void UpdateOperator(uint8_t used_bytes);
@@ -244,7 +244,7 @@ protected:
FX_DWORD m_SrcSize;
FX_DWORD m_dwLineBytes;
FX_DWORD m_SrcOffset;
- bool m_bEOD;
+ FX_BOOL m_bEOD;
uint8_t m_Operator;
};
CCodec_RLScanlineDecoder::CCodec_RLScanlineDecoder()
@@ -253,7 +253,7 @@ CCodec_RLScanlineDecoder::CCodec_RLScanlineDecoder()
, m_SrcSize(0)
, m_dwLineBytes(0)
, m_SrcOffset(0)
- , m_bEOD(false)
+ , m_bEOD(FALSE)
, m_Operator(0)
{
}
@@ -263,7 +263,7 @@ CCodec_RLScanlineDecoder::~CCodec_RLScanlineDecoder()
FX_Free(m_pScanline);
}
}
-bool CCodec_RLScanlineDecoder::CheckDestSize()
+FX_BOOL CCodec_RLScanlineDecoder::CheckDestSize()
{
FX_DWORD i = 0;
FX_DWORD old_size = 0;
@@ -273,14 +273,14 @@ bool CCodec_RLScanlineDecoder::CheckDestSize()
old_size = dest_size;
dest_size += m_pSrcBuf[i] + 1;
if (dest_size < old_size) {
- return false;
+ return FALSE;
}
i += m_pSrcBuf[i] + 2;
} else if (m_pSrcBuf[i] > 128) {
old_size = dest_size;
dest_size += 257 - m_pSrcBuf[i];
if (dest_size < old_size) {
- return false;
+ return FALSE;
}
i += 2;
} else {
@@ -288,11 +288,11 @@ bool CCodec_RLScanlineDecoder::CheckDestSize()
}
}
if (((FX_DWORD)m_OrigWidth * m_nComps * m_bpc * m_OrigHeight + 7) / 8 > dest_size) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CCodec_RLScanlineDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc)
+FX_BOOL CCodec_RLScanlineDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc)
{
m_pSrcBuf = src_buf;
m_SrcSize = src_size;
@@ -300,20 +300,20 @@ bool CCodec_RLScanlineDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size,
m_OutputHeight = m_OrigHeight = height;
m_nComps = nComps;
m_bpc = bpc;
- m_bColorTransformed = false;
+ m_bColorTransformed = FALSE;
m_DownScale = 1;
m_Pitch = (width * nComps * bpc + 31) / 32 * 4;
m_dwLineBytes = (width * nComps * bpc + 7) / 8;
m_pScanline = FX_Alloc(uint8_t, m_Pitch);
return CheckDestSize();
}
-bool CCodec_RLScanlineDecoder::v_Rewind()
+FX_BOOL CCodec_RLScanlineDecoder::v_Rewind()
{
FXSYS_memset(m_pScanline, 0, m_Pitch);
m_SrcOffset = 0;
- m_bEOD = false;
+ m_bEOD = FALSE;
m_Operator = 0;
- return true;
+ return TRUE;
}
uint8_t* CCodec_RLScanlineDecoder::v_GetNextLine()
{
@@ -326,17 +326,17 @@ uint8_t* CCodec_RLScanlineDecoder::v_GetNextLine()
}
FXSYS_memset(m_pScanline, 0, m_Pitch);
FX_DWORD col_pos = 0;
- bool eol = false;
+ FX_BOOL eol = FALSE;
while (m_SrcOffset < m_SrcSize && !eol) {
if (m_Operator < 128) {
FX_DWORD copy_len = m_Operator + 1;
if (col_pos + copy_len >= m_dwLineBytes) {
copy_len = m_dwLineBytes - col_pos;
- eol = true;
+ eol = TRUE;
}
if (copy_len >= m_SrcSize - m_SrcOffset) {
copy_len = m_SrcSize - m_SrcOffset;
- m_bEOD = true;
+ m_bEOD = TRUE;
}
FXSYS_memcpy(m_pScanline + col_pos, m_pSrcBuf + m_SrcOffset, copy_len);
col_pos += copy_len;
@@ -349,13 +349,13 @@ uint8_t* CCodec_RLScanlineDecoder::v_GetNextLine()
FX_DWORD duplicate_len = 257 - m_Operator;
if (col_pos + duplicate_len >= m_dwLineBytes) {
duplicate_len = m_dwLineBytes - col_pos;
- eol = true;
+ eol = TRUE;
}
FXSYS_memset(m_pScanline + col_pos, fill, duplicate_len);
col_pos += duplicate_len;
UpdateOperator((uint8_t)duplicate_len);
} else {
- m_bEOD = true;
+ m_bEOD = TRUE;
break;
}
}
diff --git a/core/src/fxcodec/codec/fx_codec_fax.cpp b/core/src/fxcodec/codec/fx_codec_fax.cpp
index 3446d0a7b9..d45600372f 100644
--- a/core/src/fxcodec/codec/fx_codec_fax.cpp
+++ b/core/src/fxcodec/codec/fx_codec_fax.cpp
@@ -79,7 +79,7 @@ int _FindBit(const uint8_t* data_buf, int max_pos, int start_pos, int bit)
}
return pos;
}
-void _FaxG4FindB1B2(const uint8_t* ref_buf, int columns, int a0, bool a0color, int& b1, int& b2)
+void _FaxG4FindB1B2(const uint8_t* ref_buf, int columns, int a0, FX_BOOL a0color, int& b1, int& b2)
{
if (a0color) {
a0color = 1;
@@ -400,27 +400,27 @@ int _FaxGetRun(const uint8_t* ins_array, const uint8_t* src_buf, int& bitpos, in
}
}
}
-bool _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* dest_buf, const uint8_t* ref_buf, int columns)
+FX_BOOL _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* dest_buf, const uint8_t* ref_buf, int columns)
{
int a0 = -1, a0color = 1;
while (1) {
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
int a1, a2, b1, b2;
_FaxG4FindB1B2(ref_buf, columns, a0, a0color, b1, b2);
- bool bit = NEXTBIT;
+ FX_BOOL bit = NEXTBIT;
int v_delta = 0;
if (bit) {
} else {
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
- bool bit1 = NEXTBIT;
+ FX_BOOL bit1 = NEXTBIT;
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
- bool bit2 = NEXTBIT;
+ FX_BOOL bit2 = NEXTBIT;
if (bit1 && bit2) {
v_delta = 1;
} else if (bit1) {
@@ -457,10 +457,10 @@ bool _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* des
if (a0 < columns) {
continue;
}
- return true;
+ return TRUE;
} else {
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
bit = NEXTBIT;
if (bit) {
@@ -468,26 +468,26 @@ bool _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* des
_FaxFillBits(dest_buf, columns, a0, b2);
}
if (b2 >= columns) {
- return true;
+ return TRUE;
}
a0 = b2;
continue;
} else {
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
- bool bit1 = NEXTBIT;
+ FX_BOOL bit1 = NEXTBIT;
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
- bool bit2 = NEXTBIT;
+ FX_BOOL bit2 = NEXTBIT;
if (bit1 && bit2) {
v_delta = 2;
} else if (bit1) {
v_delta = -2;
} else if (bit2) {
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
bit = NEXTBIT;
if (bit) {
@@ -497,7 +497,7 @@ bool _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* des
}
} else {
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
bit = NEXTBIT;
if (bit) {
@@ -505,7 +505,7 @@ bool _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* des
continue;
} else {
bitpos += 5;
- return true;
+ return TRUE;
}
}
}
@@ -516,13 +516,13 @@ bool _FaxG4GetRow(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* des
_FaxFillBits(dest_buf, columns, a0, a1);
}
if (a1 >= columns) {
- return true;
+ return TRUE;
}
a0 = a1;
a0color = !a0color;
}
}
-bool _FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos)
+FX_BOOL _FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos)
{
int startbit = bitpos;
while (bitpos < bitsize) {
@@ -531,18 +531,18 @@ bool _FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos)
if (bitpos - startbit <= 11) {
bitpos = startbit;
}
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool _FaxGet1DLine(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* dest_buf, int columns)
+FX_BOOL _FaxGet1DLine(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* dest_buf, int columns)
{
- int color = true;
+ int color = TRUE;
int startpos = 0;
while (1) {
if (bitpos >= bitsize) {
- return false;
+ return FALSE;
}
int run_len = 0;
while (1) {
@@ -551,10 +551,10 @@ bool _FaxGet1DLine(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* de
while (bitpos < bitsize) {
int bit = NEXTBIT;
if (bit) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
run_len += run;
if (run < 64) {
@@ -570,17 +570,17 @@ bool _FaxGet1DLine(const uint8_t* src_buf, int bitsize, int& bitpos, uint8_t* de
}
color = !color;
}
- return true;
+ return TRUE;
}
class CCodec_FaxDecoder : public CCodec_ScanlineDecoder
{
public:
CCodec_FaxDecoder();
virtual ~CCodec_FaxDecoder();
- bool Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
- int K, bool EndOfLine, bool EncodedByteAlign, bool BlackIs1, int Columns, int Rows);
+ FX_BOOL Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows);
virtual void v_DownScale(int dest_width, int dest_height) {}
- virtual bool v_Rewind();
+ virtual FX_BOOL v_Rewind();
virtual uint8_t* v_GetNextLine();
virtual FX_DWORD GetSrcOffset();
int m_Encoding, m_bEndOfLine, m_bByteAlign, m_bBlack;
@@ -604,8 +604,8 @@ CCodec_FaxDecoder::~CCodec_FaxDecoder()
FX_Free(m_pRefBuf);
}
}
-bool CCodec_FaxDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
- int K, bool EndOfLine, bool EncodedByteAlign, bool BlackIs1, int Columns, int Rows)
+FX_BOOL CCodec_FaxDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows)
{
m_Encoding = K;
m_bEndOfLine = EndOfLine;
@@ -628,14 +628,14 @@ bool CCodec_FaxDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size, int wi
m_SrcSize = src_size;
m_nComps = 1;
m_bpc = 1;
- m_bColorTransformed = false;
- return true;
+ m_bColorTransformed = FALSE;
+ return TRUE;
}
-bool CCodec_FaxDecoder::v_Rewind()
+FX_BOOL CCodec_FaxDecoder::v_Rewind()
{
FXSYS_memset(m_pRefBuf, 0xff, m_Pitch);
bitpos = 0;
- return true;
+ return TRUE;
}
uint8_t* CCodec_FaxDecoder::v_GetNextLine()
{
@@ -651,7 +651,7 @@ uint8_t* CCodec_FaxDecoder::v_GetNextLine()
} else if (m_Encoding == 0) {
_FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth);
} else {
- bool bNext1D = m_pSrcBuf[bitpos / 8] & (1 << (7 - bitpos % 8));
+ FX_BOOL bNext1D = m_pSrcBuf[bitpos / 8] & (1 << (7 - bitpos % 8));
bitpos ++;
if (bNext1D) {
_FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth);
@@ -669,7 +669,7 @@ uint8_t* CCodec_FaxDecoder::v_GetNextLine()
while (m_bByteAlign && bitpos0 < bitpos1) {
int bit = m_pSrcBuf[bitpos0 / 8] & (1 << (7 - bitpos0 % 8));
if (bit != 0) {
- m_bByteAlign = false;
+ m_bByteAlign = FALSE;
} else {
bitpos0 ++;
}
@@ -846,7 +846,7 @@ static void _AddBitStream(uint8_t* dest_buf, int& dest_bitpos, int data, int bit
dest_bitpos ++;
}
}
-static void _FaxEncodeRun(uint8_t* dest_buf, int& dest_bitpos, int run, bool bWhite)
+static void _FaxEncodeRun(uint8_t* dest_buf, int& dest_bitpos, int run, FX_BOOL bWhite)
{
while (run >= 2560) {
_AddBitStream(dest_buf, dest_bitpos, 0x1f, 12);
@@ -972,14 +972,14 @@ void CCodec_FaxEncoder::Encode(uint8_t*& dest_buf, FX_DWORD& dest_size)
dest_size = m_DestBuf.GetSize();
m_DestBuf.DetachBuffer();
}
-bool CCodec_FaxModule::Encode(const uint8_t* src_buf, int width, int height, int pitch, uint8_t*& dest_buf, FX_DWORD& dest_size)
+FX_BOOL CCodec_FaxModule::Encode(const uint8_t* src_buf, int width, int height, int pitch, uint8_t*& dest_buf, FX_DWORD& dest_size)
{
CCodec_FaxEncoder encoder(src_buf, width, height, pitch);
encoder.Encode(dest_buf, dest_size);
- return true;
+ return TRUE;
}
ICodec_ScanlineDecoder* CCodec_FaxModule::CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
- int K, bool EndOfLine, bool EncodedByteAlign, bool BlackIs1, int Columns, int Rows)
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows)
{
CCodec_FaxDecoder* pDecoder = new CCodec_FaxDecoder;
pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine, EncodedByteAlign, BlackIs1, Columns, Rows);
diff --git a/core/src/fxcodec/codec/fx_codec_flate.cpp b/core/src/fxcodec/codec/fx_codec_flate.cpp
index a61be75bbe..d129e36392 100644
--- a/core/src/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/src/fxcodec/codec/fx_codec_flate.cpp
@@ -84,7 +84,7 @@ extern "C"
class CLZWDecoder
{
public:
- int Decode(uint8_t* output, FX_DWORD& outlen, const uint8_t* input, FX_DWORD& size, bool bEarlyChange);
+ int Decode(uint8_t* output, FX_DWORD& outlen, const uint8_t* input, FX_DWORD& size, FX_BOOL bEarlyChange);
private:
void AddCode(FX_DWORD prefix_code, uint8_t append_char);
@@ -94,7 +94,7 @@ private:
FX_DWORD m_OutPos;
uint8_t* m_pOutput;
const uint8_t* m_pInput;
- bool m_Early;
+ FX_BOOL m_Early;
FX_DWORD m_CodeArray[5021];
FX_DWORD m_nCodes;
uint8_t m_DecodeStack[4000];
@@ -134,7 +134,7 @@ void CLZWDecoder::DecodeString(FX_DWORD code)
}
m_DecodeStack[m_StackLen++] = (uint8_t)code;
}
-int CLZWDecoder::Decode(uint8_t* dest_buf, FX_DWORD& dest_size, const uint8_t* src_buf, FX_DWORD& src_size, bool bEarlyChange)
+int CLZWDecoder::Decode(uint8_t* dest_buf, FX_DWORD& dest_size, const uint8_t* src_buf, FX_DWORD& src_size, FX_BOOL bEarlyChange)
{
m_CodeLen = 9;
m_InPos = 0;
@@ -238,14 +238,14 @@ static uint8_t PaethPredictor(int a, int b, int c)
}
return (uint8_t)c;
}
-static bool PNG_PredictorEncode(uint8_t*& data_buf, FX_DWORD& data_size,
+static FX_BOOL PNG_PredictorEncode(uint8_t*& data_buf, FX_DWORD& data_size,
int predictor, int Colors,
int BitsPerComponent, int Columns)
{
const int BytesPerPixel = (Colors * BitsPerComponent + 7) / 8;
const int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
if (row_size <= 0)
- return false;
+ return FALSE;
const int row_count = (data_size + row_size - 1) / row_size;
const int last_row_size = data_size % row_size;
uint8_t* dest_buf = FX_Alloc2D(uint8_t, row_size + 1, row_count);
@@ -328,7 +328,7 @@ static bool PNG_PredictorEncode(uint8_t*& data_buf, FX_DWORD& data_size,
FX_Free(data_buf);
data_buf = dest_buf;
data_size = (row_size + 1) * row_count - (last_row_size > 0 ? (row_size - last_row_size) : 0);
- return true;
+ return TRUE;
}
static void PNG_PredictLine(uint8_t* pDestData, const uint8_t* pSrcData, const uint8_t* pLastLine,
int bpc, int nColors, int nPixels)
@@ -393,13 +393,13 @@ static void PNG_PredictLine(uint8_t* pDestData, const uint8_t* pSrcData, const u
}
}
}
-static bool PNG_Predictor(uint8_t*& data_buf, FX_DWORD& data_size,
+static FX_BOOL PNG_Predictor(uint8_t*& data_buf, FX_DWORD& data_size,
int Colors, int BitsPerComponent, int Columns)
{
const int BytesPerPixel = (Colors * BitsPerComponent + 7) / 8;
const int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
if (row_size <= 0)
- return false;
+ return FALSE;
const int row_count = (data_size + row_size) / (row_size + 1);
const int last_row_size = data_size % (row_size + 1);
uint8_t* dest_buf = FX_Alloc2D(uint8_t, row_size, row_count);
@@ -479,7 +479,7 @@ static bool PNG_Predictor(uint8_t*& data_buf, FX_DWORD& data_size,
FX_Free(data_buf);
data_buf = dest_buf;
data_size = row_size * row_count - (last_row_size > 0 ? (row_size + 1 - last_row_size) : 0);
- return true;
+ return TRUE;
}
static void TIFF_PredictorEncodeLine(uint8_t* dest_buf, int row_size, int BitsPerComponent, int Colors, int Columns)
{
@@ -518,12 +518,12 @@ static void TIFF_PredictorEncodeLine(uint8_t* dest_buf, int row_size, int BitsPe
}
}
}
-static bool TIFF_PredictorEncode(uint8_t*& data_buf, FX_DWORD& data_size,
+static FX_BOOL TIFF_PredictorEncode(uint8_t*& data_buf, FX_DWORD& data_size,
int Colors, int BitsPerComponent, int Columns)
{
int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
if (row_size == 0)
- return false;
+ return FALSE;
const int row_count = (data_size + row_size - 1) / row_size;
const int last_row_size = data_size % row_size;
for (int row = 0; row < row_count; row++) {
@@ -533,7 +533,7 @@ static bool TIFF_PredictorEncode(uint8_t*& data_buf, FX_DWORD& data_size,
}
TIFF_PredictorEncodeLine(scan_line, row_size, BitsPerComponent, Colors, Columns);
}
- return true;
+ return TRUE;
}
static void TIFF_PredictLine(uint8_t* dest_buf, int row_size, int BitsPerComponent, int Colors, int Columns)
{
@@ -568,12 +568,12 @@ static void TIFF_PredictLine(uint8_t* dest_buf, int row_size, int BitsPerCompone
}
}
}
-static bool TIFF_Predictor(uint8_t*& data_buf, FX_DWORD& data_size,
+static FX_BOOL TIFF_Predictor(uint8_t*& data_buf, FX_DWORD& data_size,
int Colors, int BitsPerComponent, int Columns)
{
int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
if (row_size == 0)
- return false;
+ return FALSE;
const int row_count = (data_size + row_size - 1) / row_size;
const int last_row_size = data_size % row_size;
for (int row = 0; row < row_count; row ++) {
@@ -583,7 +583,7 @@ static bool TIFF_Predictor(uint8_t*& data_buf, FX_DWORD& data_size,
}
TIFF_PredictLine(scan_line, row_size, BitsPerComponent, Colors, Columns);
}
- return true;
+ return TRUE;
}
class CCodec_FlateScanlineDecoder : public CCodec_ScanlineDecoder
{
@@ -597,7 +597,7 @@ public:
delete this;
}
virtual void v_DownScale(int dest_width, int dest_height) {}
- virtual bool v_Rewind();
+ virtual FX_BOOL v_Rewind();
virtual uint8_t* v_GetNextLine();
virtual FX_DWORD GetSrcOffset();
void* m_pFlate;
@@ -646,7 +646,7 @@ void CCodec_FlateScanlineDecoder::Create(const uint8_t* src_buf, FX_DWORD src_si
m_OutputHeight = m_OrigHeight = height;
m_nComps = nComps;
m_bpc = bpc;
- m_bColorTransformed = false;
+ m_bColorTransformed = FALSE;
m_Pitch = (width * nComps * bpc + 7) / 8;
m_pScanline = FX_Alloc(uint8_t, m_Pitch);
m_Predictor = 0;
@@ -672,18 +672,18 @@ void CCodec_FlateScanlineDecoder::Create(const uint8_t* src_buf, FX_DWORD src_si
}
}
}
-bool CCodec_FlateScanlineDecoder::v_Rewind()
+FX_BOOL CCodec_FlateScanlineDecoder::v_Rewind()
{
if (m_pFlate) {
FPDFAPI_FlateEnd(m_pFlate);
}
m_pFlate = FPDFAPI_FlateInit(my_alloc_func, my_free_func);
if (m_pFlate == NULL) {
- return false;
+ return FALSE;
}
FPDFAPI_FlateInput(m_pFlate, m_SrcBuf, m_SrcSize);
m_LeftOver = 0;
- return true;
+ return TRUE;
}
uint8_t* CCodec_FlateScanlineDecoder::v_GetNextLine()
{
@@ -732,7 +732,7 @@ FX_DWORD CCodec_FlateScanlineDecoder::GetSrcOffset()
static void FlateUncompress(const uint8_t* src_buf, FX_DWORD src_size, FX_DWORD orig_size,
uint8_t*& dest_buf, FX_DWORD& dest_size, FX_DWORD& offset)
{
- const bool useOldImpl = src_size < 10240;
+ const FX_BOOL useOldImpl = src_size < 10240;
FX_DWORD guess_size = orig_size ? orig_size : src_size * 2;
FX_DWORD alloc_step = orig_size ? 10240 : (src_size < 10240 ? 10240 : src_size);
static const FX_DWORD kMaxInitialAllocSize = 10000000;
@@ -839,7 +839,7 @@ ICodec_ScanlineDecoder* CCodec_FlateModule::CreateDecoder(const uint8_t* src_buf
pDecoder->Create(src_buf, src_size, width, height, nComps, bpc, predictor, Colors, BitsPerComponent, Columns);
return pDecoder;
}
-FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf, FX_DWORD src_size, bool bEarlyChange,
+FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
int predictor, int Colors, int BitsPerComponent, int Columns,
FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size)
{
@@ -876,7 +876,7 @@ FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf,
if (predictor_type == 0) {
return offset;
}
- bool ret = true;
+ FX_BOOL ret = TRUE;
if (predictor_type == 2) {
ret = PNG_Predictor(dest_buf, dest_size, Colors, BitsPerComponent,
Columns);
@@ -886,7 +886,7 @@ FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf,
}
return ret ? offset : -1;
}
-bool CCodec_FlateModule::Encode(const uint8_t* src_buf, FX_DWORD src_size,
+FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf, FX_DWORD src_size,
int predictor, int Colors, int BitsPerComponent, int Columns,
uint8_t*& dest_buf, FX_DWORD& dest_size)
{
@@ -896,7 +896,7 @@ bool CCodec_FlateModule::Encode(const uint8_t* src_buf, FX_DWORD src_size,
uint8_t* pSrcBuf = NULL;
pSrcBuf = FX_Alloc(uint8_t, src_size);
FXSYS_memcpy(pSrcBuf, src_buf, src_size);
- bool ret = true;
+ FX_BOOL ret = TRUE;
if (predictor == 2) {
ret = TIFF_PredictorEncode(pSrcBuf, src_size, Colors, BitsPerComponent,
Columns);
@@ -909,12 +909,12 @@ bool CCodec_FlateModule::Encode(const uint8_t* src_buf, FX_DWORD src_size,
FX_Free(pSrcBuf);
return ret;
}
-bool CCodec_FlateModule::Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size)
+FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size)
{
dest_size = src_size + src_size / 1000 + 12;
dest_buf = FX_Alloc( uint8_t, dest_size);
unsigned long temp_size = dest_size;
FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size);
dest_size = (FX_DWORD)temp_size;
- return true;
+ return TRUE;
}
diff --git a/core/src/fxcodec/codec/fx_codec_icc.cpp b/core/src/fxcodec/codec/fx_codec_icc.cpp
index 0ccfe1fba6..7507fe5d6d 100644
--- a/core/src/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/src/fxcodec/codec/fx_codec_icc.cpp
@@ -14,7 +14,7 @@ const FX_DWORD N_COMPONENT_RGB = 3;
const FX_DWORD N_COMPONENT_CMYK = 4;
const FX_DWORD N_COMPONENT_DEFAULT = 3;
-bool MD5ComputeID( const void* buf, FX_DWORD dwSize, uint8_t ID[16] )
+FX_BOOL MD5ComputeID( const void* buf, FX_DWORD dwSize, uint8_t ID[16] )
{
return cmsMD5computeIDExt(buf, dwSize, ID);
}
@@ -22,50 +22,50 @@ struct CLcmsCmm {
cmsHTRANSFORM m_hTransform;
int m_nSrcComponents;
int m_nDstComponents;
- bool m_bLab;
+ FX_BOOL m_bLab;
};
extern "C" {
int ourHandler(int ErrorCode, const char *ErrorText)
{
- return true;
+ return TRUE;
}
};
-bool CheckComponents(cmsColorSpaceSignature cs, int nComponents, bool bDst)
+FX_BOOL CheckComponents(cmsColorSpaceSignature cs, int nComponents, FX_BOOL bDst)
{
if (nComponents <= 0 || nComponents > 15) {
- return false;
+ return FALSE;
}
switch(cs) {
case cmsSigLabData:
if (nComponents < 3) {
- return false;
+ return FALSE;
}
break;
case cmsSigGrayData:
if (bDst && nComponents != 1) {
- return false;
+ return FALSE;
}
if (!bDst && nComponents > 2) {
- return false;
+ return FALSE;
}
break;
case cmsSigRgbData:
if (bDst && nComponents != 3) {
- return false;
+ return FALSE;
}
break;
case cmsSigCmykData:
if (bDst && nComponents != 4) {
- return false;
+ return FALSE;
}
break;
default:
if (nComponents != 3) {
- return false;
+ return FALSE;
}
break;
}
- return true;
+ return TRUE;
}
int32_t GetCSComponents(cmsColorSpaceSignature cs)
{
@@ -112,12 +112,12 @@ void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, FX_DWORD dwSr
return NULL;
}
int srcFormat;
- bool bLab = false;
+ FX_BOOL bLab = FALSE;
cmsColorSpaceSignature srcCS = cmsGetColorSpace(srcProfile);
nSrcComponents = GetCSComponents(srcCS);
if (srcCS == cmsSigLabData) {
srcFormat = COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);
- bLab = true;
+ bLab = TRUE;
} else {
srcFormat = COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);
if (srcCS == cmsSigRgbData && T_DOSWAP(dwSrcFormat)) {
@@ -125,7 +125,7 @@ void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, FX_DWORD dwSr
}
}
cmsColorSpaceSignature dstCS = cmsGetColorSpace(dstProfile);
- if (!CheckComponents(dstCS, nDstComponents, true)) {
+ if (!CheckComponents(dstCS, nDstComponents, TRUE)) {
cmsCloseProfile(srcProfile);
cmsCloseProfile(dstProfile);
return NULL;
diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp
index c13a2f9526..51184306eb 100644
--- a/core/src/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jbig.cpp
@@ -26,28 +26,28 @@ void CCodec_Jbig2Module::DestroyJbig2Context(void* pJbig2Content)
}
pJbig2Content = NULL;
}
-bool CCodec_Jbig2Module::Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
+FX_BOOL CCodec_Jbig2Module::Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
const uint8_t* global_data, FX_DWORD global_size, uint8_t* dest_buf, FX_DWORD dest_pitch)
{
FXSYS_memset(dest_buf, 0, height * dest_pitch);
CJBig2_Context* pContext = CJBig2_Context::CreateContext(&m_Module,
(uint8_t*)global_data, global_size, (uint8_t*)src_buf, src_size, JBIG2_EMBED_STREAM, &m_SymbolDictCache);
if (pContext == NULL) {
- return false;
+ return FALSE;
}
int ret = pContext->getFirstPage(dest_buf, width, height, dest_pitch, NULL);
CJBig2_Context::DestroyContext(pContext);
if (ret != JBIG2_SUCCESS) {
- return false;
+ return FALSE;
}
int dword_size = height * dest_pitch / 4;
FX_DWORD* dword_buf = (FX_DWORD*)dest_buf;
for (int i = 0; i < dword_size; i ++) {
dword_buf[i] = ~dword_buf[i];
}
- return true;
+ return TRUE;
}
-bool CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr,
+FX_BOOL CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr,
FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, uint8_t*& dest_buf)
{
CJBig2_Context* pContext = NULL;
@@ -71,15 +71,15 @@ bool CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr,
height = (FX_DWORD)dest_image->m_nHeight;
pitch = (FX_DWORD)dest_image->m_nStride;
dest_buf = dest_image->m_pData;
- dest_image->m_bNeedFree = false;
+ dest_image->m_bNeedFree = FALSE;
delete dest_image;
FX_Free(src_buf);
- return true;
+ return TRUE;
failed:
if(src_buf) {
FX_Free(src_buf);
}
- return false;
+ return FALSE;
}
FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
const uint8_t* global_data, FX_DWORD global_size, uint8_t* dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause)
@@ -97,7 +97,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, FX_DWORD wid
m_pJbig2Context->m_dest_buf = dest_buf;
m_pJbig2Context->m_dest_pitch = dest_pitch;
m_pJbig2Context->m_pPause = pPause;
- m_pJbig2Context->m_bFileReader = false;
+ m_pJbig2Context->m_bFileReader = FALSE;
FXSYS_memset(dest_buf, 0, height * dest_pitch);
m_pJbig2Context->m_pContext = CJBig2_Context::CreateContext(&m_Module,
(uint8_t*)global_data, global_size, (uint8_t*)src_buf, src_size, JBIG2_EMBED_STREAM, &m_SymbolDictCache, pPause);
@@ -127,7 +127,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, IFX_FileRead
return FXCODEC_STATUS_ERR_PARAMS;
}
CCodec_Jbig2Context* m_pJbig2Context = (CCodec_Jbig2Context*)pJbig2Context;
- m_pJbig2Context->m_bFileReader = true;
+ m_pJbig2Context->m_bFileReader = TRUE;
m_pJbig2Context->m_dest_image = NULL;
m_pJbig2Context->m_src_size = (FX_DWORD)file_ptr->GetSize();
m_pJbig2Context->m_src_buf = FX_Alloc(uint8_t, m_pJbig2Context->m_src_size);
@@ -145,7 +145,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, IFX_FileRead
height = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nHeight;
pitch = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nStride;
dest_buf = m_pJbig2Context->m_dest_image->m_pData;
- m_pJbig2Context->m_dest_image->m_bNeedFree = false;
+ m_pJbig2Context->m_dest_image->m_bNeedFree = FALSE;
return FXCODEC_STATUS_DECODE_TOBECONTINUE;
}
CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
@@ -157,7 +157,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, IFX_FileRead
height = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nHeight;
pitch = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nStride;
dest_buf = m_pJbig2Context->m_dest_image->m_pData;
- m_pJbig2Context->m_dest_image->m_bNeedFree = false;
+ m_pJbig2Context->m_dest_image->m_bNeedFree = FALSE;
delete m_pJbig2Context->m_dest_image;
FX_Free(m_pJbig2Context->m_src_buf);
return FXCODEC_STATUS_DECODE_FINISH;
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
index 1ac2f03c04..6839d31509 100644
--- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
@@ -78,15 +78,15 @@ extern "C" {
#define JPEG_MARKER_AUTHORTIME (JPEG_APP0 + 3)
#define JPEG_MARKER_MAXSIZE 0xFFFF
#define JPEG_OVERHEAD_LEN 14
-static bool _JpegEmbedIccProfile(j_compress_ptr cinfo, const uint8_t* icc_buf_ptr, FX_DWORD icc_length)
+static FX_BOOL _JpegEmbedIccProfile(j_compress_ptr cinfo, const uint8_t* icc_buf_ptr, FX_DWORD icc_length)
{
if(icc_buf_ptr == NULL || icc_length == 0) {
- return false;
+ return FALSE;
}
FX_DWORD icc_segment_size = (JPEG_MARKER_MAXSIZE - 2 - JPEG_OVERHEAD_LEN);
FX_DWORD icc_segment_num = (icc_length / icc_segment_size) + 1;
if (icc_segment_num > 255) {
- return false;
+ return FALSE;
}
FX_DWORD icc_data_length = JPEG_OVERHEAD_LEN + (icc_segment_num > 1 ? icc_segment_size : icc_length);
uint8_t* icc_data = FX_Alloc(uint8_t, icc_data_length);
@@ -102,7 +102,7 @@ static bool _JpegEmbedIccProfile(j_compress_ptr cinfo, const uint8_t* icc_buf_pt
FXSYS_memcpy(icc_data + JPEG_OVERHEAD_LEN, icc_buf_ptr + icc_size, icc_length - icc_size);
jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data, JPEG_OVERHEAD_LEN + icc_length - icc_size);
FX_Free(icc_data);
- return true;
+ return TRUE;
}
extern "C" {
static void _dest_do_nothing(j_compress_ptr cinfo) {}
@@ -110,7 +110,7 @@ extern "C" {
extern "C" {
static boolean _dest_empty(j_compress_ptr cinfo)
{
- return false;
+ return FALSE;
}
};
#define JPEG_BLOCK_SIZE 1048576
@@ -178,9 +178,9 @@ static void _JpegEncode(const CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STR
}
jpeg_set_defaults(&cinfo);
if(quality != 75) {
- jpeg_set_quality(&cinfo, quality, true);
+ jpeg_set_quality(&cinfo, quality, TRUE);
}
- jpeg_start_compress(&cinfo, true);
+ jpeg_start_compress(&cinfo, TRUE);
_JpegEmbedIccProfile(&cinfo, icc_buf, icc_length);
JSAMPROW row_pointer[1];
JDIMENSION row;
@@ -221,8 +221,8 @@ static void _JpegEncode(const CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STR
}
dest_size = dest_buf_length - (FX_STRSIZE)dest.free_in_buffer;
}
-static bool _JpegLoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, bool& color_transform,
+static FX_BOOL _JpegLoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
uint8_t** icc_buf_ptr, FX_DWORD* icc_length)
{
_JpegScanSOI(src_buf, src_size);
@@ -238,7 +238,7 @@ static bool _JpegLoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width,
jmp_buf mark;
cinfo.client_data = &mark;
if (setjmp(mark) == -1) {
- return false;
+ return FALSE;
}
jpeg_create_decompress(&cinfo);
struct jpeg_source_mgr src;
@@ -252,15 +252,15 @@ static bool _JpegLoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width,
cinfo.src = &src;
if (setjmp(mark) == -1) {
jpeg_destroy_decompress(&cinfo);
- return false;
+ return FALSE;
}
if(icc_buf_ptr && icc_length) {
jpeg_save_markers(&cinfo, JPEG_MARKER_ICC, JPEG_MARKER_MAXSIZE);
}
- int ret = jpeg_read_header(&cinfo, true);
+ int ret = jpeg_read_header(&cinfo, TRUE);
if (ret != JPEG_HEADER_OK) {
jpeg_destroy_decompress(&cinfo);
- return false;
+ return FALSE;
}
width = cinfo.image_width;
height = cinfo.image_height;
@@ -274,21 +274,21 @@ static bool _JpegLoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width,
*icc_length = 0;
}
jpeg_destroy_decompress(&cinfo);
- return true;
+ return TRUE;
}
class CCodec_JpegDecoder : public CCodec_ScanlineDecoder
{
public:
CCodec_JpegDecoder();
~CCodec_JpegDecoder();
- bool Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps,
- bool ColorTransform, IFX_JpegProvider* pJP);
+ FX_BOOL Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps,
+ FX_BOOL ColorTransform, IFX_JpegProvider* pJP);
virtual void Destroy()
{
delete this;
}
virtual void v_DownScale(int dest_width, int dest_height);
- virtual bool v_Rewind();
+ virtual FX_BOOL v_Rewind();
virtual uint8_t* v_GetNextLine();
virtual FX_DWORD GetSrcOffset();
jmp_buf m_JmpBuf;
@@ -298,8 +298,8 @@ public:
const uint8_t* m_SrcBuf;
FX_DWORD m_SrcSize;
uint8_t* m_pScanlineBuf;
- bool InitDecode();
- bool m_bInited, m_bStarted, m_bJpegTransform;
+ FX_BOOL InitDecode();
+ FX_BOOL m_bInited, m_bStarted, m_bJpegTransform;
protected:
IFX_JpegProvider* m_pExtProvider;
void* m_pExtContext;
@@ -309,8 +309,8 @@ CCodec_JpegDecoder::CCodec_JpegDecoder()
{
m_pScanlineBuf = NULL;
m_DownScale = 1;
- m_bStarted = false;
- m_bInited = false;
+ m_bStarted = FALSE;
+ m_bInited = FALSE;
m_pExtProvider = NULL;
m_pExtContext = NULL;
FXSYS_memset(&cinfo, 0, sizeof(cinfo));
@@ -331,31 +331,31 @@ CCodec_JpegDecoder::~CCodec_JpegDecoder()
jpeg_destroy_decompress(&cinfo);
}
}
-bool CCodec_JpegDecoder::InitDecode()
+FX_BOOL CCodec_JpegDecoder::InitDecode()
{
cinfo.err = &jerr;
cinfo.client_data = &m_JmpBuf;
if (setjmp(m_JmpBuf) == -1) {
- return false;
+ return FALSE;
}
jpeg_create_decompress(&cinfo);
- m_bInited = true;
+ m_bInited = TRUE;
cinfo.src = &src;
src.bytes_in_buffer = m_SrcSize;
src.next_input_byte = m_SrcBuf;
if (setjmp(m_JmpBuf) == -1) {
jpeg_destroy_decompress(&cinfo);
- m_bInited = false;
- return false;
+ m_bInited = FALSE;
+ return FALSE;
}
cinfo.image_width = m_OrigWidth;
cinfo.image_height = m_OrigHeight;
- int ret = jpeg_read_header(&cinfo, true);
+ int ret = jpeg_read_header(&cinfo, TRUE);
if (ret != JPEG_HEADER_OK) {
- return false;
+ return FALSE;
}
if (cinfo.saw_Adobe_marker) {
- m_bJpegTransform = true;
+ m_bJpegTransform = TRUE;
}
if (cinfo.num_components == 3 && !m_bJpegTransform) {
cinfo.out_color_space = cinfo.jpeg_color_space;
@@ -365,10 +365,10 @@ bool CCodec_JpegDecoder::InitDecode()
m_OutputWidth = m_OrigWidth;
m_OutputHeight = m_OrigHeight;
m_nDefaultScaleDenom = cinfo.scale_denom;
- return true;
+ return TRUE;
}
-bool CCodec_JpegDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
- int nComps, bool ColorTransform, IFX_JpegProvider* pJP)
+FX_BOOL CCodec_JpegDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, FX_BOOL ColorTransform, IFX_JpegProvider* pJP)
{
if (pJP) {
m_pExtProvider = pJP;
@@ -396,21 +396,21 @@ bool CCodec_JpegDecoder::Create(const uint8_t* src_buf, FX_DWORD src_size, int w
m_OutputWidth = m_OrigWidth = width;
m_OutputHeight = m_OrigHeight = height;
if (!InitDecode()) {
- return false;
+ return FALSE;
}
if (cinfo.num_components < nComps) {
- return false;
+ return FALSE;
}
if ((int)cinfo.image_width < width) {
- return false;
+ return FALSE;
}
m_Pitch = (cinfo.image_width * cinfo.num_components + 3) / 4 * 4;
m_pScanlineBuf = FX_Alloc(uint8_t, m_Pitch);
m_nComps = cinfo.num_components;
m_bpc = 8;
- m_bColorTransformed = false;
- m_bStarted = false;
- return true;
+ m_bColorTransformed = FALSE;
+ m_bStarted = FALSE;
+ return TRUE;
}
extern "C" {
int32_t FX_GetDownsampleRatio(int32_t originWidth, int32_t originHeight, int32_t downsampleWidth, int32_t downsampleHeight)
@@ -445,7 +445,7 @@ void CCodec_JpegDecoder::v_DownScale(int dest_width, int dest_height)
m_NextLine = -1;
}
}
-bool CCodec_JpegDecoder::v_Rewind()
+FX_BOOL CCodec_JpegDecoder::v_Rewind()
{
if (m_pExtProvider) {
return m_pExtProvider->Rewind(m_pExtContext);
@@ -453,25 +453,25 @@ bool CCodec_JpegDecoder::v_Rewind()
if (m_bStarted) {
jpeg_destroy_decompress(&cinfo);
if (!InitDecode()) {
- return false;
+ return FALSE;
}
}
if (setjmp(m_JmpBuf) == -1) {
- return false;
+ return FALSE;
}
cinfo.scale_denom = m_nDefaultScaleDenom * m_DownScale;
m_OutputWidth = (m_OrigWidth + m_DownScale - 1) / m_DownScale;
m_OutputHeight = (m_OrigHeight + m_DownScale - 1) / m_DownScale;
if (!jpeg_start_decompress(&cinfo)) {
jpeg_destroy_decompress(&cinfo);
- return false;
+ return FALSE;
}
if ((int)cinfo.output_width > m_OrigWidth) {
- FXSYS_assert(false);
- return false;
+ FXSYS_assert(FALSE);
+ return FALSE;
}
- m_bStarted = true;
- return true;
+ m_bStarted = TRUE;
+ return TRUE;
}
uint8_t* CCodec_JpegDecoder::v_GetNextLine()
{
@@ -492,7 +492,7 @@ FX_DWORD CCodec_JpegDecoder::GetSrcOffset()
return (FX_DWORD)(m_SrcSize - src.bytes_in_buffer);
}
ICodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size,
- int width, int height, int nComps, bool ColorTransform)
+ int width, int height, int nComps, FX_BOOL ColorTransform)
{
if (src_buf == NULL || src_size == 0) {
return NULL;
@@ -504,8 +504,8 @@ ICodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder(const uint8_t* src_buf,
}
return pDecoder;
}
-bool CCodec_JpegModule::LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, bool& color_transform,
+FX_BOOL CCodec_JpegModule::LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
uint8_t** icc_buf_ptr, FX_DWORD* icc_length)
{
if (m_pExtProvider) {
@@ -515,17 +515,17 @@ bool CCodec_JpegModule::LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int&
}
return _JpegLoadInfo(src_buf, src_size, width, height, num_components, bits_per_components, color_transform, icc_buf_ptr, icc_length);
}
-bool CCodec_JpegModule::Encode(const CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality, const uint8_t* icc_buf, FX_DWORD icc_length)
+FX_BOOL CCodec_JpegModule::Encode(const CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality, const uint8_t* icc_buf, FX_DWORD icc_length)
{
if (m_pExtProvider) {
return m_pExtProvider->Encode(pSource, dest_buf, dest_size, quality, icc_buf, icc_length);
}
if(pSource->GetBPP() < 8 || pSource->GetPalette() != NULL) {
ASSERT(pSource->GetBPP() >= 8 && pSource->GetPalette() == NULL);
- return false;
+ return FALSE;
}
_JpegEncode(pSource, dest_buf, dest_size, quality, icc_buf, icc_length);
- return true;
+ return TRUE;
}
struct FXJPEG_Context {
jmp_buf m_JumpMark;
@@ -653,14 +653,14 @@ int CCodec_JpegModule::StartScanline(void* pContext, int down_scale)
p->m_Info.scale_denom = down_scale;
return jpeg_start_decompress(&p->m_Info);
}
-bool CCodec_JpegModule::ReadScanline(void* pContext, unsigned char* dest_buf)
+FX_BOOL CCodec_JpegModule::ReadScanline(void* pContext, unsigned char* dest_buf)
{
if (m_pExtProvider) {
return m_pExtProvider->ReadScanline(pContext, dest_buf);
}
FXJPEG_Context* p = (FXJPEG_Context*)pContext;
if (setjmp(p->m_JumpMark) == -1) {
- return false;
+ return FALSE;
}
int nlines = jpeg_read_scanlines(&p->m_Info, &dest_buf, 1);
return nlines == 1;
diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
index 92af626f25..2d395b0b4b 100644
--- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -587,17 +587,17 @@ class CJPX_Decoder
public:
CJPX_Decoder();
~CJPX_Decoder();
- bool Init(const unsigned char* src_data, int src_size);
+ FX_BOOL Init(const unsigned char* src_data, int src_size);
void GetInfo(FX_DWORD& width, FX_DWORD& height, FX_DWORD& codestream_nComps, FX_DWORD& output_nComps);
- bool Decode(uint8_t* dest_buf, int pitch, bool bTranslateColor, uint8_t* offsets);
+ FX_BOOL Decode(uint8_t* dest_buf, int pitch, FX_BOOL bTranslateColor, uint8_t* offsets);
const uint8_t* m_SrcData;
int m_SrcSize;
opj_image_t *image;
opj_codec_t* l_codec;
opj_stream_t *l_stream;
- bool m_useColorSpace;
+ FX_BOOL m_useColorSpace;
};
-CJPX_Decoder::CJPX_Decoder(): image(NULL), l_codec(NULL), l_stream(NULL), m_useColorSpace(false)
+CJPX_Decoder::CJPX_Decoder(): image(NULL), l_codec(NULL), l_stream(NULL), m_useColorSpace(FALSE)
{
}
CJPX_Decoder::~CJPX_Decoder()
@@ -612,11 +612,11 @@ CJPX_Decoder::~CJPX_Decoder()
opj_image_destroy(image);
}
}
-bool CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
+FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
{
static const unsigned char szJP2Header[] = { 0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a };
if (!src_data || src_size < sizeof(szJP2Header)) {
- return false;
+ return FALSE;
}
image = NULL;
m_SrcData = src_data;
@@ -624,7 +624,7 @@ bool CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
DecodeData srcData(const_cast<unsigned char*>(src_data), src_size);
l_stream = fx_opj_stream_create_memory_stream(&srcData, OPJ_J2K_STREAM_CHUNK_SIZE, 1);
if (l_stream == NULL) {
- return false;
+ return FALSE;
}
opj_dparameters_t parameters;
opj_set_default_decoder_parameters(&parameters);
@@ -637,33 +637,33 @@ bool CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
l_codec = opj_create_decompress(OPJ_CODEC_J2K);
}
if(!l_codec) {
- return false;
+ return FALSE;
}
opj_set_info_handler(l_codec, fx_info_callback, 00);
opj_set_warning_handler(l_codec, fx_warning_callback, 00);
opj_set_error_handler(l_codec, fx_error_callback, 00);
if ( !opj_setup_decoder(l_codec, &parameters) ) {
- return false;
+ return FALSE;
}
if(! opj_read_header(l_stream, l_codec, &image)) {
image = NULL;
- return false;
+ return FALSE;
}
if (!parameters.nb_tile_to_decode) {
if (!opj_set_decode_area(l_codec, image, parameters.DA_x0,
parameters.DA_y0, parameters.DA_x1, parameters.DA_y1)) {
opj_image_destroy(image);
image = NULL;
- return false;
+ return FALSE;
}
if (!(opj_decode(l_codec, l_stream, image) && opj_end_decompress(l_codec, l_stream))) {
opj_image_destroy(image);
image = NULL;
- return false;
+ return FALSE;
}
} else {
if (!opj_get_decoded_tile(l_codec, l_stream, image, parameters.tile_index)) {
- return false;
+ return FALSE;
}
}
opj_stream_destroy(l_stream);
@@ -684,9 +684,9 @@ bool CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
image->icc_profile_len = 0;
}
if(!image) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
void CJPX_Decoder::GetInfo(FX_DWORD& width, FX_DWORD& height, FX_DWORD& codestream_nComps, FX_DWORD& output_nComps)
{
@@ -694,7 +694,7 @@ void CJPX_Decoder::GetInfo(FX_DWORD& width, FX_DWORD& height, FX_DWORD& codestre
height = (FX_DWORD)image->y1;
output_nComps = codestream_nComps = (FX_DWORD)image->numcomps;
}
-bool CJPX_Decoder::Decode(uint8_t* dest_buf, int pitch, bool bTranslateColor, uint8_t* offsets)
+FX_BOOL CJPX_Decoder::Decode(uint8_t* dest_buf, int pitch, FX_BOOL bTranslateColor, uint8_t* offsets)
{
int i, wid, hei, row, col, channel, src;
uint8_t* pChannel;
@@ -702,14 +702,14 @@ bool CJPX_Decoder::Decode(uint8_t* dest_buf, int pitch, bool bTranslateColor, ui
uint8_t* pPixel;
if(image->comps[0].w != image->x1 || image->comps[0].h != image->y1) {
- return false;
+ return FALSE;
}
if(pitch < (int)(image->comps[0].w * 8 * image->numcomps + 31) >> 5 << 2) {
- return false;
+ return FALSE;
}
FXSYS_memset(dest_buf, 0xff, image->y1 * pitch);
uint8_t** channel_bufs = FX_Alloc(uint8_t*, image->numcomps);
- bool result = false;
+ FX_BOOL result = FALSE;
int* adjust_comps = FX_Alloc(int, image->numcomps);
for (i = 0; i < (int)image->numcomps; i ++) {
channel_bufs[i] = dest_buf + offsets[i];
@@ -765,7 +765,7 @@ bool CJPX_Decoder::Decode(uint8_t* dest_buf, int pitch, bool bTranslateColor, ui
}
}
}
- result = true;
+ result = TRUE;
done:
FX_Free(channel_bufs);
@@ -778,7 +778,7 @@ void initialize_sign_lut();
CCodec_JpxModule::CCodec_JpxModule()
{
}
-void* CCodec_JpxModule::CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size , bool useColorSpace)
+void* CCodec_JpxModule::CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size , FX_BOOL useColorSpace)
{
CJPX_Decoder* pDecoder = new CJPX_Decoder;
pDecoder->m_useColorSpace = useColorSpace;
@@ -794,7 +794,7 @@ void CCodec_JpxModule::GetImageInfo(void* ctx, FX_DWORD& width, FX_DWORD& height
CJPX_Decoder* pDecoder = (CJPX_Decoder*)ctx;
pDecoder->GetInfo(width, height, codestream_nComps, output_nComps);
}
-bool CCodec_JpxModule::Decode(void* ctx, uint8_t* dest_data, int pitch, bool bTranslateColor, uint8_t* offsets)
+FX_BOOL CCodec_JpxModule::Decode(void* ctx, uint8_t* dest_data, int pitch, FX_BOOL bTranslateColor, uint8_t* offsets)
{
CJPX_Decoder* pDecoder = (CJPX_Decoder*)ctx;
return pDecoder->Decode(dest_data, pitch, bTranslateColor, offsets);
diff --git a/core/src/fxcodec/jbig2/JBig2_BitStream.h b/core/src/fxcodec/jbig2/JBig2_BitStream.h
index fcd11f4ddf..ff0b9fcfeb 100644
--- a/core/src/fxcodec/jbig2/JBig2_BitStream.h
+++ b/core/src/fxcodec/jbig2/JBig2_BitStream.h
@@ -23,7 +23,7 @@ public:
int32_t read1Bit(FX_DWORD *dwResult);
- int32_t read1Bit(bool *bResult);
+ int32_t read1Bit(FX_BOOL *bResult);
int32_t read1Byte(uint8_t *cResult);
@@ -165,7 +165,7 @@ inline int32_t CJBig2_BitStream::read1Bit(FX_DWORD *dwResult)
}
}
-inline int32_t CJBig2_BitStream::read1Bit(bool *bResult)
+inline int32_t CJBig2_BitStream::read1Bit(FX_BOOL *bResult)
{
if(m_dwByteIdx < m_dwLength) {
*bResult = (m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01;
diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp
index 0b71c475c2..68c973547c 100644
--- a/core/src/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Context.cpp
@@ -47,7 +47,7 @@ CJBig2_Context::CJBig2_Context(uint8_t *pGlobalData, FX_DWORD dwGlobalLength,
JBIG2_ALLOC(m_pSegmentList, CJBig2_List<CJBig2_Segment>);
JBIG2_ALLOC(m_pPageInfoList, CJBig2_List<JBig2PageInfo>(1));
m_pPage = NULL;
- m_bBufSpecified = false;
+ m_bBufSpecified = FALSE;
m_pPause = pPause;
m_nSegmentDecoded = 0;
m_PauseStep = 10;
@@ -231,11 +231,11 @@ int32_t CJBig2_Context::getFirstPage(uint8_t *pBuf, int32_t width, int32_t heigh
return nRet;
}
}
- m_bFirstPage = true;
+ m_bFirstPage = TRUE;
m_PauseStep = 0;
delete m_pPage;
JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf));
- m_bBufSpecified = true;
+ m_bBufSpecified = TRUE;
if(m_pPage && pPause && pPause->NeedToPauseNow()) {
m_PauseStep = 1;
m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
@@ -298,11 +298,11 @@ int32_t CJBig2_Context::Continue(IFX_Pause* pPause)
int32_t CJBig2_Context::getNextPage(uint8_t *pBuf, int32_t width, int32_t height, int32_t stride, IFX_Pause* pPause)
{
int32_t nRet = JBIG2_ERROR_STREAM_TYPE;
- m_bFirstPage = false;
+ m_bFirstPage = FALSE;
m_PauseStep = 0;
delete m_pPage;
JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf));
- m_bBufSpecified = true;
+ m_bBufSpecified = TRUE;
if(m_pPage && pPause && pPause->NeedToPauseNow()) {
m_PauseStep = 1;
m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
@@ -330,7 +330,7 @@ int32_t CJBig2_Context::getNextPage(uint8_t *pBuf, int32_t width, int32_t height
int32_t CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause)
{
int32_t nRet;
- m_bFirstPage = true;
+ m_bFirstPage = TRUE;
m_PauseStep = 0;
if(m_pGlobalContext) {
nRet = m_pGlobalContext->decode_EmbedOrgnazation(pPause);
@@ -338,14 +338,14 @@ int32_t CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause)
return nRet;
}
}
- m_bBufSpecified = false;
+ m_bBufSpecified = FALSE;
return Continue(pPause);
}
int32_t CJBig2_Context::getNextPage(CJBig2_Image **image, IFX_Pause* pPause)
{
int32_t nRet;
- m_bBufSpecified = false;
- m_bFirstPage = false;
+ m_bBufSpecified = FALSE;
+ m_bFirstPage = FALSE;
m_PauseStep = 0;
switch(m_nStreamType) {
case JBIG2_FILE_STREAM:
@@ -601,14 +601,14 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa
CJBig2_HuffmanTable *Table_B1 = NULL, *Table_B2 = NULL, *Table_B3 = NULL, *Table_B4 = NULL, *Table_B5 = NULL;
int32_t i, nIndex, nRet;
CJBig2_Segment *pSeg = NULL, *pLRSeg = NULL;
- bool bUsed;
+ FX_BOOL bUsed;
CJBig2_Image ** SDINSYMS = NULL;
CJBig2_SDDProc *pSymbolDictDecoder;
JBig2ArithCtx *gbContext = NULL, *grContext = NULL;
CJBig2_ArithDecoder *pArithDecoder;
JBIG2_ALLOC(pSymbolDictDecoder, CJBig2_SDDProc());
uint8_t *key = pSegment->m_pData;
- bool cache_hit = false;
+ FX_BOOL cache_hit = false;
if(m_pStream->readShortInteger(&wFlags) != 0) {
m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
nRet = JBIG2_ERROR_TOO_SHORT;
@@ -825,16 +825,16 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa
}
}
if(wFlags & 0x0200) {
- pSegment->m_Result.sd->m_bContextRetained = true;
+ pSegment->m_Result.sd->m_bContextRetained = TRUE;
if(pSymbolDictDecoder->SDHUFF == 0) {
pSegment->m_Result.sd->m_gbContext = gbContext;
}
if(pSymbolDictDecoder->SDREFAGG == 1) {
pSegment->m_Result.sd->m_grContext = grContext;
}
- bUsed = true;
+ bUsed = TRUE;
} else {
- bUsed = false;
+ bUsed = FALSE;
}
delete pSymbolDictDecoder;
if(SDINSYMS) {
@@ -845,7 +845,7 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa
delete Table_B3;
delete Table_B4;
delete Table_B5;
- if(bUsed == false) {
+ if(bUsed == FALSE) {
if(gbContext) {
m_pModule->JBig2_Free(gbContext);
}
diff --git a/core/src/fxcodec/jbig2/JBig2_Context.h b/core/src/fxcodec/jbig2/JBig2_Context.h
index 02d4192ee9..e6a0d7b3bc 100644
--- a/core/src/fxcodec/jbig2/JBig2_Context.h
+++ b/core/src/fxcodec/jbig2/JBig2_Context.h
@@ -123,13 +123,13 @@ private:
CJBig2_Image *m_pPage;
- bool m_bBufSpecified;
+ FX_BOOL m_bBufSpecified;
int32_t m_nSegmentDecoded;
IFX_Pause* m_pPause;
int32_t m_PauseStep;
FXCODEC_STATUS m_ProcessiveStatus;
- bool m_bFirstPage;
+ FX_BOOL m_bFirstPage;
CJBig2_ArithDecoder *m_pArithDecoder;
CJBig2_GRDProc *m_pGRD;
JBig2ArithCtx *m_gbContext;
diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
index 1e338a5f60..cabcd4c634 100644
--- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
@@ -101,7 +101,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2, line3;
@@ -146,7 +146,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt(CJBig2_ArithDecoder *pA
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2;
@@ -213,7 +213,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt2(CJBig2_ArithDecoder *p
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2;
@@ -305,7 +305,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_ArithDecoder *p
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2, line3;
@@ -352,7 +352,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_ArithDecoder *
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2, line3;
@@ -397,7 +397,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt(CJBig2_ArithDecoder *pA
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2;
@@ -464,7 +464,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt2(CJBig2_ArithDecoder *p
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2;
@@ -555,7 +555,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_ArithDecoder *p
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2, line3;
@@ -600,7 +600,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_ArithDecoder *
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2, line3;
@@ -643,7 +643,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt(CJBig2_ArithDecoder *pA
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2;
@@ -710,7 +710,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt2(CJBig2_ArithDecoder *p
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2;
@@ -801,7 +801,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_ArithDecoder *p
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2, line3;
@@ -844,7 +844,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_ArithDecoder *
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2;
@@ -883,7 +883,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt(CJBig2_ArithDecoder *pA
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1;
@@ -941,7 +941,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt2(CJBig2_ArithDecoder *p
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1;
@@ -1017,7 +1017,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_ArithDecoder *p
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2;
@@ -1056,7 +1056,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_ArithDecoder *
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_V2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG;
FX_DWORD line1, line2, line3;
@@ -1195,7 +1195,7 @@ CJBig2_Image *CJBig2_GRDProc::decode_Arith_V2(CJBig2_ArithDecoder *pArithDecoder
}
CJBig2_Image *CJBig2_GRDProc::decode_Arith_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT = 0;
CJBig2_Image *GBREG;
LTP = 0;
@@ -1340,7 +1340,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode(CJBig2_ArithDecoder *pArithDecoder, JBig2A
}
CJBig2_Image *CJBig2_GRRDProc::decode_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GRREG;
FX_DWORD line1, line2, line3, line4, line5;
@@ -1424,7 +1424,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_unopt(CJBig2_ArithDecoder *pArit
}
CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GRREG;
FX_DWORD line1, line1_r, line2_r, line3_r;
@@ -1459,9 +1459,9 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithD
}
line1 = (h > 0) ? pLine[-nStride] << 4 : 0;
int32_t reference_h = h - GRREFERENCEDY;
- bool line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1);
- bool line2_r_ok = (reference_h > -1 && reference_h < GRHR);
- bool line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1);
+ FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1);
+ FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR);
+ FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1);
line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0;
line2_r = line2_r_ok ? pLineR[nOffset] : 0;
line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0;
@@ -1555,7 +1555,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithD
}
CJBig2_Image *CJBig2_GRRDProc::decode_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GRREG;
FX_DWORD line1, line2, line3, line4, line5;
@@ -1633,7 +1633,7 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_unopt(CJBig2_ArithDecoder *pArit
}
CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
{
- bool LTP, SLTP, bVal;
+ FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GRREG;
FX_DWORD line1, line1_r, line2_r, line3_r;
@@ -1668,9 +1668,9 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithD
}
line1 = (h > 0) ? pLine[-nStride] << 1 : 0;
int32_t reference_h = h - GRREFERENCEDY;
- bool line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1);
- bool line2_r_ok = (reference_h > -1 && reference_h < GRHR);
- bool line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1);
+ FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1);
+ FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR);
+ FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1);
line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0;
line2_r = line2_r_ok ? pLineR[nOffset] : 0;
line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0;
@@ -1758,8 +1758,8 @@ CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithD
}
CJBig2_Image *CJBig2_GRRDProc::decode_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
{
- bool LTP, SLTP, bVal;
- bool TPGRPIX, TPGRVAL;
+ FX_BOOL LTP, SLTP, bVal;
+ FX_BOOL TPGRPIX, TPGRVAL;
FX_DWORD CONTEXT;
CJBig2_Image *GRREG;
LTP = 0;
@@ -1881,12 +1881,12 @@ CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2Ari
CJBig2_Image *IBI;
FX_DWORD WI, HI;
int32_t IDS;
- bool RI;
+ FX_BOOL RI;
int32_t RDWI, RDHI, RDXI, RDYI;
CJBig2_Image *IBOI;
FX_DWORD WOI, HOI;
CJBig2_Image *SBREG;
- bool bFirst;
+ FX_BOOL bFirst;
FX_DWORD nTmp;
int32_t nVal, nBits;
CJBig2_HuffmanDecoder *pHuffmanDecoder;
@@ -1910,7 +1910,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2Ari
}
DT *= SBSTRIPS;
STRIPT = STRIPT + DT;
- bFirst = true;
+ bFirst = TRUE;
for(;;) {
if(bFirst) {
if(pHuffmanDecoder->decodeAValue(SBHUFFFS, &DFS) != 0) {
@@ -1919,7 +1919,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2Ari
}
FIRSTS = FIRSTS + DFS;
CURS = FIRSTS;
- bFirst = false;
+ bFirst = FALSE;
} else {
nVal = pHuffmanDecoder->decodeAValue(SBHUFFDS, &IDS);
if(nVal == JBIG2_OOB) {
@@ -2106,7 +2106,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J
CJBig2_Image *IBOI;
FX_DWORD WOI, HOI;
CJBig2_Image *SBREG;
- bool bFirst;
+ FX_BOOL bFirst;
int32_t nRet, nVal;
int32_t bRetained;
CJBig2_ArithIntDecoder *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH, *IARDX, *IARDY;
@@ -2123,7 +2123,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J
IARDX = pIDS->IARDX;
IARDY = pIDS->IARDY;
IAID = pIDS->IAID;
- bRetained = true;
+ bRetained = TRUE;
} else {
JBIG2_ALLOC(IADT, CJBig2_ArithIntDecoder());
JBIG2_ALLOC(IAFS, CJBig2_ArithIntDecoder());
@@ -2135,7 +2135,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J
JBIG2_ALLOC(IARDX, CJBig2_ArithIntDecoder());
JBIG2_ALLOC(IARDY, CJBig2_ArithIntDecoder());
JBIG2_ALLOC(IAID , CJBig2_ArithIaidDecoder(SBSYMCODELEN));
- bRetained = false;
+ bRetained = FALSE;
}
JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH));
SBREG->fill(SBDEFPIXEL);
@@ -2154,7 +2154,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J
}
DT *= SBSTRIPS;
STRIPT = STRIPT + DT;
- bFirst = true;
+ bFirst = TRUE;
for(;;) {
if(bFirst) {
if(IAFS->decode(pArithDecoder, &DFS) == -1) {
@@ -2163,7 +2163,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J
}
FIRSTS = FIRSTS + DFS;
CURS = FIRSTS;
- bFirst = false;
+ bFirst = FALSE;
} else {
nRet = IADS->decode(pArithDecoder, &IDS);
if(nRet == JBIG2_OOB) {
@@ -2299,7 +2299,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J
NINSTANCES = NINSTANCES + 1;
}
}
- if(bRetained == false) {
+ if(bRetained == FALSE) {
delete IADT;
delete IAFS;
delete IADS;
@@ -2313,7 +2313,7 @@ CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, J
}
return SBREG;
failed:
- if(bRetained == false) {
+ if(bRetained == FALSE) {
delete IADT;
delete IAFS;
delete IADS;
@@ -2338,9 +2338,9 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecod
int32_t DW;
CJBig2_Image *BS;
FX_DWORD I, J, REFAGGNINST;
- bool *EXFLAGS;
+ FX_BOOL *EXFLAGS;
FX_DWORD EXINDEX;
- bool CUREXFLAG;
+ FX_BOOL CUREXFLAG;
FX_DWORD EXRUNLENGTH;
int32_t nVal;
FX_DWORD nTmp;
@@ -2585,7 +2585,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecod
}
EXINDEX = 0;
CUREXFLAG = 0;
- EXFLAGS = (bool*)m_pModule->JBig2_Malloc2(sizeof(bool), (SDNUMINSYMS + SDNUMNEWSYMS));
+ EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), (SDNUMINSYMS + SDNUMNEWSYMS));
while(EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) {
if(IAEX->decode(pArithDecoder, (int*)&EXRUNLENGTH) == -1) {
m_pModule->JBig2_Free(EXFLAGS);
@@ -2676,9 +2676,9 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream,
int32_t DW;
CJBig2_Image *BS, *BHC;
FX_DWORD I, J, REFAGGNINST;
- bool *EXFLAGS;
+ FX_BOOL *EXFLAGS;
FX_DWORD EXINDEX;
- bool CUREXFLAG;
+ FX_BOOL CUREXFLAG;
FX_DWORD EXRUNLENGTH;
int32_t nVal, nBits;
FX_DWORD nTmp;
@@ -2976,7 +2976,7 @@ CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream,
CUREXFLAG = 0;
JBIG2_ALLOC(pTable, CJBig2_HuffmanTable(HuffmanTable_B1,
sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
- EXFLAGS = (bool*)m_pModule->JBig2_Malloc2(sizeof(bool), (SDNUMINSYMS + SDNUMNEWSYMS));
+ EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), (SDNUMINSYMS + SDNUMNEWSYMS));
while(EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) {
if(pHuffmanDecoder->decodeAValue(pTable, (int*)&EXRUNLENGTH) != 0) {
delete pTable;
@@ -3477,7 +3477,7 @@ FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith_V2(CJBig2_Image** pImage, CJBi
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_V2(IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
CJBig2_Image *GBREG = *m_pImage;
FX_DWORD line1, line2, line3;
@@ -3650,7 +3650,7 @@ FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith_V1(CJBig2_Image** pImage, CJBi
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_V1(IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT = 0;
CJBig2_Image *GBREG = (*m_pImage);
for(; m_loopIndex < GBH; m_loopIndex++) {
@@ -3799,7 +3799,7 @@ FXCODEC_STATUS CJBig2_GRDProc::Continue_decode(IFX_Pause* pPause)
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line2;
uint8_t *pLine1, *pLine2, cVal;
@@ -3891,7 +3891,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_Image *pImage,
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line2, line3;
for(; m_loopIndex < GBH; m_loopIndex++) {
@@ -3940,7 +3940,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_Image * pImag
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line2;
uint8_t *pLine1, *pLine2, cVal;
@@ -4031,7 +4031,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_Image *pImage,
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line2, line3;
for(FX_DWORD h = 0; h < GBH; h++) {
@@ -4078,7 +4078,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_Image * pImag
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line2;
uint8_t *pLine1, *pLine2, cVal;
@@ -4169,7 +4169,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_Image *pImage,
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line2, line3;
for(; m_loopIndex < GBH; m_loopIndex++) {
@@ -4214,7 +4214,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_Image * pImag
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1;
uint8_t *pLine1, cVal;
@@ -4290,7 +4290,7 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_Image *pImage,
}
FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
{
- bool SLTP, bVal;
+ FX_BOOL SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line2;
for(; m_loopIndex < GBH; m_loopIndex++) {
diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h
index f348e96546..2bd2ceac95 100644
--- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h
+++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h
@@ -76,7 +76,7 @@ private:
CJBig2_ArithDecoder *m_pArithDecoder;
JBig2ArithCtx *m_gbContext;
FX_WORD m_DecodeType;
- bool LTP;
+ FX_BOOL LTP;
FX_RECT m_ReplaceRect;
private:
@@ -112,12 +112,12 @@ private:
CJBig2_Image *decode_Arith_Template3_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
public:
- bool MMR;
+ FX_BOOL MMR;
FX_DWORD GBW;
FX_DWORD GBH;
uint8_t GBTEMPLATE;
- bool TPGDON;
- bool USESKIP;
+ FX_BOOL TPGDON;
+ FX_BOOL USESKIP;
CJBig2_Image * SKIP;
signed char GBAT[8];
};
@@ -139,11 +139,11 @@ public:
public:
FX_DWORD GRW;
FX_DWORD GRH;
- bool GRTEMPLATE;
+ FX_BOOL GRTEMPLATE;
CJBig2_Image *GRREFERENCE;
int32_t GRREFERENCEDX;
int32_t GRREFERENCEDY;
- bool TPGRON;
+ FX_BOOL TPGRON;
signed char GRAT[4];
};
typedef struct {
@@ -167,8 +167,8 @@ public:
CJBig2_Image *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext,
JBig2IntDecoderState *pIDS = NULL);
public:
- bool SBHUFF;
- bool SBREFINE;
+ FX_BOOL SBHUFF;
+ FX_BOOL SBREFINE;
FX_DWORD SBW;
FX_DWORD SBH;
FX_DWORD SBNUMINSTANCES;
@@ -179,10 +179,10 @@ public:
uint8_t SBSYMCODELEN;
CJBig2_Image **SBSYMS;
- bool SBDEFPIXEL;
+ FX_BOOL SBDEFPIXEL;
JBig2ComposeOp SBCOMBOP;
- bool TRANSPOSED;
+ FX_BOOL TRANSPOSED;
JBig2Corner REFCORNER;
signed char SBDSOFFSET;
@@ -194,7 +194,7 @@ public:
*SBHUFFRDX,
*SBHUFFRDY,
*SBHUFFRSIZE;
- bool SBRTEMPLATE;
+ FX_BOOL SBRTEMPLATE;
signed char SBRAT[4];
};
class CJBig2_SDDProc : public CJBig2_Object
@@ -205,8 +205,8 @@ public:
CJBig2_SymbolDict *decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext, IFX_Pause* pPause);
public:
- bool SDHUFF;
- bool SDREFAGG;
+ FX_BOOL SDHUFF;
+ FX_BOOL SDREFAGG;
FX_DWORD SDNUMINSYMS;
CJBig2_Image ** SDINSYMS;
FX_DWORD SDNUMNEWSYMS;
@@ -217,7 +217,7 @@ public:
*SDHUFFAGGINST;
uint8_t SDTEMPLATE;
signed char SDAT[8];
- bool SDRTEMPLATE;
+ FX_BOOL SDRTEMPLATE;
signed char SDRAT[4];
};
class CJBig2_HTRDProc : public CJBig2_Object
@@ -230,13 +230,13 @@ public:
public:
FX_DWORD HBW,
HBH;
- bool HMMR;
+ FX_BOOL HMMR;
uint8_t HTEMPLATE;
FX_DWORD HNUMPATS;
CJBig2_Image **HPATS;
- bool HDEFPIXEL;
+ FX_BOOL HDEFPIXEL;
JBig2ComposeOp HCOMBOP;
- bool HENABLESKIP;
+ FX_BOOL HENABLESKIP;
FX_DWORD HGW,
HGH;
int32_t HGX,
@@ -254,7 +254,7 @@ public:
CJBig2_PatternDict *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause);
public:
- bool HDMMR;
+ FX_BOOL HDMMR;
uint8_t HDPW,
HDPH;
FX_DWORD GRAYMAX;
@@ -268,8 +268,8 @@ public:
FX_DWORD *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause);
public:
- bool GSMMR;
- bool GSUSESKIP;
+ FX_BOOL GSMMR;
+ FX_BOOL GSUSESKIP;
uint8_t GSBPP;
FX_DWORD GSW,
GSH;
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp
index 4932e571f2..0616123c1e 100644
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp
@@ -9,7 +9,7 @@
#include <string.h>
CJBig2_HuffmanTable::CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines,
- bool bHTOOB)
+ FX_BOOL bHTOOB)
{
init();
m_bOK = parseFromStandardTable(pTable, nLines, bHTOOB);
@@ -38,14 +38,14 @@ CJBig2_HuffmanTable::~CJBig2_HuffmanTable()
}
void CJBig2_HuffmanTable::init()
{
- HTOOB = false;
+ HTOOB = FALSE;
NTEMP = 0;
CODES = NULL;
PREFLEN = NULL;
RANGELEN = NULL;
RANGELOW = NULL;
}
-int CJBig2_HuffmanTable::parseFromStandardTable(const JBig2TableLine *pTable, int nLines, bool bHTOOB)
+int CJBig2_HuffmanTable::parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB)
{
int CURLEN, LENMAX, CURCODE, CURTEMP, i;
int *LENCOUNT;
@@ -188,7 +188,7 @@ int CJBig2_HuffmanTable::parseFromCodedBuffer(CJBig2_BitStream *pStream)
}
m_pModule->JBig2_Free(LENCOUNT);
m_pModule->JBig2_Free(FIRSTCODE);
- return true;
+ return TRUE;
failed:
- return false;
+ return FALSE;
}
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h
index d6bc3d1c4b..d68ced2fca 100644
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h
@@ -13,7 +13,7 @@ class CJBig2_HuffmanTable : public CJBig2_Object
{
public:
- CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines, bool bHTOOB);
+ CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB);
CJBig2_HuffmanTable(CJBig2_BitStream *pStream);
@@ -21,22 +21,22 @@ public:
void init();
- int parseFromStandardTable(const JBig2TableLine *pTable, int nLines, bool bHTOOB);
+ int parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB);
int parseFromCodedBuffer(CJBig2_BitStream *pStream);
- bool isOK()
+ FX_BOOL isOK()
{
return m_bOK;
}
private:
- bool HTOOB;
+ FX_BOOL HTOOB;
int NTEMP;
int *CODES;
int *PREFLEN;
int *RANGELEN;
int *RANGELOW;
- bool m_bOK;
+ FX_BOOL m_bOK;
friend class CJBig2_HuffmanDecoder;
};
#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h b/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h
index c08d2456d4..428b2c3671 100644
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h
@@ -11,7 +11,7 @@ typedef struct {
int RANDELEN;
int RANGELOW;
} JBig2TableLine;
-const bool HuffmanTable_HTOOB_B1 = false;
+const FX_BOOL HuffmanTable_HTOOB_B1 = FALSE;
const JBig2TableLine HuffmanTable_B1[] = {
{ 1, 4, 0 },
{ 2, 8, 16 },
@@ -19,7 +19,7 @@ const JBig2TableLine HuffmanTable_B1[] = {
{ 0, 32, -1 },
{ 3, 32, 65808 }
};
-const bool HuffmanTable_HTOOB_B2 = true;
+const FX_BOOL HuffmanTable_HTOOB_B2 = TRUE;
const JBig2TableLine HuffmanTable_B2[] = {
{ 1, 0, 0 },
{ 2, 0, 1 },
@@ -30,7 +30,7 @@ const JBig2TableLine HuffmanTable_B2[] = {
{ 6, 32, 75 },
{ 6, 0, 0 }
};
-const bool HuffmanTable_HTOOB_B3 = true;
+const FX_BOOL HuffmanTable_HTOOB_B3 = TRUE;
const JBig2TableLine HuffmanTable_B3[] = {
{ 8, 8, -256 },
{ 1, 0, 0 },
@@ -42,7 +42,7 @@ const JBig2TableLine HuffmanTable_B3[] = {
{ 7, 32, 75 },
{ 6, 0, 0 }
};
-const bool HuffmanTable_HTOOB_B4 = false;
+const FX_BOOL HuffmanTable_HTOOB_B4 = FALSE;
const JBig2TableLine HuffmanTable_B4[] = {
{ 1, 0, 1 },
{ 2, 0, 2 },
@@ -52,7 +52,7 @@ const JBig2TableLine HuffmanTable_B4[] = {
{ 0, 32, -1 },
{ 5, 32, 76 },
};
-const bool HuffmanTable_HTOOB_B5 = false;
+const FX_BOOL HuffmanTable_HTOOB_B5 = FALSE;
const JBig2TableLine HuffmanTable_B5[] = {
{ 7, 8, -255 },
{ 1, 0, 1 },
@@ -63,7 +63,7 @@ const JBig2TableLine HuffmanTable_B5[] = {
{ 7, 32, -256 },
{ 6, 32, 76 }
};
-const bool HuffmanTable_HTOOB_B6 = false;
+const FX_BOOL HuffmanTable_HTOOB_B6 = FALSE;
const JBig2TableLine HuffmanTable_B6[] = {
{ 5, 10, -2048 },
{ 4, 9, -1024 },
@@ -80,7 +80,7 @@ const JBig2TableLine HuffmanTable_B6[] = {
{ 6, 32, -2049 },
{ 6, 32, 2048 }
};
-const bool HuffmanTable_HTOOB_B7 = false;
+const FX_BOOL HuffmanTable_HTOOB_B7 = FALSE;
const JBig2TableLine HuffmanTable_B7[] = {
{ 4, 9, -1024 },
{ 3, 8, -512 },
@@ -98,7 +98,7 @@ const JBig2TableLine HuffmanTable_B7[] = {
{ 5, 32, -1025 },
{ 5, 32, 2048 },
};
-const bool HuffmanTable_HTOOB_B8 = true;
+const FX_BOOL HuffmanTable_HTOOB_B8 = TRUE;
const JBig2TableLine HuffmanTable_B8[] = {
{ 8, 3, -15 },
{ 9, 1, -7 },
@@ -122,7 +122,7 @@ const JBig2TableLine HuffmanTable_B8[] = {
{ 9, 32, 1670 },
{ 2, 0, 0 }
};
-const bool HuffmanTable_HTOOB_B9 = true;
+const FX_BOOL HuffmanTable_HTOOB_B9 = TRUE;
const JBig2TableLine HuffmanTable_B9[] = {
{ 8, 4, -31 },
{ 9, 2, -15 },
@@ -147,7 +147,7 @@ const JBig2TableLine HuffmanTable_B9[] = {
{ 9, 32, 3339 },
{ 2, 0, 0 }
};
-const bool HuffmanTable_HTOOB_B10 = true;
+const FX_BOOL HuffmanTable_HTOOB_B10 = TRUE;
const JBig2TableLine HuffmanTable_B10[] = {
{ 7, 4, -21 },
{ 8, 0, -5 },
@@ -171,7 +171,7 @@ const JBig2TableLine HuffmanTable_B10[] = {
{ 8, 32, 4166 },
{ 2, 0, 0 }
};
-const bool HuffmanTable_HTOOB_B11 = false;
+const FX_BOOL HuffmanTable_HTOOB_B11 = FALSE;
const JBig2TableLine HuffmanTable_B11[] = {
{ 1, 0, 1 },
{ 2, 1, 2 },
@@ -188,7 +188,7 @@ const JBig2TableLine HuffmanTable_B11[] = {
{ 0, 32, 0 },
{ 7, 32, 141 }
};
-const bool HuffmanTable_HTOOB_B12 = false;
+const FX_BOOL HuffmanTable_HTOOB_B12 = FALSE;
const JBig2TableLine HuffmanTable_B12[] = {
{ 1, 0, 1 },
{ 2, 0, 2 },
@@ -205,7 +205,7 @@ const JBig2TableLine HuffmanTable_B12[] = {
{ 0, 32, 0 },
{ 8, 32, 73 }
};
-const bool HuffmanTable_HTOOB_B13 = false;
+const FX_BOOL HuffmanTable_HTOOB_B13 = FALSE;
const JBig2TableLine HuffmanTable_B13[] = {
{ 1, 0, 1 },
{ 3, 0, 2 },
@@ -222,7 +222,7 @@ const JBig2TableLine HuffmanTable_B13[] = {
{ 0, 32, 0 },
{ 7, 32, 141 }
};
-const bool HuffmanTable_HTOOB_B14 = false;
+const FX_BOOL HuffmanTable_HTOOB_B14 = FALSE;
const JBig2TableLine HuffmanTable_B14[] = {
{ 3, 0, -2 },
{ 3, 0, -1 },
@@ -232,7 +232,7 @@ const JBig2TableLine HuffmanTable_B14[] = {
{ 0, 32, -3 },
{ 0, 32, 3 }
};
-const bool HuffmanTable_HTOOB_B15 = false;
+const FX_BOOL HuffmanTable_HTOOB_B15 = FALSE;
const JBig2TableLine HuffmanTable_B15[] = {
{ 7, 4, -24 },
{ 6, 2, -8 },
diff --git a/core/src/fxcodec/jbig2/JBig2_Image.cpp b/core/src/fxcodec/jbig2/JBig2_Image.cpp
index 030b0c2493..9ef4464ef0 100644
--- a/core/src/fxcodec/jbig2/JBig2_Image.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Image.cpp
@@ -16,7 +16,7 @@ CJBig2_Image::CJBig2_Image(int32_t w, int32_t h)
m_nHeight = h;
if (m_nWidth <= 0 || m_nHeight <= 0 || m_nWidth > INT_MAX - 31) {
m_pData = NULL;
- m_bNeedFree = false;
+ m_bNeedFree = FALSE;
return;
}
m_nStride = ((w + 31) >> 5) << 2;
@@ -25,7 +25,7 @@ CJBig2_Image::CJBig2_Image(int32_t w, int32_t h)
} else {
m_pData = NULL;
}
- m_bNeedFree = true;
+ m_bNeedFree = TRUE;
}
CJBig2_Image::CJBig2_Image(int32_t w, int32_t h, int32_t stride, uint8_t*pBuf)
{
@@ -33,7 +33,7 @@ CJBig2_Image::CJBig2_Image(int32_t w, int32_t h, int32_t stride, uint8_t*pBuf)
m_nHeight = h;
m_nStride = stride;
m_pData = pBuf;
- m_bNeedFree = false;
+ m_bNeedFree = FALSE;
}
CJBig2_Image::CJBig2_Image(CJBig2_Image &im)
{
@@ -47,7 +47,7 @@ CJBig2_Image::CJBig2_Image(CJBig2_Image &im)
} else {
m_pData = NULL;
}
- m_bNeedFree = true;
+ m_bNeedFree = TRUE;
}
CJBig2_Image::~CJBig2_Image()
{
@@ -55,7 +55,7 @@ CJBig2_Image::~CJBig2_Image()
m_pModule->JBig2_Free(m_pData);
}
}
-bool CJBig2_Image::getPixel(int32_t x, int32_t y)
+FX_BOOL CJBig2_Image::getPixel(int32_t x, int32_t y)
{
if (!m_pData) {
return 0;
@@ -72,7 +72,7 @@ bool CJBig2_Image::getPixel(int32_t x, int32_t y)
return ((m_pData[m] >> (7 - n)) & 1);
}
-int32_t CJBig2_Image::setPixel(int32_t x, int32_t y, bool v)
+int32_t CJBig2_Image::setPixel(int32_t x, int32_t y, FX_BOOL v)
{
if (!m_pData) {
return 0;
@@ -104,31 +104,31 @@ void CJBig2_Image::copyLine(int32_t hTo, int32_t hFrom)
JBIG2_memcpy(m_pData + hTo * m_nStride, m_pData + hFrom * m_nStride, m_nStride);
}
}
-void CJBig2_Image::fill(bool v)
+void CJBig2_Image::fill(FX_BOOL v)
{
if (!m_pData) {
return;
}
JBIG2_memset(m_pData, v ? 0xff : 0, m_nStride * m_nHeight);
}
-bool CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
+FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
{
if (!m_pData) {
- return false;
+ return FALSE;
}
return composeTo_opt2(pDst, x, y, op);
}
-bool CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect)
+FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect)
{
if (!m_pData) {
- return false;
+ return FALSE;
}
if (NULL == pSrcRect || *pSrcRect == FX_RECT(0, 0, m_nWidth, m_nHeight)) {
return composeTo_opt2(pDst, x, y, op);
}
return composeTo_opt2(pDst, x, y, op, pSrcRect);
}
-bool CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
+FX_BOOL CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
{
int32_t w, h, dx, dy;
int32_t i, j;
@@ -192,17 +192,17 @@ bool CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBi
}
break;
}
- return true;
+ return TRUE;
}
-bool CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
+FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
{
int32_t x0, x1, y0, y1, xx, yy;
uint8_t *pLineSrc, *pLineDst, *srcPtr, *destPtr;
FX_DWORD src0, src1, src, dest, s1, s2, m1, m2, m3;
- bool oneByte;
+ FX_BOOL oneByte;
if (!m_pData) {
- return false;
+ return FALSE;
}
if (y < 0) {
y0 = -y;
@@ -215,7 +215,7 @@ bool CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2
y1 = m_nHeight;
}
if (y0 >= y1) {
- return false;
+ return FALSE;
}
if (x >= 0) {
x0 = x & ~7;
@@ -227,7 +227,7 @@ bool CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2
x1 = pDst->m_nWidth;
}
if (x0 >= x1) {
- return false;
+ return FALSE;
}
s1 = x & 7;
s2 = 8 - s1;
@@ -679,19 +679,19 @@ bool CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2
}
}
}
- return true;
+ return TRUE;
}
-bool CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op)
+FX_BOOL CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op)
{
if (!m_pData) {
- return false;
+ return FALSE;
}
return pSrc->composeTo(this, x, y, op);
}
-bool CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect)
+FX_BOOL CJBig2_Image::composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect)
{
if (!m_pData) {
- return false;
+ return FALSE;
}
return pSrc->composeTo(this, x, y, op, pSrcRect);
}
@@ -765,7 +765,7 @@ CJBig2_Image *CJBig2_Image::subImage(int32_t x, int32_t y, int32_t w, int32_t h)
}
return pImage;
}
-void CJBig2_Image::expand(int32_t h, bool v)
+void CJBig2_Image::expand(int32_t h, FX_BOOL v)
{
if (!m_pData || h <= m_nHeight) {
return;
@@ -788,7 +788,7 @@ void CJBig2_Image::expand(int32_t h, bool v)
JBIG2_memset(m_pData + dwHeight * dwStride, v ? 0xff : 0, (dwH - dwHeight) * dwStride);
m_nHeight = h;
}
-bool CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
+FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op)
{
int32_t xs0 = 0, ys0 = 0, xs1 = 0, ys1 = 0, xd0 = 0, yd0 = 0, xd1 = 0,
yd1 = 0, xx = 0, yy = 0, w = 0, h = 0, middleDwords = 0, lineLeft = 0;
@@ -799,10 +799,10 @@ bool CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig
uint8_t *lineSrc = NULL, *lineDst = NULL, *sp = NULL, *dp = NULL;
if (!m_pData) {
- return false;
+ return FALSE;
}
if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) {
- return false;
+ return FALSE;
}
if(y < 0) {
ys0 = -y;
@@ -1205,17 +1205,17 @@ bool CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig
}
return 1;
}
-bool CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect)
+FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect)
{
int32_t xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft;
FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, maskM;
uint8_t *lineSrc, *lineDst, *sp, *dp;
int32_t sw, sh;
if (!m_pData) {
- return false;
+ return FALSE;
}
if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) {
- return false;
+ return FALSE;
}
sw = pSrcRect->Width();
sh = pSrcRect->Height();
diff --git a/core/src/fxcodec/jbig2/JBig2_Image.h b/core/src/fxcodec/jbig2/JBig2_Image.h
index d51d99907d..423bebcede 100644
--- a/core/src/fxcodec/jbig2/JBig2_Image.h
+++ b/core/src/fxcodec/jbig2/JBig2_Image.h
@@ -28,31 +28,31 @@ public:
~CJBig2_Image();
- bool getPixel(int32_t x, int32_t y);
+ FX_BOOL getPixel(int32_t x, int32_t y);
- int32_t setPixel(int32_t x, int32_t y, bool v);
+ int32_t setPixel(int32_t x, int32_t y, FX_BOOL v);
void copyLine(int32_t hTo, int32_t hFrom);
- void fill(bool v);
+ void fill(FX_BOOL v);
- bool composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op);
- bool composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect);
+ FX_BOOL composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op);
+ FX_BOOL composeTo(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect);
- bool composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op);
+ FX_BOOL composeTo_unopt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op);
- bool composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op);
+ FX_BOOL composeTo_opt(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op);
- bool composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op);
- bool composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect);
+ FX_BOOL composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op);
+ FX_BOOL composeTo_opt2(CJBig2_Image *pDst, int32_t x, int32_t y, JBig2ComposeOp op, const FX_RECT* pSrcRect);
- bool composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op);
- bool composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect);
+ FX_BOOL composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op);
+ FX_BOOL composeFrom(int32_t x, int32_t y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect);
CJBig2_Image *subImage_unopt(int32_t x, int32_t y, int32_t w, int32_t h);
CJBig2_Image *subImage(int32_t x, int32_t y, int32_t w, int32_t h);
- void expand(int32_t h, bool v);
+ void expand(int32_t h, FX_BOOL v);
public:
int32_t m_nWidth;
@@ -63,6 +63,6 @@ public:
uint8_t *m_pData;
- bool m_bNeedFree;
+ FX_BOOL m_bNeedFree;
};
#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Page.h b/core/src/fxcodec/jbig2/JBig2_Page.h
index b4e159f2a2..b07eba8a3a 100644
--- a/core/src/fxcodec/jbig2/JBig2_Page.h
+++ b/core/src/fxcodec/jbig2/JBig2_Page.h
@@ -13,7 +13,7 @@ struct JBig2PageInfo : public CJBig2_Object {
FX_DWORD m_dwResolutionX,
m_dwResolutionY;
uint8_t m_cFlags;
- bool m_bIsStriped;
+ FX_BOOL m_bIsStriped;
FX_WORD m_wMaxStripeSize;
};
#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
index c10d461623..0e5b92ff5a 100644
--- a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
@@ -9,7 +9,7 @@ CJBig2_SymbolDict::CJBig2_SymbolDict()
{
SDNUMEXSYMS = 0;
SDEXSYMS = NULL;
- m_bContextRetained = false;
+ m_bContextRetained = FALSE;
m_gbContext = m_grContext = NULL;
}
diff --git a/core/src/fxcodec/jbig2/JBig2_SymbolDict.h b/core/src/fxcodec/jbig2/JBig2_SymbolDict.h
index 5f94dc7be8..9156e30ea8 100644
--- a/core/src/fxcodec/jbig2/JBig2_SymbolDict.h
+++ b/core/src/fxcodec/jbig2/JBig2_SymbolDict.h
@@ -19,7 +19,7 @@ public:
public:
FX_DWORD SDNUMEXSYMS;
CJBig2_Image **SDEXSYMS;
- bool m_bContextRetained;
+ FX_BOOL m_bContextRetained;
JBig2ArithCtx *m_gbContext,
*m_grContext;
};
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index 2d7f3ae220..ba42916599 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -14,8 +14,8 @@ class IFXCRT_FileAccess
{
public:
virtual ~IFXCRT_FileAccess() {}
- virtual bool Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) = 0;
- virtual bool Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) = 0;
+ virtual FX_BOOL Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) = 0;
+ virtual FX_BOOL Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) = 0;
virtual void Close() = 0;
virtual void Release() = 0;
virtual FX_FILESIZE GetSize() const = 0;
@@ -25,14 +25,14 @@ public:
virtual size_t Write(const void* pBuffer, size_t szBuffer) = 0;
virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0;
virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0;
- virtual bool Flush() = 0;
- virtual bool Truncate(FX_FILESIZE szFile) = 0;
+ virtual FX_BOOL Flush() = 0;
+ virtual FX_BOOL Truncate(FX_FILESIZE szFile) = 0;
};
IFXCRT_FileAccess* FXCRT_FileAccess_Create();
class CFX_CRTFileStream final : public IFX_FileStream
{
public:
- CFX_CRTFileStream(IFXCRT_FileAccess* pFA) : m_pFile(pFA), m_dwCount(1), m_bUseRange(false), m_nOffset(0), m_nSize(0) {}
+ CFX_CRTFileStream(IFXCRT_FileAccess* pFA) : m_pFile(pFA), m_dwCount(1), m_bUseRange(FALSE), m_nOffset(0), m_nSize(0) {}
~CFX_CRTFileStream()
{
if (m_pFile) {
@@ -55,7 +55,7 @@ public:
{
return m_bUseRange ? m_nSize : m_pFile->GetSize();
}
- virtual bool IsEOF() override
+ virtual FX_BOOL IsEOF() override
{
return GetPosition() >= GetSize();
}
@@ -67,42 +67,42 @@ public:
}
return pos;
}
- virtual bool SetRange(FX_FILESIZE offset, FX_FILESIZE size) override
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) override
{
if (offset < 0 || size < 0) {
- return false;
+ return FALSE;
}
FX_SAFE_FILESIZE pos = size;
pos += offset;
if (!pos.IsValid() || pos.ValueOrDie() > m_pFile->GetSize()) {
- return false;
+ return FALSE;
}
m_nOffset = offset, m_nSize = size;
- m_bUseRange = true;
+ m_bUseRange = TRUE;
m_pFile->SetPosition(m_nOffset);
- return true;
+ return TRUE;
}
virtual void ClearRange() override
{
- m_bUseRange = false;
+ m_bUseRange = FALSE;
}
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override
{
if (m_bUseRange && offset < 0) {
- return false;
+ return FALSE;
}
FX_SAFE_FILESIZE pos = offset;
if (m_bUseRange) {
pos += m_nOffset;
if (!pos.IsValid() || pos.ValueOrDie() > (size_t)GetSize()) {
- return false;
+ return FALSE;
}
}
- return (bool)m_pFile->ReadPos(buffer, size, pos.ValueOrDie());
+ return (FX_BOOL)m_pFile->ReadPos(buffer, size, pos.ValueOrDie());
}
virtual size_t ReadBlock(void* buffer, size_t size) override
{
@@ -114,20 +114,20 @@ public:
}
return m_pFile->Read(buffer, size);
}
- virtual bool WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override
{
if (m_bUseRange) {
offset += m_nOffset;
}
- return (bool)m_pFile->WritePos(buffer, size, offset);
+ return (FX_BOOL)m_pFile->WritePos(buffer, size, offset);
}
- virtual bool Flush() override
+ virtual FX_BOOL Flush() override
{
return m_pFile->Flush();
}
IFXCRT_FileAccess* m_pFile;
FX_DWORD m_dwCount;
- bool m_bUseRange;
+ FX_BOOL m_bUseRange;
FX_FILESIZE m_nOffset;
FX_FILESIZE m_nSize;
};
@@ -137,23 +137,23 @@ public:
class CFX_MemoryStream final : public IFX_MemoryStream
{
public:
- CFX_MemoryStream(bool bConsecutive)
+ CFX_MemoryStream(FX_BOOL bConsecutive)
: m_dwCount(1)
, m_nTotalSize(0)
, m_nCurSize(0)
, m_nCurPos(0)
, m_nGrowSize(FX_MEMSTREAM_BlockSize)
- , m_bUseRange(false)
+ , m_bUseRange(FALSE)
{
m_dwFlags = FX_MEMSTREAM_TakeOver | (bConsecutive ? FX_MEMSTREAM_Consecutive : 0);
}
- CFX_MemoryStream(uint8_t* pBuffer, size_t nSize, bool bTakeOver)
+ CFX_MemoryStream(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver)
: m_dwCount(1)
, m_nTotalSize(nSize)
, m_nCurSize(nSize)
, m_nCurPos(0)
, m_nGrowSize(FX_MEMSTREAM_BlockSize)
- , m_bUseRange(false)
+ , m_bUseRange(FALSE)
{
m_Blocks.Add(pBuffer);
m_dwFlags = FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0);
@@ -184,7 +184,7 @@ public:
{
return m_bUseRange ? (FX_FILESIZE) m_nSize : (FX_FILESIZE)m_nCurSize;
}
- virtual bool IsEOF() override
+ virtual FX_BOOL IsEOF() override
{
return m_nCurPos >= (size_t)GetSize();
}
@@ -196,30 +196,30 @@ public:
}
return pos;
}
- virtual bool SetRange(FX_FILESIZE offset, FX_FILESIZE size) override
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size) override
{
if (offset < 0 || size < 0) {
- return false;
+ return FALSE;
}
FX_SAFE_FILESIZE range = size;
range += offset;
if (!range.IsValid() || range.ValueOrDie() > m_nCurSize) {
- return false;
+ return FALSE;
}
m_nOffset = (size_t)offset, m_nSize = (size_t)size;
- m_bUseRange = true;
+ m_bUseRange = TRUE;
m_nCurPos = m_nOffset;
- return true;
+ return TRUE;
}
virtual void ClearRange() override
{
- m_bUseRange = false;
+ m_bUseRange = FALSE;
}
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override
{
if (!buffer || !size) {
- return false;
+ return FALSE;
}
FX_SAFE_FILESIZE safeOffset = offset;
@@ -228,7 +228,7 @@ public:
}
if (!safeOffset.IsValid()) {
- return false;
+ return FALSE;
}
offset = safeOffset.ValueOrDie();
@@ -236,13 +236,13 @@ public:
FX_SAFE_SIZE_T newPos = size;
newPos += offset;
if (!newPos.IsValid() || newPos.ValueOrDefault(0) == 0 || newPos.ValueOrDie() > m_nCurSize) {
- return false;
+ return FALSE;
}
m_nCurPos = newPos.ValueOrDie();
if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
FXSYS_memcpy(buffer, (uint8_t*)m_Blocks[0] + (size_t)offset, size);
- return true;
+ return TRUE;
}
size_t nStartBlock = (size_t)offset / m_nGrowSize;
offset -= (FX_FILESIZE)(nStartBlock * m_nGrowSize);
@@ -257,7 +257,7 @@ public:
nStartBlock ++;
offset = 0;
}
- return true;
+ return TRUE;
}
virtual size_t ReadBlock(void* buffer, size_t size) override
{
@@ -276,10 +276,10 @@ public:
}
return nRead;
}
- virtual bool WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) override
{
if (!buffer || !size) {
- return false;
+ return FALSE;
}
if (m_bUseRange) {
offset += (FX_FILESIZE)m_nOffset;
@@ -288,7 +288,7 @@ public:
FX_SAFE_SIZE_T newPos = size;
newPos += offset;
if (!newPos.IsValid())
- return false;
+ return FALSE;
m_nCurPos = newPos.ValueOrDie();
if (m_nCurPos > m_nTotalSize) {
@@ -301,24 +301,24 @@ public:
}
if (!m_Blocks[0]) {
m_Blocks.RemoveAll();
- return false;
+ return FALSE;
}
}
FXSYS_memcpy((uint8_t*)m_Blocks[0] + (size_t)offset, buffer, size);
if (m_nCurSize < m_nCurPos) {
m_nCurSize = m_nCurPos;
}
- return true;
+ return TRUE;
}
FX_SAFE_SIZE_T newPos = size;
newPos += offset;
if (!newPos.IsValid()) {
- return false;
+ return FALSE;
}
if (!ExpandBlocks(newPos.ValueOrDie())) {
- return false;
+ return FALSE;
}
m_nCurPos = newPos.ValueOrDie();
size_t nStartBlock = (size_t)offset / m_nGrowSize;
@@ -334,13 +334,13 @@ public:
nStartBlock ++;
offset = 0;
}
- return true;
+ return TRUE;
}
- virtual bool Flush() override
+ virtual FX_BOOL Flush() override
{
- return true;
+ return TRUE;
}
- virtual bool IsConsecutive() const override
+ virtual FX_BOOL IsConsecutive() const override
{
return m_dwFlags & FX_MEMSTREAM_Consecutive;
}
@@ -360,7 +360,7 @@ public:
{
return m_Blocks.GetSize() ? (uint8_t*)m_Blocks[0] : NULL;
}
- virtual void AttachBuffer(uint8_t* pBuffer, size_t nSize, bool bTakeOver = false) override
+ virtual void AttachBuffer(uint8_t* pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) override
{
if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
return;
@@ -390,16 +390,16 @@ protected:
size_t m_nCurPos;
size_t m_nGrowSize;
FX_DWORD m_dwFlags;
- bool m_bUseRange;
+ FX_BOOL m_bUseRange;
size_t m_nOffset;
size_t m_nSize;
- bool ExpandBlocks(size_t size)
+ FX_BOOL ExpandBlocks(size_t size)
{
if (m_nCurSize < size) {
m_nCurSize = size;
}
if (size <= m_nTotalSize) {
- return true;
+ return TRUE;
}
int32_t iCount = m_Blocks.GetSize();
size = (size - m_nTotalSize + m_nGrowSize - 1) / m_nGrowSize;
@@ -409,7 +409,7 @@ protected:
m_Blocks.SetAt(iCount ++, pBlock);
m_nTotalSize += m_nGrowSize;
}
- return true;
+ return TRUE;
}
};
#ifdef __cplusplus
@@ -424,15 +424,15 @@ typedef struct _FX_MTRANDOMCONTEXT {
_FX_MTRANDOMCONTEXT()
{
mti = MT_N + 1;
- bHaveSeed = false;
+ bHaveSeed = FALSE;
}
FX_DWORD mti;
- bool bHaveSeed;
+ FX_BOOL bHaveSeed;
FX_DWORD mt[MT_N];
} FX_MTRANDOMCONTEXT, * FX_LPMTRANDOMCONTEXT;
typedef FX_MTRANDOMCONTEXT const * FX_LPCMTRANDOMCONTEXT;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-bool FX_GenerateCryptoRandom(FX_DWORD* pBuffer, int32_t iCount);
+FX_BOOL FX_GenerateCryptoRandom(FX_DWORD* pBuffer, int32_t iCount);
#endif
#ifdef __cplusplus
}
diff --git a/core/src/fxcrt/fx_arabic.cpp b/core/src/fxcrt/fx_arabic.cpp
index 497c1bab4f..3cb2fd067a 100644
--- a/core/src/fxcrt/fx_arabic.cpp
+++ b/core/src/fxcrt/fx_arabic.cpp
@@ -13,7 +13,7 @@ IFX_BidiChar* IFX_BidiChar::Create()
return new CFX_BidiChar;
}
CFX_BidiChar::CFX_BidiChar()
- : m_bSeparateNeutral(true)
+ : m_bSeparateNeutral(TRUE)
, m_iCurStart(0)
, m_iCurCount(0)
, m_iCurBidi(0)
@@ -22,12 +22,12 @@ CFX_BidiChar::CFX_BidiChar()
, m_iLastCount(0)
{
}
-void CFX_BidiChar::SetPolicy(bool bSeparateNeutral)
+void CFX_BidiChar::SetPolicy(FX_BOOL bSeparateNeutral)
{
m_bSeparateNeutral = bSeparateNeutral;
}
-bool CFX_BidiChar::AppendChar(FX_WCHAR wch)
+FX_BOOL CFX_BidiChar::AppendChar(FX_WCHAR wch)
{
FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch];
int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
@@ -43,10 +43,10 @@ bool CFX_BidiChar::AppendChar(FX_WCHAR wch)
iContext = 2;
break;
}
- bool bRet = false;
+ FX_BOOL bRet = FALSE;
if (iContext != m_iCurBidi) {
if (m_bSeparateNeutral) {
- bRet = true;
+ bRet = TRUE;
} else {
if (m_iCurBidi == 0) {
bRet = (m_iCurCount > 0);
@@ -67,7 +67,7 @@ bool CFX_BidiChar::AppendChar(FX_WCHAR wch)
m_iCurCount ++;
return bRet;
}
-bool CFX_BidiChar::EndChar()
+FX_BOOL CFX_BidiChar::EndChar()
{
m_iLastBidi = m_iCurBidi;
m_iLastStart = m_iCurStart;
diff --git a/core/src/fxcrt/fx_arabic.h b/core/src/fxcrt/fx_arabic.h
index 10a16afa63..e4c1ddacf2 100644
--- a/core/src/fxcrt/fx_arabic.h
+++ b/core/src/fxcrt/fx_arabic.h
@@ -15,14 +15,14 @@ public:
CFX_BidiChar();
~CFX_BidiChar() override {}
- void SetPolicy(bool bSeparateNeutral = true) override;
- bool AppendChar(FX_WCHAR wch) override;
- bool EndChar() override;
+ void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) override;
+ FX_BOOL AppendChar(FX_WCHAR wch) override;
+ FX_BOOL EndChar() override;
int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) override;
void Reset() override;
private:
- bool m_bSeparateNeutral;
+ FX_BOOL m_bSeparateNeutral;
int32_t m_iCurStart;
int32_t m_iCurCount;
int32_t m_iCurBidi;
diff --git a/core/src/fxcrt/fx_basic_array.cpp b/core/src/fxcrt/fx_basic_array.cpp
index f139365740..4ab34bb022 100644
--- a/core/src/fxcrt/fx_basic_array.cpp
+++ b/core/src/fxcrt/fx_basic_array.cpp
@@ -22,7 +22,7 @@ CFX_BasicArray::~CFX_BasicArray()
{
FX_Free(m_pData);
}
-bool CFX_BasicArray::SetSize(int nNewSize)
+FX_BOOL CFX_BasicArray::SetSize(int nNewSize)
{
if (nNewSize <= 0) {
FX_Free(m_pData);
@@ -36,7 +36,7 @@ bool CFX_BasicArray::SetSize(int nNewSize)
totalSize *= m_nUnitSize;
if (!totalSize.IsValid()) {
m_nSize = m_nMaxSize = 0;
- return false;
+ return FALSE;
}
m_pData = FX_Alloc(uint8_t, totalSize.ValueOrDie());
m_nSize = m_nMaxSize = nNewSize;
@@ -50,38 +50,38 @@ bool CFX_BasicArray::SetSize(int nNewSize)
pdfium::base::CheckedNumeric<int> totalSize = nNewMax;
totalSize *= m_nUnitSize;
if (!totalSize.IsValid() || nNewMax < m_nSize) {
- return false;
+ return FALSE;
}
uint8_t* pNewData = FX_Realloc(uint8_t, m_pData, totalSize.ValueOrDie());
if (pNewData == NULL) {
- return false;
+ return FALSE;
}
FXSYS_memset(pNewData + m_nSize * m_nUnitSize, 0, (nNewMax - m_nSize) * m_nUnitSize);
m_pData = pNewData;
m_nSize = nNewSize;
m_nMaxSize = nNewMax;
}
- return true;
+ return TRUE;
}
-bool CFX_BasicArray::Append(const CFX_BasicArray& src)
+FX_BOOL CFX_BasicArray::Append(const CFX_BasicArray& src)
{
int nOldSize = m_nSize;
pdfium::base::CheckedNumeric<int> newSize = m_nSize;
newSize += src.m_nSize;
if (m_nUnitSize != src.m_nUnitSize || !newSize.IsValid() || !SetSize(newSize.ValueOrDie())) {
- return false;
+ return FALSE;
}
FXSYS_memcpy(m_pData + nOldSize * m_nUnitSize, src.m_pData, src.m_nSize * m_nUnitSize);
- return true;
+ return TRUE;
}
-bool CFX_BasicArray::Copy(const CFX_BasicArray& src)
+FX_BOOL CFX_BasicArray::Copy(const CFX_BasicArray& src)
{
if (!SetSize(src.m_nSize)) {
- return false;
+ return FALSE;
}
FXSYS_memcpy(m_pData, src.m_pData, src.m_nSize * m_nUnitSize);
- return true;
+ return TRUE;
}
uint8_t* CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount)
{
@@ -103,31 +103,31 @@ uint8_t* CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount)
}
return m_pData + nIndex * m_nUnitSize;
}
-bool CFX_BasicArray::RemoveAt(int nIndex, int nCount)
+FX_BOOL CFX_BasicArray::RemoveAt(int nIndex, int nCount)
{
if (nIndex < 0 || nCount <= 0 || m_nSize < nIndex + nCount) {
- return false;
+ return FALSE;
}
int nMoveCount = m_nSize - (nIndex + nCount);
if (nMoveCount) {
FXSYS_memmove(m_pData + nIndex * m_nUnitSize, m_pData + (nIndex + nCount) * m_nUnitSize, nMoveCount * m_nUnitSize);
}
m_nSize -= nCount;
- return true;
+ return TRUE;
}
-bool CFX_BasicArray::InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray)
+FX_BOOL CFX_BasicArray::InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray)
{
if (pNewArray == NULL) {
- return false;
+ return FALSE;
}
if (pNewArray->m_nSize == 0) {
- return true;
+ return TRUE;
}
if (!InsertSpaceAt(nStartIndex, pNewArray->m_nSize)) {
- return false;
+ return FALSE;
}
FXSYS_memcpy(m_pData + nStartIndex * m_nUnitSize, pNewArray->m_pData, pNewArray->m_nSize * m_nUnitSize);
- return true;
+ return TRUE;
}
const void* CFX_BasicArray::GetDataPtr(int index) const
{
@@ -260,7 +260,7 @@ void** CFX_BaseSegmentedArray::GetIndex(int seg_index) const
}
return pSpot;
}
-void* CFX_BaseSegmentedArray::IterateSegment(const uint8_t* pSegment, int count, bool (*callback)(void* param, void* pData), void* param) const
+void* CFX_BaseSegmentedArray::IterateSegment(const uint8_t* pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const
{
for (int i = 0; i < count; i ++) {
if (!callback(param, (void*)(pSegment + i * m_UnitSize))) {
@@ -269,7 +269,7 @@ void* CFX_BaseSegmentedArray::IterateSegment(const uint8_t* pSegment, int count,
}
return NULL;
}
-void* CFX_BaseSegmentedArray::IterateIndex(int level, int& start, void** pIndex, bool (*callback)(void* param, void* pData), void* param) const
+void* CFX_BaseSegmentedArray::IterateIndex(int level, int& start, void** pIndex, FX_BOOL (*callback)(void* param, void* pData), void* param) const
{
if (level == 0) {
int count = m_DataSize - start;
@@ -290,7 +290,7 @@ void* CFX_BaseSegmentedArray::IterateIndex(int level, int& start, void** pIndex,
}
return NULL;
}
-void* CFX_BaseSegmentedArray::Iterate(bool (*callback)(void* param, void* pData), void* param) const
+void* CFX_BaseSegmentedArray::Iterate(FX_BOOL (*callback)(void* param, void* pData), void* param) const
{
if (m_pIndex == NULL) {
return NULL;
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index 47c1c5b6b2..5eeb33b049 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -1086,9 +1086,9 @@ FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_CHAR* buf)
if (d == 0.0f) {
return 1;
}
- bool bNegative = false;
+ FX_BOOL bNegative = FALSE;
if (d < 0) {
- bNegative = true;
+ bNegative = TRUE;
d = -d;
}
int scale = 1;
diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp
index d7c1a1ad7b..9fc400e183 100644
--- a/core/src/fxcrt/fx_basic_buffer.cpp
+++ b/core/src/fxcrt/fx_basic_buffer.cpp
@@ -321,7 +321,7 @@ CFX_ArchiveLoader::CFX_ArchiveLoader(const uint8_t* pData, FX_DWORD dwSize)
m_LoadingPos = 0;
m_LoadingSize = dwSize;
}
-bool CFX_ArchiveLoader::IsEOF()
+FX_BOOL CFX_ArchiveLoader::IsEOF()
{
return m_LoadingPos >= m_LoadingSize;
}
@@ -372,14 +372,14 @@ CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_WideString& str)
str = CFX_WideString::FromUTF16LE((const unsigned short*)encoded.c_str(), encoded.GetLength());
return *this;
}
-bool CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize)
+FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize)
{
if (m_LoadingPos + dwSize > m_LoadingSize) {
- return false;
+ return FALSE;
}
FXSYS_memcpy(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize);
m_LoadingPos += dwSize;
- return true;
+ return TRUE;
}
void CFX_BitStream::Init(const uint8_t* pData, FX_DWORD dwSize)
{
@@ -441,9 +441,9 @@ void IFX_BufferArchive::Clear()
m_pBuffer = NULL;
}
}
-bool IFX_BufferArchive::Flush()
+FX_BOOL IFX_BufferArchive::Flush()
{
- bool bRet = DoWork(m_pBuffer, m_Length);
+ FX_BOOL bRet = DoWork(m_pBuffer, m_Length);
m_Length = 0;
return bRet;
}
@@ -488,7 +488,7 @@ int32_t IFX_BufferArchive::AppendString(const CFX_ByteStringC& lpsz)
CFX_FileBufferArchive::CFX_FileBufferArchive(FX_STRSIZE size)
: IFX_BufferArchive(size)
, m_pFile(NULL)
- , m_bTakeover(false)
+ , m_bTakeover(FALSE)
{
}
CFX_FileBufferArchive::~CFX_FileBufferArchive()
@@ -501,58 +501,58 @@ void CFX_FileBufferArchive::Clear()
m_pFile->Release();
}
m_pFile = NULL;
- m_bTakeover = false;
+ m_bTakeover = FALSE;
IFX_BufferArchive::Clear();
}
-bool CFX_FileBufferArchive::AttachFile(IFX_StreamWrite *pFile, bool bTakeover )
+FX_BOOL CFX_FileBufferArchive::AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover )
{
if (!pFile) {
- return false;
+ return FALSE;
}
if (m_pFile && m_bTakeover) {
m_pFile->Release();
}
m_pFile = pFile;
m_bTakeover = bTakeover;
- return true;
+ return TRUE;
}
-bool CFX_FileBufferArchive::AttachFile(const FX_WCHAR* filename)
+FX_BOOL CFX_FileBufferArchive::AttachFile(const FX_WCHAR* filename)
{
if (!filename) {
- return false;
+ return FALSE;
}
if (m_pFile && m_bTakeover) {
m_pFile->Release();
}
m_pFile = FX_CreateFileWrite(filename);
if (!m_pFile) {
- return false;
+ return FALSE;
}
- m_bTakeover = true;
- return true;
+ m_bTakeover = TRUE;
+ return TRUE;
}
-bool CFX_FileBufferArchive::AttachFile(const FX_CHAR* filename)
+FX_BOOL CFX_FileBufferArchive::AttachFile(const FX_CHAR* filename)
{
if (!filename) {
- return false;
+ return FALSE;
}
if (m_pFile && m_bTakeover) {
m_pFile->Release();
}
m_pFile = FX_CreateFileWrite(filename);
if (!m_pFile) {
- return false;
+ return FALSE;
}
- m_bTakeover = true;
- return true;
+ m_bTakeover = TRUE;
+ return TRUE;
}
-bool CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size)
+FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size)
{
if (!m_pFile) {
- return false;
+ return FALSE;
}
if (!pBuf || size < 1) {
- return true;
+ return TRUE;
}
return m_pFile->WriteBlock(pBuf, size);
}
diff --git a/core/src/fxcrt/fx_basic_coords.cpp b/core/src/fxcrt/fx_basic_coords.cpp
index 22b9bd4715..2e830809b8 100644
--- a/core/src/fxcrt/fx_basic_coords.cpp
+++ b/core/src/fxcrt/fx_basic_coords.cpp
@@ -45,15 +45,15 @@ void FX_RECT::Union(const FX_RECT& other_rect)
bottom = bottom > other.bottom ? bottom : other.bottom;
top = top < other.top ? top : other.top;
}
-bool GetIntersection(FX_FLOAT low1, FX_FLOAT high1, FX_FLOAT low2, FX_FLOAT high2,
+FX_BOOL GetIntersection(FX_FLOAT low1, FX_FLOAT high1, FX_FLOAT low2, FX_FLOAT high2,
FX_FLOAT& interlow, FX_FLOAT& interhigh)
{
if (low1 >= high2 || low2 >= high1) {
- return false;
+ return FALSE;
}
interlow = low1 > low2 ? low1 : low2;
interhigh = high1 > high2 ? high2 : high1;
- return true;
+ return TRUE;
}
extern "C" int FXSYS_round(FX_FLOAT d)
{
@@ -198,18 +198,18 @@ FX_RECT CFX_FloatRect::GetClosestRect() const
rect.Normalize();
return rect;
}
-bool CFX_FloatRect::Contains(const CFX_FloatRect& other_rect) const
+FX_BOOL CFX_FloatRect::Contains(const CFX_FloatRect& other_rect) const
{
CFX_FloatRect n1 = *this;
n1.Normalize();
CFX_FloatRect n2 = other_rect;
n2.Normalize();
if (n2.left >= n1.left && n2.right <= n1.right && n2.bottom >= n1.bottom && n2.top <= n1.top) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFX_FloatRect::Contains(FX_FLOAT x, FX_FLOAT y) const
+FX_BOOL CFX_FloatRect::Contains(FX_FLOAT x, FX_FLOAT y) const
{
CFX_FloatRect n1 = *this;
n1.Normalize();
@@ -299,13 +299,13 @@ static void FXCRT_Matrix_Concat(CFX_Matrix &m, const CFX_Matrix &m1, const CFX_M
FX_FLOAT ff = m1.e * m2.b + m1.f * m2.d + m2.f;
m.a = aa, m.b = bb, m.c = cc, m.d = dd, m.e = ee, m.f = ff;
}
-void CFX_Matrix::Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, bool bPrepended)
+void CFX_Matrix::Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended)
{
CFX_Matrix m;
m.Set(a, b, c, d, e, f);
Concat(m, bPrepended);
}
-void CFX_Matrix::Concat(const CFX_Matrix &m, bool bPrepended)
+void CFX_Matrix::Concat(const CFX_Matrix &m, FX_BOOL bPrepended)
{
if (bPrepended) {
FXCRT_Matrix_Concat(*this, m, *this);
@@ -313,25 +313,25 @@ void CFX_Matrix::Concat(const CFX_Matrix &m, bool bPrepended)
FXCRT_Matrix_Concat(*this, *this, m);
}
}
-void CFX_Matrix::ConcatInverse(const CFX_Matrix& src, bool bPrepended)
+void CFX_Matrix::ConcatInverse(const CFX_Matrix& src, FX_BOOL bPrepended)
{
CFX_Matrix m;
m.SetReverse(src);
Concat(m, bPrepended);
}
-bool CFX_Matrix::IsInvertible() const
+FX_BOOL CFX_Matrix::IsInvertible() const
{
return FXSYS_fabs(a * d - b * c) >= 0.0001f;
}
-bool CFX_Matrix::Is90Rotated() const
+FX_BOOL CFX_Matrix::Is90Rotated() const
{
return FXSYS_fabs(a * 1000) < FXSYS_fabs(b) && FXSYS_fabs(d * 1000) < FXSYS_fabs(c);
}
-bool CFX_Matrix::IsScaled() const
+FX_BOOL CFX_Matrix::IsScaled() const
{
return FXSYS_fabs(b * 1000) < FXSYS_fabs(a) && FXSYS_fabs(c * 1000) < FXSYS_fabs(d);
}
-void CFX_Matrix::Translate(FX_FLOAT x, FX_FLOAT y, bool bPrepended)
+void CFX_Matrix::Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended)
{
if (bPrepended) {
e += x * a + y * c;
@@ -340,7 +340,7 @@ void CFX_Matrix::Translate(FX_FLOAT x, FX_FLOAT y, bool bPrepended)
e += x, f += y;
}
}
-void CFX_Matrix::Scale(FX_FLOAT sx, FX_FLOAT sy, bool bPrepended)
+void CFX_Matrix::Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended)
{
a *= sx, d *= sy;
if (bPrepended) {
@@ -353,7 +353,7 @@ void CFX_Matrix::Scale(FX_FLOAT sx, FX_FLOAT sy, bool bPrepended)
f *= sy;
}
}
-void CFX_Matrix::Rotate(FX_FLOAT fRadian, bool bPrepended)
+void CFX_Matrix::Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended)
{
FX_FLOAT cosValue = FXSYS_cos(fRadian);
FX_FLOAT sinValue = FXSYS_sin(fRadian);
@@ -365,13 +365,13 @@ void CFX_Matrix::Rotate(FX_FLOAT fRadian, bool bPrepended)
FXCRT_Matrix_Concat(*this, *this, m);
}
}
-void CFX_Matrix::RotateAt(FX_FLOAT fRadian, FX_FLOAT dx, FX_FLOAT dy, bool bPrepended)
+void CFX_Matrix::RotateAt(FX_FLOAT fRadian, FX_FLOAT dx, FX_FLOAT dy, FX_BOOL bPrepended)
{
Translate(dx, dy, bPrepended);
Rotate(fRadian, bPrepended);
Translate(-dx, -dy, bPrepended);
}
-void CFX_Matrix::Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, bool bPrepended)
+void CFX_Matrix::Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended)
{
CFX_Matrix m;
m.Set(1, FXSYS_tan(fAlphaRadian), FXSYS_tan(fBetaRadian), 1, 0, 0);
diff --git a/core/src/fxcrt/fx_basic_gcc.cpp b/core/src/fxcrt/fx_basic_gcc.cpp
index 562f741d41..2497c74a8e 100644
--- a/core/src/fxcrt/fx_basic_gcc.cpp
+++ b/core/src/fxcrt/fx_basic_gcc.cpp
@@ -12,12 +12,12 @@
template <class T, class STR_T>
T FXSYS_StrToInt(STR_T str)
{
- bool neg = false;
+ FX_BOOL neg = FALSE;
if (str == NULL) {
return 0;
}
if (*str == '-') {
- neg = true;
+ neg = TRUE;
str ++;
}
T num = 0;
diff --git a/core/src/fxcrt/fx_basic_maps.cpp b/core/src/fxcrt/fx_basic_maps.cpp
index 7de7b614f4..e34acb088d 100644
--- a/core/src/fxcrt/fx_basic_maps.cpp
+++ b/core/src/fxcrt/fx_basic_maps.cpp
@@ -69,15 +69,15 @@ void CFX_MapPtrToPtr::GetNextAssoc(FX_POSITION& rNextPosition, void*& rKey, void
rKey = pAssocRet->key;
rValue = pAssocRet->value;
}
-bool CFX_MapPtrToPtr::Lookup(void* key, void*& rValue) const
+FX_BOOL CFX_MapPtrToPtr::Lookup(void* key, void*& rValue) const
{
FX_DWORD nHash;
CAssoc* pAssoc = GetAssocAt(key, nHash);
if (pAssoc == NULL) {
- return false;
+ return FALSE;
}
rValue = pAssoc->value;
- return true;
+ return TRUE;
}
void* CFX_MapPtrToPtr::GetValueAt(void* key) const
{
@@ -140,7 +140,7 @@ CFX_MapPtrToPtr::NewAssoc()
return pAssoc;
}
void CFX_MapPtrToPtr::InitHashTable(
- FX_DWORD nHashSize, bool bAllocNow)
+ FX_DWORD nHashSize, FX_BOOL bAllocNow)
{
ASSERT(m_nCount == 0);
ASSERT(nHashSize > 0);
@@ -153,10 +153,10 @@ void CFX_MapPtrToPtr::InitHashTable(
}
m_nHashTableSize = nHashSize;
}
-bool CFX_MapPtrToPtr::RemoveKey(void* key)
+FX_BOOL CFX_MapPtrToPtr::RemoveKey(void* key)
{
if (m_pHashTable == NULL) {
- return false;
+ return FALSE;
}
CAssoc** ppAssocPrev;
ppAssocPrev = &m_pHashTable[HashKey(key) % m_nHashTableSize];
@@ -165,11 +165,11 @@ bool CFX_MapPtrToPtr::RemoveKey(void* key)
if (pAssoc->key == key) {
*ppAssocPrev = pAssoc->pNext;
FreeAssoc(pAssoc);
- return true;
+ return TRUE;
}
ppAssocPrev = &pAssoc->pNext;
}
- return false;
+ return FALSE;
}
void CFX_MapPtrToPtr::FreeAssoc(CFX_MapPtrToPtr::CAssoc* pAssoc)
{
@@ -325,18 +325,18 @@ CFX_MapByteStringToPtr::GetAssocAt(const CFX_ByteStringC& key, FX_DWORD& nHash)
}
return NULL;
}
-bool CFX_MapByteStringToPtr::Lookup(const CFX_ByteStringC& key, void*& rValue) const
+FX_BOOL CFX_MapByteStringToPtr::Lookup(const CFX_ByteStringC& key, void*& rValue) const
{
FX_DWORD nHash;
CAssoc* pAssoc = GetAssocAt(key, nHash);
if (pAssoc == NULL) {
- return false;
+ return FALSE;
}
rValue = pAssoc->value;
- return true;
+ return TRUE;
}
void CFX_MapByteStringToPtr::InitHashTable(
- FX_DWORD nHashSize, bool bAllocNow)
+ FX_DWORD nHashSize, FX_BOOL bAllocNow)
{
ASSERT(m_nCount == 0);
ASSERT(nHashSize > 0);
@@ -359,10 +359,10 @@ inline FX_DWORD CFX_MapByteStringToPtr::HashKey(const CFX_ByteStringC& key) cons
}
return nHash;
}
-bool CFX_MapByteStringToPtr::RemoveKey(const CFX_ByteStringC& key)
+FX_BOOL CFX_MapByteStringToPtr::RemoveKey(const CFX_ByteStringC& key)
{
if (m_pHashTable == NULL) {
- return false;
+ return FALSE;
}
CAssoc** ppAssocPrev;
ppAssocPrev = &m_pHashTable[HashKey(key) % m_nHashTableSize];
@@ -371,11 +371,11 @@ bool CFX_MapByteStringToPtr::RemoveKey(const CFX_ByteStringC& key)
if (pAssoc->key == key) {
*ppAssocPrev = pAssoc->pNext;
FreeAssoc(pAssoc);
- return true;
+ return TRUE;
}
ppAssocPrev = &pAssoc->pNext;
}
- return false;
+ return FALSE;
}
struct _CompactString {
uint8_t m_CompactLen;
@@ -390,16 +390,16 @@ static void _CompactStringRelease(_CompactString* pCompact)
FX_Free(pCompact->m_pBuffer);
}
}
-static bool _CompactStringSame(_CompactString* pCompact, const uint8_t* pStr, int len)
+static FX_BOOL _CompactStringSame(_CompactString* pCompact, const uint8_t* pStr, int len)
{
if (len < sizeof(_CompactString)) {
if (pCompact->m_CompactLen != len) {
- return false;
+ return FALSE;
}
return FXSYS_memcmp(&pCompact->m_LenHigh, pStr, len) == 0;
}
if (pCompact->m_CompactLen != 0xff || pCompact->m_LenHigh * 256 + pCompact->m_LenLow != len) {
- return false;
+ return FALSE;
}
return FXSYS_memcmp(pCompact->m_pBuffer, pStr, len) == 0;
}
@@ -497,18 +497,18 @@ void* CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
rNextPosition = NULL;
return rValue;
}
-bool _CMapLookupCallback(void* param, void* pData)
+FX_BOOL _CMapLookupCallback(void* param, void* pData)
{
return !_CompactStringSame((_CompactString*)pData, ((CFX_ByteStringC*)param)->GetPtr(), ((CFX_ByteStringC*)param)->GetLength());
}
-bool CFX_CMapByteStringToPtr::Lookup(const CFX_ByteStringC& key, void*& rValue) const
+FX_BOOL CFX_CMapByteStringToPtr::Lookup(const CFX_ByteStringC& key, void*& rValue) const
{
void* p = m_Buffer.Iterate(_CMapLookupCallback, (void*)&key);
if (!p) {
- return false;
+ return FALSE;
}
rValue = *(void**)((_CompactString*)p + 1);
- return true;
+ return TRUE;
}
void CFX_CMapByteStringToPtr::SetAt(const CFX_ByteStringC& key, void* value)
{
@@ -579,15 +579,15 @@ struct _DWordPair {
FX_DWORD key;
FX_DWORD value;
};
-bool CFX_CMapDWordToDWord::Lookup(FX_DWORD key, FX_DWORD& value) const
+FX_BOOL CFX_CMapDWordToDWord::Lookup(FX_DWORD key, FX_DWORD& value) const
{
void* pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_DWordPair),
sizeof(_DWordPair), _CompareDWord);
if (pResult == NULL) {
- return false;
+ return FALSE;
}
value = ((FX_DWORD*)pResult)[1];
- return true;
+ return TRUE;
}
FX_POSITION CFX_CMapDWordToDWord::GetStartPosition() const
{
diff --git a/core/src/fxcrt/fx_basic_util.cpp b/core/src/fxcrt/fx_basic_util.cpp
index 1343374111..26eeacce1b 100644
--- a/core/src/fxcrt/fx_basic_util.cpp
+++ b/core/src/fxcrt/fx_basic_util.cpp
@@ -26,7 +26,7 @@ void FX_PRIVATEDATA::FreeData()
m_pCallback(m_pData);
}
}
-void CFX_PrivateData::AddData(void* pModuleId, void* pData, PD_CALLBACK_FREEDATA callback, bool bSelfDestruct)
+void CFX_PrivateData::AddData(void* pModuleId, void* pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct)
{
if (pModuleId == NULL) {
return;
@@ -46,26 +46,26 @@ void CFX_PrivateData::AddData(void* pModuleId, void* pData, PD_CALLBACK_FREEDATA
}
void CFX_PrivateData::SetPrivateData(void* pModuleId, void* pData, PD_CALLBACK_FREEDATA callback)
{
- AddData(pModuleId, pData, callback, false);
+ AddData(pModuleId, pData, callback, FALSE);
}
void CFX_PrivateData::SetPrivateObj(void* pModuleId, CFX_DestructObject* pObj)
{
- AddData(pModuleId, pObj, NULL, true);
+ AddData(pModuleId, pObj, NULL, TRUE);
}
-bool CFX_PrivateData::RemovePrivateData(void* pModuleId)
+FX_BOOL CFX_PrivateData::RemovePrivateData(void* pModuleId)
{
if (pModuleId == NULL) {
- return false;
+ return FALSE;
}
FX_PRIVATEDATA* pList = m_DataList.GetData();
int count = m_DataList.GetSize();
for (int i = 0; i < count; i ++) {
if (pList[i].m_pModuleId == pModuleId) {
m_DataList.RemoveAt(i);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
void* CFX_PrivateData::GetPrivateData(void* pModuleId)
{
@@ -90,18 +90,18 @@ void CFX_PrivateData::ClearAll()
}
m_DataList.RemoveAll();
}
-void FX_atonum(const CFX_ByteStringC& strc, bool& bInteger, void* pData)
+void FX_atonum(const CFX_ByteStringC& strc, FX_BOOL& bInteger, void* pData)
{
if (FXSYS_memchr(strc.GetPtr(), '.', strc.GetLength()) == NULL) {
- bInteger = true;
+ bInteger = TRUE;
int cc = 0, integer = 0;
const FX_CHAR* str = strc.GetCStr();
int len = strc.GetLength();
- bool bNegative = false;
+ FX_BOOL bNegative = FALSE;
if (str[0] == '+') {
cc++;
} else if (str[0] == '-') {
- bNegative = true;
+ bNegative = TRUE;
cc++;
}
while (cc < len) {
@@ -119,7 +119,7 @@ void FX_atonum(const CFX_ByteStringC& strc, bool& bInteger, void* pData)
}
*(int*)pData = integer;
} else {
- bInteger = false;
+ bInteger = FALSE;
*(FX_FLOAT*)pData = FX_atof(strc);
}
}
@@ -129,13 +129,13 @@ FX_FLOAT FX_atof(const CFX_ByteStringC& strc)
return 0.0;
}
int cc = 0;
- bool bNegative = false;
+ FX_BOOL bNegative = FALSE;
const FX_CHAR* str = strc.GetCStr();
int len = strc.GetLength();
if (str[0] == '+') {
cc++;
} else if (str[0] == '-') {
- bNegative = true;
+ bNegative = TRUE;
cc++;
}
while (cc < len) {
@@ -187,13 +187,13 @@ void FXSYS_vsnprintf(char *str, size_t size, const char* fmt, va_list ap)
}
#endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900
-static bool FX_IsDigit(uint8_t ch)
+static FX_BOOL FX_IsDigit(uint8_t ch)
{
- return (ch >= '0' && ch <= '9') ? true : false;
+ return (ch >= '0' && ch <= '9') ? TRUE : FALSE;
}
-static bool FX_IsXDigit(uint8_t ch)
+static FX_BOOL FX_IsXDigit(uint8_t ch)
{
- return (FX_IsDigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) ? true : false;
+ return (FX_IsDigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) ? TRUE : FALSE;
}
static uint8_t FX_MakeUpper(uint8_t ch)
{
@@ -299,7 +299,7 @@ class CFindFileData
public:
virtual ~CFindFileData() {}
HANDLE m_Handle;
- bool m_bEnd;
+ FX_BOOL m_bEnd;
};
class CFindFileDataA : public CFindFileData
{
@@ -332,7 +332,7 @@ void* FX_OpenFolder(const FX_CHAR* path)
delete pData;
return NULL;
}
- pData->m_bEnd = false;
+ pData->m_bEnd = FALSE;
return pData;
#else
DIR* dir = opendir(path);
@@ -352,82 +352,82 @@ void* FX_OpenFolder(const FX_WCHAR* path)
delete pData;
return NULL;
}
- pData->m_bEnd = false;
+ pData->m_bEnd = FALSE;
return pData;
#else
DIR* dir = opendir(CFX_ByteString::FromUnicode(path));
return dir;
#endif
}
-bool FX_GetNextFile(void* handle, CFX_ByteString& filename, bool& bFolder)
+FX_BOOL FX_GetNextFile(void* handle, CFX_ByteString& filename, FX_BOOL& bFolder)
{
if (handle == NULL) {
- return false;
+ return FALSE;
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#ifndef _WIN32_WCE
CFindFileDataA* pData = (CFindFileDataA*)handle;
if (pData->m_bEnd) {
- return false;
+ return FALSE;
}
filename = pData->m_FindData.cFileName;
bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
if (!FindNextFileA(pData->m_Handle, &pData->m_FindData)) {
- pData->m_bEnd = true;
+ pData->m_bEnd = TRUE;
}
- return true;
+ return TRUE;
#else
CFindFileDataW* pData = (CFindFileDataW*)handle;
if (pData->m_bEnd) {
- return false;
+ return FALSE;
}
filename = CFX_ByteString::FromUnicode(pData->m_FindData.cFileName);
bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
if (!FindNextFileW(pData->m_Handle, &pData->m_FindData)) {
- pData->m_bEnd = true;
+ pData->m_bEnd = TRUE;
}
- return true;
+ return TRUE;
#endif
#elif defined(__native_client__)
abort();
- return false;
+ return FALSE;
#else
struct dirent *de = readdir((DIR*)handle);
if (de == NULL) {
- return false;
+ return FALSE;
}
filename = de->d_name;
bFolder = de->d_type == DT_DIR;
- return true;
+ return TRUE;
#endif
}
-bool FX_GetNextFile(void* handle, CFX_WideString& filename, bool& bFolder)
+FX_BOOL FX_GetNextFile(void* handle, CFX_WideString& filename, FX_BOOL& bFolder)
{
if (handle == NULL) {
- return false;
+ return FALSE;
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
CFindFileDataW* pData = (CFindFileDataW*)handle;
if (pData->m_bEnd) {
- return false;
+ return FALSE;
}
filename = pData->m_FindData.cFileName;
bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
if (!FindNextFileW(pData->m_Handle, &pData->m_FindData)) {
- pData->m_bEnd = true;
+ pData->m_bEnd = TRUE;
}
- return true;
+ return TRUE;
#elif defined(__native_client__)
abort();
- return false;
+ return FALSE;
#else
struct dirent *de = readdir((DIR*)handle);
if (de == NULL) {
- return false;
+ return FALSE;
}
filename = CFX_WideString::FromLocal(de->d_name);
bFolder = de->d_type == DT_DIR;
- return true;
+ return TRUE;
#endif
}
void FX_CloseFolder(void* handle)
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index bb236ac21b..b6b595588d 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -980,11 +980,11 @@ FX_FLOAT FX_wtof(const FX_WCHAR* str, int len)
return 0.0;
}
int cc = 0;
- bool bNegative = false;
+ FX_BOOL bNegative = FALSE;
if (str[0] == '+') {
cc++;
} else if (str[0] == '-') {
- bNegative = true;
+ bNegative = TRUE;
cc++;
}
int integer = 0;
diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp
index fe6f29f6a2..4662e8f893 100644
--- a/core/src/fxcrt/fx_extension.cpp
+++ b/core/src/fxcrt/fx_extension.cpp
@@ -72,12 +72,12 @@ size_t FX_File_WritePos(FX_HFILE hFile, const void* pBuffer, size_t szBuffer, FX
FXSYS_assert(hFile != NULL);
return ((IFXCRT_FileAccess*)hFile)->WritePos(pBuffer, szBuffer, pos);
}
-bool FX_File_Flush(FX_HFILE hFile)
+FX_BOOL FX_File_Flush(FX_HFILE hFile)
{
FXSYS_assert(hFile != NULL);
return ((IFXCRT_FileAccess*)hFile)->Flush();
}
-bool FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile)
+FX_BOOL FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile)
{
FXSYS_assert(hFile != NULL);
return ((IFXCRT_FileAccess*)hFile)->Truncate(szFile);
@@ -122,11 +122,11 @@ IFX_FileRead* FX_CreateFileRead(const FX_WCHAR* filename)
{
return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly);
}
-IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, size_t dwSize, bool bTakeOver)
+IFX_MemoryStream* FX_CreateMemoryStream(uint8_t* pBuffer, size_t dwSize, FX_BOOL bTakeOver)
{
return new CFX_MemoryStream(pBuffer, dwSize, bTakeOver);
}
-IFX_MemoryStream* FX_CreateMemoryStream(bool bConsecutive)
+IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive)
{
return new CFX_MemoryStream(bConsecutive);
}
@@ -160,10 +160,10 @@ FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr, int32_t iLength, int32_t *pUsedLen
return 0.0f;
}
int32_t iUsedLen = 0;
- bool bNegtive = false;
+ FX_BOOL bNegtive = FALSE;
switch (pwsStr[iUsedLen]) {
case '-':
- bNegtive = true;
+ bNegtive = TRUE;
case '+':
iUsedLen++;
break;
@@ -230,7 +230,7 @@ int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count)
}
return ch1 - ch2;
}
-FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, bool bIgnoreCase)
+FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
@@ -249,7 +249,7 @@ FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, bool bIgn
}
return dwHashCode;
}
-FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, bool bIgnoreCase)
+FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
@@ -283,7 +283,7 @@ void* FX_Random_MT_Start(FX_DWORD dwSeed)
for (i = 1; i < MT_N; i ++) {
pBuf[i] = (1812433253UL * (pBuf[i - 1] ^ (pBuf[i - 1] >> 30)) + i);
}
- pContext->bHaveSeed = true;
+ pContext->bHaveSeed = TRUE;
return pContext;
}
FX_DWORD FX_Random_MT_Generate(void* pContext)
@@ -347,8 +347,8 @@ void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount)
do {
::GetSystemTime(&st2);
} while (FXSYS_memcmp(&st1, &st2, sizeof(SYSTEMTIME)) == 0);
- FX_DWORD dwHash1 = FX_HashCode_String_GetA((const FX_CHAR*)&st1, sizeof(st1), true);
- FX_DWORD dwHash2 = FX_HashCode_String_GetA((const FX_CHAR*)&st2, sizeof(st2), true);
+ FX_DWORD dwHash1 = FX_HashCode_String_GetA((const FX_CHAR*)&st1, sizeof(st1), TRUE);
+ FX_DWORD dwHash2 = FX_HashCode_String_GetA((const FX_CHAR*)&st2, sizeof(st2), TRUE);
::srand((dwHash1 << 16) | (FX_DWORD)dwHash2);
#else
time_t tmLast = time(NULL), tmCur;
@@ -360,15 +360,15 @@ void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount)
}
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-bool FX_GenerateCryptoRandom(FX_DWORD* pBuffer, int32_t iCount)
+FX_BOOL FX_GenerateCryptoRandom(FX_DWORD* pBuffer, int32_t iCount)
{
HCRYPTPROV hCP = NULL;
if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || hCP == NULL) {
- return false;
+ return FALSE;
}
::CryptGenRandom(hCP, iCount * sizeof(FX_DWORD), (uint8_t*)pBuffer);
::CryptReleaseContext(hCP, 0);
- return true;
+ return TRUE;
}
#endif
void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount)
diff --git a/core/src/fxcrt/fx_unicode.cpp b/core/src/fxcrt/fx_unicode.cpp
index 1d63da93aa..d66a58a9b3 100644
--- a/core/src/fxcrt/fx_unicode.cpp
+++ b/core/src/fxcrt/fx_unicode.cpp
@@ -13,27 +13,27 @@ FX_DWORD FX_GetUnicodeProperties(FX_WCHAR wch)
{
return gs_FX_TextLayout_CodeProperties[(FX_WORD)wch];
}
-bool FX_IsCtrlCode(FX_WCHAR ch)
+FX_BOOL FX_IsCtrlCode(FX_WCHAR ch)
{
FX_DWORD dwRet = (gs_FX_TextLayout_CodeProperties[(FX_WORD)ch] & FX_CHARTYPEBITSMASK);
return dwRet == FX_CHARTYPE_Tab || dwRet == FX_CHARTYPE_Control;
}
-bool FX_IsRotationCode(FX_WCHAR ch)
+FX_BOOL FX_IsRotationCode(FX_WCHAR ch)
{
return (gs_FX_TextLayout_CodeProperties[(FX_WORD)ch] & 0x8000) != 0;
}
-bool FX_IsCombinationChar(FX_WCHAR wch)
+FX_BOOL FX_IsCombinationChar(FX_WCHAR wch)
{
FX_DWORD dwProps = (gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & FX_CHARTYPEBITSMASK);
return dwProps == FX_CHARTYPE_Combination;
}
-bool FX_IsBidiChar(FX_WCHAR wch)
+FX_BOOL FX_IsBidiChar(FX_WCHAR wch)
{
FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch];
int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
return (FX_BIDICLASS_R == iBidiCls || FX_BIDICLASS_AL == iBidiCls);
}
-FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, bool bRTL, bool bVertical)
+FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical)
{
FX_DWORD dwProps = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch];
FX_DWORD dwTemp = (dwProps & 0xFF800000);
@@ -49,7 +49,7 @@ FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, bool bRTL, bool bVertical)
}
return wch;
}
-FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, bool bRTL, bool bVertical)
+FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, FX_BOOL bRTL, FX_BOOL bVertical)
{
FX_DWORD dwTemp = (dwProps & 0xFF800000);
if (bRTL && dwTemp < 0xFF800000) {
diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp
index 73695a6ec8..dcf91d1a97 100644
--- a/core/src/fxcrt/fx_xml_parser.cpp
+++ b/core/src/fxcrt/fx_xml_parser.cpp
@@ -12,34 +12,34 @@ CXML_Parser::~CXML_Parser()
m_pDataAcc->Release();
}
}
-bool CXML_Parser::Init(uint8_t* pBuffer, size_t size)
+FX_BOOL CXML_Parser::Init(uint8_t* pBuffer, size_t size)
{
m_pDataAcc = new CXML_DataBufAcc(pBuffer, size);
- return Init(true);
+ return Init(TRUE);
}
-bool CXML_Parser::Init(IFX_FileRead *pFileRead)
+FX_BOOL CXML_Parser::Init(IFX_FileRead *pFileRead)
{
m_pDataAcc = new CXML_DataStmAcc(pFileRead);
- return Init(true);
+ return Init(TRUE);
}
-bool CXML_Parser::Init(IFX_BufferRead *pBuffer)
+FX_BOOL CXML_Parser::Init(IFX_BufferRead *pBuffer)
{
if (!pBuffer) {
- return false;
+ return FALSE;
}
m_pDataAcc = pBuffer;
- return Init(false);
+ return Init(FALSE);
}
-bool CXML_Parser::Init(bool bOwndedStream)
+FX_BOOL CXML_Parser::Init(FX_BOOL bOwndedStream)
{
m_bOwnedStream = bOwndedStream;
m_nOffset = 0;
return ReadNextBlock();
}
-bool CXML_Parser::ReadNextBlock()
+FX_BOOL CXML_Parser::ReadNextBlock()
{
if (!m_pDataAcc->ReadNextBlock()) {
- return false;
+ return FALSE;
}
m_pBuffer = m_pDataAcc->GetBlockBuffer();
m_dwBufferSize = m_pDataAcc->GetBlockSize();
@@ -47,10 +47,10 @@ bool CXML_Parser::ReadNextBlock()
m_dwIndex = 0;
return m_dwBufferSize > 0;
}
-bool CXML_Parser::IsEOF()
+FX_BOOL CXML_Parser::IsEOF()
{
if (!m_pDataAcc->IsEOF()) {
- return false;
+ return FALSE;
}
return m_dwIndex >= m_dwBufferSize;
}
@@ -82,27 +82,27 @@ uint8_t g_FXCRT_XML_ByteTypes[256] = {
0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x01, 0x01,
};
-bool g_FXCRT_XML_IsWhiteSpace(uint8_t ch)
+FX_BOOL g_FXCRT_XML_IsWhiteSpace(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_SpaceChar) != 0;
}
-bool g_FXCRT_XML_IsLetter(uint8_t ch)
+FX_BOOL g_FXCRT_XML_IsLetter(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Letter) != 0;
}
-bool g_FXCRT_XML_IsDigital(uint8_t ch)
+FX_BOOL g_FXCRT_XML_IsDigital(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Digital) != 0;
}
-bool g_FXCRT_XML_IsNameIntro(uint8_t ch)
+FX_BOOL g_FXCRT_XML_IsNameIntro(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameIntro) != 0;
}
-bool g_FXCRT_XML_IsNameChar(uint8_t ch)
+FX_BOOL g_FXCRT_XML_IsNameChar(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameChar) != 0;
}
-bool g_FXCRT_XML_IsHexChar(uint8_t ch)
+FX_BOOL g_FXCRT_XML_IsHexChar(uint8_t ch)
{
return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar) != 0;
}
@@ -310,13 +310,13 @@ void CXML_Parser::GetAttrValue(CFX_WideString &value)
} while (ReadNextBlock());
value = decoder.GetResult();
}
-void CXML_Parser::GetTagName(CFX_ByteString &space, CFX_ByteString &name, bool &bEndTag, bool bStartTag)
+void CXML_Parser::GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOOL &bEndTag, FX_BOOL bStartTag)
{
m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
if (IsEOF()) {
return;
}
- bEndTag = false;
+ bEndTag = FALSE;
uint8_t ch;
int32_t iState = bStartTag ? 1 : 0;
do {
@@ -345,10 +345,10 @@ void CXML_Parser::GetTagName(CFX_ByteString &space, CFX_ByteString &name, bool &
if (ch == '/') {
m_dwIndex ++;
GetName(space, name);
- bEndTag = true;
+ bEndTag = TRUE;
} else {
GetName(space, name);
- bEndTag = false;
+ bEndTag = FALSE;
}
return;
}
@@ -359,14 +359,14 @@ void CXML_Parser::GetTagName(CFX_ByteString &space, CFX_ByteString &name, bool &
}
} while (ReadNextBlock());
}
-CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, bool bStartTag)
+CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag)
{
m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
if (IsEOF()) {
return NULL;
}
CFX_ByteString tag_name, tag_space;
- bool bEndTag;
+ FX_BOOL bEndTag;
GetTagName(tag_space, tag_name, bEndTag, bStartTag);
if (tag_name.IsEmpty() || bEndTag) {
return NULL;
@@ -427,7 +427,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, bool bStartTag)
}
CFX_UTF8Decoder decoder;
CFX_WideTextBuf content;
- bool bCDATA = false;
+ FX_BOOL bCDATA = FALSE;
int32_t iState = 0;
do {
while (m_dwIndex < m_dwBufferSize) {
@@ -465,10 +465,10 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, bool bStartTag)
InsertContentSegment(bCDATA, dataStr, pElement);
content.Clear();
decoder.Clear();
- bCDATA = false;
+ bCDATA = FALSE;
iState = 0;
m_dwIndex --;
- CXML_Element* pSubElement = ParseElement(pElement, true);
+ CXML_Element* pSubElement = ParseElement(pElement, TRUE);
if (pSubElement == NULL) {
break;
}
@@ -509,10 +509,10 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, bool bStartTag)
InsertContentSegment(bCDATA, dataStr, pElement);
content.Clear();
decoder.Clear();
- bCDATA = false;
+ bCDATA = FALSE;
return pElement;
}
-void CXML_Parser::InsertContentSegment(bool bCDATA, const CFX_WideStringC& content, CXML_Element* pElement)
+void CXML_Parser::InsertContentSegment(FX_BOOL bCDATA, const CFX_WideStringC& content, CXML_Element* pElement)
{
if (content.IsEmpty()) {
return;
@@ -522,16 +522,16 @@ void CXML_Parser::InsertContentSegment(bool bCDATA, const CFX_WideStringC& conte
pElement->m_Children.Add((void*)CXML_Element::Content);
pElement->m_Children.Add(pContent);
}
-static CXML_Element* XML_ContinueParse(CXML_Parser &parser, bool bSaveSpaceChars, FX_FILESIZE* pParsedSize)
+static CXML_Element* XML_ContinueParse(CXML_Parser &parser, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize)
{
parser.m_bSaveSpaceChars = bSaveSpaceChars;
- CXML_Element* pElement = parser.ParseElement(NULL, false);
+ CXML_Element* pElement = parser.ParseElement(NULL, FALSE);
if (pParsedSize) {
*pParsedSize = parser.m_nOffset;
}
return pElement;
}
-CXML_Element* CXML_Element::Parse(const void* pBuffer, size_t size, bool bSaveSpaceChars, FX_FILESIZE* pParsedSize)
+CXML_Element* CXML_Element::Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize)
{
CXML_Parser parser;
if (!parser.Init((uint8_t*)pBuffer, size)) {
@@ -539,7 +539,7 @@ CXML_Element* CXML_Element::Parse(const void* pBuffer, size_t size, bool bSaveSp
}
return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
}
-CXML_Element* CXML_Element::Parse(IFX_FileRead *pFile, bool bSaveSpaceChars, FX_FILESIZE* pParsedSize)
+CXML_Element* CXML_Element::Parse(IFX_FileRead *pFile, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize)
{
CXML_Parser parser;
if (!parser.Init(pFile)) {
@@ -547,7 +547,7 @@ CXML_Element* CXML_Element::Parse(IFX_FileRead *pFile, bool bSaveSpaceChars, FX_
}
return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
}
-CXML_Element* CXML_Element::Parse(IFX_BufferRead *pBuffer, bool bSaveSpaceChars, FX_FILESIZE* pParsedSize)
+CXML_Element* CXML_Element::Parse(IFX_BufferRead *pBuffer, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize)
{
CXML_Parser parser;
if (!parser.Init(pBuffer)) {
@@ -600,7 +600,7 @@ void CXML_Element::RemoveChildren()
}
m_Children.RemoveAll();
}
-CFX_ByteString CXML_Element::GetTagName(bool bQualified) const
+CFX_ByteString CXML_Element::GetTagName(FX_BOOL bQualified) const
{
if (!bQualified || m_QSpaceName.IsEmpty()) {
return m_TagName;
@@ -610,7 +610,7 @@ CFX_ByteString CXML_Element::GetTagName(bool bQualified) const
bsTag += m_TagName;
return bsTag;
}
-CFX_ByteString CXML_Element::GetNamespace(bool bQualified) const
+CFX_ByteString CXML_Element::GetNamespace(FX_BOOL bQualified) const
{
if (bQualified) {
return m_QSpaceName;
@@ -644,61 +644,61 @@ void CXML_Element::GetAttrByIndex(int index, CFX_ByteString& space, CFX_ByteStri
name = item.m_AttrName;
value = item.m_Value;
}
-bool CXML_Element::HasAttr(const CFX_ByteStringC& name) const
+FX_BOOL CXML_Element::HasAttr(const CFX_ByteStringC& name) const
{
CFX_ByteStringC bsSpace, bsName;
FX_XML_SplitQualifiedName(name, bsSpace, bsName);
return m_AttrMap.Lookup(bsSpace, bsName) != NULL;
}
-bool CXML_Element::GetAttrValue(const CFX_ByteStringC& name, CFX_WideString& attribute) const
+FX_BOOL CXML_Element::GetAttrValue(const CFX_ByteStringC& name, CFX_WideString& attribute) const
{
CFX_ByteStringC bsSpace, bsName;
FX_XML_SplitQualifiedName(name, bsSpace, bsName);
return GetAttrValue(bsSpace, bsName, attribute);
}
-bool CXML_Element::GetAttrValue(const CFX_ByteStringC& space, const CFX_ByteStringC& name, CFX_WideString& attribute) const
+FX_BOOL CXML_Element::GetAttrValue(const CFX_ByteStringC& space, const CFX_ByteStringC& name, CFX_WideString& attribute) const
{
const CFX_WideString* pValue = m_AttrMap.Lookup(space, name);
if (pValue) {
attribute = *pValue;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CXML_Element::GetAttrInteger(const CFX_ByteStringC& name, int& attribute) const
+FX_BOOL CXML_Element::GetAttrInteger(const CFX_ByteStringC& name, int& attribute) const
{
CFX_ByteStringC bsSpace, bsName;
FX_XML_SplitQualifiedName(name, bsSpace, bsName);
const CFX_WideString* pwsValue = m_AttrMap.Lookup(bsSpace, bsName);
if (pwsValue) {
attribute = pwsValue->GetInteger();
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CXML_Element::GetAttrInteger(const CFX_ByteStringC& space, const CFX_ByteStringC& name, int& attribute) const
+FX_BOOL CXML_Element::GetAttrInteger(const CFX_ByteStringC& space, const CFX_ByteStringC& name, int& attribute) const
{
const CFX_WideString* pwsValue = m_AttrMap.Lookup(space, name);
if (pwsValue) {
attribute = pwsValue->GetInteger();
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CXML_Element::GetAttrFloat(const CFX_ByteStringC& name, FX_FLOAT& attribute) const
+FX_BOOL CXML_Element::GetAttrFloat(const CFX_ByteStringC& name, FX_FLOAT& attribute) const
{
CFX_ByteStringC bsSpace, bsName;
FX_XML_SplitQualifiedName(name, bsSpace, bsName);
return GetAttrFloat(bsSpace, bsName, attribute);
}
-bool CXML_Element::GetAttrFloat(const CFX_ByteStringC& space, const CFX_ByteStringC& name, FX_FLOAT& attribute) const
+FX_BOOL CXML_Element::GetAttrFloat(const CFX_ByteStringC& space, const CFX_ByteStringC& name, FX_FLOAT& attribute) const
{
const CFX_WideString* pValue = m_AttrMap.Lookup(space, name);
if (pValue) {
attribute = pValue->GetFloat();
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
FX_DWORD CXML_Element::CountChildren() const
{
diff --git a/core/src/fxcrt/fxcrt_platforms.cpp b/core/src/fxcrt/fxcrt_platforms.cpp
index 813af02ce4..e7182943be 100644
--- a/core/src/fxcrt/fxcrt_platforms.cpp
+++ b/core/src/fxcrt/fxcrt_platforms.cpp
@@ -40,20 +40,20 @@ CFXCRT_FileAccess_CRT::~CFXCRT_FileAccess_CRT()
{
Close();
}
-bool CFXCRT_FileAccess_CRT::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode)
+FX_BOOL CFXCRT_FileAccess_CRT::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode)
{
if (m_hFile) {
- return false;
+ return FALSE;
}
CFX_ByteString strMode;
FXCRT_GetFileModeString(dwMode, strMode);
m_hFile = FXSYS_fopen(fileName.GetCStr(), strMode.c_str());
return m_hFile != NULL;
}
-bool CFXCRT_FileAccess_CRT::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode)
+FX_BOOL CFXCRT_FileAccess_CRT::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode)
{
if (m_hFile) {
- return false;
+ return FALSE;
}
CFX_WideString strMode;
FXCRT_GetFileModeString(dwMode, strMode);
@@ -128,45 +128,45 @@ size_t CFXCRT_FileAccess_CRT::WritePos(const void* pBuffer, size_t szBuffer, FX_
FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
return FXSYS_fwrite(pBuffer, 1, szBuffer, m_hFile);
}
-bool CFXCRT_FileAccess_CRT::Flush()
+FX_BOOL CFXCRT_FileAccess_CRT::Flush()
{
if (!m_hFile) {
- return false;
+ return FALSE;
}
return !FXSYS_fflush(m_hFile);
}
-bool CFXCRT_FileAccess_CRT::Truncate(FX_FILESIZE szFile)
+FX_BOOL CFXCRT_FileAccess_CRT::Truncate(FX_FILESIZE szFile)
{
- return false;
+ return FALSE;
}
-bool FX_File_Exist(const CFX_ByteStringC& fileName)
+FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName)
{
return access(fileName.GetCStr(), F_OK) > -1;
}
-bool FX_File_Exist(const CFX_WideStringC& fileName)
+FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName)
{
return FX_File_Exist(FX_UTF8Encode(fileName));
}
-bool FX_File_Delete(const CFX_ByteStringC& fileName)
+FX_BOOL FX_File_Delete(const CFX_ByteStringC& fileName)
{
return remove(fileName.GetCStr()) > -1;
}
-bool FX_File_Delete(const CFX_WideStringC& fileName)
+FX_BOOL FX_File_Delete(const CFX_WideStringC& fileName)
{
return FX_File_Delete(FX_UTF8Encode(fileName));
}
-bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
+FX_BOOL FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
{
CFXCRT_FileAccess_CRT src, dst;
if (!src.Open(fileNameSrc, FX_FILEMODE_ReadOnly)) {
- return false;
+ return FALSE;
}
FX_FILESIZE size = src.GetSize();
if (!size) {
- return false;
+ return FALSE;
}
if (!dst.Open(fileNameDst, FX_FILEMODE_Truncate)) {
- return false;
+ return FALSE;
}
FX_FILESIZE num = 0;
uint8_t* pBuffer = FX_Alloc(uint8_t, 32768);
@@ -176,17 +176,17 @@ bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fil
}
}
FX_Free(pBuffer);
- return true;
+ return TRUE;
}
-bool FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
+FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
{
return FX_File_Copy(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
}
-bool FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
+FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
{
return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
}
-bool FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
+FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
{
return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
}
diff --git a/core/src/fxcrt/fxcrt_platforms.h b/core/src/fxcrt/fxcrt_platforms.h
index d95ae4f376..4fd0588c94 100644
--- a/core/src/fxcrt/fxcrt_platforms.h
+++ b/core/src/fxcrt/fxcrt_platforms.h
@@ -17,8 +17,8 @@ class CFXCRT_FileAccess_CRT : public IFXCRT_FileAccess
public:
CFXCRT_FileAccess_CRT();
virtual ~CFXCRT_FileAccess_CRT();
- virtual bool Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode);
- virtual bool Open(const CFX_WideStringC& fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(const CFX_WideStringC& fileName, FX_DWORD dwMode);
virtual void Close();
virtual void Release();
virtual FX_FILESIZE GetSize() const;
@@ -28,8 +28,8 @@ public:
virtual size_t Write(const void* pBuffer, size_t szBuffer);
virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual bool Flush();
- virtual bool Truncate(FX_FILESIZE szFile);
+ virtual FX_BOOL Flush();
+ virtual FX_BOOL Truncate(FX_FILESIZE szFile);
protected:
FXSYS_FILE* m_hFile;
};
diff --git a/core/src/fxcrt/fxcrt_posix.cpp b/core/src/fxcrt/fxcrt_posix.cpp
index eb7213e5b0..84646efd5c 100644
--- a/core/src/fxcrt/fxcrt_posix.cpp
+++ b/core/src/fxcrt/fxcrt_posix.cpp
@@ -34,17 +34,17 @@ CFXCRT_FileAccess_Posix::~CFXCRT_FileAccess_Posix()
{
Close();
}
-bool CFXCRT_FileAccess_Posix::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode)
+FX_BOOL CFXCRT_FileAccess_Posix::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode)
{
if (m_nFD > -1) {
- return false;
+ return FALSE;
}
int32_t nFlags, nMasks;
FXCRT_Posix_GetFileMode(dwMode, nFlags, nMasks);
m_nFD = open(fileName.GetCStr(), nFlags, nMasks);
return m_nFD > -1;
}
-bool CFXCRT_FileAccess_Posix::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode)
+FX_BOOL CFXCRT_FileAccess_Posix::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode)
{
return Open(FX_UTF8Encode(fileName), dwMode);
}
@@ -121,48 +121,48 @@ size_t CFXCRT_FileAccess_Posix::WritePos(const void* pBuffer, size_t szBuffer, F
}
return Write(pBuffer, szBuffer);
}
-bool CFXCRT_FileAccess_Posix::Flush()
+FX_BOOL CFXCRT_FileAccess_Posix::Flush()
{
if (m_nFD < 0) {
- return false;
+ return FALSE;
}
return fsync(m_nFD) > -1;
}
-bool CFXCRT_FileAccess_Posix::Truncate(FX_FILESIZE szFile)
+FX_BOOL CFXCRT_FileAccess_Posix::Truncate(FX_FILESIZE szFile)
{
if (m_nFD < 0) {
- return false;
+ return FALSE;
}
return !ftruncate(m_nFD, szFile);
}
-bool FX_File_Exist(const CFX_ByteStringC& fileName)
+FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName)
{
return access(fileName.GetCStr(), F_OK) > -1;
}
-bool FX_File_Exist(const CFX_WideStringC& fileName)
+FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName)
{
return FX_File_Exist(FX_UTF8Encode(fileName));
}
-bool FX_File_Delete(const CFX_ByteStringC& fileName)
+FX_BOOL FX_File_Delete(const CFX_ByteStringC& fileName)
{
return remove(fileName.GetCStr()) > -1;
}
-bool FX_File_Delete(const CFX_WideStringC& fileName)
+FX_BOOL FX_File_Delete(const CFX_WideStringC& fileName)
{
return FX_File_Delete(FX_UTF8Encode(fileName));
}
-bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
+FX_BOOL FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
{
CFXCRT_FileAccess_Posix src, dst;
if (!src.Open(fileNameSrc, FX_FILEMODE_ReadOnly)) {
- return false;
+ return FALSE;
}
FX_FILESIZE size = src.GetSize();
if (!size) {
- return false;
+ return FALSE;
}
if (!dst.Open(fileNameDst, FX_FILEMODE_Truncate)) {
- return false;
+ return FALSE;
}
size_t num = 0;
uint8_t* pBuffer = FX_Alloc(uint8_t, 32768);
@@ -174,17 +174,17 @@ bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fil
num = src.Read(pBuffer, 32768);
}
FX_Free(pBuffer);
- return true;
+ return TRUE;
}
-bool FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
+FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
{
return FX_File_Copy(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
}
-bool FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
+FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
{
return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
}
-bool FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
+FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
{
return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
}
diff --git a/core/src/fxcrt/fxcrt_posix.h b/core/src/fxcrt/fxcrt_posix.h
index 653a150aa8..39df1c8507 100644
--- a/core/src/fxcrt/fxcrt_posix.h
+++ b/core/src/fxcrt/fxcrt_posix.h
@@ -15,8 +15,8 @@ class CFXCRT_FileAccess_Posix : public IFXCRT_FileAccess
public:
CFXCRT_FileAccess_Posix();
virtual ~CFXCRT_FileAccess_Posix();
- virtual bool Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode);
- virtual bool Open(const CFX_WideStringC& fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(const CFX_WideStringC& fileName, FX_DWORD dwMode);
virtual void Close();
virtual void Release();
virtual FX_FILESIZE GetSize() const;
@@ -26,8 +26,8 @@ public:
virtual size_t Write(const void* pBuffer, size_t szBuffer);
virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual bool Flush();
- virtual bool Truncate(FX_FILESIZE szFile);
+ virtual FX_BOOL Flush();
+ virtual FX_BOOL Truncate(FX_FILESIZE szFile);
protected:
int32_t m_nFD;
};
diff --git a/core/src/fxcrt/fxcrt_windows.cpp b/core/src/fxcrt/fxcrt_windows.cpp
index 7effab6919..d4e3830cf2 100644
--- a/core/src/fxcrt/fxcrt_windows.cpp
+++ b/core/src/fxcrt/fxcrt_windows.cpp
@@ -8,19 +8,19 @@
#include "fxcrt_windows.h"
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-bool FX_File_Exist(const CFX_ByteStringC& fileName)
+FX_BOOL FX_File_Exist(const CFX_ByteStringC& fileName)
{
FX_DWORD dwAttri = ::GetFileAttributesA(fileName.GetCStr());
if (dwAttri == -1) {
- return false;
+ return FALSE;
}
return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0;
}
-bool FX_File_Exist(const CFX_WideStringC& fileName)
+FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName)
{
FX_DWORD dwAttri = ::GetFileAttributesW((LPCWSTR)fileName.GetPtr());
if (dwAttri == -1) {
- return false;
+ return FALSE;
}
return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0;
}
@@ -55,10 +55,10 @@ CFXCRT_FileAccess_Win64::~CFXCRT_FileAccess_Win64()
{
Close();
}
-bool CFXCRT_FileAccess_Win64::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode)
+FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode)
{
if (m_hFile) {
- return false;
+ return FALSE;
}
FX_DWORD dwAccess, dwShare, dwCreation;
FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
@@ -68,10 +68,10 @@ bool CFXCRT_FileAccess_Win64::Open(const CFX_ByteStringC& fileName, FX_DWORD dwM
}
return m_hFile != NULL;
}
-bool CFXCRT_FileAccess_Win64::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode)
+FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode)
{
if (m_hFile) {
- return false;
+ return FALSE;
}
FX_DWORD dwAccess, dwShare, dwCreation;
FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
@@ -174,41 +174,41 @@ size_t CFXCRT_FileAccess_Win64::WritePos(const void* pBuffer, size_t szBuffer, F
}
return Write(pBuffer, szBuffer);
}
-bool CFXCRT_FileAccess_Win64::Flush()
+FX_BOOL CFXCRT_FileAccess_Win64::Flush()
{
if (!m_hFile) {
- return false;
+ return FALSE;
}
return ::FlushFileBuffers(m_hFile);
}
-bool CFXCRT_FileAccess_Win64::Truncate(FX_FILESIZE szFile)
+FX_BOOL CFXCRT_FileAccess_Win64::Truncate(FX_FILESIZE szFile)
{
if (SetPosition(szFile) == (FX_FILESIZE) - 1) {
- return false;
+ return FALSE;
}
return ::SetEndOfFile(m_hFile);
}
-bool FX_File_Delete(const CFX_ByteStringC& fileName)
+FX_BOOL FX_File_Delete(const CFX_ByteStringC& fileName)
{
return ::DeleteFileA(fileName.GetCStr());
}
-bool FX_File_Delete(const CFX_WideStringC& fileName)
+FX_BOOL FX_File_Delete(const CFX_WideStringC& fileName)
{
return ::DeleteFileW((LPCWSTR)fileName.GetPtr());
}
-bool FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
+FX_BOOL FX_File_Copy(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
{
- return ::CopyFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr(), false);
+ return ::CopyFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr(), FALSE);
}
-bool FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
+FX_BOOL FX_File_Copy(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
{
- return ::CopyFileW((LPCWSTR)fileNameSrc.GetPtr(), (LPCWSTR)fileNameDst.GetPtr(), false);
+ return ::CopyFileW((LPCWSTR)fileNameSrc.GetPtr(), (LPCWSTR)fileNameDst.GetPtr(), FALSE);
}
-bool FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
+FX_BOOL FX_File_Move(const CFX_ByteStringC& fileNameSrc, const CFX_ByteStringC& fileNameDst)
{
return ::MoveFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
}
-bool FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
+FX_BOOL FX_File_Move(const CFX_WideStringC& fileNameSrc, const CFX_WideStringC& fileNameDst)
{
return ::MoveFileW((LPCWSTR)fileNameSrc.GetPtr(), (LPCWSTR)fileNameDst.GetPtr());
}
diff --git a/core/src/fxcrt/fxcrt_windows.h b/core/src/fxcrt/fxcrt_windows.h
index 414b863a50..8dd2cddc82 100644
--- a/core/src/fxcrt/fxcrt_windows.h
+++ b/core/src/fxcrt/fxcrt_windows.h
@@ -15,8 +15,8 @@ class CFXCRT_FileAccess_Win64 : public IFXCRT_FileAccess
public:
CFXCRT_FileAccess_Win64();
virtual ~CFXCRT_FileAccess_Win64();
- virtual bool Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode);
- virtual bool Open(const CFX_WideStringC& fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(const CFX_WideStringC& fileName, FX_DWORD dwMode);
virtual void Close();
virtual void Release();
virtual FX_FILESIZE GetSize() const;
@@ -26,8 +26,8 @@ public:
virtual size_t Write(const void* pBuffer, size_t szBuffer);
virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual bool Flush();
- virtual bool Truncate(FX_FILESIZE szFile);
+ virtual FX_BOOL Flush();
+ virtual FX_BOOL Truncate(FX_FILESIZE szFile);
protected:
void* m_hFile;
};
diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h
index ec8bdc2850..109c7a43d2 100644
--- a/core/src/fxcrt/xml_int.h
+++ b/core/src/fxcrt/xml_int.h
@@ -23,7 +23,7 @@ public:
{
delete this;
}
- virtual bool IsEOF()
+ virtual FX_BOOL IsEOF()
{
return m_dwCurPos >= m_dwSize;
}
@@ -35,16 +35,16 @@ public:
{
return 0;
}
- virtual bool ReadNextBlock(bool bRestart = false)
+ virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE)
{
if (bRestart) {
m_dwCurPos = 0;
}
if (m_dwCurPos < m_dwSize) {
m_dwCurPos = m_dwSize;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
virtual const uint8_t* GetBlockBuffer()
{
@@ -85,7 +85,7 @@ public:
{
delete this;
}
- virtual bool IsEOF()
+ virtual FX_BOOL IsEOF()
{
return m_nStart + (FX_FILESIZE)m_dwSize >= m_pFileRead->GetSize();
}
@@ -97,7 +97,7 @@ public:
{
return 0;
}
- virtual bool ReadNextBlock(bool bRestart = false)
+ virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE)
{
if (bRestart) {
m_nStart = 0;
@@ -105,7 +105,7 @@ public:
FX_FILESIZE nLength = m_pFileRead->GetSize();
m_nStart += (FX_FILESIZE)m_dwSize;
if (m_nStart >= nLength) {
- return false;
+ return FALSE;
}
m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart);
if (!m_pBuffer) {
@@ -136,28 +136,28 @@ class CXML_Parser
public:
~CXML_Parser();
IFX_BufferRead* m_pDataAcc;
- bool m_bOwnedStream;
+ FX_BOOL m_bOwnedStream;
FX_FILESIZE m_nOffset;
- bool m_bSaveSpaceChars;
+ FX_BOOL m_bSaveSpaceChars;
const uint8_t* m_pBuffer;
size_t m_dwBufferSize;
FX_FILESIZE m_nBufferOffset;
size_t m_dwIndex;
- bool Init(uint8_t* pBuffer, size_t size);
- bool Init(IFX_FileRead *pFileRead);
- bool Init(IFX_BufferRead *pBuffer);
- bool Init(bool bOwndedStream);
- bool ReadNextBlock();
- bool IsEOF();
- bool HaveAvailData();
+ FX_BOOL Init(uint8_t* pBuffer, size_t size);
+ FX_BOOL Init(IFX_FileRead *pFileRead);
+ FX_BOOL Init(IFX_BufferRead *pBuffer);
+ FX_BOOL Init(FX_BOOL bOwndedStream);
+ FX_BOOL ReadNextBlock();
+ FX_BOOL IsEOF();
+ FX_BOOL HaveAvailData();
void SkipWhiteSpaces();
void GetName(CFX_ByteString& space, CFX_ByteString& name);
void GetAttrValue(CFX_WideString &value);
FX_DWORD GetCharRef();
- void GetTagName(CFX_ByteString &space, CFX_ByteString &name, bool &bEndTag, bool bStartTag = false);
+ void GetTagName(CFX_ByteString &space, CFX_ByteString &name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE);
void SkipLiterals(const CFX_ByteStringC& str);
- CXML_Element* ParseElement(CXML_Element* pParent, bool bStartTag = false);
- void InsertContentSegment(bool bCDATA, const CFX_WideStringC& content, CXML_Element* pElement);
+ CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE);
+ void InsertContentSegment(FX_BOOL bCDATA, const CFX_WideStringC& content, CXML_Element* pElement);
void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXML_Element* pElement);
};
void FX_XML_SplitQualifiedName(const CFX_ByteStringC& bsFullName, CFX_ByteStringC &bsSpace, CFX_ByteStringC &bsName);
diff --git a/core/src/fxge/agg/include/fx_agg_driver.h b/core/src/fxge/agg/include/fx_agg_driver.h
index c8d620122e..29b56c77e4 100644
--- a/core/src/fxge/agg/include/fx_agg_driver.h
+++ b/core/src/fxge/agg/include/fx_agg_driver.h
@@ -22,7 +22,7 @@ public:
class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver
{
public:
- CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout);
+ CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout);
virtual ~CFX_AggDeviceDriver();
void InitPlatform();
void DestroyPlatform();
@@ -32,22 +32,22 @@ public:
virtual void SaveState();
- virtual void RestoreState(bool bKeepSaved);
+ virtual void RestoreState(FX_BOOL bKeepSaved);
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData,
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
);
- virtual bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
);
- virtual bool DrawPath(const CFX_PathData* pPathData,
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -58,44 +58,44 @@ public:
int blend_type
);
- virtual bool SetPixel(int x, int y, FX_DWORD color,
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
int alpha_flag, void* pIccTransform);
- virtual bool FillRect(const FX_RECT* pRect,
+ virtual FX_BOOL FillRect(const FX_RECT* pRect,
FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int alpha_flag, void* pIccTransform, int blend_type)
{
- return false;
+ return FALSE;
}
- virtual bool GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
- virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false);
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
virtual CFX_DIBitmap* GetBackDrop()
{
return m_pOriDevice;
}
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform);
- virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause);
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
virtual void CancelDIBits(void* handle);
- virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform);
- virtual bool RenderRasterizer(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa)& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+ virtual FX_BOOL RenderRasterizer(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa)& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
int alpha_flag, void* pIccTransform);
void SetClipMask(FX_NAMESPACE_DECLARE(agg, rasterizer_scanline_aa)& rasterizer);
@@ -117,9 +117,9 @@ public:
void* m_pDwRenderTartget;
int m_FillFlags;
int m_DitherBits;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bRgbByteOrder;
CFX_DIBitmap* m_pOriDevice;
- bool m_bGroupKnockout;
+ FX_BOOL m_bGroupKnockout;
};
#endif // FX_AGG_DRIVER_H_
diff --git a/core/src/fxge/agg/src/fx_agg_driver.cpp b/core/src/fxge/agg/src/fx_agg_driver.cpp
index 2f96ef7379..118db7bf1f 100644
--- a/core/src/fxge/agg/src/fx_agg_driver.cpp
+++ b/core/src/fxge/agg/src/fx_agg_driver.cpp
@@ -119,7 +119,7 @@ private:
static void RasterizeStroke(agg::rasterizer_scanline_aa& rasterizer, agg::path_storage& path_data,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState, FX_FLOAT scale = 1.0f,
- bool bStrokeAdjust = false, bool bTextMode = false)
+ FX_BOOL bStrokeAdjust = FALSE, FX_BOOL bTextMode = FALSE)
{
agg::line_cap_e cap;
switch (pGraphState->m_LineCap) {
@@ -185,11 +185,11 @@ static void RasterizeStroke(agg::rasterizer_scanline_aa& rasterizer, agg::path_s
rasterizer.add_path_transformed(stroke, pObject2Device);
}
}
-IFX_RenderDeviceDriver* IFX_RenderDeviceDriver::CreateFxgeDriver(CFX_DIBitmap* pBitmap, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+IFX_RenderDeviceDriver* IFX_RenderDeviceDriver::CreateFxgeDriver(CFX_DIBitmap* pBitmap, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
return new CFX_AggDeviceDriver(pBitmap, 0, bRgbByteOrder, pOriDevice, bGroupKnockout);
}
-CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
m_pBitmap = pBitmap;
m_DitherBits = dither_bits;
@@ -217,11 +217,11 @@ void CFX_AggDeviceDriver::InitPlatform()
void CFX_AggDeviceDriver::DestroyPlatform()
{
}
-bool CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform)
{
- return false;
+ return FALSE;
}
#endif
int CFX_AggDeviceDriver::GetDeviceCaps(int caps_id)
@@ -267,7 +267,7 @@ void CFX_AggDeviceDriver::SaveState()
}
m_StateStack.Add(pClip);
}
-void CFX_AggDeviceDriver::RestoreState(bool bKeepSaved)
+void CFX_AggDeviceDriver::RestoreState(FX_BOOL bKeepSaved)
{
if (m_StateStack.GetSize() == 0) {
delete m_pClipRgn;
@@ -307,7 +307,7 @@ void CFX_AggDeviceDriver::SetClipMask(agg::rasterizer_scanline_aa& rasterizer)
agg::render_scanlines(rasterizer, scanline, final_render, (m_FillFlags & FXFILL_NOPATHSMOOTH) != 0);
m_pClipRgn->IntersectMaskF(path_rect.left, path_rect.top, mask);
}
-bool CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
+FX_BOOL CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
)
@@ -322,7 +322,7 @@ bool CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
rectf.Intersect(CFX_FloatRect(0, 0, (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_WIDTH), (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
FX_RECT rect = rectf.GetOutterRect();
m_pClipRgn->IntersectRect(rect);
- return true;
+ return TRUE;
}
}
CAgg_PathData path_data;
@@ -333,9 +333,9 @@ bool CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
rasterizer.add_path(path_data.m_PathData);
rasterizer.filling_rule((fill_mode & 3) == FXFILL_WINDING ? agg::fill_non_zero : agg::fill_even_odd);
SetClipMask(rasterizer);
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
+FX_BOOL CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
)
@@ -350,7 +350,7 @@ bool CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
RasterizeStroke(rasterizer, path_data.m_PathData, pObject2Device, pGraphState);
rasterizer.filling_rule(agg::fill_non_zero);
SetClipMask(rasterizer);
- return true;
+ return TRUE;
}
class CFX_Renderer
{
@@ -361,8 +361,8 @@ private:
m_Blue,
m_Gray;
FX_DWORD m_Color;
- bool m_bFullCover;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bFullCover;
+ FX_BOOL m_bRgbByteOrder;
CFX_DIBitmap* m_pOriDevice;
FX_RECT m_ClipBox;
const CFX_DIBitmap* m_pClipMask;
@@ -371,7 +371,7 @@ private:
void (CFX_Renderer::*composite_span)(uint8_t*, int, int, int, uint8_t*, int, int, uint8_t*, uint8_t*);
public:
void prepare(unsigned) {}
- void CompositeSpan(uint8_t* dest_scan, uint8_t* ori_scan, int Bpp, bool bDestAlpha,
+ void CompositeSpan(uint8_t* dest_scan, uint8_t* ori_scan, int Bpp, FX_BOOL bDestAlpha,
int span_left, int span_len, uint8_t* cover_scan,
int clip_left, int clip_right, uint8_t* clip_scan)
{
@@ -955,7 +955,7 @@ public:
ori_scan = m_pOriDevice->GetBuffer() + m_pOriDevice->GetPitch() * y;
}
int Bpp = m_pDevice->GetBPP() / 8;
- bool bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsAlphaMask();
+ FX_BOOL bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsAlphaMask();
unsigned num_spans = sl.num_spans();
typename Scanline::const_iterator span = sl.begin();
while (1) {
@@ -988,7 +988,7 @@ public:
}
}
- bool Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, bool bFullCover, bool bRgbByteOrder,
+ FX_BOOL Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder,
int alpha_flag = 0, void* pIccTransform = NULL)
{
m_pDevice = pDevice;
@@ -1008,8 +1008,8 @@ public:
m_pClipMask = m_pClipRgn->GetMask();
}
m_bFullCover = bFullCover;
- bool bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
- bool bDeviceCMYK = pDevice->IsCmykImage();
+ FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bDeviceCMYK = pDevice->IsCmykImage();
m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
ICodec_IccModule* pIccModule = NULL;
if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
@@ -1039,7 +1039,7 @@ public:
}
}
}
- return true;
+ return TRUE;
}
if (bDeviceCMYK) {
ASSERT(!m_bRgbByteOrder);
@@ -1051,7 +1051,7 @@ public:
}
} else {
if (!pIccTransform) {
- return false;
+ return FALSE;
}
color = FXARGB_TODIB(color);
pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&color, 1);
@@ -1100,22 +1100,22 @@ public:
if (m_pDevice->GetBPP() == 1) {
composite_span = &CFX_Renderer::CompositeSpan1bpp;
}
- return true;
+ return TRUE;
}
};
-bool CFX_AggDeviceDriver::RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+FX_BOOL CFX_AggDeviceDriver::RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
int alpha_flag, void* pIccTransform)
{
CFX_DIBitmap* pt = bGroupKnockout ? m_pOriDevice : NULL;
CFX_Renderer render;
if (!render.Init(m_pBitmap, pt, m_pClipRgn, color, bFullCover, m_bRgbByteOrder, alpha_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
agg::scanline_u8 scanline;
agg::render_scanlines(rasterizer, scanline, render, (m_FillFlags & FXFILL_NOPATHSMOOTH) != 0);
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
+FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -1127,10 +1127,10 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
if (GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
m_FillFlags = fill_mode;
if ((fill_mode & 3) && fill_color) {
@@ -1140,8 +1140,8 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
rasterizer.add_path(path_data.m_PathData);
rasterizer.filling_rule((fill_mode & 3) == FXFILL_WINDING ? agg::fill_non_zero : agg::fill_even_odd);
- if (!RenderRasterizer(rasterizer, fill_color, fill_mode & FXFILL_FULLCOVER, false, alpha_flag, pIccTransform)) {
- return false;
+ if (!RenderRasterizer(rasterizer, fill_color, fill_mode & FXFILL_FULLCOVER, FALSE, alpha_flag, pIccTransform)) {
+ return FALSE;
}
}
int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
@@ -1151,12 +1151,12 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
path_data.BuildPath(pPathData, pObject2Device);
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
- RasterizeStroke(rasterizer, path_data.m_PathData, NULL, pGraphState, 1, false, fill_mode & FX_STROKE_TEXT_MODE);
+ RasterizeStroke(rasterizer, path_data.m_PathData, NULL, pGraphState, 1, FALSE, fill_mode & FX_STROKE_TEXT_MODE);
int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag) << 8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
if (!RenderRasterizer(rasterizer, stroke_color, fill_mode & FXFILL_FULLCOVER, m_bGroupKnockout, fill_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
CFX_AffineMatrix matrix1, matrix2;
if (pObject2Device) {
@@ -1174,13 +1174,13 @@ bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
path_data.BuildPath(pPathData, &matrix1);
agg::rasterizer_scanline_aa rasterizer;
rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
- RasterizeStroke(rasterizer, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, false, fill_mode & FX_STROKE_TEXT_MODE);
+ RasterizeStroke(rasterizer, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, FALSE, fill_mode & FX_STROKE_TEXT_MODE);
int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag) << 8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
if (!RenderRasterizer(rasterizer, stroke_color, fill_mode & FXFILL_FULLCOVER, m_bGroupKnockout, fill_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, FX_DWORD argb)
{
@@ -1208,7 +1208,7 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid
width = rect.Width();
int src_r = FXARGB_R(argb), src_g = FXARGB_G(argb), src_b = FXARGB_B(argb);
int Bpp = pBitmap->GetBPP() / 8;
- bool bAlpha = pBitmap->HasAlpha();
+ FX_BOOL bAlpha = pBitmap->HasAlpha();
int dib_argb = FXARGB_TOBGRORDERDIB(argb);
uint8_t* pBuffer = pBitmap->GetBuffer();
if (src_alpha == 255) {
@@ -1317,7 +1317,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
}
}
} else {
- ASSERT(false);
+ ASSERT(FALSE);
}
} else if (dest_format == FXDIB_Argb || dest_format == FXDIB_Rgb32) {
if (src_format == FXDIB_Rgb) {
@@ -1351,7 +1351,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
}
}
} else {
- ASSERT(false);
+ ASSERT(FALSE);
}
}
FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha)
@@ -1361,9 +1361,9 @@ FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha)
r, g, b);
return ArgbEncode(alpha, r, g, b);
}
-bool _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
+FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
- bool bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
int alpha = bObjCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
@@ -1376,7 +1376,7 @@ bool _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha
} else {
if (pDevice->IsCmykImage()) {
if (!bObjCMYK) {
- return false;
+ return FALSE;
}
} else {
if (bObjCMYK) {
@@ -1388,12 +1388,12 @@ bool _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha
if (pDevice->m_pAlphaMask) {
pDevice->m_pAlphaMask->SetPixel(x, y, alpha << 24);
}
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
pIccTransform = NULL;
@@ -1413,12 +1413,12 @@ bool CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag,
}
} else if (m_pClipRgn->GetType() == CFX_ClipRgn::MaskF) {
const CFX_DIBitmap* pMask = m_pClipRgn->GetMask();
- bool bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
int new_alpha = bCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
new_alpha = new_alpha * pMask->GetScanline(y)[x] / 255;
if (m_bRgbByteOrder) {
RgbByteOrderSetPixel(m_pBitmap, x, y, (color & 0xffffff) | (new_alpha << 24));
- return true;
+ return TRUE;
}
if (bCMYK) {
FXSETFLAG_ALPHA_FILL(alpha_flag, new_alpha);
@@ -1428,15 +1428,15 @@ bool CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag,
return _DibSetPixel(m_pBitmap, x, y, color, alpha_flag, pIccTransform);
}
}
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
+FX_BOOL CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
FX_RECT clip_rect;
GetClipBox(&clip_rect);
@@ -1445,7 +1445,7 @@ bool CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, in
draw_rect.Intersect(*pRect);
}
if (draw_rect.IsEmpty()) {
- return true;
+ return TRUE;
}
if (m_pClipRgn == NULL || m_pClipRgn->GetType() == CFX_ClipRgn::RectI) {
if (m_bRgbByteOrder) {
@@ -1453,27 +1453,27 @@ bool CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, in
} else {
m_pBitmap->CompositeRect(draw_rect.left, draw_rect.top, draw_rect.Width(), draw_rect.Height(), fill_color, alpha_flag, pIccTransform);
}
- return true;
+ return TRUE;
}
m_pBitmap->CompositeMask(draw_rect.left, draw_rect.top, draw_rect.Width(), draw_rect.Height(), (const CFX_DIBitmap*)m_pClipRgn->GetMask(),
fill_color, draw_rect.left - clip_rect.left, draw_rect.top - clip_rect.top, FXDIB_BLEND_NORMAL, NULL, m_bRgbByteOrder, alpha_flag, pIccTransform);
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::GetClipBox(FX_RECT* pRect)
+FX_BOOL CFX_AggDeviceDriver::GetClipBox(FX_RECT* pRect)
{
if (m_pClipRgn == NULL) {
pRect->left = pRect->top = 0;
pRect->right = GetDeviceCaps(FXDC_PIXEL_WIDTH);
pRect->bottom = GetDeviceCaps(FXDC_PIXEL_HEIGHT);
- return true;
+ return TRUE;
}
*pRect = m_pClipRgn->GetBox();
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge)
+FX_BOOL CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
if (bDEdge) {
if (m_bRgbByteOrder) {
@@ -1481,23 +1481,23 @@ bool CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, vo
} else {
return pBitmap->TransferBitmap(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight(), m_pBitmap, left, top, pIccTransform);
}
- return true;
+ return TRUE;
}
FX_RECT rect(left, top, left + pBitmap->GetWidth(), top + pBitmap->GetHeight());
CFX_DIBitmap *pBack = NULL;
if (m_pOriDevice) {
pBack = m_pOriDevice->Clone(&rect);
if (!pBack) {
- return true;
+ return TRUE;
}
pBack->CompositeBitmap(0, 0, pBack->GetWidth(), pBack->GetHeight(), m_pBitmap, 0, 0);
} else {
pBack = m_pBitmap->Clone(&rect);
}
if (!pBack) {
- return true;
+ return TRUE;
}
- bool bRet = true;
+ FX_BOOL bRet = TRUE;
left = left >= 0 ? 0 : left;
top = top >= 0 ? 0 : top;
if (m_bRgbByteOrder) {
@@ -1508,11 +1508,11 @@ bool CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, vo
delete pBack;
return bRet;
}
-bool CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+FX_BOOL CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
if (pBitmap->IsAlphaMask())
return m_pBitmap->CompositeMask(left, top, pSrcRect->Width(), pSrcRect->Height(), pBitmap, argb,
@@ -1520,12 +1520,12 @@ bool CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb,
return m_pBitmap->CompositeBitmap(left, top, pSrcRect->Width(), pSrcRect->Height(), pBitmap,
pSrcRect->left, pSrcRect->top, blend_type, m_pClipRgn, m_bRgbByteOrder, pIccTransform);
}
-bool CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
+FX_BOOL CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
if (dest_width == pSource->GetWidth() && dest_height == pSource->GetHeight()) {
FX_RECT rect(0, 0, dest_width, dest_height);
@@ -1536,30 +1536,30 @@ bool CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD a
FX_RECT dest_clip = dest_rect;
dest_clip.Intersect(*pClipRect);
CFX_BitmapComposer composer;
- composer.Compose(m_pBitmap, m_pClipRgn, 255, argb, dest_clip, false, false, false, m_bRgbByteOrder, alpha_flag, pIccTransform, blend_type);
+ composer.Compose(m_pBitmap, m_pClipRgn, 255, argb, dest_clip, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, blend_type);
dest_clip.Offset(-dest_rect.left, -dest_rect.top);
CFX_ImageStretcher stretcher;
if (stretcher.Start(&composer, pSource, dest_width, dest_height, dest_clip, flags)) {
stretcher.Continue(NULL);
}
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
+FX_BOOL CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
CFX_ImageRenderer* pRenderer = new CFX_ImageRenderer;
pRenderer->Start(m_pBitmap, m_pClipRgn, pSource, bitmap_alpha, argb, pMatrix, render_flags, m_bRgbByteOrder, alpha_flag, pIccTransform);
handle = pRenderer;
- return true;
+ return TRUE;
}
-bool CFX_AggDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
+FX_BOOL CFX_AggDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
{
if (m_pBitmap->GetBuffer() == NULL) {
- return true;
+ return TRUE;
}
return ((CFX_ImageRenderer*)pHandle)->Continue(pPause);
}
@@ -1572,30 +1572,30 @@ void CFX_AggDeviceDriver::CancelDIBits(void* pHandle)
}
CFX_FxgeDevice::CFX_FxgeDevice()
{
- m_bOwnedBitmap = false;
+ m_bOwnedBitmap = FALSE;
}
-bool CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+FX_BOOL CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
SetBitmap(pBitmap);
IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
-bool CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
+FX_BOOL CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
{
- m_bOwnedBitmap = true;
+ m_bOwnedBitmap = TRUE;
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
if (!pBitmap->Create(width, height, format)) {
delete pBitmap;
- return false;
+ return FALSE;
}
SetBitmap(pBitmap);
- IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, false, pOriDevice, false);
+ IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
CFX_FxgeDevice::~CFX_FxgeDevice()
{
diff --git a/core/src/fxge/android/fpf_skiafont.cpp b/core/src/fxge/android/fpf_skiafont.cpp
index f5ac6c0ce6..2dad01057a 100644
--- a/core/src/fxge/android/fpf_skiafont.cpp
+++ b/core/src/fxge/android/fpf_skiafont.cpp
@@ -87,23 +87,23 @@ int32_t CFPF_SkiaFont::GetDescent() const
}
return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face));
}
-bool CFPF_SkiaFont::GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox)
+FX_BOOL CFPF_SkiaFont::GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox)
{
if (!m_Face) {
- return false;
+ return FALSE;
}
if (FXFT_Is_Face_Tricky(m_Face)) {
if (FXFT_Set_Char_Size(m_Face, 0, 1000 * 64, 72, 72)) {
- return false;
+ return FALSE;
}
if (FXFT_Load_Glyph(m_Face, iGlyphIndex, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- return false;
+ return FALSE;
}
FXFT_Glyph glyph;
if (FXFT_Get_Glyph(m_Face->glyph, &glyph)) {
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- return false;
+ return FALSE;
}
FXFT_BBox cbox;
FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
@@ -119,24 +119,24 @@ bool CFPF_SkiaFont::GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox)
return FXFT_Set_Pixel_Sizes(m_Face, 0, 64) == 0;
}
if (FXFT_Load_Glyph(m_Face, iGlyphIndex, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
- return false;
+ return FALSE;
}
rtBBox.left = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriBearingX(m_Face));
rtBBox.bottom = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriBearingY(m_Face));
rtBBox.right = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriBearingX(m_Face) + FXFT_Get_Glyph_Width(m_Face));
rtBBox.top = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriBearingY(m_Face) - FXFT_Get_Glyph_Height(m_Face));
- return true;
+ return TRUE;
}
-bool CFPF_SkiaFont::GetBBox(FX_RECT &rtBBox)
+FX_BOOL CFPF_SkiaFont::GetBBox(FX_RECT &rtBBox)
{
if (!m_Face) {
- return false;
+ return FALSE;
}
rtBBox.left = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_xMin(m_Face));
rtBBox.top = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_yMin(m_Face));
rtBBox.right = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_xMax(m_Face));
rtBBox.bottom = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_yMax(m_Face));
- return true;
+ return TRUE;
}
int32_t CFPF_SkiaFont::GetHeight() const
{
@@ -167,10 +167,10 @@ FX_DWORD CFPF_SkiaFont::GetFontData(FX_DWORD dwTable, uint8_t* pBuffer, FX_DWORD
}
return pdfium::base::checked_cast<FX_DWORD>(ulSize);
}
-bool CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset)
+FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset)
{
if (!pFontMgr || !pFontDes) {
- return false;
+ return FALSE;
}
switch (pFontDes->GetType()) {
case FPF_SKIAFONTTYPE_Path: {
@@ -189,16 +189,16 @@ bool CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor
}
break;
default:
- return false;
+ return FALSE;
}
if (!m_Face) {
- return false;
+ return FALSE;
}
m_dwStyle = dwStyle;
m_uCharset = uCharset;
m_pFontMgr = pFontMgr;
m_pFontDes = pFontDes;
m_dwRefCount = 1;
- return true;
+ return TRUE;
}
#endif
diff --git a/core/src/fxge/android/fpf_skiafont.h b/core/src/fxge/android/fpf_skiafont.h
index 90cf5cb29c..49819d4c11 100644
--- a/core/src/fxge/android/fpf_skiafont.h
+++ b/core/src/fxge/android/fpf_skiafont.h
@@ -39,13 +39,13 @@ public:
virtual int32_t GetAscent() const;
virtual int32_t GetDescent() const;
- virtual bool GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox);
- virtual bool GetBBox(FX_RECT &rtBBox);
+ virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox);
+ virtual FX_BOOL GetBBox(FX_RECT &rtBBox);
virtual int32_t GetHeight() const;
virtual int32_t GetItalicAngle() const;
virtual FX_DWORD GetFontData(FX_DWORD dwTable, uint8_t* pBuffer, FX_DWORD dwSize);
- bool InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset);
+ FX_BOOL InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset);
protected:
CFPF_SkiaFontMgr *m_pFontMgr;
CFPF_SkiaFontDescriptor *m_pFontDes;
diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp
index 8c835392fc..86bb052435 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.cpp
+++ b/core/src/fxge/android/fpf_skiafontmgr.cpp
@@ -103,7 +103,7 @@ FX_DWORD FPF_SkiaGetSansFont(FX_DWORD dwHash)
}
return 0;
}
-static uint32_t FPF_GetHashCode_StringA(const FX_CHAR* pStr, int32_t iLength, bool bIgnoreCase = false)
+static uint32_t FPF_GetHashCode_StringA(const FX_CHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE)
{
if (!pStr) {
return 0;
@@ -208,27 +208,27 @@ static FX_DWORD FPF_SKIAGetFamilyHash(const CFX_ByteStringC& bsFamily, FX_DWORD
bsFont += "Serif";
}
bsFont += uCharset;
- return FPF_GetHashCode_StringA(bsFont.c_str(), bsFont.GetLength(), true);
+ return FPF_GetHashCode_StringA(bsFont.c_str(), bsFont.GetLength(), TRUE);
}
-static bool FPF_SkiaIsCJK(uint8_t uCharset)
+static FX_BOOL FPF_SkiaIsCJK(uint8_t uCharset)
{
return (uCharset == FXFONT_GB2312_CHARSET) || (uCharset == FXFONT_CHINESEBIG5_CHARSET)
|| (uCharset == FXFONT_HANGEUL_CHARSET) || (uCharset == FXFONT_SHIFTJIS_CHARSET);
}
-static bool FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename)
+static FX_BOOL FPF_SkiaMaybeSymbol(const CFX_ByteStringC& bsFacename)
{
CFX_ByteString bsName = bsFacename;
bsName.MakeLower();
return bsName.Find("symbol") > -1;
}
-static bool FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename)
+static FX_BOOL FPF_SkiaMaybeArabic(const CFX_ByteStringC& bsFacename)
{
CFX_ByteString bsName = bsFacename;
bsName.MakeLower();
return bsName.Find("arabic") > -1;
}
CFPF_SkiaFontMgr::CFPF_SkiaFontMgr()
- : m_bLoaded(false), m_FTLibrary(NULL)
+ : m_bLoaded(FALSE), m_FTLibrary(NULL)
{
}
CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr()
@@ -252,7 +252,7 @@ CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr()
FXFT_Done_FreeType(m_FTLibrary);
}
}
-bool CFPF_SkiaFontMgr::InitFTLibrary()
+FX_BOOL CFPF_SkiaFontMgr::InitFTLibrary()
{
if (m_FTLibrary == NULL) {
FXFT_Init_FreeType(&m_FTLibrary);
@@ -266,7 +266,7 @@ void CFPF_SkiaFontMgr::LoadSystemFonts()
}
ScanPath(FX_BSTRC("/system/fonts"));
OutputSystemFonts();
- m_bLoaded = true;
+ m_bLoaded = TRUE;
}
void CFPF_SkiaFontMgr::LoadPrivateFont(IFX_FileRead* pFontFile)
{
@@ -289,7 +289,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, uin
FX_DWORD dwFaceName = FPF_SKIANormalizeFontName(bsFamilyname);
FX_DWORD dwSubst = FPF_SkiaGetSubstFont(dwFaceName);
FX_DWORD dwSubstSans = FPF_SkiaGetSansFont(dwFaceName);
- bool bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname);
+ FX_BOOL bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname);
if (uCharset != FXFONT_ARABIC_CHARSET && FPF_SkiaMaybeArabic(bsFamilyname)) {
uCharset = FXFONT_ARABIC_CHARSET;
} else if (uCharset == FXFONT_ANSI_CHARSET && (dwMatch & FPF_MATCHFONT_REPLACEANSI)) {
@@ -309,7 +309,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, uin
if (dwFaceName == dwSysFontName) {
nFind += FPF_SKIAMATCHWEIGHT_NAME1;
}
- bool bMatchedName = (nFind == FPF_SKIAMATCHWEIGHT_NAME1);
+ FX_BOOL bMatchedName = (nFind == FPF_SKIAMATCHWEIGHT_NAME1);
if ((dwStyle & FXFONT_BOLD) == (pFontDes->m_dwStyle & FXFONT_BOLD)) {
nFind += FPF_SKIAMATCHWEIGHT_1;
}
@@ -327,7 +327,7 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname, uin
}
if (dwSubst == dwSysFontName || dwSubstSans == dwSysFontName) {
nFind += FPF_SKIAMATCHWEIGHT_NAME2;
- bMatchedName = true;
+ bMatchedName = TRUE;
}
if (uCharset == FXFONT_DEFAULT_CHARSET || bMaybeSymbol) {
if (nFind > nMax && bMatchedName) {
@@ -399,7 +399,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const CFX_ByteStringC& bsFile, int32_t i
args.pathname = (FT_String*)bsFile.GetCStr();
FXFT_Face face;
if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face)) {
- return false;
+ return FALSE;
}
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
@@ -418,7 +418,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(const uint8_t* pBuffer, size_t szBuffer,
args.memory_size = szBuffer;
FXFT_Face face;
if (FXFT_Open_Face(m_FTLibrary, &args, iFaceIndex, &face)) {
- return false;
+ return FALSE;
}
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
@@ -430,7 +430,7 @@ void CFPF_SkiaFontMgr::ScanPath(const CFX_ByteStringC& path)
return;
}
CFX_ByteString filename;
- bool bFolder = false;
+ FX_BOOL bFolder = FALSE;
while (FX_GetNextFile(handle, filename, bFolder)) {
if (bFolder) {
if (filename == FX_BSTRC(".") || filename == FX_BSTRC("..")) {
diff --git a/core/src/fxge/android/fpf_skiafontmgr.h b/core/src/fxge/android/fpf_skiafontmgr.h
index b4ebe9454a..8c721ff68a 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.h
+++ b/core/src/fxge/android/fpf_skiafontmgr.h
@@ -94,7 +94,7 @@ class CFPF_SkiaFontMgr : public IFPF_FontMgr
public:
CFPF_SkiaFontMgr();
virtual ~CFPF_SkiaFontMgr();
- bool InitFTLibrary();
+ FX_BOOL InitFTLibrary();
virtual void LoadSystemFonts();
virtual void LoadPrivateFont(IFX_FileRead* pFontFile);
virtual void LoadPrivateFont(const CFX_ByteStringC& bsFileName);
@@ -109,7 +109,7 @@ protected:
void ScanFile(const CFX_ByteStringC& file);
void ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor *pFontDesc);
void OutputSystemFonts();
- bool m_bLoaded;
+ FX_BOOL m_bLoaded;
CFX_PtrArray m_FontFaces;
FXFT_Library m_FTLibrary;
CFX_MapPtrToPtr m_FamilyFonts;
diff --git a/core/src/fxge/android/fx_android_font.cpp b/core/src/fxge/android/fx_android_font.cpp
index 4f2bc15b2a..3e2fc45854 100644
--- a/core/src/fxge/android/fx_android_font.cpp
+++ b/core/src/fxge/android/fx_android_font.cpp
@@ -10,20 +10,20 @@ CFX_AndroidFontInfo::CFX_AndroidFontInfo()
: m_pFontMgr(NULL)
{
}
-bool CFX_AndroidFontInfo::Init(IFPF_FontMgr *pFontMgr)
+FX_BOOL CFX_AndroidFontInfo::Init(IFPF_FontMgr *pFontMgr)
{
if (!pFontMgr) {
- return false;
+ return FALSE;
}
pFontMgr->LoadSystemFonts();
m_pFontMgr = pFontMgr;
- return true;
+ return TRUE;
}
-bool CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper)
+FX_BOOL CFX_AndroidFontInfo::EnumFontList(CFX_FontMapper* pMapper)
{
- return false;
+ return FALSE;
}
-void* CFX_AndroidFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, bool& bExact)
+void* CFX_AndroidFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact)
{
if (!m_pFontMgr) {
return NULL;
@@ -57,21 +57,21 @@ FX_DWORD CFX_AndroidFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t*
}
return ((IFPF_Font*)hFont)->GetFontData(table, buffer, size);
}
-bool CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
+FX_BOOL CFX_AndroidFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
{
if (!hFont) {
- return false;
+ return FALSE;
}
name = ((IFPF_Font*)hFont)->GetFamilyName();
- return true;
+ return TRUE;
}
-bool CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset)
+FX_BOOL CFX_AndroidFontInfo::GetFontCharset(void* hFont, int& charset)
{
if (!hFont) {
- return false;
+ return FALSE;
}
charset = ((IFPF_Font*)hFont)->GetCharset();
- return false;
+ return FALSE;
}
void CFX_AndroidFontInfo::DeleteFont(void* hFont)
{
diff --git a/core/src/fxge/android/fx_android_font.h b/core/src/fxge/android/fx_android_font.h
index 075b79e7f2..83c04a03a4 100644
--- a/core/src/fxge/android/fx_android_font.h
+++ b/core/src/fxge/android/fx_android_font.h
@@ -18,18 +18,18 @@ public:
delete this;
}
- virtual bool EnumFontList(CFX_FontMapper* pMapper);
+ virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
- virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, bool& bExact);
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact);
virtual void* GetFont(const FX_CHAR* face);
virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size);
- virtual bool GetFaceName(void* hFont, CFX_ByteString& name);
- virtual bool GetFontCharset(void* hFont, int& charset);
+ virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
+ virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
virtual void DeleteFont(void* hFont);
virtual void* RetainFont(void* hFont);
- bool Init(IFPF_FontMgr *pFontMgr);
+ FX_BOOL Init(IFPF_FontMgr *pFontMgr);
protected:
IFPF_FontMgr *m_pFontMgr;
};
diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h
index 0e6c9d683f..715e48d6c2 100644
--- a/core/src/fxge/apple/apple_int.h
+++ b/core/src/fxge/apple/apple_int.h
@@ -51,7 +51,7 @@ public:
void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize);
void DestroyFont(void* pFont);
void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix);
- bool drawGraphicsString(void* graphics,
+ FX_BOOL drawGraphicsString(void* graphics,
void* font,
FX_FLOAT fontSize,
FX_WORD* glyphIndices,
@@ -92,26 +92,26 @@ public:
{
return NULL;
}
- virtual bool IsPSPrintDriver()
+ virtual FX_BOOL IsPSPrintDriver()
{
- return false;
+ return FALSE;
}
- virtual bool StartRendering()
+ virtual FX_BOOL StartRendering()
{
- return true;
+ return TRUE;
}
virtual void EndRendering() {}
virtual void SaveState();
- virtual void RestoreState(bool bKeepSaved);
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData,
+ virtual void RestoreState(FX_BOOL bKeepSaved);
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
);
- virtual bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
);
- virtual bool DrawPath(const CFX_PathData* pPathData,
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -121,36 +121,36 @@ public:
void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL
);
- virtual bool SetPixel(int x, int y, FX_DWORD color,
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL)
{
- return false;
+ return FALSE;
}
- virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
+ virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual bool GetClipBox(FX_RECT* pRect);
- virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false);
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
int dest_left, int dest_top, int blend_type,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL)
{
- return false;
+ return FALSE;
}
- virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause)
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause)
{
- return false;
+ return FALSE;
}
virtual void CancelDIBits(void* handle) {}
- virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
virtual void ClearDriver();
@@ -159,7 +159,7 @@ protected:
void setFillInfo(FX_ARGB argb);
void setPathToContext(const CFX_PathData * pathData);
FX_FLOAT getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm);
- bool CG_DrawGlypRun(int nChars,
+ FX_BOOL CG_DrawGlypRun(int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,
CFX_FontCache* pCache,
@@ -195,9 +195,9 @@ public:
{
return (FX_FILESIZE)_totalSize;
}
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
- virtual bool IsEOF() override
+ virtual FX_BOOL IsEOF() override
{
return _offSet == _totalSize;
}
diff --git a/core/src/fxge/apple/fx_apple_platform.cpp b/core/src/fxge/apple/fx_apple_platform.cpp
index 9f4712bf7e..9db807c3af 100644
--- a/core/src/fxge/apple/fx_apple_platform.cpp
+++ b/core/src/fxge/apple/fx_apple_platform.cpp
@@ -39,7 +39,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(CFX_Font * pFont,
{
return NULL;
}
-static bool _CGDrawGlyphRun(CGContextRef pContext,
+static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext,
int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,
@@ -51,10 +51,10 @@ static bool _CGDrawGlyphRun(CGContextRef pContext,
void* pIccTransform)
{
if (nChars == 0) {
- return true;
+ return TRUE;
}
CFX_AffineMatrix new_matrix;
- bool bNegSize = font_size < 0;
+ FX_BOOL bNegSize = font_size < 0;
if (bNegSize) {
font_size = -font_size;
}
@@ -66,11 +66,11 @@ static bool _CGDrawGlyphRun(CGContextRef pContext,
CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
if (!pFont->m_pPlatformFont) {
if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- return false;
+ return FALSE;
}
pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize);
if (NULL == pFont->m_pPlatformFont) {
- return false;
+ return FALSE;
}
}
CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars);
@@ -101,7 +101,7 @@ static bool _CGDrawGlyphRun(CGContextRef pContext,
NULL);
}
static void _DoNothing(void *info, const void *data, size_t size) {}
-bool CFX_AggDeviceDriver::DrawDeviceText(int nChars,
+FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars,
const FXTEXT_CHARPOS * pCharPos,
CFX_Font * pFont,
CFX_FontCache * pCache,
@@ -111,22 +111,22 @@ bool CFX_AggDeviceDriver::DrawDeviceText(int nChars,
int alpha_flag, void* pIccTransform)
{
if (!pFont) {
- return false;
+ return FALSE;
}
- bool bBold = pFont->IsBold();
+ FX_BOOL bBold = pFont->IsBold();
if (!bBold && pFont->GetSubstFont() &&
pFont->GetSubstFont()->m_Weight >= 500 &&
pFont->GetSubstFont()->m_Weight <= 600) {
- return false;
+ return FALSE;
}
for (int i = 0; i < nChars; i ++) {
if (pCharPos[i].m_bGlyphAdjust) {
- return false;
+ return FALSE;
}
}
CGContextRef ctx = CGContextRef(m_pPlatformGraphics);
if (NULL == ctx) {
- return false;
+ return FALSE;
}
CGContextSaveGState(ctx);
CGContextSetTextDrawingMode(ctx, kCGTextFillClip);
@@ -143,7 +143,7 @@ bool CFX_AggDeviceDriver::DrawDeviceText(int nChars,
CGFloat decode_f[2] = {255.f, 0.f};
pImageCG = CGImageMaskCreate(pClipMask->GetWidth(), pClipMask->GetHeight(),
8, 8, pClipMask->GetPitch(), pClipMaskDataProvider,
- decode_f, false);
+ decode_f, FALSE);
CGDataProviderRelease(pClipMaskDataProvider);
}
} else {
@@ -155,7 +155,7 @@ bool CFX_AggDeviceDriver::DrawDeviceText(int nChars,
} else {
CGContextClipToRect(ctx, rect_cg);
}
- bool ret = _CGDrawGlyphRun(ctx, nChars, pCharPos, pFont, pCache, pObject2Device, font_size, argb, alpha_flag, pIccTransform);
+ FX_BOOL ret = _CGDrawGlyphRun(ctx, nChars, pCharPos, pFont, pCache, pObject2Device, font_size, argb, alpha_flag, pIccTransform);
if (pImageCG) {
CGImageRelease(pImageCG);
}
diff --git a/core/src/fxge/apple/fx_mac_imp.cpp b/core/src/fxge/apple/fx_mac_imp.cpp
index 5e5908b8ff..04b04b8ba8 100644
--- a/core/src/fxge/apple/fx_mac_imp.cpp
+++ b/core/src/fxge/apple/fx_mac_imp.cpp
@@ -28,7 +28,7 @@ Base14Substs[] = {
class CFX_MacFontInfo : public CFX_FolderFontInfo
{
public:
- virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool& bExact);
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL& bExact);
};
#define JAPAN_GOTHIC "Hiragino Kaku Gothic Pro W6"
#define JAPAN_MINCHO "Hiragino Mincho Pro W6"
@@ -44,14 +44,14 @@ static void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_fa
face = JAPAN_MINCHO;
}
}
-void* CFX_MacFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, bool& bExact)
+void* CFX_MacFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact)
{
CFX_ByteString face = cstr_face;
int iBaseFont;
for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++)
if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) {
face = Base14Substs[iBaseFont].m_pSubstName;
- bExact = true;
+ bExact = TRUE;
break;
}
if (iBaseFont < 12) {
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp
index 8aa689fa91..d1e4f544ba 100644
--- a/core/src/fxge/apple/fx_quartz_device.cpp
+++ b/core/src/fxge/apple/fx_quartz_device.cpp
@@ -76,7 +76,7 @@ void CQuartz2D::setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix)
matrix->e,
ty));
}
-bool CQuartz2D::drawGraphicsString(void* graphics,
+FX_BOOL CQuartz2D::drawGraphicsString(void* graphics,
void* font,
FX_FLOAT fontSize,
FX_WORD* glyphIndices,
@@ -86,7 +86,7 @@ bool CQuartz2D::drawGraphicsString(void* graphics,
CFX_AffineMatrix* matrix )
{
if (!graphics) {
- return false;
+ return FALSE;
}
CGContextRef context = (CGContextRef) graphics;
CGContextSetFont(context, (CGFontRef)font);
@@ -113,7 +113,7 @@ bool CQuartz2D::drawGraphicsString(void* graphics,
#if CGFLOAT_IS_DOUBLE
CGPoint* glyphPositionsCG = new CGPoint[charsCount];
if (!glyphPositionsCG) {
- return false;
+ return FALSE;
}
for (int index = 0; index < charsCount; ++index) {
glyphPositionsCG[index].x = glyphPositions[index].x;
@@ -130,7 +130,7 @@ bool CQuartz2D::drawGraphicsString(void* graphics,
delete[] glyphPositionsCG;
#endif
CGContextRestoreGState(context);
- return true;
+ return TRUE;
}
void CQuartz2D::saveGraphicsState(void * graphics)
{
@@ -251,7 +251,7 @@ void CFX_QuartzDeviceDriver::SaveState()
CGContextSaveGState(_context);
m_saveCount++;
}
-void CFX_QuartzDeviceDriver::RestoreState(bool isKeepSaved )
+void CFX_QuartzDeviceDriver::RestoreState(FX_BOOL isKeepSaved )
{
CGContextRestoreGState(_context);
if (isKeepSaved) {
@@ -260,7 +260,7 @@ void CFX_QuartzDeviceDriver::RestoreState(bool isKeepSaved )
m_saveCount--;
}
}
-bool CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData,
+FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData,
const CFX_AffineMatrix* matrix,
int fillMode )
{
@@ -272,13 +272,13 @@ bool CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData,
m = CGAffineTransformConcat(m, _foxitDevice2User);
CGContextConcatCTM(_context, m);
setPathToContext(pathData);
- RestoreState(false);
+ RestoreState(FALSE);
if ((fillMode & 3) == FXFILL_WINDING) {
CGContextClip(_context);
} else {
CGContextEOClip(_context);
}
- return true;
+ return TRUE;
}
FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm)
{
@@ -294,7 +294,7 @@ FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth(const CFX_GraphStateData * graphSt
}
return lineWidth;
}
-bool CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathData,
+FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathData,
const CFX_AffineMatrix* matrix,
const CFX_GraphStateData* graphState )
{
@@ -309,9 +309,9 @@ bool CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathDat
setStrokeInfo(graphState, 0xFF000000, lineWidth);
setPathToContext(pathData);
CGContextReplacePathWithStrokedPath(_context);
- RestoreState(false);
+ RestoreState(FALSE);
CGContextClip(_context);
- return true;
+ return TRUE;
}
static CGBlendMode GetCGBlendMode(int blend_type)
{
@@ -371,7 +371,7 @@ static CGBlendMode GetCGBlendMode(int blend_type)
}
return mode;
}
-bool CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
+FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
const CFX_AffineMatrix* matrix,
const CFX_GraphStateData* graphState,
FX_DWORD fillArgb,
@@ -423,10 +423,10 @@ bool CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
} else if (pathMode == 6) {
CGContextDrawPath(_context, kCGPathEOFillStroke);
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
+FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
FX_ARGB fillArgb,
int alphaFlag ,
void* iccTransform ,
@@ -449,9 +449,9 @@ bool CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
if (mode != kCGBlendModeNormal) {
CGContextSetBlendMode(_context, kCGBlendModeNormal);
}
- return true;
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
+FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
FX_FLOAT y1,
FX_FLOAT x2,
FX_FLOAT y2,
@@ -483,9 +483,9 @@ bool CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
if (mode != kCGBlendModeNormal) {
CGContextSetBlendMode(_context, kCGBlendModeNormal);
}
- return true;
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
+FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
{
CGRect r = CGContextGetClipBoundingBox(_context);
r = CGRectApplyAffineTransform(r, _user2FoxitDevice);
@@ -493,22 +493,22 @@ bool CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
rect->top = FXSYS_floor(r.origin.y);
rect->right = FXSYS_ceil(r.origin.x + r.size.width);
rect->bottom = FXSYS_ceil(r.origin.y + r.size.height);
- return true;
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
+FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
int32_t left,
int32_t top,
void* pIccTransform,
- bool bDEdge)
+ FX_BOOL bDEdge)
{
if (FXDC_PRINTER == _deviceClass) {
- return false;
+ return FALSE;
}
if (bitmap->GetBPP() < 32) {
- return false;
+ return FALSE;
}
if (!(_renderCaps | FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
CGPoint pt = CGPointMake(left, top);
pt = CGPointApplyAffineTransform(pt, _foxitDevice2User);
@@ -517,7 +517,7 @@ bool CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
pt.y *= FXSYS_fabs(ctm.d);
CGImageRef image = CGBitmapContextCreateImage(_context);
if (NULL == image) {
- return false;
+ return FALSE;
}
CGFloat width = (CGFloat) bitmap->GetWidth();
CGFloat height = (CGFloat) bitmap->GetHeight();
@@ -552,9 +552,9 @@ bool CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
}
}
}
- return true;
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
+FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
FX_ARGB argb,
const FX_RECT* srcRect,
int dest_left,
@@ -598,8 +598,8 @@ bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
pBitmap1 = pBitmap->Clone();
}
if (NULL == pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL,
pBitmap1->GetBuffer(),
@@ -629,8 +629,8 @@ bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
if (pBitmap1 != pBitmap) {
delete pBitmap1;
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
if (pBitmap->GetBPP() < 32) {
pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32);
@@ -642,15 +642,15 @@ bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
}
}
if (NULL == pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
if (pBitmap1->HasAlpha()) {
if (pBitmap1 == pBitmap) {
pBitmap1 = pBitmap->Clone();
if (!pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
}
for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
@@ -682,10 +682,10 @@ bool CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
if (pBitmap1 != pBitmap) {
delete pBitmap1;
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
+FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
FX_ARGB argb,
int dest_left,
int dest_top,
@@ -723,8 +723,8 @@ bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
pBitmap1 = pBitmap->Clone();
}
if (NULL == pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL,
pBitmap1->GetBuffer(),
@@ -754,8 +754,8 @@ bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
if (pBitmap1 != pBitmap) {
delete pBitmap1;
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
if (pBitmap->GetBPP() < 32) {
pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32);
@@ -767,15 +767,15 @@ bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
}
}
if (NULL == pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
if (pBitmap1->HasAlpha()) {
if (pBitmap1 == pBitmap) {
pBitmap1 = pBitmap->Clone();
if (!pBitmap1) {
- RestoreState(false);
- return false;
+ RestoreState(FALSE);
+ return FALSE;
}
}
for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
@@ -796,10 +796,10 @@ bool CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
if (pBitmap1 != pBitmap) {
delete pBitmap1;
}
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
+FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,
CFX_FontCache* pCache,
@@ -811,16 +811,16 @@ bool CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
void* pIccTransform)
{
if (nChars == 0) {
- return true;
+ return TRUE;
}
CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
if (!pFont->m_pPlatformFont) {
if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- return false;
+ return FALSE;
}
pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize);
if (NULL == pFont->m_pPlatformFont) {
- return false;
+ return FALSE;
}
}
CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars);
@@ -872,10 +872,10 @@ bool CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
(CGGlyph*)glyph_indices,
glyph_positions,
nChars);
- RestoreState(false);
- return true;
+ RestoreState(FALSE);
+ return TRUE;
}
-bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
+FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont,
CFX_FontCache* pCache,
@@ -886,24 +886,24 @@ bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
void* pIccTransform)
{
if (NULL == pFont || NULL == _context) {
- return false;
+ return FALSE;
}
- bool bBold = pFont->IsBold();
+ FX_BOOL bBold = pFont->IsBold();
if (!bBold && pFont->GetSubstFont() &&
pFont->GetSubstFont()->m_Weight >= 500 &&
pFont->GetSubstFont()->m_Weight <= 600) {
- return false;
+ return FALSE;
}
SaveState();
CGContextSetTextDrawingMode(_context, kCGTextFillClip);
- bool ret = false;
+ FX_BOOL ret = FALSE;
int32_t i = 0;
while (i < nChars) {
if (pCharPos[i].m_bGlyphAdjust || font_size < 0) {
if (i > 0) {
ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform);
if (!ret) {
- RestoreState(false);
+ RestoreState(FALSE);
return ret;
}
}
@@ -920,7 +920,7 @@ bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
}
ret = CG_DrawGlypRun(1, char_pos, pFont, pCache, &glphy_matrix, pObject2Device, font_size, color, alpha_flag, pIccTransform);
if (!ret) {
- RestoreState(false);
+ RestoreState(FALSE);
return ret;
}
i ++;
@@ -934,7 +934,7 @@ bool CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
if (i > 0) {
ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform);
}
- RestoreState(false);
+ RestoreState(FALSE);
return ret;
}
void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState, FX_ARGB argb, FX_FLOAT lineWidth)
@@ -1074,7 +1074,7 @@ void CFX_QuartzDeviceDriver::ClearDriver()
}
CFX_QuartzDevice::CFX_QuartzDevice()
{
- m_bOwnedBitmap = false;
+ m_bOwnedBitmap = FALSE;
m_pContext = NULL;
}
CFX_QuartzDevice::~CFX_QuartzDevice()
@@ -1090,7 +1090,7 @@ CGContextRef CFX_QuartzDevice::GetContext()
{
return m_pContext;
}
-bool CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass)
+FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass)
{
if (m_pContext) {
CGContextRelease(m_pContext);
@@ -1099,30 +1099,30 @@ bool CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass)
CGContextRetain(m_pContext);
IFX_RenderDeviceDriver* pDriver = new CFX_QuartzDeviceDriver(m_pContext, nDeviceClass);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
-bool CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap)
+FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap)
{
SetBitmap(pBitmap);
m_pContext = createContextWithBitmap(pBitmap);
if (NULL == m_pContext) {
- return false;
+ return FALSE;
}
IFX_RenderDeviceDriver* pDriver = new CFX_QuartzDeviceDriver(m_pContext, FXDC_DISPLAY);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
-bool CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format)
+FX_BOOL CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format)
{
if ((uint8_t)format < 32) {
- return false;
+ return FALSE;
}
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
if (!pBitmap->Create(width, height, format)) {
delete pBitmap;
- return false;
+ return FALSE;
}
- m_bOwnedBitmap = true;
+ m_bOwnedBitmap = TRUE;
return Attach(pBitmap);
}
#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
diff --git a/core/src/fxge/dib/dib_int.h b/core/src/fxge/dib/dib_int.h
index a6834fd641..825cabe1d1 100644
--- a/core/src/fxge/dib/dib_int.h
+++ b/core/src/fxge/dib/dib_int.h
@@ -63,7 +63,7 @@ public:
int dest_width, int dest_height, const FX_RECT& clip_rect,
const CFX_DIBSource* pSrcBitmap, int flags);
~CStretchEngine();
- bool Continue(IFX_Pause* pPause);
+ FX_BOOL Continue(IFX_Pause* pPause);
public:
FXDIB_Format m_DestFormat;
int m_DestBpp, m_SrcBpp, m_bHasAlpha;
@@ -84,8 +84,8 @@ public:
int m_Flags;
CWeightTable m_WeightTable;
int m_CurRow;
- bool StartStretchHorz();
- bool ContinueStretchHorz(IFX_Pause* pPause);
+ FX_BOOL StartStretchHorz();
+ FX_BOOL ContinueStretchHorz(IFX_Pause* pPause);
void StretchVert();
int m_State;
};
diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp
index 9f454cc31d..cb99a37ff4 100644
--- a/core/src/fxge/dib/fx_dib_composite.cpp
+++ b/core/src/fxge/dib/fx_dib_composite.cpp
@@ -272,7 +272,7 @@ void _CompositeRow_Argb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int p
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
@@ -467,7 +467,7 @@ inline void _CompositeRow_Argb2Gray(uint8_t* dest_scan, const uint8_t* src_scan,
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
@@ -558,7 +558,7 @@ inline void _CompositeRow_Rgb2Gray(uint8_t* dest_scan, const uint8_t* src_scan,
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
if (pIccTransform) {
@@ -605,7 +605,7 @@ void _CompositeRow_Rgb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int sr
}
if (blend_type) {
int blended_color;
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
int back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
@@ -689,7 +689,7 @@ void _CompositeRow_Argb2Argb(uint8_t* dest_scan, const uint8_t* src_scan, int pi
uint8_t* dest_alpha_scan, const uint8_t* src_alpha_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
if (dest_alpha_scan == NULL) {
if (src_alpha_scan == NULL) {
uint8_t back_alpha = 0;
@@ -896,7 +896,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(uint8_t* dest_scan, const uint8_t* src_
uint8_t* dest_alpha_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
@@ -957,7 +957,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(uint8_t* dest_scan, const uint8_t*
uint8_t* dest_alpha_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
@@ -1121,7 +1121,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(uint8_t* dest_scan, const uint8_t* src_
const uint8_t* src_alpha_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int dest_gap = dest_Bpp - 3;
if (src_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
@@ -1243,7 +1243,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(uint8_t* dest_scan, const uint8_t* sr
inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int dest_gap = dest_Bpp - 3;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
@@ -1266,7 +1266,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(uint8_t* dest_scan, const uint8_t
inline void _CompositeRow_Rgb2Rgb_Blend_Clip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int dest_gap = dest_Bpp - 3;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
@@ -1357,7 +1357,7 @@ void _CompositeRow_Argb2Argb_Transform(uint8_t* dest_scan, const uint8_t* src_sc
}
} else {
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
uint8_t back_alpha = *dest_alpha_scan;
@@ -1487,7 +1487,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_Transform(uint8_t* dest_scan, const uin
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int dest_gap = dest_Bpp - 3;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
@@ -1630,7 +1630,7 @@ inline void _CompositeRow_8bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc
{
if (src_alpha_scan) {
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = pPalette[*src_scan];
@@ -1668,7 +1668,7 @@ inline void _CompositeRow_8bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc
}
} else {
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = pPalette[*src_scan];
@@ -1704,7 +1704,7 @@ inline void _CompositeRow_8bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s
{
if (src_alpha_scan) {
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = pPalette[*src_scan];
@@ -1778,7 +1778,7 @@ inline void _CompositeRow_8bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s
}
} else {
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = pPalette[*src_scan];
@@ -1836,7 +1836,7 @@ inline void _CompositeRow_1bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc
int reset_gray = pPalette[0];
int set_gray = pPalette[1];
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
@@ -1870,7 +1870,7 @@ inline void _CompositeRow_1bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s
int reset_gray = pPalette[0];
int set_gray = pPalette[1];
if (blend_type) {
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
@@ -2787,7 +2787,7 @@ void _CompositeRow_BitMask2Graya(uint8_t* dest_scan, const uint8_t* src_scan, in
void _CompositeRow_Argb2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, int blend_type, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
@@ -2844,7 +2844,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src
void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
uint8_t back_alpha = dest_scan[3];
@@ -2881,7 +2881,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const
inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < width; col ++) {
uint8_t src_alpha;
if (clip_scan) {
@@ -2928,7 +2928,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_sca
inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
if (bNonseparableBlend) {
@@ -2995,7 +2995,7 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan
inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
int src_alpha = *clip_scan ++;
@@ -3039,7 +3039,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, c
inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
- bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
uint8_t src_alpha = *clip_scan ++;
@@ -3495,7 +3495,7 @@ void _CompositeRow_BitMask2Rgb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* s
dest_scan += Bpp;
}
}
-inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, FX_DWORD mask_color, int& mask_alpha,
+inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, FX_DWORD mask_color, int& mask_alpha,
int& mask_red, int& mask_green, int& mask_blue, int& mask_black,
void* icc_module, void* pIccTransform)
{
@@ -3513,7 +3513,7 @@ inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alp
mask_blue = FXARGB_B(mask_color);
}
if (dest_format == FXDIB_8bppMask) {
- return true;
+ return TRUE;
}
if ((dest_format & 0xff) == 8) {
if (pIccTransform) {
@@ -3550,15 +3550,15 @@ inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alp
mask_blue = mask_color_p[0];
}
}
- return true;
+ return TRUE;
}
inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB_Format dest_format,
FX_DWORD*& pDestPalette, FX_DWORD* pSrcPalette,
void* icc_module, void* pIccTransform)
{
ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module;
- bool isSrcCmyk = src_format & 0x0400 ? true : false;
- bool isDstCmyk = dest_format & 0x0400 ? true : false;
+ FX_BOOL isSrcCmyk = src_format & 0x0400 ? TRUE : FALSE;
+ FX_BOOL isDstCmyk = dest_format & 0x0400 ? TRUE : FALSE;
pDestPalette = NULL;
if (pIccTransform) {
if (pSrcPalette) {
@@ -3679,7 +3679,7 @@ CFX_ScanlineCompositor::CFX_ScanlineCompositor()
m_pSrcPalette = NULL;
m_pCacheScanline = NULL;
m_CacheSize = 0;
- m_bRgbByteOrder = false;
+ m_bRgbByteOrder = FALSE;
m_BlendType = FXDIB_BLEND_NORMAL;
}
CFX_ScanlineCompositor::~CFX_ScanlineCompositor()
@@ -3691,8 +3691,8 @@ CFX_ScanlineCompositor::~CFX_ScanlineCompositor()
FX_Free(m_pCacheScanline);
}
}
-bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette,
- FX_DWORD mask_color, int blend_type, bool bClip, bool bRgbByteOrder, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette,
+ FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
{
m_SrcFormat = src_format;
m_DestFormat = dest_format;
@@ -3707,7 +3707,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for
}
m_pIccTransform = pIccTransform;
if ((dest_format & 0xff) == 1) {
- return false;
+ return FALSE;
}
if (m_SrcFormat == FXDIB_1bppMask || m_SrcFormat == FXDIB_8bppMask) {
return _ScanlineCompositor_InitSourceMask(dest_format, alpha_flag, mask_color,
@@ -3715,11 +3715,11 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for
pIccModule, pIccTransform);
}
if (pIccTransform == NULL && (~src_format & 0x0400) && (dest_format & 0x0400)) {
- return false;
+ return FALSE;
}
if ((m_SrcFormat & 0xff) <= 8) {
if (dest_format == FXDIB_8bppMask) {
- return true;
+ return TRUE;
}
_ScanlineCompositor_InitSourcePalette(src_format, dest_format, m_pSrcPalette, pSrcPalette,
pIccModule, pIccTransform);
@@ -3727,7 +3727,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for
+ (dest_format & 0x0200 ? 2 : 0)
+ (dest_format & 0x0400 ? 4 : 0)
+ ((src_format & 0xff) == 1 ? 8 : 0);
- return true;
+ return TRUE;
}
m_Transparency = (src_format & 0x0200 ? 0 : 1)
+ (dest_format & 0x0200 ? 0 : 2)
@@ -3736,7 +3736,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for
+ (src_format & 0x0400 ? 16 : 0)
+ (dest_format & 0x0400 ? 32 : 0)
+ (pIccTransform ? 64 : 0);
- return true;
+ return TRUE;
}
void CFX_ScanlineCompositor::CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan,
const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha)
@@ -4059,22 +4059,22 @@ void CFX_ScanlineCompositor::CompositeBitMaskLine(uint8_t* dest_scan, const uint
_CompositeRow_BitMask2Rgb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
src_left, width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
}
-bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height,
+FX_BOOL CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top,
- int blend_type, const CFX_ClipRgn* pClipRgn, bool bRgbByteOrder, void* pIccTransform)
+ int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
ASSERT(!pSrcBitmap->IsAlphaMask());
ASSERT(m_bpp >= 8);
if (pSrcBitmap->IsAlphaMask() || m_bpp < 8) {
- return false;
+ return FALSE;
}
GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(),
src_left, src_top, pClipRgn);
if (width == 0 || height == 0) {
- return true;
+ return TRUE;
}
const CFX_DIBitmap* pClipMask = NULL;
FX_RECT clip_box;
@@ -4086,11 +4086,11 @@ bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int h
CFX_ScanlineCompositor compositor;
if (!compositor.Init(GetFormat(), pSrcBitmap->GetFormat(), width, pSrcBitmap->GetPalette(), 0, blend_type,
pClipMask != NULL, bRgbByteOrder, 0, pIccTransform)) {
- return false;
+ return FALSE;
}
int dest_Bpp = m_bpp / 8;
int src_Bpp = pSrcBitmap->GetBPP() / 8;
- bool bRgb = src_Bpp > 1 && !pSrcBitmap->IsCmykImage();
+ FX_BOOL bRgb = src_Bpp > 1 && !pSrcBitmap->IsCmykImage();
CFX_DIBitmap* pSrcAlphaMask = pSrcBitmap->m_pAlphaMask;
for (int row = 0; row < height; row ++) {
uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * dest_Bpp;
@@ -4107,27 +4107,27 @@ bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int h
compositor.CompositePalBitmapLine(dest_scan, src_scan, src_left, width, clip_scan, src_scan_extra_alpha, dst_scan_extra_alpha);
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height,
+FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top,
- int blend_type, const CFX_ClipRgn* pClipRgn, bool bRgbByteOrder, int alpha_flag, void* pIccTransform)
+ int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
ASSERT(pMask->IsAlphaMask());
ASSERT(m_bpp >= 8);
if (!pMask->IsAlphaMask() || m_bpp < 8) {
- return false;
+ return FALSE;
}
GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, pClipRgn);
if (width == 0 || height == 0) {
- return true;
+ return TRUE;
}
int src_alpha = (uint8_t)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
if (src_alpha == 0) {
- return true;
+ return TRUE;
}
const CFX_DIBitmap* pClipMask = NULL;
FX_RECT clip_box;
@@ -4140,7 +4140,7 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int hei
int Bpp = GetBPP() / 8;
CFX_ScanlineCompositor compositor;
if (!compositor.Init(GetFormat(), pMask->GetFormat(), width, NULL, color, blend_type, pClipMask != NULL, bRgbByteOrder, alpha_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
for (int row = 0; row < height; row ++) {
uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
@@ -4156,21 +4156,21 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int hei
compositor.CompositeByteMaskLine(dest_scan, src_scan + src_left, width, clip_scan, dst_scan_extra_alpha);
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DWORD color, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
int src_alpha = (alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
if (src_alpha == 0) {
- return true;
+ return TRUE;
}
FX_RECT rect(left, top, left + width, top + height);
rect.Intersect(0, 0, m_Width, m_Height);
if (rect.IsEmpty()) {
- return true;
+ return TRUE;
}
width = rect.Width();
FX_DWORD dst_color;
@@ -4210,7 +4210,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
dest_scan ++;
}
}
- return true;
+ return TRUE;
}
if (m_bpp == 1) {
ASSERT(!IsCmykImage() && (uint8_t)(alpha_flag >> 8) == 0);
@@ -4248,11 +4248,11 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
}
}
}
- return true;
+ return TRUE;
}
ASSERT(m_bpp >= 24);
if (m_bpp < 24) {
- return false;
+ return FALSE;
}
if (pIccTransform && CFX_GEModule::Get()->GetCodecModule()) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
@@ -4262,15 +4262,15 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
color_p[2], color_p[1], color_p[0]);
else if (!(alpha_flag >> 8) && IsCmykImage()) {
- return false;
+ return FALSE;
}
}
if(!IsCmykImage()) {
color_p[3] = (uint8_t)src_alpha;
}
int Bpp = m_bpp / 8;
- bool bAlpha = HasAlpha();
- bool bArgb = GetFormat() == FXDIB_Argb ? true : false;
+ FX_BOOL bAlpha = HasAlpha();
+ FX_BOOL bArgb = GetFormat() == FXDIB_Argb ? TRUE : FALSE;
if (src_alpha == 255) {
for (int row = rect.top; row < rect.bottom; row ++) {
uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
@@ -4291,7 +4291,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
}
}
}
- return true;
+ return TRUE;
}
for (int row = rect.top; row < rect.bottom; row ++) {
uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
@@ -4346,7 +4346,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW
}
}
}
- return true;
+ return TRUE;
}
CFX_BitmapComposer::CFX_BitmapComposer()
{
@@ -4354,7 +4354,7 @@ CFX_BitmapComposer::CFX_BitmapComposer()
m_pScanlineAlphaV = NULL;
m_pClipScanV = NULL;
m_pAddClipScan = NULL;
- m_bRgbByteOrder = false;
+ m_bRgbByteOrder = FALSE;
m_BlendType = FXDIB_BLEND_NORMAL;
}
CFX_BitmapComposer::~CFX_BitmapComposer()
@@ -4373,8 +4373,8 @@ CFX_BitmapComposer::~CFX_BitmapComposer()
}
}
void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha,
- FX_DWORD mask_color, FX_RECT& dest_rect, bool bVertical,
- bool bFlipX, bool bFlipY, bool bRgbByteOrder,
+ FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical,
+ FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder,
int alpha_flag, void* pIccTransform, int blend_type)
{
m_pBitmap = pDest;
@@ -4397,12 +4397,12 @@ void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRg
m_bRgbByteOrder = bRgbByteOrder;
m_BlendType = blend_type;
}
-bool CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
+FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
{
m_SrcFormat = src_format;
if (!m_Compositor.Init(m_pBitmap->GetFormat(), src_format, width, pSrcPalette, m_MaskColor, FXDIB_BLEND_NORMAL,
m_pClipMask != NULL || (m_BitmapAlpha < 255), m_bRgbByteOrder, m_AlphaFlag, m_pIccTransform)) {
- return false;
+ return FALSE;
}
if (m_bVertical) {
m_pScanlineV = FX_Alloc(uint8_t, m_pBitmap->GetBPP() / 8 * width + 4);
@@ -4414,7 +4414,7 @@ bool CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format,
if (m_BitmapAlpha < 255) {
m_pAddClipScan = FX_Alloc(uint8_t, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth());
}
- return true;
+ return TRUE;
}
void CFX_BitmapComposer::DoCompose(uint8_t* dest_scan, const uint8_t* src_scan, int dest_width, const uint8_t* clip_scan,
const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha)
diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp
index 7e5a0341a2..d7860aee19 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -103,7 +103,7 @@ public:
CFX_Palette();
~CFX_Palette();
public:
- bool BuildPalette(const CFX_DIBSource* pBitmap, int dwPaletteType);
+ FX_BOOL BuildPalette(const CFX_DIBSource* pBitmap, int dwPaletteType);
FX_DWORD* GetPalette() const
{
return m_pPalette;
@@ -227,10 +227,10 @@ CFX_Palette::~CFX_Palette()
}
m_lut = 0;
}
-bool CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
+FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
{
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
if (m_pPalette != NULL) {
FX_Free(m_pPalette);
@@ -277,9 +277,9 @@ bool CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
win_mac_pal = (FX_DWORD*)g_dwMacPalette;
}
_Obtain_Pal(m_aLut, m_cLut, m_pPalette, pal_type, win_mac_pal, m_lut);
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
uint8_t set_gray, reset_gray;
@@ -296,9 +296,9 @@ bool _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width,
dest_scan ++;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
for (int row = 0; row < height; row ++) {
@@ -306,9 +306,9 @@ bool _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width,
const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
FXSYS_memcpy(dest_scan, src_scan, width);
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
@@ -359,9 +359,9 @@ bool _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, i
dest_scan ++;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
@@ -402,9 +402,9 @@ bool _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, i
*dest_scan++ = gray[*src_scan++];
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int Bpp = pSrcBitmap->GetBPP() / 8;
@@ -451,7 +451,7 @@ bool _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width,
}
}
}
- return true;
+ return TRUE;
}
inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
@@ -476,7 +476,7 @@ inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int widt
}
}
}
-bool _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
{
_ConvertBuffer_IndexCopy(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
@@ -515,9 +515,9 @@ bool _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, in
FXSYS_memcpy(dst_plt, src_plt, plt_size * 4);
}
}
- return true;
+ return TRUE;
}
-inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_pitch, int width, int height,
+inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt)
{
int bpp = pSrcBitmap->GetBPP() / 8;
@@ -527,7 +527,7 @@ inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_p
FX_DWORD* cLut = palette.GetColorLut();
FX_DWORD* aLut = palette.GetAmountLut();
if (cLut == NULL || aLut == NULL) {
- return false;
+ return FALSE;
}
int lut = palette.Getlut();
FX_DWORD* pPalette = palette.GetPalette();
@@ -571,12 +571,12 @@ inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_p
}
}
FXSYS_memcpy(dst_plt, pPalette, sizeof(FX_DWORD) * 256);
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
{
- bool ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt);
+ FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt);
if (ret && pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
for (int i = 0; i < 256; i++) {
@@ -588,7 +588,7 @@ bool _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, in
}
return ret;
}
-bool _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
int comps = (dst_format & 0xff) / 8;
@@ -611,9 +611,9 @@ bool _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int
dest_scan += comps;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
int comps = (dst_format & 0xff) / 8;
@@ -629,9 +629,9 @@ bool _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int
dest_scan += comps - 2;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = (dst_format & 0xff) / 8;
@@ -676,9 +676,9 @@ bool _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int
dest_scan += comps - 2;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = (dst_format & 0xff) / 8;
@@ -722,9 +722,9 @@ bool _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int
dest_scan += comps - 2;
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
if (pIccTransform) {
@@ -741,9 +741,9 @@ bool _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width,
FXSYS_memcpy(dest_scan, src_scan, width * 3);
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
for (int row = 0; row < height; row ++) {
@@ -763,9 +763,9 @@ bool _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width,
pIccModule->TranslateScanline(pIccTransform, dest_scan, dest_scan, width);
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = pSrcBitmap->GetBPP() / 8;
@@ -793,9 +793,9 @@ bool _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int
}
}
}
- return true;
+ return TRUE;
}
-bool _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
if (pIccTransform) {
@@ -821,9 +821,9 @@ bool _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width
}
}
}
- return true;
+ return TRUE;
}
-bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& d_pal, void* pIccTransform)
{
FXDIB_Format src_format = pSrcBitmap->GetFormat();
@@ -835,8 +835,8 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
case FXDIB_1bppCmyk:
case FXDIB_1bppMask:
case FXDIB_1bppRgb:
- ASSERT(false);
- return false;
+ ASSERT(FALSE);
+ return FALSE;
case FXDIB_8bppMask: {
if ((src_format & 0xff) == 1) {
if (pSrcBitmap->GetPalette()) {
@@ -853,7 +853,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
if ((src_format & 0xff) >= 24) {
return _ConvertBuffer_RgbOrCmyk2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
}
- return false;
+ return FALSE;
}
case FXDIB_8bppRgb:
case FXDIB_8bppRgba: {
@@ -867,7 +867,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
if ((src_format & 0xff) >= 24) {
return _ConvertBuffer_Rgb2PltRgb8(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform);
}
- return false;
+ return FALSE;
}
case FXDIB_Rgb:
case FXDIB_Rgba: {
@@ -889,7 +889,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
if ((src_format & 0xff) == 32) {
return _ConvertBuffer_32bppRgb2Rgb24(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
}
- return false;
+ return FALSE;
}
case FXDIB_Argb:
case FXDIB_Rgb32: {
@@ -911,12 +911,12 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch,
}
return _ConvertBuffer_Rgb2Rgb32(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
}
- return false;
+ return FALSE;
}
default:
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_RECT* pClip, void* pIccTransform) const
{
@@ -939,7 +939,7 @@ CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_REC
delete pClone;
return NULL;
}
- bool ret = true;
+ FX_BOOL ret = TRUE;
CFX_DIBitmap* pSrcAlpha = NULL;
if (m_AlphaFlag & 2) {
pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask;
@@ -981,15 +981,15 @@ CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_REC
}
return pClone;
}
-bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
+FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
{
FXDIB_Format src_format = GetFormat();
if (dest_format == src_format && pIccTransform == NULL) {
- return true;
+ return TRUE;
}
if (dest_format == FXDIB_8bppMask && src_format == FXDIB_8bppRgb && m_pPalette == NULL) {
m_AlphaFlag = 1;
- return true;
+ return TRUE;
}
if (dest_format == FXDIB_Argb && src_format == FXDIB_Rgb32 && pIccTransform == NULL) {
m_AlphaFlag = 2;
@@ -1000,13 +1000,13 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
scanline += 4;
}
}
- return true;
+ return TRUE;
}
int dest_bpp = dest_format & 0xff;
int dest_pitch = (dest_bpp * m_Width + 31) / 32 * 4;
uint8_t* dest_buf = FX_TryAlloc(uint8_t, dest_pitch * m_Height + 4);
if (dest_buf == NULL) {
- return false;
+ return FALSE;
}
CFX_DIBitmap* pAlphaMask = NULL;
if (dest_format == FXDIB_Argb) {
@@ -1026,13 +1026,13 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
pAlphaMask = GetAlphaMask();
if (pAlphaMask == NULL) {
FX_Free(dest_buf);
- return false;
+ return FALSE;
}
} else {
if (m_pAlphaMask == NULL) {
if (!BuildAlphaMask()) {
FX_Free(dest_buf);
- return false;
+ return FALSE;
}
pAlphaMask = m_pAlphaMask;
m_pAlphaMask = NULL;
@@ -1041,7 +1041,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
}
}
}
- bool ret = false;
+ FX_BOOL ret = FALSE;
FX_DWORD* pal_8bpp = NULL;
ret = ConvertBuffer(dest_format, dest_buf, dest_pitch, m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform);
if (!ret) {
@@ -1054,7 +1054,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
if (dest_buf) {
FX_Free(dest_buf);
}
- return false;
+ return FALSE;
}
if (m_pAlphaMask && pAlphaMask != m_pAlphaMask) {
delete m_pAlphaMask;
@@ -1067,10 +1067,10 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
if (!m_bExtBuf) {
FX_Free(m_pBuffer);
}
- m_bExtBuf = false;
+ m_bExtBuf = FALSE;
m_pBuffer = dest_buf;
m_bpp = (uint8_t)dest_format;
m_AlphaFlag = (uint8_t)(dest_format >> 8);
m_Pitch = dest_pitch;
- return true;
+ return TRUE;
}
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index f143ac3ae2..7390c431d9 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -217,7 +217,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d
m_SrcHeight = pSrcBitmap->GetHeight();
m_SrcPitch = (m_SrcWidth * m_SrcBpp + 31) / 32 * 4;
if ((flags & FXDIB_NOSMOOTH) == 0) {
- bool bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL;
+ FX_BOOL bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL;
if (!bInterpol && FXSYS_abs(dest_width) != 0 && FXSYS_abs(dest_height) < m_SrcWidth * m_SrcHeight * 8 / FXSYS_abs(dest_width)) {
flags = FXDIB_INTERPOL;
}
@@ -280,16 +280,16 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d
}
}
}
-bool CStretchEngine::Continue(IFX_Pause* pPause)
+FX_BOOL CStretchEngine::Continue(IFX_Pause* pPause)
{
while (m_State == 1) {
if (ContinueStretchHorz(pPause)) {
- return true;
+ return TRUE;
}
m_State = 2;
StretchVert();
}
- return false;
+ return FALSE;
}
CStretchEngine::~CStretchEngine()
{
@@ -306,46 +306,46 @@ CStretchEngine::~CStretchEngine()
FX_Free(m_pDestMaskScanline);
}
}
-bool CStretchEngine::StartStretchHorz()
+FX_BOOL CStretchEngine::StartStretchHorz()
{
if (m_DestWidth == 0 || m_pDestScanline == NULL || m_SrcClip.Height() > (int)((1U << 29) / m_InterPitch) || m_SrcClip.Height() == 0) {
- return false;
+ return FALSE;
}
m_pInterBuf = FX_TryAlloc(unsigned char, m_SrcClip.Height() * m_InterPitch);
if (m_pInterBuf == NULL) {
- return false;
+ return FALSE;
}
if (m_pSource && m_bHasAlpha && m_pSource->m_pAlphaMask) {
m_pExtraAlphaBuf = FX_Alloc2D(unsigned char, m_SrcClip.Height(), m_ExtraMaskPitch);
FX_DWORD size = (m_DestClip.Width() * 8 + 31) / 32 * 4;
m_pDestMaskScanline = FX_TryAlloc(unsigned char, size);
if (!m_pDestMaskScanline) {
- return false;
+ return FALSE;
}
}
m_WeightTable.Calc(m_DestWidth, m_DestClip.left, m_DestClip.right, m_SrcWidth, m_SrcClip.left, m_SrcClip.right, m_Flags);
if (m_WeightTable.m_pWeightTables == NULL) {
- return false;
+ return FALSE;
}
m_CurRow = m_SrcClip.top;
m_State = 1;
- return true;
+ return TRUE;
}
#define FX_STRECH_PAUSE_ROWS 10
-bool CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
+FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
{
if (!m_DestWidth) {
return 0;
}
if (m_pSource->SkipToScanline(m_CurRow, pPause)) {
- return true;
+ return TRUE;
}
int Bpp = m_DestBpp / 8;
int rows_to_go = FX_STRECH_PAUSE_ROWS;
for (; m_CurRow < m_SrcClip.bottom; m_CurRow ++) {
if (rows_to_go == 0) {
if (pPause && pPause->NeedToPauseNow()) {
- return true;
+ return TRUE;
}
rows_to_go = FX_STRECH_PAUSE_ROWS;
}
@@ -532,7 +532,7 @@ bool CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
}
rows_to_go --;
}
- return false;
+ return FALSE;
}
void CStretchEngine::StretchVert()
{
@@ -697,7 +697,7 @@ FXDIB_Format _GetStretchedFormat(const CFX_DIBSource* pSrc)
}
return format;
}
-bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
+FX_BOOL CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
const CFX_DIBSource* pSource, int dest_width, int dest_height,
const FX_RECT& rect, FX_DWORD flags)
{
@@ -722,7 +722,7 @@ bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
pal[i] = ArgbEncode(a, r, g, b);
}
if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) {
- return false;
+ return FALSE;
}
} else if (pSource->GetFormat() == FXDIB_1bppCmyk && pSource->GetPalette()) {
FX_CMYK pal[256];
@@ -737,17 +737,17 @@ bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
pal[i] = CmykEncode(c, m, y, k);
}
if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) {
- return false;
+ return FALSE;
}
} else if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, NULL)) {
- return false;
+ return FALSE;
}
if (flags & FXDIB_DOWNSAMPLE) {
return StartQuickStretch();
}
return StartStretch();
}
-bool CFX_ImageStretcher::Continue(IFX_Pause* pPause)
+FX_BOOL CFX_ImageStretcher::Continue(IFX_Pause* pPause)
{
if (m_Flags & FXDIB_DOWNSAMPLE) {
return ContinueQuickStretch(pPause);
@@ -755,39 +755,39 @@ bool CFX_ImageStretcher::Continue(IFX_Pause* pPause)
return ContinueStretch(pPause);
}
#define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000
-bool CFX_ImageStretcher::StartStretch()
+FX_BOOL CFX_ImageStretcher::StartStretch()
{
m_pStretchEngine = new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, m_ClipRect, m_pSource, m_Flags);
m_pStretchEngine->StartStretchHorz();
if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
m_pStretchEngine->Continue(NULL);
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause)
+FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause)
{
if (m_pStretchEngine == NULL) {
- return false;
+ return FALSE;
}
return m_pStretchEngine->Continue(pPause);
}
-bool CFX_ImageStretcher::StartQuickStretch()
+FX_BOOL CFX_ImageStretcher::StartQuickStretch()
{
- m_bFlipX = false;
- m_bFlipY = false;
+ m_bFlipX = FALSE;
+ m_bFlipY = FALSE;
if (m_DestWidth < 0) {
- m_bFlipX = true;
+ m_bFlipX = TRUE;
m_DestWidth = -m_DestWidth;
}
if (m_DestHeight < 0) {
- m_bFlipY = true;
+ m_bFlipY = TRUE;
m_DestHeight = -m_DestHeight;
}
m_LineIndex = 0;
FX_DWORD size = m_ClipRect.Width();
if (size && m_DestBPP > (int)(INT_MAX / size)) {
- return false;
+ return FALSE;
}
size *= m_DestBPP;
m_pScanline = FX_Alloc(uint8_t, (size / 8 + 3) / 4 * 4);
@@ -796,14 +796,14 @@ bool CFX_ImageStretcher::StartQuickStretch()
}
if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
ContinueQuickStretch(NULL);
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
+FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
{
if (m_pScanline == NULL) {
- return false;
+ return FALSE;
}
int result_width = m_ClipRect.Width(), result_height = m_ClipRect.Height();
int src_height = m_pSource->GetHeight();
@@ -823,7 +823,7 @@ bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
src_y = 0;
}
if (m_pSource->SkipToScanline(src_y, pPause)) {
- return true;
+ return TRUE;
}
m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width);
if (m_pMaskScanline) {
@@ -831,5 +831,5 @@ bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
}
m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline);
}
- return false;
+ return FALSE;
}
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index efd886e2b7..8a864f10a1 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -9,7 +9,7 @@
#include "../../../include/fxcodec/fx_codec.h"
#include "dib_int.h"
#include <limits.h>
-bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
+FX_BOOL ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& pal, void* pIccTransform);
void CmykDecode(FX_DWORD cmyk, int& c, int& m, int& y, int& k)
{
@@ -52,39 +52,39 @@ CFX_DIBSource::~CFX_DIBSource()
}
CFX_DIBitmap::CFX_DIBitmap()
{
- m_bExtBuf = false;
+ m_bExtBuf = FALSE;
m_pBuffer = NULL;
m_pPalette = NULL;
}
#define _MAX_OOM_LIMIT_ 12000000
-bool CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer, int pitch)
+FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer, int pitch)
{
m_pBuffer = NULL;
m_bpp = (uint8_t)format;
m_AlphaFlag = (uint8_t)(format >> 8);
m_Width = m_Height = m_Pitch = 0;
if (width <= 0 || height <= 0 || pitch < 0) {
- return false;
+ return FALSE;
}
if ((INT_MAX - 31) / width < (format & 0xff)) {
- return false;
+ return FALSE;
}
if (!pitch) {
pitch = (width * (format & 0xff) + 31) / 32 * 4;
}
if ((1 << 30) / pitch < height) {
- return false;
+ return FALSE;
}
if (pBuffer) {
m_pBuffer = pBuffer;
- m_bExtBuf = true;
+ m_bExtBuf = TRUE;
} else {
int size = pitch * height + 4;
int oomlimit = _MAX_OOM_LIMIT_;
if (oomlimit >= 0 && size >= oomlimit) {
m_pBuffer = FX_TryAlloc(uint8_t, size);
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
} else {
m_pBuffer = FX_Alloc(uint8_t, size);
@@ -94,33 +94,33 @@ bool CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* p
m_Height = height;
m_Pitch = pitch;
if (HasAlpha() && format != FXDIB_Argb) {
- bool ret = true;
+ FX_BOOL ret = TRUE;
ret = BuildAlphaMask();
if (!ret) {
if (!m_bExtBuf && m_pBuffer) {
FX_Free(m_pBuffer);
m_pBuffer = NULL;
m_Width = m_Height = m_Pitch = 0;
- return false;
+ return FALSE;
}
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc)
+FX_BOOL CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc)
{
if (m_pBuffer) {
- return false;
+ return FALSE;
}
if (!Create(pSrc->GetWidth(), pSrc->GetHeight(), pSrc->GetFormat())) {
- return false;
+ return FALSE;
}
CopyPalette(pSrc->GetPalette());
CopyAlphaMask(pSrc->m_pAlphaMask);
for (int row = 0; row < pSrc->GetHeight(); row ++) {
FXSYS_memcpy(m_pBuffer + row * m_Pitch, pSrc->GetScanline(row), m_Pitch);
}
- return true;
+ return TRUE;
}
CFX_DIBitmap::~CFX_DIBitmap()
{
@@ -218,19 +218,19 @@ void CFX_DIBSource::BuildPalette()
}
}
}
-bool CFX_DIBSource::BuildAlphaMask()
+FX_BOOL CFX_DIBSource::BuildAlphaMask()
{
if (m_pAlphaMask) {
- return true;
+ return TRUE;
}
m_pAlphaMask = new CFX_DIBitmap;
if (!m_pAlphaMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete m_pAlphaMask;
m_pAlphaMask = NULL;
- return false;
+ return FALSE;
}
FXSYS_memset(m_pAlphaMask->GetBuffer(), 0xff, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch());
- return true;
+ return TRUE;
}
FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const
{
@@ -367,15 +367,15 @@ void CFX_DIBSource::GetOverlapRect(int& dest_left, int& dest_top, int& width, in
width = dest_rect.right - dest_rect.left;
height = dest_rect.bottom - dest_rect.top;
}
-bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height,
+FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(), src_left, src_top, NULL);
if (width == 0 || height == 0) {
- return true;
+ return TRUE;
}
FXDIB_Format dest_format = GetFormat();
FXDIB_Format src_format = pSrcBitmap->GetFormat();
@@ -402,7 +402,7 @@ bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int he
}
} else {
if (m_pPalette) {
- return false;
+ return FALSE;
}
if (m_bpp == 8) {
dest_format = FXDIB_8bppMask;
@@ -410,25 +410,25 @@ bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int he
uint8_t* dest_buf = m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8;
FX_DWORD* d_plt = NULL;
if(!ConvertBuffer(dest_format, dest_buf, m_Pitch, width, height, pSrcBitmap, src_left, src_top, d_plt, pIccTransform)) {
- return false;
+ return FALSE;
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int height,
+FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int height,
const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag, void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
ASSERT(HasAlpha() && (m_bpp >= 24));
ASSERT(pMask->IsAlphaMask());
if (!HasAlpha() || !pMask->IsAlphaMask() || m_bpp < 24) {
- return false;
+ return FALSE;
}
GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, NULL);
if (width == 0 || height == 0) {
- return true;
+ return TRUE;
}
int src_bpp = pMask->GetBPP();
int alpha;
@@ -449,7 +449,7 @@ bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int heig
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
color_p[2], color_p[1], color_p[0]);
else if (!(alpha_flag >> 8) && IsCmykImage()) {
- return false;
+ return FALSE;
}
}
if(!IsCmykImage()) {
@@ -507,7 +507,7 @@ bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int heig
}
}
}
- return true;
+ return TRUE;
}
void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size)
{
@@ -570,21 +570,21 @@ CFX_DIBitmap* CFX_DIBSource::GetAlphaMask(const FX_RECT* pClip) const
}
return pMask;
}
-bool CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip)
+FX_BOOL CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip)
{
if (!HasAlpha() || GetFormat() == FXDIB_Argb) {
- return false;
+ return FALSE;
}
if (pAlphaMask) {
FX_RECT rect(0, 0, pAlphaMask->m_Width, pAlphaMask->m_Height);
if (pClip) {
rect.Intersect(*pClip);
if (rect.IsEmpty() || rect.Width() != m_Width || rect.Height() != m_Height) {
- return false;
+ return FALSE;
}
} else {
if (pAlphaMask->m_Width != m_Width || pAlphaMask->m_Height != m_Height) {
- return false;
+ return FALSE;
}
}
for (int row = 0; row < m_Height; row ++)
@@ -593,25 +593,25 @@ bool CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT
} else {
m_pAlphaMask->Clear(0xff000000);
}
- return true;
+ return TRUE;
}
const int g_ChannelOffset[] = {0, 2, 1, 0, 0, 1, 2, 3, 3};
-bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel)
+FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
CFX_DIBSource* pSrcClone = (CFX_DIBSource*)pSrcBitmap;
CFX_DIBitmap* pDst = this;
int destOffset, srcOffset;
if (srcChannel == FXDIB_Alpha) {
if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsAlphaMask()) {
- return false;
+ return FALSE;
}
if (pSrcBitmap->GetBPP() == 1) {
pSrcClone = pSrcBitmap->CloneConvert(FXDIB_8bppMask);
if (pSrcClone == NULL) {
- return false;
+ return FALSE;
}
}
if(pSrcBitmap->GetFormat() == FXDIB_Argb) {
@@ -621,7 +621,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
}
} else {
if (pSrcBitmap->IsAlphaMask()) {
- return false;
+ return FALSE;
}
if (pSrcBitmap->GetBPP() < 24) {
if (pSrcBitmap->IsCmykImage()) {
@@ -630,7 +630,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
pSrcClone = pSrcBitmap->CloneConvert((FXDIB_Format)((pSrcBitmap->GetFormat() & 0xff00) | 0x18));
}
if (pSrcClone == NULL) {
- return false;
+ return FALSE;
}
}
srcOffset = g_ChannelOffset[srcChannel];
@@ -641,7 +641,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
destOffset = 0;
} else {
@@ -650,7 +650,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
if (GetFormat() == FXDIB_Argb) {
destOffset = 3;
@@ -661,7 +661,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
if (GetBPP() < 24) {
if (HasAlpha()) {
@@ -669,7 +669,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
} else
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -680,7 +680,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
}
destOffset = g_ChannelOffset[destChannel];
@@ -694,7 +694,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
}
}
@@ -710,7 +710,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
delete pSrcClone;
}
if (pSrcMatched == NULL) {
- return false;
+ return FALSE;
}
pSrcClone = pSrcMatched;
}
@@ -732,24 +732,24 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p
if (pSrcClone != pSrcBitmap && pSrcClone != pSrcBitmap->m_pAlphaMask) {
delete pSrcClone;
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
+FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
int destOffset;
if (destChannel == FXDIB_Alpha) {
if (IsAlphaMask()) {
if(!ConvertFormat(FXDIB_8bppMask)) {
- return false;
+ return FALSE;
}
destOffset = 0;
} else {
destOffset = 0;
if(!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
- return false;
+ return FALSE;
}
if (GetFormat() == FXDIB_Argb) {
destOffset = 3;
@@ -757,21 +757,21 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
}
} else {
if (IsAlphaMask()) {
- return false;
+ return FALSE;
}
if (GetBPP() < 24) {
if (HasAlpha()) {
if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
- return false;
+ return FALSE;
}
} else
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) {
- return false;
+ return FALSE;
}
#else
if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) {
- return false;
+ return FALSE;
}
#endif
}
@@ -780,11 +780,11 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
int Bpp = GetBPP() / 8;
if (Bpp == 1) {
FXSYS_memset(m_pBuffer, value, m_Height * m_Pitch);
- return true;
+ return TRUE;
}
if (destChannel == FXDIB_Alpha && m_pAlphaMask) {
FXSYS_memset(m_pAlphaMask->GetBuffer(), value, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch());
- return true;
+ return TRUE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* scan_line = m_pBuffer + row * m_Pitch + destOffset;
@@ -793,16 +793,16 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
scan_line += Bpp;
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
+FX_BOOL CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
ASSERT(pSrcBitmap->IsAlphaMask());
if (!pSrcBitmap->IsAlphaMask()) {
- return false;
+ return FALSE;
}
if (!IsAlphaMask() && !HasAlpha()) {
return LoadChannel(FXDIB_Alpha, pSrcBitmap, FXDIB_Alpha);
@@ -812,7 +812,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height);
ASSERT(pSrcClone != NULL);
if (pSrcClone == NULL) {
- return false;
+ return FALSE;
}
}
if (IsAlphaMask()) {
@@ -820,7 +820,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* dest_scan = m_pBuffer + m_Pitch * row;
@@ -844,7 +844,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* dest_scan = m_pBuffer + m_Pitch * row + 3;
@@ -861,17 +861,17 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
if (pSrcClone != pSrcBitmap) {
delete pSrcClone;
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
+FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
switch (GetFormat()) {
case FXDIB_1bppRgb: {
if (m_pPalette == NULL) {
- return false;
+ return FALSE;
}
uint8_t gray[2];
for (int i = 0; i < 2; i ++) {
@@ -883,7 +883,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
- return false;
+ return FALSE;
}
FXSYS_memset(pMask->GetBuffer(), gray[0], pMask->GetPitch() * m_Height);
for (int row = 0; row < m_Height; row ++) {
@@ -902,7 +902,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
}
case FXDIB_8bppRgb: {
if (m_pPalette == NULL) {
- return false;
+ return FALSE;
}
uint8_t gray[256];
for (int i = 0; i < 256; i ++) {
@@ -914,7 +914,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
@@ -931,7 +931,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* src_pos = m_pBuffer + row * m_Pitch;
@@ -949,7 +949,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
delete pMask;
- return false;
+ return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
uint8_t* src_pos = m_pBuffer + row * m_Pitch;
@@ -964,19 +964,19 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform)
break;
}
default:
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::MultiplyAlpha(int alpha)
+FX_BOOL CFX_DIBitmap::MultiplyAlpha(int alpha)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
switch (GetFormat()) {
case FXDIB_1bppMask:
if (!ConvertFormat(FXDIB_8bppMask)) {
- return false;
+ return FALSE;
}
MultiplyAlpha(alpha);
break;
@@ -1004,18 +1004,18 @@ bool CFX_DIBitmap::MultiplyAlpha(int alpha)
m_pAlphaMask->MultiplyAlpha(alpha);
} else if (IsCmykImage()) {
if (!ConvertFormat((FXDIB_Format)(GetFormat() | 0x0200))) {
- return false;
+ return FALSE;
}
m_pAlphaMask->MultiplyAlpha(alpha);
} else {
if (!ConvertFormat(FXDIB_Argb)) {
- return false;
+ return FALSE;
}
MultiplyAlpha(alpha);
}
break;
}
- return true;
+ return TRUE;
}
FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const
{
@@ -1122,7 +1122,7 @@ void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color)
}
}
void CFX_DIBitmap::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
{
if (m_pBuffer == NULL) {
return;
@@ -1179,15 +1179,15 @@ void CFX_DIBitmap::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp
}
}
}
-bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
+FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
{
ASSERT(!IsAlphaMask());
if (m_pBuffer == NULL || IsAlphaMask()) {
- return false;
+ return FALSE;
}
int fc, fm, fy, fk, bc, bm, by, bk;
int fr, fg, fb, br, bg, bb;
- bool isCmykImage = IsCmykImage();
+ FX_BOOL isCmykImage = IsCmykImage();
if (isCmykImage) {
fc = FXSYS_GetCValue(forecolor);
fm = FXSYS_GetMValue(forecolor);
@@ -1208,10 +1208,10 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
if (m_bpp <= 8) {
if (isCmykImage) {
if (forecolor == 0xff && backcolor == 0 && m_pPalette == NULL) {
- return true;
+ return TRUE;
}
} else if (forecolor == 0 && backcolor == 0xffffff && m_pPalette == NULL) {
- return true;
+ return TRUE;
}
if (m_pPalette == NULL) {
BuildPalette();
@@ -1232,7 +1232,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
m_pPalette[i] = FXARGB_MAKE(0xff, br + (fr - br) * gray / 255, bg + (fg - bg) * gray / 255,
bb + (fb - bb) * gray / 255);
}
- return true;
+ return TRUE;
}
if (isCmykImage) {
if (forecolor == 0xff && backcolor == 0x00) {
@@ -1248,7 +1248,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
*scanline ++ = 255 - FXRGB2GRAY(r, g, b);
}
}
- return true;
+ return TRUE;
}
} else if (forecolor == 0 && backcolor == 0xffffff) {
for (int row = 0; row < m_Height; row ++) {
@@ -1262,7 +1262,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
scanline += gap;
}
}
- return true;
+ return TRUE;
}
if (isCmykImage) {
for (int row = 0; row < m_Height; row ++) {
@@ -1291,18 +1291,18 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
}
}
}
- return true;
+ return TRUE;
}
-bool CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect)
+FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect)
{
if (m_pBuffer == NULL) {
- return false;
+ return FALSE;
}
if (m_bpp != 8 && m_pPalette != NULL && m_AlphaFlag != 0) {
- return false;
+ return FALSE;
}
if (m_Width < 4 && m_Height < 4) {
- return false;
+ return FALSE;
}
FX_RECT rect(0, 0, m_Width, m_Height);
if (pRect) {
@@ -1374,9 +1374,9 @@ bool CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_REC
}
}
}
- return true;
+ return TRUE;
}
-CFX_DIBitmap* CFX_DIBSource::FlipImage(bool bXFlip, bool bYFlip) const
+CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const
{
CFX_DIBitmap* pFlipped = new CFX_DIBitmap;
if (!pFlipped->Create(m_Width, m_Height, GetFormat())) {
@@ -1480,7 +1480,7 @@ CFX_FilteredDIB::~CFX_FilteredDIB()
FX_Free(m_pScanline);
}
}
-void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, bool bAutoDropSrc)
+void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
{
m_pSrc = pSrc;
m_bAutoDropSrc = bAutoDropSrc;
@@ -1499,7 +1499,7 @@ const uint8_t* CFX_FilteredDIB::GetScanline(int line) const
return m_pScanline;
}
void CFX_FilteredDIB::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
- int dest_width, bool bFlipX, int clip_left, int clip_width) const
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
{
m_pSrc->DownSampleScanline(line, dest_scan, dest_bpp, dest_width, bFlipX, clip_left, clip_width);
TranslateDownSamples(dest_scan, dest_scan, clip_width, dest_bpp);
@@ -1508,18 +1508,18 @@ CFX_ImageRenderer::CFX_ImageRenderer()
{
m_Status = 0;
m_pTransformer = NULL;
- m_bRgbByteOrder = false;
+ m_bRgbByteOrder = FALSE;
m_BlendType = FXDIB_BLEND_NORMAL;
}
CFX_ImageRenderer::~CFX_ImageRenderer()
{
delete m_pTransformer;
}
-extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, bool bFlipX, bool bFlipY);
-bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
+extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY);
+FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
const CFX_DIBSource* pSource, int bitmap_alpha,
FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix,
- FX_DWORD dib_flags, bool bRgbByteOrder,
+ FX_DWORD dib_flags, FX_BOOL bRgbByteOrder,
int alpha_flag, void* pIccTransform, int blend_type)
{
m_Matrix = *pMatrix;
@@ -1528,7 +1528,7 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn
m_ClipBox = pClipRgn ? pClipRgn->GetBox() : FX_RECT(0, 0, pDevice->GetWidth(), pDevice->GetHeight());
m_ClipBox.Intersect(image_rect);
if (m_ClipBox.IsEmpty()) {
- return false;
+ return FALSE;
}
m_pDevice = pDevice;
m_pClipRgn = pClipRgn;
@@ -1540,7 +1540,7 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn
m_pIccTransform = pIccTransform;
m_bRgbByteOrder = bRgbByteOrder;
m_BlendType = blend_type;
- bool ret = true;
+ FX_BOOL ret = TRUE;
if ((FXSYS_fabs(m_Matrix.b) >= 0.5f || m_Matrix.a == 0) ||
(FXSYS_fabs(m_Matrix.c) >= 0.5f || m_Matrix.d == 0) ) {
if (FXSYS_fabs(m_Matrix.a) < FXSYS_fabs(m_Matrix.b) / 20 && FXSYS_fabs(m_Matrix.d) < FXSYS_fabs(m_Matrix.c) / 20 &&
@@ -1550,18 +1550,18 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn
FX_RECT bitmap_clip = m_ClipBox;
bitmap_clip.Offset(-image_rect.left, -image_rect.top);
bitmap_clip = _FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height, m_Matrix.c > 0, m_Matrix.b < 0);
- m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, true,
+ m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, TRUE,
m_Matrix.c > 0, m_Matrix.b < 0, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
if (!m_Stretcher.Start(&m_Composer, pSource, dest_height, dest_width, bitmap_clip, dib_flags)) {
- return false;
+ return FALSE;
}
m_Status = 1;
- return true;
+ return TRUE;
}
m_Status = 2;
m_pTransformer = new CFX_ImageTransformer;
m_pTransformer->Start(pSource, &m_Matrix, dib_flags, &m_ClipBox);
- return true;
+ return TRUE;
}
int dest_width = image_rect.Width();
if (m_Matrix.a < 0) {
@@ -1572,32 +1572,32 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn
dest_height = -dest_height;
}
if (dest_width == 0 || dest_height == 0) {
- return false;
+ return FALSE;
}
FX_RECT bitmap_clip = m_ClipBox;
bitmap_clip.Offset(-image_rect.left, -image_rect.top);
m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color,
- m_ClipBox, false, false, false, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
+ m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
m_Status = 1;
ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitmap_clip, dib_flags);
return ret;
}
-bool CFX_ImageRenderer::Continue(IFX_Pause* pPause)
+FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause)
{
if (m_Status == 1) {
return m_Stretcher.Continue(pPause);
}
if (m_Status == 2) {
if (m_pTransformer->Continue(pPause)) {
- return true;
+ return TRUE;
}
CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
if (pBitmap->GetBuffer() == NULL) {
delete pBitmap;
- return false;
+ return FALSE;
}
if (pBitmap->IsAlphaMask()) {
if (m_BitmapAlpha != 255) {
@@ -1618,9 +1618,9 @@ bool CFX_ImageRenderer::Continue(IFX_Pause* pPause)
pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, 0, 0, m_BlendType, m_pClipRgn, m_bRgbByteOrder, m_pIccTransform);
}
delete pBitmap;
- return false;
+ return FALSE;
}
- return false;
+ return FALSE;
}
CFX_BitmapStorer::CFX_BitmapStorer()
{
@@ -1653,16 +1653,16 @@ void CFX_BitmapStorer::ComposeScanline(int line, const uint8_t* scanline, const
FXSYS_memcpy(dest_alpha_buf, scan_extra_alpha, m_pBitmap->m_pAlphaMask->GetPitch());
}
}
-bool CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
+FX_BOOL CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
{
m_pBitmap = new CFX_DIBitmap;
if (!m_pBitmap->Create(width, height, src_format)) {
delete m_pBitmap;
m_pBitmap = NULL;
- return false;
+ return FALSE;
}
if (pSrcPalette) {
m_pBitmap->CopyPalette(pSrcPalette);
}
- return true;
+ return TRUE;
}
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp
index 01bc167ede..e34e715bf2 100644
--- a/core/src/fxge/dib/fx_dib_transform.cpp
+++ b/core/src/fxge/dib/fx_dib_transform.cpp
@@ -54,7 +54,7 @@ public:
y1 /= base;
}
};
-CFX_DIBitmap* CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pDestClip) const
+CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pDestClip) const
{
FX_RECT dest_clip(0, 0, m_Height, m_Width);
if (pDestClip) {
@@ -148,7 +148,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pDe
return pTransBitmap;
}
#define FIX16_005 0.05f
-FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, bool bFlipX, bool bFlipY)
+FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY)
{
FX_RECT rect;
if (bFlipY) {
@@ -206,7 +206,7 @@ CFX_ImageTransformer::CFX_ImageTransformer()
CFX_ImageTransformer::~CFX_ImageTransformer()
{
}
-bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix, int flags, const FX_RECT* pDestClip)
+FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix, int flags, const FX_RECT* pDestClip)
{
m_pMatrix = (CFX_AffineMatrix*)pDestMatrix;
CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect();
@@ -216,7 +216,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr
result_clip.Intersect(*pDestClip);
}
if (result_clip.IsEmpty()) {
- return false;
+ return FALSE;
}
m_ResultLeft = result_clip.left;
m_ResultTop = result_clip.top;
@@ -232,7 +232,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr
result_clip = _FXDIB_SwapClipBox(result_clip, dest_width, dest_height, pDestMatrix->c > 0, pDestMatrix->b < 0);
m_Stretcher.Start(&m_Storer, pSrc, dest_height, dest_width, result_clip, flags);
m_Status = 1;
- return true;
+ return TRUE;
}
if (FXSYS_fabs(pDestMatrix->b) < FIX16_005 && FXSYS_fabs(pDestMatrix->c) < FIX16_005) {
int dest_width = pDestMatrix->a > 0 ? (int)FXSYS_ceil(pDestMatrix->a) : (int)FXSYS_floor(pDestMatrix->a);
@@ -240,7 +240,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr
result_clip.Offset(-result_rect.left, -result_rect.top);
m_Stretcher.Start(&m_Storer, pSrc, dest_width, dest_height, result_clip, flags);
m_Status = 2;
- return true;
+ return TRUE;
}
int stretch_width = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->a, pDestMatrix->b));
int stretch_height = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->c, pDestMatrix->d));
@@ -254,7 +254,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr
m_StretchClip.Intersect(0, 0, stretch_width, stretch_height);
m_Stretcher.Start(&m_Storer, pSrc, stretch_width, stretch_height, m_StretchClip, flags);
m_Status = 3;
- return true;
+ return TRUE;
}
uint8_t _bilinear_interpol(const uint8_t* buf, int row_offset_l, int row_offset_r,
int src_col_l, int src_col_r, int res_x, int res_y,
@@ -335,30 +335,30 @@ FXDIB_Format _GetTransformedFormat(const CFX_DIBSource* pDrc)
}
return format;
}
-bool CFX_ImageTransformer::Continue(IFX_Pause* pPause)
+FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
{
if (m_Status == 1) {
if (m_Stretcher.Continue(pPause)) {
- return true;
+ return TRUE;
}
if (m_Storer.GetBitmap()) {
m_Storer.Replace(m_Storer.GetBitmap()->SwapXY(m_pMatrix->c > 0, m_pMatrix->b < 0));
}
- return false;
+ return FALSE;
}
if (m_Status == 2) {
return m_Stretcher.Continue(pPause);
}
if (m_Status != 3) {
- return false;
+ return FALSE;
}
if (m_Stretcher.Continue(pPause)) {
- return true;
+ return TRUE;
}
int stretch_width = m_StretchClip.Width();
int stretch_height = m_StretchClip.Height();
if (m_Storer.GetBitmap() == NULL) {
- return false;
+ return FALSE;
}
const uint8_t* stretch_buf = m_Storer.GetBitmap()->GetBuffer();
const uint8_t* stretch_buf_mask = NULL;
@@ -370,7 +370,7 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause)
FXDIB_Format transformF = _GetTransformedFormat(m_Stretcher.m_pSource);
if (!pTransformed->Create(m_ResultWidth, m_ResultHeight, transformF)) {
delete pTransformed;
- return false;
+ return FALSE;
}
pTransformed->Clear(0);
if (pTransformed->m_pAlphaMask) {
@@ -641,7 +641,7 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause)
}
}
} else {
- bool bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
+ FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
int destBpp = pTransformed->GetBPP() / 8;
if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
@@ -786,5 +786,5 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause)
}
}
m_Storer.Replace(pTransformed);
- return false;
+ return FALSE;
}
diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp
index ecdd1b0183..0baa99cdc7 100644
--- a/core/src/fxge/ge/fx_ge_device.cpp
+++ b/core/src/fxge/ge/fx_ge_device.cpp
@@ -35,7 +35,7 @@ void CFX_RenderDevice::InitDeviceInfo()
m_ClipBox.bottom = m_Height;
}
}
-bool CFX_RenderDevice::StartRendering()
+FX_BOOL CFX_RenderDevice::StartRendering()
{
return m_pDeviceDriver->StartRendering();
}
@@ -47,7 +47,7 @@ void CFX_RenderDevice::SaveState()
{
m_pDeviceDriver->SaveState();
}
-void CFX_RenderDevice::RestoreState(bool bKeepSaved)
+void CFX_RenderDevice::RestoreState(FX_BOOL bKeepSaved)
{
m_pDeviceDriver->RestoreState(bKeepSaved);
UpdateClipBox();
@@ -60,7 +60,7 @@ CFX_Matrix CFX_RenderDevice::GetCTM() const
{
return m_pDeviceDriver->GetCTM();
}
-bool CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const
+FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const
{
if (m_RenderCaps & FXRC_CMYK_OUTPUT) {
return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Cmyka : FXDIB_Cmyk);
@@ -74,37 +74,37 @@ bool CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int
return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb);
#endif
}
-bool CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData,
+FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
)
{
if (!m_pDeviceDriver->SetClip_PathFill(pPathData, pObject2Device, fill_mode)) {
- return false;
+ return FALSE;
}
UpdateClipBox();
- return true;
+ return TRUE;
}
-bool CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData,
+FX_BOOL CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
)
{
if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device, pGraphState)) {
- return false;
+ return FALSE;
}
UpdateClipBox();
- return true;
+ return TRUE;
}
-bool CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect)
+FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect)
{
CFX_PathData path;
path.AppendRect((FX_FLOAT)(pRect->left), (FX_FLOAT)(pRect->bottom), (FX_FLOAT)(pRect->right), (FX_FLOAT)(pRect->top));
if (!SetClip_PathFill(&path, NULL, FXFILL_WINDING)) {
- return false;
+ return FALSE;
}
UpdateClipBox();
- return true;
+ return TRUE;
}
void CFX_RenderDevice::UpdateClipBox()
{
@@ -116,7 +116,7 @@ void CFX_RenderDevice::UpdateClipBox()
m_ClipBox.right = m_Width;
m_ClipBox.bottom = m_Height;
}
-bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
+FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color, FX_DWORD stroke_color, int fill_mode,
@@ -149,7 +149,7 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
y2 = pPoints[1].m_PointY;
}
DrawCosmeticLine(x1, y1, x2, y2, fill_color, fill_mode, alpha_flag, pIccTransform, blend_type);
- return true;
+ return TRUE;
}
if ((pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) && stroke_alpha == 0) {
CFX_FloatRect rect_f;
@@ -184,13 +184,13 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
}
}
if (FillRect(&rect_i, fill_color, alpha_flag, pIccTransform, blend_type)) {
- return true;
+ return TRUE;
}
}
}
if((fill_mode & 3) && stroke_alpha == 0 && !(fill_mode & FX_FILL_STROKE) && !(fill_mode & FX_FILL_TEXT_MODE)) {
CFX_PathData newPath;
- bool bThin = false;
+ FX_BOOL bThin = FALSE;
if (pPathData->GetZeroAreaPath(newPath, (CFX_Matrix*)pObject2Device, bThin, m_pDeviceDriver->GetDriverType())) {
CFX_GraphStateData graphState;
graphState.m_LineWidth = 0.0f;
@@ -215,7 +215,7 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
}
if ((fill_mode & 3) && fill_alpha && stroke_alpha < 0xff && (fill_mode & FX_FILL_STROKE)) {
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
CFX_FloatRect bbox;
if (pGraphState) {
@@ -232,19 +232,19 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
FX_RECT rect = bbox.GetOutterRect();
CFX_DIBitmap bitmap, Backdrop;
if (!CreateCompatibleBitmap(&bitmap, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY))) {
- return false;
+ return FALSE;
}
if (bitmap.HasAlpha()) {
bitmap.Clear(0);
Backdrop.Copy(&bitmap);
} else {
if (!m_pDeviceDriver->GetDIBits(&bitmap, rect.left, rect.top, NULL)) {
- return false;
+ return FALSE;
}
Backdrop.Copy(&bitmap);
}
CFX_FxgeDevice bitmap_device;
- bitmap_device.Attach(&bitmap, 0, false, &Backdrop, true);
+ bitmap_device.Attach(&bitmap, 0, FALSE, &Backdrop, TRUE);
CFX_AffineMatrix matrix;
if (pObject2Device) {
matrix = *pObject2Device;
@@ -252,51 +252,51 @@ bool CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
matrix.TranslateI(-rect.left, -rect.top);
matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0);
if (!bitmap_device.GetDeviceDriver()->DrawPath(pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
- return false;
+ return FALSE;
}
FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY));
return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top, FXDIB_BLEND_NORMAL);
}
return m_pDeviceDriver->DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type);
}
-bool CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (m_pDeviceDriver->SetPixel(x, y, color, alpha_flag, pIccTransform)) {
- return true;
+ return TRUE;
}
FX_RECT rect(x, y, x + 1, y + 1);
return FillRect(&rect, color, alpha_flag, pIccTransform);
}
-bool CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
+FX_BOOL CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
{
if (m_pDeviceDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform, blend_type)) {
- return true;
+ return TRUE;
}
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
CFX_DIBitmap bitmap;
if (!CreateCompatibleBitmap(&bitmap, pRect->Width(), pRect->Height())) {
- return false;
+ return FALSE;
}
if (!m_pDeviceDriver->GetDIBits(&bitmap, pRect->left, pRect->top)) {
- return false;
+ return FALSE;
}
if (!bitmap.CompositeRect(0, 0, pRect->Width(), pRect->Height(), fill_color, alpha_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
FX_RECT src_rect(0, 0, pRect->Width(), pRect->Height());
m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, pRect->left, pRect->top, FXDIB_BLEND_NORMAL);
- return true;
+ return TRUE;
}
-bool CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int fill_mode, int alpha_flag, void* pIccTransform, int blend_type)
{
if (((m_RenderCaps & FXRC_ALPHA_PATH) &&
(FXGETFLAG_COLORTYPE(alpha_flag) && FXGETFLAG_ALPHA_FILL(alpha_flag) == 0xff)) ||
color >= 0xff000000)
if (m_pDeviceDriver->DrawCosmeticLine(x1, y1, x2, y2, color, alpha_flag, pIccTransform, blend_type)) {
- return true;
+ return TRUE;
}
CFX_GraphStateData graph_state;
CFX_PathData path;
@@ -305,10 +305,10 @@ bool CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, F
path.SetPoint(1, x2, y2, FXPT_LINETO);
return m_pDeviceDriver->DrawPath(&path, NULL, &graph_state, 0, color, fill_mode, alpha_flag, pIccTransform, blend_type);
}
-bool CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform)
+FX_BOOL CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform)
{
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
return m_pDeviceDriver->GetDIBits(pBitmap, left, top, pIccTransform);
}
@@ -316,7 +316,7 @@ CFX_DIBitmap* CFX_RenderDevice::GetBackDrop()
{
return m_pDeviceDriver->GetBackDrop();
}
-bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode,
+FX_BOOL CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode,
void* pIccTransform)
{
ASSERT(!pBitmap->IsAlphaMask());
@@ -326,7 +326,7 @@ bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top
FX_RECT dest_rect(left, top, FXSYS_round(left + pBitmap->GetWidth() / fScaleX), FXSYS_round(top + pBitmap->GetHeight() / fScaleY));
dest_rect.Intersect(m_ClipBox);
if (dest_rect.IsEmpty()) {
- return true;
+ return TRUE;
}
FX_RECT src_rect(dest_rect.left - left, dest_rect.top - top,
dest_rect.left - left + dest_rect.Width(), dest_rect.top - top + dest_rect.Height());
@@ -337,29 +337,29 @@ bool CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top
if ((blend_mode != FXDIB_BLEND_NORMAL && !(m_RenderCaps & FXRC_BLEND_MODE)) ||
(pBitmap->HasAlpha() && !(m_RenderCaps & FXRC_ALPHA_IMAGE))) {
if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return false;
+ return FALSE;
}
int bg_pixel_width = FXSYS_round(dest_rect.Width() * fScaleX);
int bg_pixel_height = FXSYS_round(dest_rect.Height() * fScaleY);
CFX_DIBitmap background;
if (!background.Create(bg_pixel_width, bg_pixel_height,
(m_RenderCaps & FXRC_CMYK_OUTPUT) ? FXDIB_Cmyk : FXDIB_Rgb32)) {
- return false;
+ return FALSE;
}
if (!m_pDeviceDriver->GetDIBits(&background, dest_rect.left, dest_rect.top)) {
- return false;
+ return FALSE;
}
if (!background.CompositeBitmap(0, 0, bg_pixel_width, bg_pixel_height,
pBitmap, src_rect.left, src_rect.top,
- blend_mode, NULL, false, pIccTransform)) {
- return false;
+ blend_mode, NULL, FALSE, pIccTransform)) {
+ return FALSE;
}
FX_RECT src_rect(0, 0, bg_pixel_width, bg_pixel_height);
return m_pDeviceDriver->SetDIBits(&background, 0, &src_rect, dest_rect.left, dest_rect.top, FXDIB_BLEND_NORMAL);
}
return m_pDeviceDriver->SetDIBits(pBitmap, 0, &src_rect, dest_rect.left, dest_rect.top, blend_mode, 0, pIccTransform);
}
-bool CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top,
+FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top,
int dest_width, int dest_height, FX_DWORD flags,
void* pIccTransform, int blend_mode)
{
@@ -367,17 +367,17 @@ bool CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int
FX_RECT clip_box = m_ClipBox;
clip_box.Intersect(dest_rect);
if (clip_box.IsEmpty()) {
- return true;
+ return TRUE;
}
return m_pDeviceDriver->StretchDIBits(pBitmap, 0, left, top, dest_width, dest_height, &clip_box, flags, 0, pIccTransform, blend_mode);
}
-bool CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb,
+FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb,
int alpha_flag, void* pIccTransform)
{
FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
return m_pDeviceDriver->SetDIBits(pBitmap, argb, &src_rect, left, top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
}
-bool CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top,
+FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top,
int dest_width, int dest_height, FX_DWORD argb, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
@@ -386,13 +386,13 @@ bool CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, in
clip_box.Intersect(dest_rect);
return m_pDeviceDriver->StretchDIBits(pBitmap, argb, left, top, dest_width, dest_height, &clip_box, flags, alpha_flag, pIccTransform);
}
-bool CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
+FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_mode)
{
return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, flags, handle, alpha_flag, pIccTransform, blend_mode);
}
-bool CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause)
+FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause)
{
return m_pDeviceDriver->ContinueDIBits(handle, pPause);
}
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index 7a5e0ccabd..6a950bf20b 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -13,8 +13,8 @@ CFX_Font::CFX_Font()
{
m_pSubstFont = NULL;
m_Face = NULL;
- m_bEmbedded = false;
- m_bVertical = false;
+ m_bEmbedded = FALSE;
+ m_bVertical = FALSE;
m_pFontData = NULL;
m_pFontDataAllocation = NULL;
m_dwSize = 0;
@@ -24,7 +24,7 @@ CFX_Font::CFX_Font()
m_pPlatformFontCollection = NULL;
m_pDwFont = NULL;
m_hHandle = NULL;
- m_bDwLoaded = false;
+ m_bDwLoaded = FALSE;
}
CFX_Font::~CFX_Font()
{
@@ -61,10 +61,10 @@ void CFX_Font::DeleteFace()
FXFT_Done_Face(m_Face);
m_Face = NULL;
}
-bool CFX_Font::LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, bool bVertical)
+FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical)
{
- m_bEmbedded = false;
+ m_bEmbedded = FALSE;
m_bVertical = bVertical;
m_pSubstFont = new CFX_SubstFont;
m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
@@ -79,7 +79,7 @@ bool CFX_Font::LoadSubst(const CFX_ByteString& face_name, bool bTrueType, FX_DWO
m_pFontData = FXFT_Get_Face_Stream_Base(m_Face);
m_dwSize = FXFT_Get_Face_Stream_Size(m_Face);
}
- return true;
+ return TRUE;
}
extern "C" {
unsigned long _FTStreamRead(FXFT_Stream stream, unsigned long offset,
@@ -99,7 +99,7 @@ extern "C" {
{
}
};
-bool _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
+FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
{
FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(uint8_t, sizeof (FXFT_StreamRec));
stream1->base = NULL;
@@ -113,16 +113,16 @@ bool _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_
args.stream = stream1;
if (FXFT_Open_Face(library, &args, 0, Face)) {
FX_Free(stream1);
- return false;
+ return FALSE;
}
if (stream) {
*stream = stream1;
}
- return true;
+ return TRUE;
}
-bool CFX_Font::LoadFile(IFX_FileRead* pFile)
+FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile)
{
- m_bEmbedded = false;
+ m_bEmbedded = FALSE;
FXFT_Library library;
if (CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary == NULL) {
FXFT_Init_FreeType(&CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary);
@@ -130,11 +130,11 @@ bool CFX_Font::LoadFile(IFX_FileRead* pFile)
library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
FXFT_Stream stream = NULL;
if (!_LoadFile(library, &m_Face, pFile, &stream)) {
- return false;
+ return FALSE;
}
m_pOwnedStream = stream;
FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- return true;
+ return TRUE;
}
int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index)
{
@@ -169,20 +169,20 @@ static FXFT_Face FT_LoadFont(uint8_t* pData, int size)
}
return face;
}
-bool CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size)
+FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size)
{
m_pFontDataAllocation = FX_Alloc(uint8_t, size);
FXSYS_memcpy(m_pFontDataAllocation, data, size);
m_Face = FT_LoadFont((uint8_t*)m_pFontDataAllocation, size);
m_pFontData = (uint8_t*)m_pFontDataAllocation;
- m_bEmbedded = true;
+ m_bEmbedded = TRUE;
m_dwSize = size;
return m_Face != NULL;
}
-bool CFX_Font::IsTTFont()
+FX_BOOL CFX_Font::IsTTFont()
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
return FXFT_Is_Face_TT_OT(m_Face) == FXFT_FACE_FLAG_SFNT;
}
@@ -202,25 +202,25 @@ int CFX_Font::GetDescent() const
int descent = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face));
return descent;
}
-bool CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
+FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
if (FXFT_Is_Face_Tricky(m_Face)) {
int error = FXFT_Set_Char_Size(m_Face, 0, 1000 * 64, 72, 72);
if (error) {
- return false;
+ return FALSE;
}
error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
if (error) {
- return false;
+ return FALSE;
}
FXFT_BBox cbox;
FT_Glyph glyph;
error = FXFT_Get_Glyph(((FXFT_Face)m_Face)->glyph, &glyph);
if (error) {
- return false;
+ return FALSE;
}
FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
int pixel_size_x = ((FXFT_Face)m_Face)->size->metrics.x_ppem,
@@ -246,7 +246,7 @@ bool CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
return FXFT_Set_Pixel_Sizes(m_Face, 0, 64) == 0;
}
if (FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
- return false;
+ return FALSE;
}
int em = FXFT_Get_Face_UnitsPerEM(m_Face);
if (em == 0) {
@@ -260,34 +260,34 @@ bool CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
bbox.right = (FXFT_Get_Glyph_HoriBearingX(m_Face) + FXFT_Get_Glyph_Width(m_Face)) * 1000 / em;
bbox.bottom = (FXFT_Get_Glyph_HoriBearingY(m_Face)) * 1000 / em;
}
- return true;
+ return TRUE;
}
-bool CFX_Font::IsItalic()
+FX_BOOL CFX_Font::IsItalic()
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
- bool ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
+ FX_BOOL ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
if (!ret) {
CFX_ByteString str(FXFT_Get_Face_Style_Name(m_Face));
str.MakeLower();
if (str.Find("italic") != -1) {
- ret = true;
+ ret = TRUE;
}
}
return ret;
}
-bool CFX_Font::IsBold()
+FX_BOOL CFX_Font::IsBold()
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
return FXFT_Is_Face_Bold(m_Face) == FXFT_STYLE_FLAG_BOLD;
}
-bool CFX_Font::IsFixedWidth()
+FX_BOOL CFX_Font::IsFixedWidth()
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
return FXFT_Is_Face_fixedwidth(m_Face);
}
@@ -331,10 +331,10 @@ CFX_ByteString CFX_Font::GetFaceName() const
}
return m_pSubstFont->m_Family;
}
-bool CFX_Font::GetBBox(FX_RECT &bbox)
+FX_BOOL CFX_Font::GetBBox(FX_RECT &bbox)
{
if (m_Face == NULL) {
- return false;
+ return FALSE;
}
int em = FXFT_Get_Face_UnitsPerEM(m_Face);
if (em == 0) {
@@ -348,7 +348,7 @@ bool CFX_Font::GetBBox(FX_RECT &bbox)
bbox.right = FXFT_Get_Face_xMax(m_Face) * 1000 / em;
bbox.bottom = FXFT_Get_Face_yMax(m_Face) * 1000 / em;
}
- return true;
+ return TRUE;
}
int CFX_Font::GetHeight()
{
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 15f022e86b..14427a5e40 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -18,9 +18,9 @@ CFX_SubstFont::CFX_SubstFont()
m_SubstFlags = 0;
m_Weight = 0;
m_ItalicAngle = 0;
- m_bSubstOfCJK = false;
+ m_bSubstOfCJK = FALSE;
m_WeightCJK = 0;
- m_bItlicCJK = false;
+ m_bItlicCJK = FALSE;
}
CTTFontDesc::~CTTFontDesc()
{
@@ -38,11 +38,11 @@ CTTFontDesc::~CTTFontDesc()
FX_Free(m_pFontData);
}
}
-bool CTTFontDesc::ReleaseFace(FXFT_Face face)
+FX_BOOL CTTFontDesc::ReleaseFace(FXFT_Face face)
{
if (m_Type == 1) {
if (m_SingleFace.m_pFace != face) {
- return false;
+ return FALSE;
}
} else if (m_Type == 2) {
int i;
@@ -51,15 +51,15 @@ bool CTTFontDesc::ReleaseFace(FXFT_Face face)
break;
}
if (i == 16) {
- return false;
+ return FALSE;
}
}
m_RefCount --;
if (m_RefCount) {
- return false;
+ return FALSE;
}
delete this;
- return true;
+ return TRUE;
}
CFX_FontMgr::CFX_FontMgr()
{
@@ -98,7 +98,7 @@ void CFX_FontMgr::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo)
{
m_pBuiltinMapper->SetSystemFontInfo(pFontInfo);
}
-FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, bool bTrueType,
+FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType,
FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont)
{
if (m_FTLibrary == NULL) {
@@ -115,7 +115,7 @@ FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, bool bTrue
CharsetCP, pSubstFont);
}
FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
- int weight, bool bItalic, uint8_t*& pFontData)
+ int weight, FX_BOOL bItalic, uint8_t*& pFontData)
{
CFX_ByteString key(face_name);
key += ',';
@@ -131,7 +131,7 @@ FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
return NULL;
}
FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name,
- int weight, bool bItalic, uint8_t* pData, FX_DWORD size, int face_index)
+ int weight, FX_BOOL bItalic, uint8_t* pData, FX_DWORD size, int face_index)
{
CTTFontDesc* pFontDesc = new CTTFontDesc;
pFontDesc->m_Type = 1;
@@ -433,10 +433,10 @@ void _FPDFAPI_GetInternalFontData(int id, const uint8_t*& data, FX_DWORD& size)
{
CFX_GEModule::Get()->GetFontMgr()->GetStandardFont(data, size, id);
}
-bool CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index)
+FX_BOOL CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int index)
{
if (index > 15 || index < 0) {
- return false;
+ return FALSE;
}
{
if (index >= 14) {
@@ -452,14 +452,14 @@ bool CFX_FontMgr::GetStandardFont(const uint8_t*& pFontData, FX_DWORD& size, int
size = g_FoxitFonts[index].m_dwSize;
}
}
- return true;
+ return TRUE;
}
CFX_FontMapper::CFX_FontMapper()
{
FXSYS_memset(m_FoxitFaces, 0, sizeof m_FoxitFaces);
m_MMFaces[0] = m_MMFaces[1] = NULL;
m_pFontInfo = NULL;
- m_bListLoaded = false;
+ m_bListLoaded = FALSE;
m_pFontEnumerator = NULL;
}
CFX_FontMapper::~CFX_FontMapper()
@@ -583,10 +583,10 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset)
return;
}
const uint8_t* ptr = name;
- bool bLocalized = false;
+ FX_BOOL bLocalized = FALSE;
for (int i = 0; i < name.GetLength(); i ++)
if (ptr[i] > 0x80) {
- bLocalized = true;
+ bLocalized = TRUE;
break;
}
if (bLocalized) {
@@ -620,7 +620,7 @@ void CFX_FontMapper::LoadInstalledFonts()
return;
}
m_pFontInfo->EnumFontList(this);
- m_bListLoaded = true;
+ m_bListLoaded = TRUE;
}
CFX_ByteString CFX_FontMapper::MatchInstalledFonts(const CFX_ByteString& norm_name)
{
@@ -847,7 +847,7 @@ CFX_ByteString ParseStyle(const FX_CHAR* pStyle, int iLen, int iIndex)
}
return buf.GetByteString();
}
-int32_t GetStyleType(const CFX_ByteString &bsStyle, bool bRevert)
+int32_t GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert)
{
int32_t iLen = bsStyle.GetLength();
if (!iLen) {
@@ -872,15 +872,15 @@ int32_t GetStyleType(const CFX_ByteString &bsStyle, bool bRevert)
}
return -1;
}
-bool CheckSupportThirdPartFont(CFX_ByteString name, int &PitchFamily)
+FX_BOOL CheckSupportThirdPartFont(CFX_ByteString name, int &PitchFamily)
{
if (name == FX_BSTRC("MyriadPro")) {
PitchFamily &= ~FXFONT_FF_ROMAN;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueType, FX_DWORD flags,
+FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTrueType, FX_DWORD flags,
int weight, int italic_angle, int WindowCP, CFX_SubstFont* pSubstFont)
{
if (!(flags & FXFONT_USEEXTERNATTR)) {
@@ -923,14 +923,14 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
}
int iBaseFont = 0;
CFX_ByteString family, style;
- bool bHasComma = false;
- bool bHasHypen = false;
+ FX_BOOL bHasComma = FALSE;
+ FX_BOOL bHasHypen = FALSE;
int find = SubstName.Find(FX_BSTRC(","), 0);
if (find >= 0) {
family = SubstName.Left(find);
_PDF_GetStandardFontName(family);
style = SubstName.Mid(find + 1);
- bHasComma = true;
+ bHasComma = TRUE;
} else {
family = SubstName;
}
@@ -939,9 +939,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
break;
}
int PitchFamily = 0;
- bool bItalic = false;
+ FX_BOOL bItalic = FALSE;
FX_DWORD nStyle = 0;
- bool bStyleAvail = false;
+ FX_BOOL bStyleAvail = FALSE;
if (iBaseFont < 12) {
family = g_Base14FontNames[iBaseFont];
if ((iBaseFont % 4) == 1 || (iBaseFont % 4) == 2) {
@@ -962,12 +962,12 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
if (find >= 0) {
style = family.Mid(find + 1);
family = family.Left(find);
- bHasHypen = true;
+ bHasHypen = TRUE;
}
}
if (!bHasHypen) {
int nLen = family.GetLength();
- int32_t nRet = GetStyleType(family, true);
+ int32_t nRet = GetStyleType(family, TRUE);
if (nRet > -1) {
family = family.Left(nLen - g_FontStyles[nRet].len);
if (nRet == 0) {
@@ -995,17 +995,17 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
int nLen = style.GetLength();
const FX_CHAR* pStyle = style;
int i = 0;
- bool bFirstItem = true;
+ FX_BOOL bFirstItem = TRUE;
CFX_ByteString buf;
while (i < nLen) {
buf = ParseStyle(pStyle, nLen, i);
- int32_t nRet = GetStyleType(buf, false);
+ int32_t nRet = GetStyleType(buf, FALSE);
if ((i && !bStyleAvail) || (!i && nRet < 0)) {
family = SubstName;
iBaseFont = 12;
break;
} else if (nRet >= 0) {
- bStyleAvail = true;
+ bStyleAvail = TRUE;
}
if (nRet == 0) {
if (nStyle & FX_FONT_STYLE_Bold) {
@@ -1013,7 +1013,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
} else {
nStyle |= FX_FONT_STYLE_Bold;
}
- bFirstItem = false;
+ bFirstItem = FALSE;
}
if (nRet == 1) {
if (bFirstItem) {
@@ -1031,7 +1031,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
} else {
nStyle |= FX_FONT_STYLE_Bold;
}
- bFirstItem = false;
+ bFirstItem = FALSE;
}
i += buf.GetLength() + 1;
}
@@ -1042,9 +1042,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
weight = nStyle & FX_FONT_STYLE_BoldBold ? 900 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL);
}
if (nStyle & FX_FONT_STYLE_Italic) {
- bItalic = true;
+ bItalic = TRUE;
}
- bool bCJK = false;
+ FX_BOOL bCJK = FALSE;
int iExact = 0;
int Charset = FXFONT_ANSI_CHARSET;
if (WindowCP) {
@@ -1054,7 +1054,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
}
if (Charset == FXFONT_SHIFTJIS_CHARSET || Charset == FXFONT_GB2312_CHARSET ||
Charset == FXFONT_HANGEUL_CHARSET || Charset == FXFONT_CHINESEBIG5_CHARSET) {
- bCJK = true;
+ bCJK = TRUE;
}
if (m_pFontInfo == NULL) {
pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
@@ -1069,21 +1069,21 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
if (!bCJK) {
if (!CheckSupportThirdPartFont(family, PitchFamily)) {
if (italic_angle != 0) {
- bItalic = true;
+ bItalic = TRUE;
} else {
- bItalic = false;
+ bItalic = FALSE;
}
weight = old_weight;
}
} else {
- pSubstFont->m_bSubstOfCJK = true;
+ pSubstFont->m_bSubstOfCJK = TRUE;
if (nStyle) {
pSubstFont->m_WeightCJK = weight;
} else {
pSubstFont->m_WeightCJK = FXFONT_FW_NORMAL;
}
if (nStyle & FX_FONT_STYLE_Italic) {
- pSubstFont->m_bItlicCJK = true;
+ pSubstFont->m_bItlicCJK = TRUE;
}
}
} else {
@@ -1123,7 +1123,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
}
} else {
if (flags & FXFONT_ITALIC) {
- bItalic = true;
+ bItalic = TRUE;
}
}
iExact = !match.IsEmpty();
@@ -1134,9 +1134,9 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
if (hFont == NULL) {
if (bCJK) {
if (italic_angle != 0) {
- bItalic = true;
+ bItalic = TRUE;
} else {
- bItalic = false;
+ bItalic = FALSE;
}
weight = old_weight;
}
@@ -1221,18 +1221,18 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, bool bTrueTy
}
pSubstFont->m_Family = SubstName;
pSubstFont->m_Charset = Charset;
- bool bNeedUpdateWeight = false;
+ FX_BOOL bNeedUpdateWeight = FALSE;
if (FXFT_Is_Face_Bold(face)) {
if (weight == FXFONT_FW_BOLD) {
- bNeedUpdateWeight = false;
+ bNeedUpdateWeight = FALSE;
} else {
- bNeedUpdateWeight = true;
+ bNeedUpdateWeight = TRUE;
}
} else {
if (weight == FXFONT_FW_NORMAL) {
- bNeedUpdateWeight = false;
+ bNeedUpdateWeight = FALSE;
} else {
- bNeedUpdateWeight = true;
+ bNeedUpdateWeight = TRUE;
}
}
if (bNeedUpdateWeight) {
@@ -1262,7 +1262,7 @@ CFontFileFaceInfo::CFontFileFaceInfo()
m_FileSize = 0;
m_FontOffset = 0;
m_Weight = 0;
- m_bItalic = false;
+ m_bItalic = FALSE;
m_PitchFamily = 0;
}
CFontFileFaceInfo::~CFontFileFaceInfo()
@@ -1272,7 +1272,7 @@ CFontFileFaceInfo::~CFontFileFaceInfo()
}
m_Face = NULL;
}
-extern bool _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
+extern FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
#if _FX_OS_ == _FX_ANDROID_
IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
{
@@ -1300,13 +1300,13 @@ void CFX_FolderFontInfo::Release()
{
delete this;
}
-bool CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper)
+FX_BOOL CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper)
{
m_pMapper = pMapper;
for (int i = 0; i < m_PathList.GetSize(); i ++) {
ScanPath(m_PathList[i]);
}
- return true;
+ return TRUE;
}
void CFX_FolderFontInfo::ScanPath(CFX_ByteString& path)
{
@@ -1315,7 +1315,7 @@ void CFX_FolderFontInfo::ScanPath(CFX_ByteString& path)
return;
}
CFX_ByteString filename;
- bool bFolder;
+ FX_BOOL bFolder;
while (FX_GetNextFile(handle, filename, bFolder)) {
if (bFolder) {
if (filename == "." || filename == "..") {
@@ -1451,7 +1451,7 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_
}
m_FontList.SetAt(facename, pInfo);
}
-void* CFX_FolderFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact)
+void* CFX_FolderFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact)
{
return NULL;
}
@@ -1506,16 +1506,16 @@ FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t* b
void CFX_FolderFontInfo::DeleteFont(void* hFont)
{
}
-bool CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
+FX_BOOL CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
{
if (hFont == NULL) {
- return false;
+ return FALSE;
}
CFontFaceInfo* pFont = (CFontFaceInfo*)hFont;
name = pFont->m_FaceName;
- return true;
+ return TRUE;
}
-bool CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
+FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
{
- return false;
+ return FALSE;
}
diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
index 9f493a6cfc..861afd259c 100644
--- a/core/src/fxge/ge/fx_ge_linux.cpp
+++ b/core/src/fxge/ge/fx_ge_linux.cpp
@@ -30,9 +30,9 @@ Base14Substs[] = {
class CFX_LinuxFontInfo : public CFX_FolderFontInfo
{
public:
- void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override;
- bool ParseFontCfg();
- void* FindFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool bMatchName);
+ void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override;
+ FX_BOOL ParseFontCfg();
+ void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName);
};
#define LINUX_GPNAMESIZE 6
static const struct {
@@ -77,7 +77,7 @@ static int32_t GetJapanesePreference(const FX_CHAR* facearr, int weight, int pic
}
return 2;
}
-void* CFX_LinuxFontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, int& iExact)
+void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, int& iExact)
{
CFX_ByteString face = cstr_face;
int iBaseFont;
@@ -91,7 +91,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, bool bItalic, int charset, int pitc
return GetFont(face);
}
void* p = NULL;
- bool bCJK = true;
+ FX_BOOL bCJK = TRUE;
switch (charset) {
case FXFONT_SHIFTJIS_CHARSET: {
int32_t index = GetJapanesePreference(cstr_face, weight, pitch_family);
@@ -129,7 +129,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, bool bItalic, int charset, int pitc
}
break;
default:
- bCJK = false;
+ bCJK = FALSE;
break;
}
if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
@@ -157,7 +157,7 @@ static FX_DWORD _LinuxGetCharset(int charset)
}
return 0;
}
-static int32_t _LinuxGetSimilarValue(int weight, bool bItalic, int pitch_family, FX_DWORD style)
+static int32_t _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style)
{
int32_t iSimilarValue = 0;
if ((style & FXFONT_BOLD) == (weight > 400)) {
@@ -177,7 +177,7 @@ static int32_t _LinuxGetSimilarValue(int weight, bool bItalic, int pitch_family,
}
return iSimilarValue;
}
-void* CFX_LinuxFontInfo::FindFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, bool bMatchName)
+void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL bMatchName)
{
CFontFaceInfo* pFind = NULL;
FX_DWORD charset_flag = _LinuxGetCharset(charset);
@@ -217,9 +217,9 @@ IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
}
return pInfo;
}
-bool CFX_LinuxFontInfo::ParseFontCfg()
+FX_BOOL CFX_LinuxFontInfo::ParseFontCfg()
{
- return false;
+ return FALSE;
}
void CFX_GEModule::InitPlatform()
{
diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp
index 4bc9a88128..b1410b3911 100644
--- a/core/src/fxge/ge/fx_ge_path.cpp
+++ b/core/src/fxge/ge/fx_ge_path.cpp
@@ -110,7 +110,7 @@ void CFX_ClipRgn::IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask)
m_Mask = new_mask;
return;
}
- ASSERT(false);
+ ASSERT(FALSE);
}
CFX_PathData::CFX_PathData()
{
@@ -257,8 +257,8 @@ static void _UpdateLineJoinPoints(CFX_FloatRect& rect, FX_FLOAT start_x, FX_FLOA
FX_FLOAT half_width, FX_FLOAT miter_limit)
{
FX_FLOAT start_k = 0, start_c = 0, end_k = 0, end_c = 0, start_len = 0, start_dc = 0, end_len = 0, end_dc = 0;
- bool bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20;
- bool bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20;
+ FX_BOOL bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20;
+ FX_BOOL bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20;
if (bStartVert && bEndVert) {
int start_dir = middle_y > start_y ? 1 : -1;
FX_FLOAT point_y = middle_y + half_width * start_dir;
@@ -342,12 +342,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_l
int iPoint = 0;
FX_FLOAT half_width = line_width;
int iStartPoint, iEndPoint, iMiddlePoint;
- bool bJoin;
+ FX_BOOL bJoin;
while (iPoint < m_PointCount) {
if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) {
iStartPoint = iPoint + 1;
iEndPoint = iPoint;
- bJoin = false;
+ bJoin = FALSE;
} else {
if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) {
rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY);
@@ -357,12 +357,12 @@ CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_l
if (iPoint == m_PointCount - 1 || m_pPoints[iPoint + 1].m_Flag == FXPT_MOVETO) {
iStartPoint = iPoint - 1;
iEndPoint = iPoint;
- bJoin = false;
+ bJoin = FALSE;
} else {
iStartPoint = iPoint - 1;
iMiddlePoint = iPoint;
iEndPoint = iPoint + 1;
- bJoin = true;
+ bJoin = TRUE;
}
}
FX_FLOAT start_x = m_pPoints[iStartPoint].m_PointX;
@@ -389,10 +389,10 @@ void CFX_PathData::Transform(const CFX_AffineMatrix* pMatrix)
pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY);
}
}
-bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, bool&bThin, bool bAdjust) const
+FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const
{
if (m_PointCount < 3) {
- return false;
+ return FALSE;
}
if (m_PointCount == 3 && (m_pPoints[0].m_Flag & FXPT_TYPE) == FXPT_MOVETO &&
(m_pPoints[1].m_Flag & FXPT_TYPE) == FXPT_LINETO && (m_pPoints[2].m_Flag & FXPT_TYPE) == FXPT_LINETO
@@ -422,19 +422,19 @@ bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMat
NewPath.SetPoint(1, m_pPoints[1].m_PointX, m_pPoints[1].m_PointY, FXPT_LINETO);
}
if (m_pPoints[0].m_PointX != m_pPoints[1].m_PointX && m_pPoints[0].m_PointY != m_pPoints[1].m_PointY) {
- bThin = true;
+ bThin = TRUE;
}
- return true;
+ return TRUE;
}
if (((m_PointCount > 3) && (m_PointCount % 2))) {
int mid = m_PointCount / 2;
- bool bZeroArea = false;
+ FX_BOOL bZeroArea = FALSE;
CFX_PathData t_path;
for (int i = 0; i < mid; i++) {
if (!(m_pPoints[mid - i - 1].m_PointX == m_pPoints[mid + i + 1].m_PointX
&& m_pPoints[mid - i - 1].m_PointY == m_pPoints[mid + i + 1].m_PointY &&
((m_pPoints[mid - i - 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[mid + i + 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO))) {
- bZeroArea = true;
+ bZeroArea = TRUE;
break;
}
int new_count = t_path.GetPointCount();
@@ -444,8 +444,8 @@ bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMat
}
if (!bZeroArea) {
NewPath.Append(&t_path, NULL);
- bThin = true;
- return true;
+ bThin = TRUE;
+ return TRUE;
}
}
int stratPoint = 0;
@@ -488,7 +488,7 @@ bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMat
NewPath.AddPointCount(2);
NewPath.SetPoint(new_count, m_pPoints[i - 1].m_PointX, m_pPoints[i - 1].m_PointY, FXPT_MOVETO);
NewPath.SetPoint(new_count + 1, m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, FXPT_LINETO);
- bThin = true;
+ bThin = TRUE;
}
}
} else if (point_type == FXPT_BEZIERTO) {
@@ -497,42 +497,42 @@ bool CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMat
}
}
if (m_PointCount > 3 && NewPath.GetPointCount()) {
- bThin = true;
+ bThin = TRUE;
}
if (NewPath.GetPointCount() == 0) {
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_PathData::IsRect() const
+FX_BOOL CFX_PathData::IsRect() const
{
if (m_PointCount != 5 && m_PointCount != 4) {
- return false;
+ return FALSE;
}
if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX ||
m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
(m_pPoints[0].m_PointX == m_pPoints[2].m_PointX && m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) ||
(m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
- return false;
+ return FALSE;
}
if (m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
- return false;
+ return FALSE;
}
for (int i = 1; i < 4; i ++) {
if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
- return false;
+ return FALSE;
}
if (m_pPoints[i].m_PointX != m_pPoints[i - 1].m_PointX && m_pPoints[i].m_PointY != m_pPoints[i - 1].m_PointY) {
- return false;
+ return FALSE;
}
}
return m_PointCount == 5 || (m_pPoints[3].m_Flag & FXPT_CLOSEFIGURE);
}
-bool CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect) const
+FX_BOOL CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect) const
{
if (pMatrix == NULL) {
if (!IsRect()) {
- return false;
+ return FALSE;
}
if (pRect) {
pRect->left = m_pPoints[0].m_PointX;
@@ -541,27 +541,27 @@ bool CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect)
pRect->top = m_pPoints[2].m_PointY;
pRect->Normalize();
}
- return true;
+ return TRUE;
}
if (m_PointCount != 5 && m_PointCount != 4) {
- return false;
+ return FALSE;
}
if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
(m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
- return false;
+ return FALSE;
}
if (m_PointCount == 4 && m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
- return false;
+ return FALSE;
}
FX_FLOAT x[5], y[5];
for (int i = 0; i < m_PointCount; i ++) {
pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, x[i], y[i]);
if (i) {
if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
- return false;
+ return FALSE;
}
if (x[i] != x[i - 1] && y[i] != y[i - 1]) {
- return false;
+ return FALSE;
}
}
}
@@ -572,7 +572,7 @@ bool CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect)
pRect->top = y[2];
pRect->Normalize();
}
- return true;
+ return TRUE;
}
void CFX_PathData::Copy(const CFX_PathData &src)
{
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index e375288247..ba5c5fbabb 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -10,7 +10,7 @@
struct PSGlyph {
CFX_Font* m_pFont;
FX_DWORD m_GlyphIndex;
- bool m_bGlyphAdjust;
+ FX_BOOL m_bGlyphAdjust;
FX_FLOAT m_AdjustMatrix[4];
};
class CPSFont
@@ -22,8 +22,8 @@ public:
CFX_PSRenderer::CFX_PSRenderer()
{
m_pOutput = NULL;
- m_bColorSet = m_bGraphStateSet = false;
- m_bInited = false;
+ m_bColorSet = m_bGraphStateSet = FALSE;
+ m_bInited = FALSE;
}
CFX_PSRenderer::~CFX_PSRenderer()
{
@@ -33,7 +33,7 @@ CFX_PSRenderer::~CFX_PSRenderer()
}
}
#define OUTPUT_PS(str) m_pOutput->OutputPS(str, sizeof str-1)
-void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int height, bool bCmykOutput)
+void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int height, FX_BOOL bCmykOutput)
{
m_PSLevel = pslevel;
m_pOutput = pOutput;
@@ -42,10 +42,10 @@ void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int hei
m_ClipBox.bottom = height;
m_bCmykOutput = bCmykOutput;
}
-bool CFX_PSRenderer::StartRendering()
+FX_BOOL CFX_PSRenderer::StartRendering()
{
if (m_bInited) {
- return true;
+ return TRUE;
}
static const char init_str[] = "\nsave\n/im/initmatrix load def\n"
"/n/newpath load def/m/moveto load def/l/lineto load def/c/curveto load def/h/closepath load def\n"
@@ -57,15 +57,15 @@ bool CFX_PSRenderer::StartRendering()
"/cm/concat load def/Cm/currentmatrix load def/mx/matrix load def/sm/setmatrix load def\n"
;
OUTPUT_PS(init_str);
- m_bInited = true;
- return true;
+ m_bInited = TRUE;
+ return TRUE;
}
void CFX_PSRenderer::EndRendering()
{
if (m_bInited) {
OUTPUT_PS("\nrestore\n");
}
- m_bInited = false;
+ m_bInited = FALSE;
}
void CFX_PSRenderer::SaveState()
{
@@ -73,7 +73,7 @@ void CFX_PSRenderer::SaveState()
OUTPUT_PS("q\n");
m_ClipBoxStack.Add(m_ClipBox);
}
-void CFX_PSRenderer::RestoreState(bool bKeepSaved)
+void CFX_PSRenderer::RestoreState(FX_BOOL bKeepSaved)
{
StartRendering();
if (bKeepSaved) {
@@ -81,7 +81,7 @@ void CFX_PSRenderer::RestoreState(bool bKeepSaved)
} else {
OUTPUT_PS("Q\n");
}
- m_bColorSet = m_bGraphStateSet = false;
+ m_bColorSet = m_bGraphStateSet = FALSE;
m_ClipBox = m_ClipBoxStack.GetAt(m_ClipBoxStack.GetSize() - 1);
if (!bKeepSaved) {
m_ClipBoxStack.RemoveAt(m_ClipBoxStack.GetSize() - 1);
@@ -175,7 +175,7 @@ void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData,
OUTPUT_PS("strokepath W n\n");
}
}
-bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
+FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -189,13 +189,13 @@ bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
int fill_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
if (fill_alpha && fill_alpha < 255) {
- return false;
+ return FALSE;
}
if (stroke_alpha && stroke_alpha < 255) {
- return false;
+ return FALSE;
}
if (fill_alpha == 0 && stroke_alpha == 0) {
- return false;
+ return FALSE;
}
if (stroke_alpha) {
SetGraphState(pGraphState);
@@ -233,7 +233,7 @@ bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
}
}
OUTPUT_PS("\n");
- return true;
+ return TRUE;
}
void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
{
@@ -259,7 +259,7 @@ void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
buf << pGraphState->m_MiterLimit << FX_BSTRC(" M\n");
}
m_CurGraphState.Copy(*pGraphState);
- m_bGraphStateSet = true;
+ m_bGraphStateSet = TRUE;
if (buf.GetSize()) {
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
@@ -305,7 +305,7 @@ static void PSCompressData(int PSLevel, uint8_t* src_buf, FX_DWORD src_size,
}
}
}
-bool CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int left, int top,
+FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int left, int top,
int alpha_flag, void* pIccTransform)
{
StartRendering();
@@ -313,7 +313,7 @@ bool CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int
(FX_FLOAT)(left), (FX_FLOAT)(top + pSource->GetHeight()));
return DrawDIBits(pSource, color, &matrix, 0, alpha_flag, pIccTransform);
}
-bool CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
@@ -322,20 +322,20 @@ bool CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
(FX_FLOAT)(dest_left), (FX_FLOAT)(dest_top + dest_height));
return DrawDIBits(pSource, color, &matrix, flags, alpha_flag, pIccTransform);
}
-bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
+FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
StartRendering();
if ((pMatrix->a == 0 && pMatrix->b == 0) || (pMatrix->c == 0 && pMatrix->d == 0)) {
- return true;
+ return TRUE;
}
if (pSource->HasAlpha()) {
- return false;
+ return FALSE;
}
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(color) : FXARGB_A(color);
if (pSource->IsAlphaMask() && (alpha < 255 || pSource->GetBPP() != 1)) {
- return false;
+ return FALSE;
}
OUTPUT_PS("q\n");
CFX_ByteTextBuf buf;
@@ -358,7 +358,7 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
FaxCompressData(src_buf, width, height, output_buf, output_size);
if (pSource->IsAlphaMask()) {
SetColor(color, alpha_flag, pIccTransform);
- m_bColorSet = false;
+ m_bColorSet = FALSE;
buf << FX_BSTRC(" true[");
} else {
buf << FX_BSTRC(" 1[");
@@ -406,7 +406,7 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
}
if (pConverted == NULL) {
OUTPUT_PS("\nQ\n");
- return false;
+ return FALSE;
}
int Bpp = pConverted->GetBPP() / 8;
uint8_t* output_buf = NULL;
@@ -462,14 +462,14 @@ bool CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
FX_Free(output_buf);
}
OUTPUT_PS("\nQ\n");
- return true;
+ return TRUE;
}
void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
pIccTransform = NULL;
}
- bool bCMYK = false;
+ FX_BOOL bCMYK = FALSE;
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
@@ -490,7 +490,7 @@ void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransfor
<< FXARGB_B(color) / 255.0 << FX_BSTRC(" rg\n");
}
if (bCMYK == m_bCmykOutput) {
- m_bColorSet = true;
+ m_bColorSet = TRUE;
m_LastColor = color;
}
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
@@ -588,7 +588,7 @@ void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont,
<< FX_BSTRC("/") << ps_glyphindex << FX_BSTRC(" put\n");
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
}
-bool CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+FX_BOOL CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device,
FX_FLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform)
@@ -596,10 +596,10 @@ bool CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Fo
StartRendering();
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
if (alpha < 255) {
- return false;
+ return FALSE;
}
if ((pObject2Device->a == 0 && pObject2Device->b == 0) || (pObject2Device->c == 0 && pObject2Device->d == 0)) {
- return true;
+ return TRUE;
}
SetColor(color, alpha_flag, pIccTransform);
CFX_ByteTextBuf buf;
@@ -628,7 +628,7 @@ bool CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Fo
}
buf << FX_BSTRC("Q\n");
m_pOutput->OutputPS((const FX_CHAR*)buf.GetBuffer(), buf.GetSize());
- return true;
+ return TRUE;
}
void CFX_PSRenderer::WritePSBinary(const uint8_t* data, int len)
{
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index c5da66a4ce..59a4cfb37d 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -46,7 +46,7 @@ private:
FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
{
FX_RECT rect(0, 0, 0, 0);
- bool bStarted = false;
+ FX_BOOL bStarted = FALSE;
for (int iChar = 0; iChar < nChars; iChar ++) {
FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
const CFX_GlyphBitmap* pGlyph = glyph.m_pGlyph;
@@ -66,7 +66,7 @@ FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_a
rect.right = char_right;
rect.top = char_top;
rect.bottom = char_bottom;
- bStarted = true;
+ bStarted = TRUE;
} else {
if (rect.left > char_left) {
rect.left = char_left;
@@ -87,9 +87,9 @@ FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_a
static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars)
{
ASSERT(nChars > 1);
- bool bVertical = false;
+ FX_BOOL bVertical = FALSE;
if (pGlyphAndPos[nChars - 1].m_OriginX == pGlyphAndPos[0].m_OriginX) {
- bVertical = true;
+ bVertical = TRUE;
} else if (pGlyphAndPos[nChars - 1].m_OriginY != pGlyphAndPos[0].m_OriginY) {
return;
}
@@ -155,7 +155,7 @@ void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransf
bgra[3] = (alpha_flag >> 24) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXGETFLAG_ALPHA_STROKE(alpha_flag);
argb = FXARGB_MAKE(bgra[3], bgra[2], bgra[1], bgra[0]);
}
-bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
+FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
FX_DWORD fill_color, FX_DWORD text_flags,
@@ -171,12 +171,12 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
#endif
#endif
if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
- return true;
+ return TRUE;
}
}
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
if (alpha < 255) {
- return false;
+ return FALSE;
}
} else if (!(text_flags & FXTEXT_NO_NATIVETEXT)) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
@@ -186,7 +186,7 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
#endif
#endif
if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
- return true;
+ return TRUE;
}
}
CFX_AffineMatrix char2device, deviceCtm, text2Device;
@@ -204,24 +204,24 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
}
}
int anti_alias = FXFT_RENDER_MODE_MONO;
- bool bNormal = false;
+ FX_BOOL bNormal = FALSE;
if ((text_flags & FXTEXT_NOSMOOTH) == 0) {
if (m_DeviceClass == FXDC_DISPLAY && m_bpp > 1) {
- bool bClearType;
+ FX_BOOL bClearType;
if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_CLEARTYPE)) {
- bClearType = false;
+ bClearType = FALSE;
} else {
bClearType = text_flags & FXTEXT_CLEARTYPE;
}
if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) {
anti_alias = FXFT_RENDER_MODE_LCD;
- bNormal = true;
+ bNormal = TRUE;
} else if (m_bpp < 16) {
anti_alias = FXFT_RENDER_MODE_NORMAL;
} else {
- if (bClearType == false) {
+ if (bClearType == FALSE) {
anti_alias = FXFT_RENDER_MODE_LCD;
- bNormal = true;
+ bNormal = TRUE;
} else {
anti_alias = FXFT_RENDER_MODE_LCD;
}
@@ -278,7 +278,7 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
bmp_rect.Intersect(m_ClipBox);
if (bmp_rect.IsEmpty()) {
FX_Free(pGlyphAndPos);
- return true;
+ return TRUE;
}
int pixel_width = FXSYS_round(bmp_rect.Width() * scale_x);
int pixel_height = FXSYS_round(bmp_rect.Height() * scale_y);
@@ -288,7 +288,7 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
CFX_DIBitmap bitmap;
if (!bitmap.Create(pixel_width, pixel_height, FXDIB_1bppMask)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
bitmap.Clear(0);
for (iChar = 0; iChar < nChars; iChar ++) {
@@ -308,19 +308,19 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
if (m_bpp == 8) {
if (!bitmap.Create(pixel_width, pixel_height, FXDIB_8bppMask)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
} else {
if (!CreateCompatibleBitmap(&bitmap, pixel_width, pixel_height)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
}
if (!bitmap.HasAlpha() && !bitmap.IsAlphaMask()) {
bitmap.Clear(0xFFFFFFFF);
if (!GetDIBits(&bitmap, bmp_rect.left, bmp_rect.top)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
} else {
bitmap.Clear(0);
@@ -352,13 +352,13 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
int nrows = pGlyph->GetHeight();
if (anti_alias == FXFT_RENDER_MODE_NORMAL) {
if (!bitmap.CompositeMask(left, top, ncols, nrows, pGlyph, fill_color,
- 0, 0, FXDIB_BLEND_NORMAL, NULL, false, alpha_flag, pIccTransform)) {
+ 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
FX_Free(pGlyphAndPos);
- return false;
+ return FALSE;
}
continue;
}
- bool bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
+ FX_BOOL bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
ncols /= 3;
int x_subpixel = (int)(glyph.m_fOriginX * 3) % 3;
uint8_t* src_buf = pGlyph->GetBuffer();
@@ -945,9 +945,9 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos
SetDIBits(&bitmap, bmp_rect.left, bmp_rect.top);
}
FX_Free(pGlyphAndPos);
- return true;
+ return TRUE;
}
-bool CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
+FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
CFX_Font* pFont, CFX_FontCache* pCache,
FX_FLOAT font_size, const CFX_AffineMatrix* pText2User,
const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState,
@@ -973,7 +973,7 @@ bool CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
matrix.Concat(*pText2User);
CFX_PathData TransformedPath(*pPath);
TransformedPath.Transform(&matrix);
- bool bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) ?
+ FX_BOOL bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) ?
(FXGETFLAG_ALPHA_FILL(alpha_flag) || FXGETFLAG_ALPHA_STROKE(alpha_flag)) :
(fill_color || stroke_color);
if (bHasAlpha) {
@@ -989,24 +989,24 @@ bool CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
}
fill_mode |= FX_FILL_TEXT_MODE;
if (!DrawPath(&TransformedPath, pUser2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
- return false;
+ return FALSE;
}
}
if (pClippingPath) {
pClippingPath->Append(&TransformedPath, pUser2Device);
}
}
- return true;
+ return TRUE;
}
CFX_FontCache::~CFX_FontCache()
{
- FreeCache(true);
+ FreeCache(TRUE);
}
CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont)
{
FXFT_Face internal_face = pFont->GetFace();
- const bool bExternal = internal_face == nullptr;
+ const FX_BOOL bExternal = internal_face == nullptr;
FXFT_Face face = bExternal ?
(FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
@@ -1028,7 +1028,7 @@ CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont)
void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont)
{
FXFT_Face internal_face = pFont->GetFace();
- const bool bExternal = internal_face == nullptr;
+ const FX_BOOL bExternal = internal_face == nullptr;
FXFT_Face face = bExternal ?
(FXFT_Face)pFont->GetSubstFont()->m_ExtHandle : internal_face;
CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
@@ -1043,7 +1043,7 @@ void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont)
}
}
-void CFX_FontCache::FreeCache(bool bRelease)
+void CFX_FontCache::FreeCache(FX_BOOL bRelease)
{
for (auto it = m_FTFaceMap.begin(); it != m_FTFaceMap.end();) {
auto curr_it = it++;
@@ -1095,7 +1095,7 @@ void CFX_FaceCache::InitPlatform()
}
#endif
CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix,
- CFX_ByteStringC& FaceGlyphsKey, FX_DWORD glyph_index, bool bFontStyle,
+ CFX_ByteStringC& FaceGlyphsKey, FX_DWORD glyph_index, FX_BOOL bFontStyle,
int dest_width, int anti_alias)
{
CFX_SizeGlyphCache* pSizeCache = NULL;
@@ -1114,7 +1114,7 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_Aff
pSizeCache->m_GlyphMap.SetAt((void*)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
-const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle, const CFX_AffineMatrix* pMatrix,
+const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
int dest_width, int anti_alias, int& text_flags)
{
if (glyph_index == (FX_DWORD) - 1) {
@@ -1311,7 +1311,7 @@ static void _ContrastAdjust(uint8_t* pDataIn, uint8_t* pDataOut, int nWid, int n
}
}
}
-CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, bool bFontStyle,
+CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle,
const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias)
{
if (m_Face == NULL) {
@@ -1322,7 +1322,7 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde
ft_matrix.xy = (signed long)(pMatrix->GetC() / 64 * 65536);
ft_matrix.yx = (signed long)(pMatrix->GetB() / 64 * 65536);
ft_matrix.yy = (signed long)(pMatrix->GetD() / 64 * 65536);
- bool bUseCJKSubFont = false;
+ FX_BOOL bUseCJKSubFont = FALSE;
const CFX_SubstFont* pSubstFont = pFont->GetSubstFont();
if (pSubstFont) {
bUseCJKSubFont = pSubstFont->m_bSubstOfCJK && bFontStyle;
@@ -1422,18 +1422,18 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde
}
return pGlyphBitmap;
}
-bool _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
+FX_BOOL _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
int glyph_index, FX_ARGB argb)
{
CFX_DIBitmap* pDib = (CFX_DIBitmap*)dib;
FXFT_Face face = pFont->GetFace();
int error = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_NO_BITMAP);
if (error) {
- return false;
+ return FALSE;
}
error = FXFT_Render_Glyph(face, FXFT_RENDER_MODE_NORMAL);
if (error) {
- return false;
+ return FALSE;
}
int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(face));
int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(face));
@@ -1451,13 +1451,13 @@ bool _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
FXSYS_memcpy(dest_scan, src_scan, dest_pitch);
}
pDib->CompositeMask(x + left, y - top, bmwidth, bmheight, &mask, argb, 0, 0);
- return true;
+ return TRUE;
}
-bool OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb)
{
if (!pFont) {
- return false;
+ return FALSE;
}
FXFT_Face face = pFont->GetFace();
FXFT_Select_Charmap(pFont->m_Face, FXFT_ENCODING_UNICODE);
@@ -1490,9 +1490,9 @@ bool OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
}
if (pText_matrix)
ResetTransform(face);
- return true;
+ return TRUE;
}
-bool OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb)
{
FXFT_Matrix ft_matrix;
@@ -1507,7 +1507,7 @@ bool OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
ft_matrix.yy = (signed long)(font_size / 64 * 65536);
}
ScopedFontTransform scoped_transform(pFont->m_Face, &ft_matrix);
- bool ret = _OutputGlyph(dib, x, y, pFont,
+ FX_BOOL ret = _OutputGlyph(dib, x, y, pFont,
glyph_index, argb);
return ret;
}
@@ -1533,7 +1533,7 @@ const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph
return pGlyphPath;
}
typedef struct {
- bool m_bCount;
+ FX_BOOL m_bCount;
int m_PointCount;
FX_PATHPOINT* m_pPoints;
int m_CurX;
@@ -1684,7 +1684,7 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
funcs.shift = 0;
funcs.delta = 0;
OUTLINE_PARAMS params;
- params.m_bCount = true;
+ params.m_bCount = TRUE;
params.m_PointCount = 0;
FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, &params);
if (params.m_PointCount == 0) {
@@ -1692,7 +1692,7 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
}
CFX_PathData* pPath = new CFX_PathData;
pPath->SetPointCount(params.m_PointCount);
- params.m_bCount = false;
+ params.m_bCount = FALSE;
params.m_PointCount = 0;
params.m_pPoints = pPath->GetPoints();
params.m_CurX = params.m_CurY = 0;
diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h
index 2e861baf1b..12fac6a60a 100644
--- a/core/src/fxge/ge/text_int.h
+++ b/core/src/fxge/ge/text_int.h
@@ -32,12 +32,12 @@ public:
m_RefCount = 0;
}
~CTTFontDesc();
- bool ReleaseFace(FXFT_Face face);
+ FX_BOOL ReleaseFace(FXFT_Face face);
int m_Type;
union {
struct {
- bool m_bItalic;
- bool m_bBold;
+ FX_BOOL m_bItalic;
+ FX_BOOL m_bBold;
FXFT_Face m_pFace;
} m_SingleFace;
struct {
@@ -63,9 +63,9 @@ private:
{
return Unicode;
}
- virtual bool IsUnicodeCompatible() const
+ virtual FX_BOOL IsUnicodeCompatible() const
{
- return true;
+ return TRUE;
}
};
#define CHARSET_FLAG_ANSI 1
@@ -97,7 +97,7 @@ public:
FX_DWORD m_FileSize;
FX_DWORD m_FontOffset;
int m_Weight;
- bool m_bItalic;
+ FX_BOOL m_bItalic;
int m_PitchFamily;
CFX_ByteString m_FontTables;
};
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.cpp b/core/src/fxge/skia/fx_skia_blitter_new.cpp
index 13bb753e45..3437eb497d 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.cpp
+++ b/core/src/fxge/skia/fx_skia_blitter_new.cpp
@@ -1298,7 +1298,7 @@
//--------------------------------------------------------------------
- bool CFX_SkiaRenderer::Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, bool bFullCover, bool bRgbByteOrder,
+ FX_BOOL CFX_SkiaRenderer::Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder,
int alpha_flag, void* pIccTransform) //The alpha flag must be fill_flag if exist.
{
m_pDevice = pDevice;
@@ -1331,8 +1331,8 @@
m_bFullCover = bFullCover;
- bool bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
- bool bDeviceCMYK = pDevice->IsCmykImage();
+ FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bDeviceCMYK = pDevice->IsCmykImage();
m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
@@ -1377,7 +1377,7 @@
pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&m_Color, 1);
} else { // Object RGB
if (!pIccTransform)
- return false;
+ return FALSE;
color = FXARGB_TODIB(color);
pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&color, 1);
}
@@ -1385,7 +1385,7 @@
m_Green = ((uint8_t*)&m_Color)[1];
m_Blue = ((uint8_t*)&m_Color)[2];
m_Gray = ((uint8_t*)&m_Color)[3];
- return true;
+ return TRUE;
}
if (pIccTransform) {
color = bObjectCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
@@ -1496,8 +1496,8 @@
break;
}
if (composite_span == NULL)
- return false;
- return true;
+ return FALSE;
+ return TRUE;
}
/*----------------------------------------------------------------------------------------------------*/
@@ -1595,7 +1595,7 @@
blitV(x, y, height, rightAlpha);
}
- bool CFX_SkiaA8Renderer::Init(CFX_DIBitmap* pDevice, int Left, int Top)
+ FX_BOOL CFX_SkiaA8Renderer::Init(CFX_DIBitmap* pDevice, int Left, int Top)
{
m_pDevice = pDevice;
m_Left = Left;
@@ -1604,6 +1604,6 @@
m_dstWidth = m_Left + pDevice->GetWidth();
m_dstHeight = m_Top + pDevice->GetHeight();
}
- return true;
+ return TRUE;
}
#endif
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.h b/core/src/fxge/skia/fx_skia_blitter_new.h
index cd411da9f5..e60c6398d2 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.h
+++ b/core/src/fxge/skia/fx_skia_blitter_new.h
@@ -15,9 +15,9 @@ protected:
m_Blue, // Yellow
m_Gray; // Black
FX_DWORD m_Color; // FX_ARGB or FX_CMYK
- bool m_bFullCover;
+ FX_BOOL m_bFullCover;
int m_ProcessFilter;
- bool m_bRgbByteOrder;
+ FX_BOOL m_bRgbByteOrder;
FX_RECT m_ClipBox;
CFX_DIBitmap* m_pDevice;
@@ -205,7 +205,7 @@ public:
//--------------------------------------------------------------------
- bool Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, bool bFullCover, bool bRgbByteOrder,
+ FX_BOOL Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder,
int alpha_flag = 0, void* pIccTransform = NULL); //The alpha flag must be fill_flag if exist.
};
class CFX_SkiaA8Renderer : public SkBlitter
@@ -218,7 +218,7 @@ public:
virtual void blitRect(int x, int y, int width, int height);
virtual void blitAntiRect(int x, int y, int width, int height, SkAlpha leftAlpha, SkAlpha rightAlpha);
//--------------------------------------------------------------------
- bool Init(CFX_DIBitmap* pDevice, int Left, int Top);
+ FX_BOOL Init(CFX_DIBitmap* pDevice, int Left, int Top);
CFX_DIBitmap* m_pDevice;
int m_Left;
int m_Top;
diff --git a/core/src/fxge/skia/fx_skia_device.cpp b/core/src/fxge/skia/fx_skia_device.cpp
index 72478b1097..41ce077976 100644
--- a/core/src/fxge/skia/fx_skia_device.cpp
+++ b/core/src/fxge/skia/fx_skia_device.cpp
@@ -46,24 +46,24 @@ class SuperBlitter_skia
public:
static void DrawPath(const SkPath& srcPath, SkBlitter* blitter, const SkRasterClip& rect, const SkPaint& origPaint);
};
-bool FxSkDrawTreatAsHairline(const SkPaint& paint, SkScalar* coverage) {
+FX_BOOL FxSkDrawTreatAsHairline(const SkPaint& paint, SkScalar* coverage) {
if (SkPaint::kStroke_Style != paint.getStyle())
- return false;
+ return FALSE;
FXSYS_assert(coverage);
SkScalar strokeWidth = paint.getStrokeWidth();
if (0 == strokeWidth) {
*coverage = SK_Scalar1;
- return true;
+ return TRUE;
}
// if we get here, we need to try to fake a thick-stroke with a modulated
// hairline
if (!paint.isAntiAlias())
- return false;
+ return FALSE;
if (strokeWidth <= SK_Scalar1) {
*coverage = strokeWidth;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void SuperBlitter_skia::DrawPath(const SkPath& srcPath, SkBlitter* blitter, const SkRasterClip& rect, const SkPaint& origPaint)
@@ -167,7 +167,7 @@ void CSkia_PathData::BuildPath(const CFX_PathData* pPathData, const CFX_AffineMa
static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path_data,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState, FX_FIXFLOAT scale = FIX8_ONE,
- bool bStrokeAdjust = false, bool bTextMode = false)
+ FX_BOOL bStrokeAdjust = FALSE, FX_BOOL bTextMode = FALSE)
{
SkPaint::Cap cap;
switch (pGraphState->m_LineCap) {
@@ -203,7 +203,7 @@ static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path
stroker.setJoin(join);
stroker.setMiterLimit(pGraphState->m_MiterLimit);
stroker.setWidth(width);
- stroker.setDoFill(false);
+ stroker.setDoFill(FALSE);
stroker.strokePath(path_data, dstPathData);
SkMatrix smatrix;
smatrix.setAll(pObject2Device->a, pObject2Device->c, pObject2Device->e, pObject2Device->b, pObject2Device->d, pObject2Device->f, 0, 0, 1);
@@ -235,7 +235,7 @@ static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path
}
}
-CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
m_pAggDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
}
@@ -243,7 +243,7 @@ CFX_SkiaDeviceDriver::~CFX_SkiaDeviceDriver()
{
delete m_pAggDriver;
}
-bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FIXFLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform)
{
@@ -259,7 +259,7 @@ void CFX_SkiaDeviceDriver::SaveState()
m_pAggDriver->SaveState();
}
-void CFX_SkiaDeviceDriver::RestoreState(bool bKeepSaved)
+void CFX_SkiaDeviceDriver::RestoreState(FX_BOOL bKeepSaved)
{
m_pAggDriver->RestoreState(bKeepSaved);
}
@@ -294,7 +294,7 @@ void CFX_SkiaDeviceDriver::SetClipMask(SkPath& skPath, SkPaint* spaint)
m_pAggDriver->m_pClipRgn->IntersectMaskF(clip_box.fLeft, clip_box.fTop, mask);
}
-bool CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // path info
+FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
int fill_mode // fill mode, WINDING or ALTERNATE
)
@@ -308,7 +308,7 @@ bool CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // pa
rectf.Intersect(CFX_FloatRect(0, 0, (FX_FIXFLOAT)GetDeviceCaps(FXDC_PIXEL_WIDTH), (FX_FIXFLOAT)GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
FX_RECT rect = rectf.GetOutterRect();
m_pAggDriver->m_pClipRgn->IntersectRect(rect);
- return true;
+ return TRUE;
}
}
CSkia_PathData path_data;
@@ -318,15 +318,15 @@ bool CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // pa
SkPaint spaint;
spaint.setColor(0xffffffff);
- spaint.setAntiAlias(true);
+ spaint.setAntiAlias(TRUE);
spaint.setStyle(SkPaint::kFill_Style);
SetClipMask(path_data.m_PathData, &spaint);
- return true;
+ return TRUE;
}
-bool CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, // path info
+FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState // graphic state, for pen attributes
)
@@ -342,36 +342,36 @@ bool CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, //
SkPaint spaint;
spaint.setColor(0xffffffff);
spaint.setStyle(SkPaint::kStroke_Style);
- spaint.setAntiAlias(true);
+ spaint.setAntiAlias(TRUE);
SkPath dst_path;
- SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, pObject2Device, pGraphState, 1, false, 0);
+ SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, pObject2Device, pGraphState, 1, FALSE, 0);
spaint.setStyle(SkPaint::kFill_Style);
SetClipMask(dst_path, &spaint);
- return true;
+ return TRUE;
}
-bool CFX_SkiaDeviceDriver::RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+FX_BOOL CFX_SkiaDeviceDriver::RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->RenderRasterizer(rasterizer, color, bFullCover, bGroupKnockout,alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
- int alpha_flag, void* pIccTransform, bool bFill)
+FX_BOOL CFX_SkiaDeviceDriver::RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
+ int alpha_flag, void* pIccTransform, FX_BOOL bFill)
{
CFX_DIBitmap* pt = bGroupKnockout?m_pAggDriver->GetBackDrop():NULL;
CFX_SkiaRenderer render;
if (!render.Init(m_pAggDriver->m_pBitmap, pt, m_pAggDriver->m_pClipRgn, color, bFullCover, m_pAggDriver->m_bRgbByteOrder, alpha_flag, pIccTransform))
- return false;
+ return FALSE;
SkRasterClip rasterClip(rect);
SuperBlitter_skia::DrawPath(skPath, (SkBlitter*)&render, rasterClip, origPaint);
- return true;
+ return TRUE;
}
-bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
+FX_BOOL CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState, // graphic state, for pen attributes
FX_DWORD fill_color, // fill color
@@ -381,7 +381,7 @@ bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
void* pIccTransform
)
{
- if (GetBuffer() == NULL) return true;
+ if (GetBuffer() == NULL) return TRUE;
FOXIT_DEBUG1("CFX_SkiaDeviceDriver::DrawPath: entering");
SkIRect rect;
rect.set(0, 0, GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
@@ -396,11 +396,11 @@ bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
path_data.m_PathData.setFillType((fill_mode&3) == FXFILL_WINDING? SkPath::kWinding_FillType:SkPath::kEvenOdd_FillType);
SkPaint spaint;
- spaint.setAntiAlias(true);
+ spaint.setAntiAlias(TRUE);
spaint.setStyle(SkPaint::kFill_Style);
spaint.setColor(fill_color);
- if (!RenderRasterizerSkia(path_data.m_PathData, spaint, rect, fill_color, fill_mode & FXFILL_FULLCOVER, false, alpha_flag, pIccTransform))
- return false;
+ if (!RenderRasterizerSkia(path_data.m_PathData, spaint, rect, fill_color, fill_mode & FXFILL_FULLCOVER, FALSE, alpha_flag, pIccTransform))
+ return FALSE;
}
int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
@@ -427,48 +427,48 @@ bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
SkPaint spaint;
spaint.setColor(stroke_color);
spaint.setStyle(SkPaint::kStroke_Style);
- spaint.setAntiAlias(true);
+ spaint.setAntiAlias(TRUE);
SkPath dst_path;
- SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, false, 0);
+ SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, FALSE, 0);
spaint.setStyle(SkPaint::kFill_Style);
int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag)<<8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
- if (!RenderRasterizerSkia(dst_path, spaint, rect, stroke_color, fill_mode & FXFILL_FULLCOVER, false, fill_flag, pIccTransform, false))
- return false;
+ if (!RenderRasterizerSkia(dst_path, spaint, rect, stroke_color, fill_mode & FXFILL_FULLCOVER, FALSE, fill_flag, pIccTransform, FALSE))
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFX_SkiaDeviceDriver::SetPixel(int x, int y, FX_DWORD color,
+FX_BOOL CFX_SkiaDeviceDriver::SetPixel(int x, int y, FX_DWORD color,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->SetPixel(x, y, color, alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform)
+FX_BOOL CFX_SkiaDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect)
+FX_BOOL CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect)
{
return m_pAggDriver->GetClipBox(pRect);
}
-bool CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge)
+FX_BOOL CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
{
return m_pAggDriver->GetDIBits(pBitmap, left, top, pIccTransform, bDEdge);
}
-bool CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->SetDIBits(pBitmap, argb, pSrcRect, left, top, blend_type, alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
+FX_BOOL CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
@@ -477,7 +477,7 @@ bool CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD
alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
+FX_BOOL CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform)
{
@@ -485,7 +485,7 @@ bool CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_
pMatrix, render_flags, handle, alpha_flag, pIccTransform);
}
-bool CFX_SkiaDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
+FX_BOOL CFX_SkiaDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
{
return m_pAggDriver->ContinueDIBits(pHandle, pPause);
}
@@ -497,31 +497,31 @@ void CFX_SkiaDeviceDriver::CancelDIBits(void* pHandle)
CFX_SkiaDevice::CFX_SkiaDevice()
{
- m_bOwnedBitmap = false;
+ m_bOwnedBitmap = FALSE;
}
-bool CFX_SkiaDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
+FX_BOOL CFX_SkiaDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
{
if (pBitmap == NULL)
- return false;
+ return FALSE;
SetBitmap(pBitmap);
CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
-bool CFX_SkiaDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
+FX_BOOL CFX_SkiaDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
{
- m_bOwnedBitmap = true;
+ m_bOwnedBitmap = TRUE;
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
if (!pBitmap->Create(width, height, format)) {
delete pBitmap;
- return false;
+ return FALSE;
}
SetBitmap(pBitmap);
- CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, false, pOriDevice, false);
+ CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
SetDeviceDriver(pDriver);
- return true;
+ return TRUE;
}
CFX_SkiaDevice::~CFX_SkiaDevice()
{
diff --git a/core/src/fxge/skia/fx_skia_device.h b/core/src/fxge/skia/fx_skia_device.h
index 7278671dc7..ab51e51a33 100644
--- a/core/src/fxge/skia/fx_skia_device.h
+++ b/core/src/fxge/skia/fx_skia_device.h
@@ -9,7 +9,7 @@
class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver
{
public:
- CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout);
+ CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout);
virtual ~CFX_SkiaDeviceDriver();
/** Options */
@@ -17,22 +17,22 @@ public:
/** Save and restore all graphic states */
virtual void SaveState();
- virtual void RestoreState(bool bKeepSaved);
+ virtual void RestoreState(FX_BOOL bKeepSaved);
/** Set clipping path using filled region */
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData, // path info
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
int fill_mode // fill mode, WINDING or ALTERNATE
);
/** Set clipping path using stroked region */
- virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, // path info
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState // graphic state, for pen attributes
);
/** Draw a path */
- virtual bool DrawPath(const CFX_PathData* pPathData,
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -42,44 +42,44 @@ public:
void* pIccTransform = NULL
);
- virtual bool SetPixel(int x, int y, FX_DWORD color,
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
+ virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
int alpha_flag = 0, void* pIccTransform = NULL);
/** Draw a single pixel (device dependant) line */
- virtual bool DrawCosmeticLine(FX_FIXFLOAT x1, FX_FIXFLOAT y1, FX_FIXFLOAT x2, FX_FIXFLOAT y2, FX_DWORD color,
- int alpha_flag, void* pIccTransform, int blend_type) { return false; }
+ virtual FX_BOOL DrawCosmeticLine(FX_FIXFLOAT x1, FX_FIXFLOAT y1, FX_FIXFLOAT x2, FX_FIXFLOAT y2, FX_DWORD color,
+ int alpha_flag, void* pIccTransform, int blend_type) { return FALSE; }
- virtual bool GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
/** Load device buffer into a DIB */
- virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false);
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
virtual CFX_DIBitmap* GetBackDrop() { return m_pAggDriver->GetBackDrop(); }
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
int dest_left, int dest_top, int blend_type,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause);
+ virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
virtual void CancelDIBits(void* handle);
- virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FIXFLOAT font_size, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual bool RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+ virtual FX_BOOL RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
int alpha_flag, void* pIccTransform);
- virtual bool RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
- int alpha_flag, void* pIccTransform, bool bFill = true);
+ virtual FX_BOOL RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
+ int alpha_flag, void* pIccTransform, FX_BOOL bFill = TRUE);
void SetClipMask(rasterizer_scanline_aa& rasterizer);
void SetClipMask(SkPath& skPath, SkPaint* spaint);
virtual uint8_t* GetBuffer() const {return m_pAggDriver->GetBuffer();}
diff --git a/core/src/fxge/win32/dwrite_int.h b/core/src/fxge/win32/dwrite_int.h
index 4896161547..dc2a338935 100644
--- a/core/src/fxge/win32/dwrite_int.h
+++ b/core/src/fxge/win32/dwrite_int.h
@@ -35,15 +35,15 @@ public:
void Load();
void Unload();
- bool IsAvailable()
+ FX_BOOL IsAvailable()
{
return m_pDWriteFactory != NULL;
}
void* DwCreateFontFaceFromStream(uint8_t* pData, FX_DWORD size, int simulation_style);
- bool DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget);
+ FX_BOOL DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget);
void DwDeleteRenderingTarget(void* renderTarget);
- bool DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
+ FX_BOOL DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
void *font, FX_FLOAT font_size, FX_ARGB text_color,
int glyph_count, unsigned short* glyph_indices,
FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY,
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index e6667b17ec..18bcc595a4 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -24,18 +24,18 @@ public:
CWin32FontInfo();
~CWin32FontInfo();
virtual void Release();
- virtual bool EnumFontList(CFX_FontMapper* pMapper);
- virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* face, bool& bExact);
+ virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact);
virtual void* GetFont(const FX_CHAR* face)
{
return NULL;
}
virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size);
virtual void DeleteFont(void* hFont);
- virtual bool GetFaceName(void* hFont, CFX_ByteString& name);
- virtual bool GetFontCharset(void* hFont, int& charset);
- bool IsOpenTypeFromDiv(const LOGFONTA *plf);
- bool IsSupportFontFormDiv(const LOGFONTA* plf);
+ virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
+ virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
+ FX_BOOL IsOpenTypeFromDiv(const LOGFONTA *plf);
+ FX_BOOL IsSupportFontFormDiv(const LOGFONTA* plf);
void AddInstalledFont(const LOGFONTA *plf, FX_DWORD FontType);
void GetGBPreference(CFX_ByteString& face, int weight, int picth_family);
void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_family);
@@ -59,10 +59,10 @@ void CWin32FontInfo::Release()
delete this;
}
#define TT_MAKE_TAG(x1, x2, x3, x4) (((FX_DWORD)x1<<24)|((FX_DWORD)x2<<16)|((FX_DWORD)x3<<8)|(FX_DWORD)x4)
-bool CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf)
+FX_BOOL CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf)
{
HFONT hFont = CreateFontIndirectA(plf);
- bool ret = false;
+ FX_BOOL ret = FALSE;
FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
FX_DWORD lVersion = 0;
@@ -74,16 +74,16 @@ bool CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf)
lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
lVersion == TT_MAKE_TAG('t', 'r', 'u', 'e') ||
lVersion == 0x00020000) {
- ret = true;
+ ret = TRUE;
}
}
DeleteFont(hFont);
return ret;
}
-bool CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf)
+FX_BOOL CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf)
{
HFONT hFont = CreateFontIndirectA(plf);
- bool ret = false;
+ FX_BOOL ret = FALSE;
FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
FX_DWORD lVersion = 0;
@@ -95,10 +95,10 @@ bool CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf)
lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
lVersion == TT_MAKE_TAG('t', 'r', 'u', 'e') ||
lVersion == 0x00020000) {
- ret = true;
+ ret = TRUE;
} else if ((lVersion & 0xFFFF0000) == TT_MAKE_TAG(0x80, 0x01, 0x00, 0x00) ||
(lVersion & 0xFFFF0000) == TT_MAKE_TAG('%', '!', 0, 0)) {
- ret = true;
+ ret = TRUE;
}
}
DeleteFont(hFont);
@@ -139,7 +139,7 @@ static int CALLBACK FontEnumProc(
pFontInfo->AddInstalledFont(plf, FontType);
return 1;
}
-bool CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper)
+FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper)
{
m_pMapper = pMapper;
LOGFONTA lf;
@@ -151,7 +151,7 @@ bool CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper)
if (pMapper->GetFontEnumerator()) {
pMapper->GetFontEnumerator()->Finish();
}
- return true;
+ return TRUE;
}
static const struct {
const FX_CHAR* m_pFaceName;
@@ -163,22 +163,22 @@ VariantNames[] = {
static const struct {
const FX_CHAR* m_pName;
const FX_CHAR* m_pWinName;
- bool m_bBold;
- bool m_bItalic;
+ FX_BOOL m_bBold;
+ FX_BOOL m_bItalic;
}
Base14Substs[] = {
- {"Courier", "Courier New", false, false},
- {"Courier-Bold", "Courier New", true, false},
- {"Courier-BoldOblique", "Courier New", true, true},
- {"Courier-Oblique", "Courier New", false, true},
- {"Helvetica", "Arial", false, false},
- {"Helvetica-Bold", "Arial", true, false},
- {"Helvetica-BoldOblique", "Arial", true, true},
- {"Helvetica-Oblique", "Arial", false, true},
- {"Times-Roman", "Times New Roman", false, false},
- {"Times-Bold", "Times New Roman", true, false},
- {"Times-BoldItalic", "Times New Roman", true, true},
- {"Times-Italic", "Times New Roman", false, true},
+ {"Courier", "Courier New", FALSE, FALSE},
+ {"Courier-Bold", "Courier New", TRUE, FALSE},
+ {"Courier-BoldOblique", "Courier New", TRUE, TRUE},
+ {"Courier-Oblique", "Courier New", FALSE, TRUE},
+ {"Helvetica", "Arial", FALSE, FALSE},
+ {"Helvetica-Bold", "Arial", TRUE, FALSE},
+ {"Helvetica-BoldOblique", "Arial", TRUE, TRUE},
+ {"Helvetica-Oblique", "Arial", FALSE, TRUE},
+ {"Times-Roman", "Times New Roman", FALSE, FALSE},
+ {"Times-Bold", "Times New Roman", TRUE, FALSE},
+ {"Times-BoldItalic", "Times New Roman", TRUE, TRUE},
+ {"Times-Italic", "Times New Roman", FALSE, TRUE},
};
CFX_ByteString CWin32FontInfo::FindFont(const CFX_ByteString& name)
{
@@ -212,17 +212,17 @@ extern "C" {
return FXSYS_stricmp((const FX_CHAR*)key, ((_FontNameMap*)element)->m_pSrcFontName);
}
}
-bool _GetSubFontName(CFX_ByteString& name)
+FX_BOOL _GetSubFontName(CFX_ByteString& name)
{
int size = sizeof g_JpFontNameMap;
void* pFontnameMap = (void*)g_JpFontNameMap;
_FontNameMap* found = (_FontNameMap*)FXSYS_bsearch(name.c_str(), pFontnameMap,
size / sizeof (_FontNameMap), sizeof (_FontNameMap), compareString);
if (found == NULL) {
- return false;
+ return FALSE;
}
name = found->m_pSubFontName;
- return true;
+ return TRUE;
}
void CWin32FontInfo::GetGBPreference(CFX_ByteString& face, int weight, int picth_family)
{
@@ -285,7 +285,7 @@ void CWin32FontInfo::GetJapanesePreference(CFX_ByteString& face, int weight, int
face = "MS PMincho";
}
}
-void* CWin32FontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, bool& bExact)
+void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact)
{
CFX_ByteString face = cstr_face;
int iBaseFont;
@@ -294,7 +294,7 @@ void* CWin32FontInfo::MapFont(int weight, bool bItalic, int charset, int pitch_f
face = Base14Substs[iBaseFont].m_pWinName;
weight = Base14Substs[iBaseFont].m_bBold ? FW_BOLD : FW_NORMAL;
bItalic = Base14Substs[iBaseFont].m_bItalic;
- bExact = true;
+ bExact = TRUE;
break;
}
if (charset == ANSI_CHARSET || charset == SYMBOL_CHARSET) {
@@ -373,26 +373,26 @@ FX_DWORD CWin32FontInfo::GetFontData(void* hFont, FX_DWORD table, uint8_t* buffe
}
return size;
}
-bool CWin32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
+FX_BOOL CWin32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
{
char facebuf[100];
HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
int ret = ::GetTextFaceA(m_hDC, 100, facebuf);
::SelectObject(m_hDC, hOldFont);
if (ret == 0) {
- return false;
+ return FALSE;
}
name = facebuf;
- return true;
+ return TRUE;
}
-bool CWin32FontInfo::GetFontCharset(void* hFont, int& charset)
+FX_BOOL CWin32FontInfo::GetFontCharset(void* hFont, int& charset)
{
TEXTMETRIC tm;
HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
::GetTextMetrics(m_hDC, &tm);
::SelectObject(m_hDC, hOldFont);
charset = tm.tmCharSet;
- return true;
+ return TRUE;
}
IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
{
@@ -466,16 +466,16 @@ void* CGdiDeviceDriver::GetClipRgn()
}
return (void*)hClipRgn;
}
-bool CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform)
+FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform)
{
if (m_DeviceClass == FXDC_PRINTER) {
- CFX_DIBitmap* pBitmap = pBitmap1->FlipImage(false, true);
+ CFX_DIBitmap* pBitmap = pBitmap1->FlipImage(FALSE, TRUE);
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
if ((pBitmap->IsCmykImage() || pIccTransform) &&
!pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) {
- return false;
+ return FALSE;
}
int width = pSrcRect->Width(), height = pSrcRect->Height();
int pitch = pBitmap->GetPitch();
@@ -493,7 +493,7 @@ bool CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT
CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
if ((pBitmap->IsCmykImage() || pIccTransform) &&
(pBitmap = pBitmap->CloneConvert(FXDIB_Rgb, NULL, pIccTransform)) == NULL) {
- return false;
+ return FALSE;
}
int width = pSrcRect->Width(), height = pSrcRect->Height();
int pitch = pBitmap->GetPitch();
@@ -505,18 +505,18 @@ bool CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT
delete pBitmap;
}
}
- return true;
+ return TRUE;
}
-bool CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top,
+FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD flags, void* pIccTransform)
{
CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
if (pBitmap == NULL || dest_width == 0 || dest_height == 0) {
- return false;
+ return FALSE;
}
if ((pBitmap->IsCmykImage() || pIccTransform) &&
!pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) {
- return false;
+ return FALSE;
}
CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
if ((int64_t)abs(dest_width) * abs(dest_height) < (int64_t)pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 ||
@@ -538,15 +538,15 @@ bool CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_
if (del) {
delete pToStrechBitmap;
}
- return true;
+ return TRUE;
}
-bool CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top,
+FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD bitmap_color, FX_DWORD flags,
int alpha_flag, void* pIccTransform)
{
CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
if (pBitmap == NULL || dest_width == 0 || dest_height == 0) {
- return false;
+ return FALSE;
}
_Color2Argb(bitmap_color, bitmap_color, alpha_flag | (1 << 24), pIccTransform);
int width = pBitmap->GetWidth(), height = pBitmap->GetHeight();
@@ -592,16 +592,16 @@ bool CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest
SelectObject(m_hDC, hOld);
DeleteObject(hPattern);
- return true;
+ return TRUE;
}
BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect)
{
return ::GetClipBox(m_hDC, (RECT*)pRect);
}
-bool CGdiDeviceDriver::SetClipRgn(void* hRgn)
+FX_BOOL CGdiDeviceDriver::SetClipRgn(void* hRgn)
{
::SelectClipRgn(m_hDC, (HRGN)hRgn);
- return true;
+ return TRUE;
}
static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, FX_DWORD argb)
{
@@ -749,11 +749,11 @@ void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT
MoveToEx(m_hDC, FXSYS_round(x1), FXSYS_round(y1), NULL);
LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2));
}
-static bool _MatrixNoScaled(const CFX_AffineMatrix* pMatrix)
+static FX_BOOL _MatrixNoScaled(const CFX_AffineMatrix* pMatrix)
{
return pMatrix->GetA() == 1.0f && pMatrix->GetB() == 0 && pMatrix->GetC() == 0 && pMatrix->GetD() == 1.0f;
}
-bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
+FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pMatrix,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -765,7 +765,7 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
_Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
_Color2Argb(stroke_color, stroke_color, alpha_flag, pIccTransform);
@@ -786,9 +786,9 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
}
int fill_alpha = FXARGB_A(fill_color);
int stroke_alpha = FXARGB_A(stroke_color);
- bool bDrawAlpha = (fill_alpha > 0 && fill_alpha < 255) || (stroke_alpha > 0 && stroke_alpha < 255 && pGraphState);
+ FX_BOOL bDrawAlpha = (fill_alpha > 0 && fill_alpha < 255) || (stroke_alpha > 0 && stroke_alpha < 255 && pGraphState);
if (!pPlatform->m_GdiplusExt.IsAvailable() && bDrawAlpha) {
- return false;
+ return FALSE;
}
if (pPlatform->m_GdiplusExt.IsAvailable()) {
if (bDrawAlpha || ((m_DeviceClass != FXDC_PRINTER && !(fill_mode & FXFILL_FULLCOVER)) || (pGraphState && pGraphState->m_DashCount))) {
@@ -797,7 +797,7 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
(pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) &&
pPathData->IsRect()) ) {
if (pPlatform->m_GdiplusExt.DrawPath(m_hDC, pPathData, pMatrix, pGraphState, fill_color, stroke_color, fill_mode)) {
- return true;
+ return TRUE;
}
}
}
@@ -852,29 +852,29 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
hBrush = (HBRUSH)SelectObject(m_hDC, hBrush);
DeleteObject(hBrush);
}
- return true;
+ return TRUE;
}
-bool CGdiDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
+FX_BOOL CGdiDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
_Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
int alpha;
FX_COLORREF rgb;
ArgbDecode(fill_color, alpha, rgb);
if (alpha == 0) {
- return true;
+ return TRUE;
}
if (alpha < 255) {
- return false;
+ return FALSE;
}
HBRUSH hBrush = CreateSolidBrush(rgb);
::FillRect(m_hDC, (RECT*)pRect, hBrush);
DeleteObject(hBrush);
- return true;
+ return TRUE;
}
-bool CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
+FX_BOOL CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pMatrix,
int fill_mode
)
@@ -884,15 +884,15 @@ bool CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
if (pPathData->IsRect(pMatrix, &rectf)) {
FX_RECT rect = rectf.GetOutterRect();
IntersectClipRect(m_hDC, rect.left, rect.top, rect.right, rect.bottom);
- return true;
+ return TRUE;
}
}
_SetPathToDC(m_hDC, pPathData, pMatrix);
SetPolyFillMode(m_hDC, fill_mode & 3);
SelectClipPath(m_hDC, RGN_AND);
- return true;
+ return TRUE;
}
-bool CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
+FX_BOOL CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pMatrix,
const CFX_GraphStateData* pGraphState
)
@@ -902,23 +902,23 @@ bool CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
_SetPathToDC(m_hDC, pPathData, pMatrix);
WidenPath(m_hDC);
SetPolyFillMode(m_hDC, WINDING);
- bool ret = SelectClipPath(m_hDC, RGN_AND);
+ FX_BOOL ret = SelectClipPath(m_hDC, RGN_AND);
hPen = (HPEN)SelectObject(m_hDC, hPen);
DeleteObject(hPen);
return ret;
}
-bool CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
_Color2Argb(color, color, alpha_flag | (1 << 24), pIccTransform);
int a;
FX_COLORREF rgb;
ArgbDecode(color, a, rgb);
if (a == 0) {
- return true;
+ return TRUE;
}
HPEN hPen = CreatePen(PS_SOLID, 1, rgb);
hPen = (HPEN)SelectObject(m_hDC, hPen);
@@ -926,12 +926,12 @@ bool CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, F
LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2));
hPen = (HPEN)SelectObject(m_hDC, hPen);
DeleteObject(hPen);
- return true;
+ return TRUE;
}
-bool CGdiDeviceDriver::DeleteDeviceRgn(void* pRgn)
+FX_BOOL CGdiDeviceDriver::DeleteDeviceRgn(void* pRgn)
{
DeleteObject((HGDIOBJ)pRgn);
- return true;
+ return TRUE;
}
CGdiDisplayDriver::CGdiDisplayDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_DISPLAY)
{
@@ -940,9 +940,9 @@ CGdiDisplayDriver::CGdiDisplayDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_DISPL
m_RenderCaps |= FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE;
}
}
-bool CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge)
+FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
{
- bool ret = false;
+ FX_BOOL ret = FALSE;
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
HBITMAP hbmp = CreateCompatibleBitmap(m_hDC, width, height);
@@ -969,7 +969,7 @@ bool CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void
::GetDIBits(hDCMemory, hbmp, 0, height, bitmap.GetBuffer(), &bmi, DIB_RGB_COLORS);
ret = pBitmap->TransferBitmap(0, 0, width, height, &bitmap, 0, 0, pIccTransform);
} else {
- ret = false;
+ ret = FALSE;
}
}
if (pBitmap->HasAlpha() && ret) {
@@ -979,22 +979,22 @@ bool CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void
DeleteObject(hDCMemory);
return ret;
}
-bool CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform)
{
ASSERT(blend_type == FXDIB_BLEND_NORMAL);
if (pSource->IsAlphaMask()) {
int width = pSource->GetWidth(), height = pSource->GetHeight();
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
- bool bGDI = pSource->GetBPP() == 1 && alpha == 255;
+ FX_BOOL bGDI = pSource->GetBPP() == 1 && alpha == 255;
if (!bGDI) {
CFX_DIBitmap background;
if (!background.Create(width, height, FXDIB_Rgb32) ||
!GetDIBits(&background, left, top, NULL) ||
!background.CompositeMask(0, 0, width, height, pSource, color,
- 0, 0, FXDIB_BLEND_NORMAL, NULL, false,
+ 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE,
alpha_flag, pIccTransform)) {
- return false;
+ return FALSE;
}
FX_RECT src_rect(0, 0, width, height);
return SetDIBits(&background, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL, 0, NULL);
@@ -1008,8 +1008,8 @@ bool CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
CFX_DIBitmap bitmap;
if (!bitmap.Create(width, height, FXDIB_Rgb) ||
!GetDIBits(&bitmap, left, top, NULL) ||
- !bitmap.CompositeBitmap(0, 0, width, height, pSource, pSrcRect->left, pSrcRect->top, FXDIB_BLEND_NORMAL, NULL, false, pIccTransform)) {
- return false;
+ !bitmap.CompositeBitmap(0, 0, width, height, pSource, pSrcRect->left, pSrcRect->top, FXDIB_BLEND_NORMAL, NULL, FALSE, pIccTransform)) {
+ return FALSE;
}
FX_RECT src_rect(0, 0, width, height);
return SetDIBits(&bitmap, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL, 0, NULL);
@@ -1019,9 +1019,9 @@ bool CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
if (pBitmap) {
return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform);
}
- return false;
+ return FALSE;
}
-bool CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, int render_flags,
int alpha_flag, void* pIccTransform, int blend_type)
{
@@ -1035,14 +1035,14 @@ bool CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_D
bitmap_clip.Offset(-dest_left, -dest_top);
CFX_DIBitmap* pStretched = pSource->StretchTo(dest_width, dest_height, render_flags, &bitmap_clip);
if (pStretched == NULL) {
- return true;
+ return TRUE;
}
FX_RECT src_rect(0, 0, pStretched->GetWidth(), pStretched->GetHeight());
- bool ret = SetDIBits(pStretched, color, &src_rect, pClipRect->left, pClipRect->top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
+ FX_BOOL ret = SetDIBits(pStretched, color, &src_rect, pClipRect->left, pClipRect->top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
delete pStretched;
return ret;
}
-bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type)
{
@@ -1063,17 +1063,17 @@ bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col
int clip_width = clip_rect.Width(), clip_height = clip_rect.Height();
CFX_DIBitmap* pStretched = pSource->StretchTo(dest_width, dest_height, flags, &clip_rect);
if (pStretched == NULL) {
- return true;
+ return TRUE;
}
CFX_DIBitmap background;
if (!background.Create(clip_width, clip_height, FXDIB_Rgb32) ||
!GetDIBits(&background, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, NULL) ||
- !background.CompositeMask(0, 0, clip_width, clip_height, pStretched, color, 0, 0, FXDIB_BLEND_NORMAL, NULL, false, alpha_flag, pIccTransform)) {
+ !background.CompositeMask(0, 0, clip_width, clip_height, pStretched, color, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
delete pStretched;
- return false;
+ return FALSE;
}
FX_RECT src_rect(0, 0, clip_width, clip_height);
- bool ret = SetDIBits(&background, 0, &src_rect, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, FXDIB_BLEND_NORMAL, 0, NULL);
+ FX_BOOL ret = SetDIBits(&background, 0, &src_rect, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, FXDIB_BLEND_NORMAL, 0, NULL);
delete pStretched;
return ret;
}
@@ -1083,7 +1083,7 @@ bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col
CFX_DIBExtractor temp(pSource);
CFX_DIBitmap* pBitmap = temp;
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
return pPlatform->m_GdiplusExt.StretchDIBits(m_hDC, pBitmap, dest_left, dest_top, dest_width, dest_height, pClipRect, flags);
}
@@ -1095,7 +1095,7 @@ bool CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col
if (pBitmap) {
return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform);
}
- return false;
+ return FALSE;
}
#define GET_PS_FEATURESETTING 4121
#define FEATURESETTING_PSLEVEL 2
@@ -1134,7 +1134,7 @@ int GetPSLevel(HDC hDC)
return 2;
}
int CFX_WindowsDevice::m_psLevel = 2;
-CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, bool bCmykOutput, bool bForcePSOutput, int psLevel)
+CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput, FX_BOOL bForcePSOutput, int psLevel)
{
m_bForcePSOutput = bForcePSOutput;
m_psLevel = psLevel;
@@ -1154,7 +1154,7 @@ HDC CFX_WindowsDevice::GetDC() const
}
return (HDC)pRDD->GetPlatformSurface();
}
-IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, bool bCmykOutput)
+IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, FX_BOOL bCmykOutput)
{
int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY);
int obj_type = ::GetObjectType(hDC);
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp
index 610c69e4b1..3dcfce4802 100644
--- a/core/src/fxge/win32/fx_win32_dib.cpp
+++ b/core/src/fxge/win32/fx_win32_dib.cpp
@@ -49,19 +49,19 @@ CFX_ByteString CFX_WindowsDIB::GetBitmapInfo(const CFX_DIBitmap* pBitmap)
result.ReleaseBuffer(len);
return result;
}
-CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, bool bAlpha)
+CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL bAlpha)
{
int width = pbmi->bmiHeader.biWidth;
int height = pbmi->bmiHeader.biHeight;
- BOOL bBottomUp = true;
+ BOOL bBottomUp = TRUE;
if (height < 0) {
height = -height;
- bBottomUp = false;
+ bBottomUp = FALSE;
}
int pitch = (width * pbmi->bmiHeader.biBitCount + 31) / 32 * 4;
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
FXDIB_Format format = bAlpha ? (FXDIB_Format)(pbmi->bmiHeader.biBitCount + 0x200) : (FXDIB_Format)pbmi->bmiHeader.biBitCount;
- bool ret = pBitmap->Create(width, height, format);
+ FX_BOOL ret = pBitmap->Create(width, height, format);
if (!ret) {
delete pBitmap;
return NULL;
@@ -93,7 +93,7 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, bool bA
}
CFX_DIBitmap* CFX_WindowsDIB::LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData)
{
- return _FX_WindowsDIB_LoadFromBuf(pbmi, pData, false);
+ return _FX_WindowsDIB_LoadFromBuf(pbmi, pData, FALSE);
}
HBITMAP CFX_WindowsDIB::GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC)
{
@@ -174,7 +174,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args)
}
CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pPalette, FX_DWORD palsize)
{
- bool bCreatedDC = hDC == NULL;
+ FX_BOOL bCreatedDC = hDC == NULL;
if (hDC == NULL) {
hDC = CreateCompatibleDC(NULL);
}
diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp
index 8533343926..65a35d86a1 100644
--- a/core/src/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/src/fxge/win32/fx_win32_dwrite.cpp
@@ -133,7 +133,7 @@ LPVOID CDWriteExt::DwCreateFontFaceFromStream(uint8_t* pData, FX_DWORD size, int
IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory;
IDWriteFontFile* pDwFontFile = NULL;
IDWriteFontFace* pDwFontFace = NULL;
- BOOL isSupportedFontType = false;
+ BOOL isSupportedFontType = FALSE;
DWRITE_FONT_FILE_TYPE fontFileType;
DWRITE_FONT_FACE_TYPE fontFaceType;
UINT32 numberOfFaces;
@@ -174,10 +174,10 @@ failed:
SafeRelease(&pDwFontFile);
return NULL;
}
-bool CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTarget)
+FX_BOOL CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTarget)
{
if (pBitmap->GetFormat() > FXDIB_Argb) {
- return false;
+ return FALSE;
}
IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory;
IDWriteGdiInterop* pGdiInterop = NULL;
@@ -212,14 +212,14 @@ bool CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTar
SafeRelease(&pGdiInterop);
SafeRelease(&pBitmapRenderTarget);
SafeRelease(&pRenderingParams);
- return true;
+ return TRUE;
failed:
SafeRelease(&pGdiInterop);
SafeRelease(&pBitmapRenderTarget);
SafeRelease(&pRenderingParams);
- return false;
+ return FALSE;
}
-bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
+FX_BOOL CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
void *font, FX_FLOAT font_size, FX_ARGB text_color,
int glyph_count, unsigned short* glyph_indices,
FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY,
@@ -227,7 +227,7 @@ bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_R
FX_FLOAT* glyph_advances)
{
if (renderTarget == NULL) {
- return true;
+ return TRUE;
}
CDwGdiTextRenderer* pTextRenderer = (CDwGdiTextRenderer*)renderTarget;
DWRITE_MATRIX transform;
@@ -247,7 +247,7 @@ bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_R
glyphRun.glyphIndices = glyph_indices;
glyphRun.glyphAdvances = glyph_advances;
glyphRun.glyphOffsets = (DWRITE_GLYPH_OFFSET*)glyph_offsets;
- glyphRun.isSideways = false;
+ glyphRun.isSideways = FALSE;
glyphRun.bidiLevel = 0;
hr = pTextRenderer->DrawGlyphRun(
stringRect,
@@ -258,7 +258,7 @@ bool CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_R
&glyphRun,
RGB(FXARGB_R(text_color), FXARGB_G(text_color), FXARGB_B(text_color))
);
- return SUCCEEDED(hr) ? true : false;
+ return SUCCEEDED(hr) ? TRUE : FALSE;
}
void CDWriteExt::DwDeleteRenderingTarget(void* renderTarget)
{
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index 94fac69157..d76d52e50b 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -274,12 +274,12 @@ void* CGdiplusExt::GdiAddFontMemResourceEx(void *pFontdata, FX_DWORD size, void*
}
return NULL;
}
-bool CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle)
+FX_BOOL CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle)
{
if (m_pGdiRemoveFontMemResourseEx) {
return ((FuncType_GdiRemoveFontMemResourceEx)m_pGdiRemoveFontMemResourseEx)((HANDLE)handle);
}
- return false;
+ return FALSE;
}
static GpBrush* _GdipCreateBrush(DWORD argb)
{
@@ -291,11 +291,11 @@ static GpBrush* _GdipCreateBrush(DWORD argb)
static CFX_DIBitmap* _StretchMonoToGray(int dest_width, int dest_height,
const CFX_DIBitmap* pSource, FX_RECT* pClipRect)
{
- bool bFlipX = dest_width < 0;
+ FX_BOOL bFlipX = dest_width < 0;
if (bFlipX) {
dest_width = -dest_width;
}
- bool bFlipY = dest_height < 0;
+ FX_BOOL bFlipY = dest_height < 0;
if (bFlipY) {
dest_height = -dest_height;
}
@@ -382,7 +382,7 @@ static void OutputImageMask(GpGraphics* pGraphics, BOOL bMonoDevice, const CFX_D
if (src_width * src_height > 10000) {
pStretched = _StretchMonoToGray(dest_width, dest_height, pBitmap, &image_clip);
} else {
- pStretched = pBitmap->StretchTo(dest_width, dest_height, false, &image_clip);
+ pStretched = pBitmap->StretchTo(dest_width, dest_height, FALSE, &image_clip);
}
GpBitmap* bitmap;
CallFunc(GdipCreateBitmapFromScan0)(image_clip.Width(), image_clip.Height(),
@@ -536,7 +536,7 @@ void CGdiplusExt::DeleteMemFont(LPVOID pCollection)
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
CallFunc(GdipDeletePrivateFontCollection)((GpFontCollection**)&pCollection);
}
-bool CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap)
+FX_BOOL CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap)
{
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
PixelFormat format;
@@ -551,41 +551,41 @@ bool CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap)
format = PixelFormat32bppARGB;
break;
default:
- return false;
+ return FALSE;
}
GpStatus status = CallFunc(GdipCreateBitmapFromScan0)(pBitmap->GetWidth(), pBitmap->GetHeight(),
pBitmap->GetPitch(), format, pBitmap->GetBuffer(), (GpBitmap**)bitmap);
if (status == Ok) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics)
+FX_BOOL CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics)
{
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
GpStatus status = CallFunc(GdipGetImageGraphicsContext)((GpBitmap*)bitmap, (GpGraphics**)graphics);
if (status == Ok) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CGdiplusExt::GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily)
+FX_BOOL CGdiplusExt::GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily)
{
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
GpStatus status = CallFunc(GdipCreateFontFamilyFromName)((GDIPCONST WCHAR *)name, (GpFontCollection*)pFontCollection, (GpFontFamily**)pFamily);
if (status == Ok) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CGdiplusExt::GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont)
+FX_BOOL CGdiplusExt::GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont)
{
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
GpStatus status = CallFunc(GdipCreateFont)((GpFontFamily*)pFamily, font_size, fontstyle, Unit(flag), (GpFont**)pFont);
if (status == Ok) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void CGdiplusExt::GdipGetFontSize(void *pFont, FX_FLOAT *size)
{
@@ -608,16 +608,16 @@ void CGdiplusExt::GdipSetPageUnit(void* graphics, FX_DWORD unit)
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
CallFunc(GdipSetPageUnit)((GpGraphics*)graphics, (GpUnit)unit);
}
-bool CGdiplusExt::GdipDrawDriverString(void *graphics, unsigned short *text, int length,
+FX_BOOL CGdiplusExt::GdipDrawDriverString(void *graphics, unsigned short *text, int length,
void *font, void* brush, void *positions, int flags, const void *matrix)
{
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
GpStatus status = CallFunc(GdipDrawDriverString)((GpGraphics*)graphics, (GDIPCONST UINT16 *)text, (INT)length, (GDIPCONST GpFont *)font, (GDIPCONST GpBrush*)brush,
(GDIPCONST PointF *)positions, (INT)flags, (GDIPCONST GpMatrix *)matrix);
if (status == Ok) {
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void CGdiplusExt::GdipCreateBrush(FX_DWORD fill_argb, void** pBrush)
{
@@ -684,7 +684,7 @@ void CGdiplusExt::GdipDeleteGraphics(void* graphics)
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
CallFunc(GdipDeleteGraphics)((GpGraphics*)graphics);
}
-bool CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+FX_BOOL CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD argb, const FX_RECT* pClipRect, int flags)
{
ASSERT(pBitmap->GetBPP() == 1);
@@ -699,9 +699,9 @@ bool CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap*
}
OutputImageMask(pGraphics, bMonoDevice, pBitmap, dest_left, dest_top, dest_width, dest_height, argb, pClipRect);
CallFunc(GdipDeleteGraphics)(pGraphics);
- return true;
+ return TRUE;
}
-bool CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+FX_BOOL CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, int flags)
{
GpGraphics* pGraphics;
@@ -719,9 +719,9 @@ bool CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_l
OutputImage(pGraphics, pBitmap, &src_rect, dest_left, dest_top, dest_width, dest_height);
CallFunc(GdipDeleteGraphics)(pGraphics);
CallFunc(GdipDeleteGraphics)(pGraphics);
- return true;
+ return TRUE;
}
-static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, DWORD argb, bool bTextMode = false)
+static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, DWORD argb, FX_BOOL bTextMode = FALSE)
{
CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
FX_FLOAT width = pGraphState ? pGraphState->m_LineWidth : 1.0f;
@@ -735,7 +735,7 @@ static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_Af
CallFunc(GdipCreatePen1)((ARGB)argb, width, UnitWorld, &pPen);
LineCap lineCap;
DashCap dashCap = DashCapFlat;
- bool bDashExtend = false;
+ FX_BOOL bDashExtend = FALSE;
switch(pGraphState->m_LineCap) {
case CFX_GraphStateData::LineCapButt:
lineCap = LineCapFlat;
@@ -743,11 +743,11 @@ static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_Af
case CFX_GraphStateData::LineCapRound:
lineCap = LineCapRound;
dashCap = DashCapRound;
- bDashExtend = true;
+ bDashExtend = TRUE;
break;
case CFX_GraphStateData::LineCapSquare:
lineCap = LineCapSquare;
- bDashExtend = true;
+ bDashExtend = TRUE;
break;
}
CallFunc(GdipSetPenLineCap197819)(pPen, lineCap, lineCap, dashCap);
@@ -839,10 +839,10 @@ static BOOL IsSmallTriangle(PointF* points, const CFX_AffineMatrix* pMatrix, int
if (distance_square < (1.0f * 2 + 1.0f / 4)) {
v1 = i;
v2 = pair1;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
@@ -854,7 +854,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
{
int nPoints = pPathData->GetPointCount();
if (nPoints == 0) {
- return true;
+ return TRUE;
}
FX_PATHPOINT* pPoints = pPathData->GetPoints();
GpGraphics* pGraphics = NULL;
@@ -870,9 +870,9 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
PointF *points = FX_Alloc(PointF, nPoints);
BYTE * types = FX_Alloc(BYTE, nPoints);
int nSubPathes = 0;
- bool bSubClose = false;
+ FX_BOOL bSubClose = FALSE;
int pos_subclose = 0;
- bool bSmooth = false;
+ FX_BOOL bSmooth = FALSE;
int startpoint = 0;
for(int i = 0; i < nPoints; i++) {
points[i].X = pPoints[i].m_PointX;
@@ -900,7 +900,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
if(point_type == FXPT_MOVETO) {
types[i] = PathPointTypeStart;
nSubPathes ++;
- bSubClose = false;
+ bSubClose = FALSE;
startpoint = i;
} else if (point_type == FXPT_LINETO) {
types[i] = PathPointTypeLine;
@@ -910,31 +910,31 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
continue;
}
if (!bSmooth && points[i].X != points[i - 1].X && points[i].Y != points[i - 1].Y) {
- bSmooth = true;
+ bSmooth = TRUE;
}
} else if (point_type == FXPT_BEZIERTO) {
types[i] = PathPointTypeBezier;
- bSmooth = true;
+ bSmooth = TRUE;
}
if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE) {
if (bSubClose) {
types[pos_subclose] &= ~PathPointTypeCloseSubpath;
} else {
- bSubClose = true;
+ bSubClose = TRUE;
}
pos_subclose = i;
types[i] |= PathPointTypeCloseSubpath;
if (!bSmooth && points[i].X != points[startpoint].X && points[i].Y != points[startpoint].Y) {
- bSmooth = true;
+ bSmooth = TRUE;
}
}
}
if (fill_mode & FXFILL_NOPATHSMOOTH) {
- bSmooth = false;
+ bSmooth = FALSE;
CallFunc(GdipSetSmoothingMode)(pGraphics, SmoothingModeNone);
} else if (!(fill_mode & FXFILL_FULLCOVER)) {
if (!bSmooth && (fill_mode & 3)) {
- bSmooth = true;
+ bSmooth = TRUE;
}
if (bSmooth || (pGraphState && pGraphState->m_LineWidth > 2)) {
CallFunc(GdipSetSmoothingMode)(pGraphics, SmoothingModeAntiAlias);
@@ -949,7 +949,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
CallFunc(GdipDrawLineI)(pGraphics, pPen, FXSYS_round(points[v1].X), FXSYS_round(points[v1].Y),
FXSYS_round(points[v2].X), FXSYS_round(points[v2].Y));
CallFunc(GdipDeletePen)(pPen);
- return true;
+ return TRUE;
}
}
GpPath* pGpPath = NULL;
@@ -961,7 +961,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
FX_Free(points);
FX_Free(types);
CallFunc(GdipDeleteGraphics)(pGraphics);
- return false;
+ return FALSE;
}
if (new_fill_mode) {
GpBrush* pBrush = _GdipCreateBrush(fill_argb);
@@ -994,7 +994,7 @@ BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
FX_Free(types);
CallFunc(GdipDeletePath)(pGpPath);
CallFunc(GdipDeleteGraphics)(pGraphics);
- return true;
+ return TRUE;
}
class GpStream final : public IStream
{
@@ -1229,7 +1229,7 @@ static void FreeDIBitmap(PREVIEW3_DIBITMAP* pInfo)
}
FX_Free(pInfo);
}
-CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, bool bAlpha);
+CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL bAlpha);
CFX_DIBitmap* CGdiplusExt::LoadDIBitmap(WINDIB_Open_Args_ args)
{
PREVIEW3_DIBITMAP* pInfo = ::LoadDIBitmap(args);
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp
index 63c3849237..86dbf9bb0a 100644
--- a/core/src/fxge/win32/fx_win32_print.cpp
+++ b/core/src/fxge/win32/fx_win32_print.cpp
@@ -18,7 +18,7 @@ CGdiPrinterDriver::CGdiPrinterDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_PRINT
{
m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE);
- m_bSupportROP = true;
+ m_bSupportROP = TRUE;
}
int CGdiPrinterDriver::GetDeviceCaps(int caps_id)
{
@@ -30,7 +30,7 @@ int CGdiPrinterDriver::GetDeviceCaps(int caps_id)
}
return CGdiDeviceDriver::GetDeviceCaps(caps_id);
}
-bool CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform)
{
if (pSource->IsAlphaMask()) {
@@ -41,28 +41,28 @@ bool CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
ASSERT(pSource != NULL && !pSource->IsAlphaMask() && pSrcRect != NULL);
ASSERT(blend_type == FXDIB_BLEND_NORMAL);
if (pSource->HasAlpha()) {
- return false;
+ return FALSE;
}
CFX_DIBExtractor temp(pSource);
CFX_DIBitmap* pBitmap = temp;
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform);
}
-bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (pSource->IsAlphaMask()) {
int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
if (pSource->GetBPP() != 1 || alpha != 255 || !m_bSupportROP) {
- return false;
+ return FALSE;
}
if (dest_width < 0 || dest_height < 0) {
CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0);
if (pFlipped == NULL) {
- return false;
+ return FALSE;
}
if (dest_width < 0) {
dest_left += dest_width;
@@ -70,24 +70,24 @@ bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col
if (dest_height < 0) {
dest_top += dest_height;
}
- bool ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform);
+ FX_BOOL ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform);
delete pFlipped;
return ret;
}
CFX_DIBExtractor temp(pSource);
CFX_DIBitmap* pBitmap = temp;
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width, dest_height, color, flags, alpha_flag, pIccTransform);
}
if (pSource->HasAlpha()) {
- return false;
+ return FALSE;
}
if (dest_width < 0 || dest_height < 0) {
CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0);
if (pFlipped == NULL) {
- return false;
+ return FALSE;
}
if (dest_width < 0) {
dest_left += dest_width;
@@ -95,14 +95,14 @@ bool CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD col
if (dest_height < 0) {
dest_top += dest_height;
}
- bool ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform);
+ FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform);
delete pFlipped;
return ret;
}
CFX_DIBExtractor temp(pSource);
CFX_DIBitmap* pBitmap = temp;
if (pBitmap == NULL) {
- return false;
+ return FALSE;
}
return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform);
}
@@ -189,18 +189,18 @@ static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_Af
}
return pTempBitmap;
}
-bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color,
+FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (bitmap_alpha < 255 || pSource->HasAlpha() || (pSource->IsAlphaMask() && (pSource->GetBPP() != 1 || !m_bSupportROP))) {
- return false;
+ return FALSE;
}
CFX_FloatRect unit_rect = pMatrix->GetUnitRect();
FX_RECT full_rect = unit_rect.GetOutterRect();
if (FXSYS_fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && FXSYS_fabs(pMatrix->c) < 0.5f && pMatrix->d != 0) {
- bool bFlipX = pMatrix->a < 0;
- bool bFlipY = pMatrix->d > 0;
+ FX_BOOL bFlipX = pMatrix->a < 0;
+ FX_BOOL bFlipY = pMatrix->d > 0;
return StretchDIBits(pSource, color, bFlipX ? full_rect.right : full_rect.left, bFlipY ? full_rect.bottom : full_rect.top,
bFlipX ? -full_rect.Width() : full_rect.Width(), bFlipY ? -full_rect.Height() : full_rect.Height(), NULL, 0,
alpha_flag, pIccTransform, blend_type);
@@ -208,9 +208,9 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alp
if (FXSYS_fabs(pMatrix->a) < 0.5f && FXSYS_fabs(pMatrix->d) < 0.5f) {
CFX_DIBitmap* pTransformed = pSource->SwapXY(pMatrix->c > 0, pMatrix->b < 0);
if (pTransformed == NULL) {
- return false;
+ return FALSE;
}
- bool ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0,
+ FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0,
alpha_flag, pIccTransform, blend_type);
delete pTransformed;
return ret;
@@ -218,20 +218,20 @@ bool CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alp
if (pSource->GetBPP() == 1) {
CFX_DIBitmap* pTransformed = Transform1bppBitmap(pSource, pMatrix);
if (pIccTransform == NULL) {
- return false;
+ return FALSE;
}
SaveState();
CFX_PathData path;
path.AppendRect(0, 0, 1.0f, 1.0f);
SetClip_PathFill(&path, pMatrix, WINDING);
- bool ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0,
+ FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0,
alpha_flag, pIccTransform, blend_type);
RestoreState();
delete pTransformed;
handle = NULL;
return ret;
}
- return false;
+ return FALSE;
}
CPSOutput::CPSOutput(HDC hDC)
{
@@ -266,14 +266,14 @@ void CPSOutput::OutputPS(const FX_CHAR* string, int len)
CPSPrinterDriver::CPSPrinterDriver()
{
m_pPSOutput = NULL;
- m_bCmykOutput = false;
+ m_bCmykOutput = FALSE;
}
CPSPrinterDriver::~CPSPrinterDriver()
{
EndRendering();
delete m_pPSOutput;
}
-bool CPSPrinterDriver::Init(HDC hDC, int pslevel, bool bCmykOutput)
+FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput)
{
m_hDC = hDC;
m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
@@ -305,7 +305,7 @@ bool CPSPrinterDriver::Init(HDC hDC, int pslevel, bool bCmykOutput)
}
}
::DeleteObject(hRgn);
- return true;
+ return TRUE;
}
int CPSPrinterDriver::GetDeviceCaps(int caps_id)
{
@@ -327,7 +327,7 @@ int CPSPrinterDriver::GetDeviceCaps(int caps_id)
}
return 0;
}
-bool CPSPrinterDriver::StartRendering()
+FX_BOOL CPSPrinterDriver::StartRendering()
{
return m_PSRenderer.StartRendering();
}
@@ -339,69 +339,69 @@ void CPSPrinterDriver::SaveState()
{
m_PSRenderer.SaveState();
}
-void CPSPrinterDriver::RestoreState(bool bKeepSaved)
+void CPSPrinterDriver::RestoreState(FX_BOOL bKeepSaved)
{
m_PSRenderer.RestoreState(bKeepSaved);
}
-bool CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device,
+FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device,
int fill_mode)
{
m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode);
- return true;
+ return TRUE;
}
-bool CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
+FX_BOOL CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState)
{
m_PSRenderer.SetClip_PathStroke(pPathData, pObject2Device, pGraphState);
- return true;
+ return TRUE;
}
-bool CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData,
+FX_BOOL CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState, FX_ARGB fill_color, FX_ARGB stroke_color,
int fill_mode, int alpha_flag, void* pIccTransform, int blend_type)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
return m_PSRenderer.DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode & 3, alpha_flag, pIccTransform);
}
-bool CPSPrinterDriver::GetClipBox(FX_RECT* pRect)
+FX_BOOL CPSPrinterDriver::GetClipBox(FX_RECT* pRect)
{
*pRect = m_PSRenderer.GetClipBox();
- return true;
+ return TRUE;
}
-bool CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
return m_PSRenderer.SetDIBits(pBitmap, color, left, top, alpha_flag, pIccTransform);
}
-bool CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
return m_PSRenderer.StretchDIBits(pBitmap, color, dest_left, dest_top, dest_width, dest_height, flags, alpha_flag, pIccTransform);
}
-bool CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type)
{
if (blend_type != FXDIB_BLEND_NORMAL) {
- return false;
+ return FALSE;
}
if (bitmap_alpha < 255) {
- return false;
+ return FALSE;
}
handle = NULL;
return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_flag, pIccTransform);
}
-bool CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform)
{
diff --git a/core/src/fxge/win32/win32_int.h b/core/src/fxge/win32/win32_int.h
index f9b6a639b9..569c4f6baa 100644
--- a/core/src/fxge/win32/win32_int.h
+++ b/core/src/fxge/win32/win32_int.h
@@ -13,15 +13,15 @@ public:
CGdiplusExt();
~CGdiplusExt();
void Load();
- bool IsAvailable()
+ FX_BOOL IsAvailable()
{
return m_hModule != NULL;
}
- bool StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ FX_BOOL StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD argb, const FX_RECT* pClipRect, int flags);
- bool StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ FX_BOOL StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, int flags);
- bool DrawPath(HDC hDC, const CFX_PathData* pPathData,
+ FX_BOOL DrawPath(HDC hDC, const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_argb,
@@ -31,26 +31,26 @@ public:
void* LoadMemFont(uint8_t* pData, FX_DWORD size);
void DeleteMemFont(void* pFontCollection);
- bool GdipCreateFromImage(void* bitmap, void** graphics);
+ FX_BOOL GdipCreateFromImage(void* bitmap, void** graphics);
void GdipDeleteGraphics(void* graphics);
void GdipSetTextRenderingHint(void* graphics, int mode);
void GdipSetPageUnit(void* graphics, FX_DWORD unit);
void GdipSetWorldTransform(void* graphics, void* pMatrix);
- bool GdipDrawDriverString(void *graphics, unsigned short *text, int length, void *font, void* brush, void *positions, int flags, const void *matrix);
+ FX_BOOL GdipDrawDriverString(void *graphics, unsigned short *text, int length, void *font, void* brush, void *positions, int flags, const void *matrix);
void GdipCreateBrush(FX_DWORD fill_argb, void** pBrush);
void GdipDeleteBrush(void* pBrush);
void GdipCreateMatrix(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, void** matrix);
void GdipDeleteMatrix(void* matrix);
- bool GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily);
+ FX_BOOL GdipCreateFontFamilyFromName(const FX_WCHAR* name, void* pFontCollection, void**pFamily);
void GdipDeleteFontFamily(void* pFamily);
- bool GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont);
+ FX_BOOL GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont);
void* GdipCreateFontFromCollection(void* pFontCollection, FX_FLOAT font_size, int fontstyle);
void GdipDeleteFont(void* pFont);
- bool GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap);
+ FX_BOOL GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap);
void GdipDisposeImage(void* bitmap);
void GdipGetFontSize(void *pFont, FX_FLOAT *size);
void* GdiAddFontMemResourceEx(void *pFontdata, FX_DWORD size, void* pdv, FX_DWORD* num_face);
- bool GdiRemoveFontMemResourceEx(void* handle);
+ FX_BOOL GdiRemoveFontMemResourceEx(void* handle);
void* m_Functions[100];
void* m_pGdiAddFontMemResourceEx;
void* m_pGdiRemoveFontMemResourseEx;
@@ -63,7 +63,7 @@ protected:
class CWin32Platform
{
public:
- bool m_bHalfTone;
+ FX_BOOL m_bHalfTone;
CGdiplusExt m_GdiplusExt;
CDWriteExt m_DWriteExt;
};
@@ -75,22 +75,22 @@ protected:
{
SaveDC(m_hDC);
}
- virtual void RestoreState(bool bKeepSaved = false)
+ virtual void RestoreState(FX_BOOL bKeepSaved = FALSE)
{
RestoreDC(m_hDC, -1);
if (bKeepSaved) {
SaveDC(m_hDC);
}
}
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData,
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
);
- virtual bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
);
- virtual bool DrawPath(const CFX_PathData* pPathData,
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -100,26 +100,26 @@ protected:
void* pIccTransform,
int blend_type
);
- virtual bool FillRect(const FX_RECT* pRect,
+ virtual FX_BOOL FillRect(const FX_RECT* pRect,
FX_DWORD fill_color,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
int alpha_flag, void* pIccTransform, int blend_type);
virtual void* GetClipRgn() ;
- virtual bool SetClipRgn(void* pRgn) ;
- virtual bool GetClipBox(FX_RECT* pRect);
- virtual bool DeleteDeviceRgn(void* pRgn);
+ virtual FX_BOOL SetClipRgn(void* pRgn) ;
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL DeleteDeviceRgn(void* pRgn);
virtual void DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2);
virtual void* GetPlatformSurface()
{
return (void*)m_hDC;
}
- bool GDI_SetDIBits(const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect, int left, int top,
+ FX_BOOL GDI_SetDIBits(const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect, int left, int top,
void* pIccTransform);
- bool GDI_StretchDIBits(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ FX_BOOL GDI_StretchDIBits(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD flags,
void* pIccTransform);
- bool GDI_StretchBitMask(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ FX_BOOL GDI_StretchBitMask(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
int dest_width, int dest_height, FX_DWORD bitmap_color, FX_DWORD flags,
int alpha_flag, void* pIccTransform);
HDC m_hDC;
@@ -133,19 +133,19 @@ class CGdiDisplayDriver : public CGdiDeviceDriver
public:
CGdiDisplayDriver(HDC hDC);
protected:
- virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false);
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform);
- virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type)
{
- return false;
+ return FALSE;
}
- bool UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+ FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, int render_flags,
int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
};
@@ -155,16 +155,16 @@ public:
CGdiPrinterDriver(HDC hDC);
protected:
virtual int GetDeviceCaps(int caps_id);
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform);
- virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type);
int m_HorzSize, m_VertSize;
- bool m_bSupportROP;
+ FX_BOOL m_bSupportROP;
};
class CPSOutput : public IFX_PSOutput
{
@@ -184,27 +184,27 @@ class CPSPrinterDriver : public IFX_RenderDeviceDriver
{
public:
CPSPrinterDriver();
- bool Init(HDC hDC, int ps_level, bool bCmykOutput);
+ FX_BOOL Init(HDC hDC, int ps_level, FX_BOOL bCmykOutput);
~CPSPrinterDriver();
protected:
- virtual bool IsPSPrintDriver()
+ virtual FX_BOOL IsPSPrintDriver()
{
- return true;
+ return TRUE;
}
virtual int GetDeviceCaps(int caps_id);
- virtual bool StartRendering();
+ virtual FX_BOOL StartRendering();
virtual void EndRendering();
virtual void SaveState();
- virtual void RestoreState(bool bKeepSaved = false);
- virtual bool SetClip_PathFill(const CFX_PathData* pPathData,
+ virtual void RestoreState(FX_BOOL bKeepSaved = FALSE);
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
int fill_mode
);
- virtual bool SetClip_PathStroke(const CFX_PathData* pPathData,
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState
);
- virtual bool DrawPath(const CFX_PathData* pPathData,
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -214,16 +214,16 @@ protected:
void* pIccTransform,
int blend_type
);
- virtual bool GetClipBox(FX_RECT* pRect);
- virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform);
- virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
int alpha_flag, void* pIccTransform, int blend_type);
- virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform);
virtual void* GetPlatformSurface()
@@ -231,7 +231,7 @@ protected:
return (void*)m_hDC;
}
HDC m_hDC;
- bool m_bCmykOutput;
+ FX_BOOL m_bCmykOutput;
int m_Width, m_Height, m_nBitsPerPixel;
int m_HorzSize, m_VertSize;
CPSOutput* m_pPSOutput;
diff --git a/fpdfsdk/include/formfiller/FFL_CheckBox.h b/fpdfsdk/include/formfiller/FFL_CheckBox.h
index 6880977094..3deeae8aa7 100644
--- a/fpdfsdk/include/formfiller/FFL_CheckBox.h
+++ b/fpdfsdk/include/formfiller/FFL_CheckBox.h
@@ -17,11 +17,11 @@ public:
virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
- virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual bool OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
virtual void SaveData(CPDFSDK_PageView* pPageView);
};
diff --git a/fpdfsdk/include/formfiller/FFL_ComboBox.h b/fpdfsdk/include/formfiller/FFL_ComboBox.h
index 957fda425f..e5c65c2715 100644
--- a/fpdfsdk/include/formfiller/FFL_ComboBox.h
+++ b/fpdfsdk/include/formfiller/FFL_ComboBox.h
@@ -31,19 +31,19 @@ public:
virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual bool IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
virtual void SaveData(CPDFSDK_PageView* pPageView);
virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa);
virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa);
- virtual bool IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew);
+ virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew);
virtual void SaveState(CPDFSDK_PageView* pPageView);
virtual void RestoreState(CPDFSDK_PageView* pPageView);
- virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue);
- virtual void OnKeyStroke(bool bKeyDown, FX_UINT nFlag);
+ virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
+ virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag);
public:
virtual void OnSetFocus(CPWL_Wnd* pWnd);
@@ -53,9 +53,9 @@ public:
virtual void OnAddUndo(CPWL_Edit* pEdit);
public:
- virtual bool CanCopy(CPDFSDK_Document* pDocument);
- virtual bool CanCut(CPDFSDK_Document* pDocument);
- virtual bool CanPaste(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
private:
CFX_WideString GetSelectExportText();
diff --git a/fpdfsdk/include/formfiller/FFL_FormFiller.h b/fpdfsdk/include/formfiller/FFL_FormFiller.h
index 98995c1a58..fc858a8822 100644
--- a/fpdfsdk/include/formfiller/FFL_FormFiller.h
+++ b/fpdfsdk/include/formfiller/FFL_FormFiller.h
@@ -39,23 +39,23 @@ public:
virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual bool OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
- virtual bool OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual bool OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
- virtual bool OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
+ virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
+ virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
- virtual bool CanCopy(CPDFSDK_Document* pDocument);
- virtual bool CanCut(CPDFSDK_Document* pDocument);
- virtual bool CanPaste(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
virtual void DoCopy(CPDFSDK_Document* pDocument);
virtual void DoCut(CPDFSDK_Document* pDocument);
@@ -72,15 +72,15 @@ public:
PDFSDK_FieldAction& fa);
virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
const PDFSDK_FieldAction& fa);
- virtual bool IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+ virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
const PDFSDK_FieldAction& faNew);
virtual void SaveState(CPDFSDK_PageView* pPageView);
virtual void RestoreState(CPDFSDK_PageView* pPageView);
- virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue);
+ virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
- virtual void OnKeyStroke(bool bKeyDown);
+ virtual void OnKeyStroke(FX_BOOL bKeyDown);
CPDF_Matrix GetCurMatrix();
@@ -95,19 +95,19 @@ public:
void SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow);
CPDF_Rect GetWindowRect(CPDFSDK_PageView* pPageView);
- bool CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag);
- virtual bool IsDataChanged(CPDFSDK_PageView* pPageView);
+ FX_BOOL CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag);
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
virtual void SaveData(CPDFSDK_PageView* pPageView);
- CPWL_Wnd* GetPDFWindow(CPDFSDK_PageView* pPageView, bool bNew);
+ CPWL_Wnd* GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew);
void DestroyPDFWindow(CPDFSDK_PageView* pPageView);
- void EscapeFiller(CPDFSDK_PageView* pPageView, bool bDestroyPDFWindow);
+ void EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow);
virtual PWL_CREATEPARAM GetCreateParam();
virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView) = 0;
virtual CPDF_Rect GetFocusBox(CPDFSDK_PageView* pPageView);
- bool IsValid() const;
+ FX_BOOL IsValid() const;
CPDF_Rect GetPDFWindowRect() const;
CPDFSDK_PageView* GetCurPageView();
@@ -124,7 +124,7 @@ protected:
CPDFSDK_Widget* m_pWidget;
CPDFSDK_Annot* m_pAnnot;
- bool m_bValid;
+ FX_BOOL m_bValid;
CFFL_PageView2PDFWindow m_Maps;
CPDF_Point m_ptOldPos;
};
@@ -137,9 +137,9 @@ public:
virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual bool OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
FX_DWORD dwFlags);
@@ -148,8 +148,8 @@ public:
CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
FX_DWORD dwFlags);
protected:
- bool m_bMouseIn;
- bool m_bMouseDown;
+ FX_BOOL m_bMouseIn;
+ FX_BOOL m_bMouseDown;
};
#endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_
diff --git a/fpdfsdk/include/formfiller/FFL_IFormFiller.h b/fpdfsdk/include/formfiller/FFL_IFormFiller.h
index 51b0279d0a..e553723dc3 100644
--- a/fpdfsdk/include/formfiller/FFL_IFormFiller.h
+++ b/fpdfsdk/include/formfiller/FFL_IFormFiller.h
@@ -20,7 +20,7 @@ public:
CFFL_IFormFiller(CPDFDoc_Environment* pApp);
virtual ~CFFL_IFormFiller();
- virtual bool Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point);
+ virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point);
virtual FX_RECT GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
virtual void OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
@@ -34,41 +34,41 @@ public:
virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
- virtual bool OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
- virtual bool OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual bool OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag);
- virtual bool OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
+ virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag);
+ virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet);
- virtual void OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, int32_t nKeyCode,
+ virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode,
CFX_WideString & strChange, const CFX_WideString& strChangeEx,
int nSelStart, int nSelEnd,
- bool bKeyDown, bool & bRC, bool & bExit, FX_DWORD nFlag);
- virtual void OnAfterKeyStroke(bool bEditOrList, void* pPrivateData, bool & bExit, FX_DWORD nFlag) ;
+ FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag);
+ virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) ;
- CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, bool bRegister);
+ CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister);
void RemoveFormFiller(CPDFSDK_Annot* pAnnot);
- static bool IsVisible(CPDFSDK_Widget* pWidget);
- static bool IsReadOnly(CPDFSDK_Widget* pWidget);
- static bool IsFillingAllowed(CPDFSDK_Widget* pWidget);
- static bool IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
+ static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget);
+ static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget);
+ static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget);
+ static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
- void OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bRC, bool& bExit, FX_DWORD nFlag);
- void OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bRC, bool& bExit, FX_DWORD nFlag);
+ void OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag);
+ void OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag);
- void OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bExit, FX_DWORD nFlag);
- void OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bExit, FX_DWORD nFlag);
- void OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bReset, bool& bExit,FX_UINT nFlag);
+ void OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag);
+ void OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag);
+ void OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag);
private:
using CFFL_Widget2Filler = std::map<CPDFSDK_Annot*, CFFL_FormFiller*>;
@@ -77,7 +77,7 @@ private:
CPDFDoc_Environment* m_pApp;
CFFL_Widget2Filler m_Maps;
- bool m_bNotifying;
+ FX_BOOL m_bNotifying;
};
class CFFL_PrivateData
diff --git a/fpdfsdk/include/formfiller/FFL_ListBox.h b/fpdfsdk/include/formfiller/FFL_ListBox.h
index 59e3d6c689..4c0813f5c8 100644
--- a/fpdfsdk/include/formfiller/FFL_ListBox.h
+++ b/fpdfsdk/include/formfiller/FFL_ListBox.h
@@ -23,10 +23,10 @@ public:
virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp,
CPDFSDK_PageView* pPageView);
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar,
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar,
FX_UINT nFlags);
- virtual bool IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
virtual void SaveData(CPDFSDK_PageView* pPageView);
virtual void GetActionData(CPDFSDK_PageView* pPageView,
@@ -40,8 +40,8 @@ public:
virtual void RestoreState(CPDFSDK_PageView* pPageView);
virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView,
- bool bRestoreValue);
- virtual void OnKeyStroke(bool bKeyDown, FX_DWORD nFlag);
+ FX_BOOL bRestoreValue);
+ virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag);
private:
CBA_FontMap* m_pFontMap;
diff --git a/fpdfsdk/include/formfiller/FFL_Notify.h b/fpdfsdk/include/formfiller/FFL_Notify.h
index 8a9c04c5df..961d4b7a79 100644
--- a/fpdfsdk/include/formfiller/FFL_Notify.h
+++ b/fpdfsdk/include/formfiller/FFL_Notify.h
@@ -20,35 +20,35 @@ public:
virtual ~CFFL_Notify();
public:
- bool OnSetFocus(bool & bExit);
- bool OnMouseEnter(bool & bExit);
- bool OnMouseDown(bool & bExit);
- bool OnMouseUp(bool & bExit);
- bool OnMouseExit(bool & bExit);
- bool OnKillFocus(bool & bExit);
-
- bool OnCalculate();
- bool OnFormat(int iCommitKey);
- bool OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
- const CFX_WideString& strChangeEx, bool bKeyDown, bool bModifier,
- bool bShift, bool & bRC);
- bool OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
- const CFX_WideString& strChangeEx, bool bKeyDown, bool bModifier,
- bool bShift, bool bWillCommit, bool bFieldFull,
- int& nSelStart, int& nSelEnd, bool& bRC);
+ FX_BOOL OnSetFocus(FX_BOOL & bExit);
+ FX_BOOL OnMouseEnter(FX_BOOL & bExit);
+ FX_BOOL OnMouseDown(FX_BOOL & bExit);
+ FX_BOOL OnMouseUp(FX_BOOL & bExit);
+ FX_BOOL OnMouseExit(FX_BOOL & bExit);
+ FX_BOOL OnKillFocus(FX_BOOL & bExit);
+
+ FX_BOOL OnCalculate();
+ FX_BOOL OnFormat(int iCommitKey);
+ FX_BOOL OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
+ FX_BOOL bShift, FX_BOOL & bRC);
+ FX_BOOL OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
+ FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull,
+ int& nSelStart, int& nSelEnd, FX_BOOL& bRC);
void BeforeNotify();
void AfterNotify();
- bool IsNotifying() const {return m_nNotifyFlag > 0;}
+ FX_BOOL IsNotifying() const {return m_nNotifyFlag > 0;}
private:
- bool DoAAction(CPDF_AAction::AActionType eAAT, bool & bExit);
- bool FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action);
- bool FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action);
- bool ExecuteActionTree(CPDF_AAction::AActionType eAAT, CPDF_Action & action, bool& bExit);
- bool ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,bool& bExit);
+ FX_BOOL DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit);
+ FX_BOOL FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action);
+ FX_BOOL FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action);
+ FX_BOOL ExecuteActionTree(CPDF_AAction::AActionType eAAT, CPDF_Action & action, FX_BOOL& bExit);
+ FX_BOOL ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit);
- bool m_bDoActioning;
+ FX_BOOL m_bDoActioning;
int32_t m_nNotifyFlag;
};
diff --git a/fpdfsdk/include/formfiller/FFL_PushButton.h b/fpdfsdk/include/formfiller/FFL_PushButton.h
index 26de7a1b23..3cfaefb9bd 100644
--- a/fpdfsdk/include/formfiller/FFL_PushButton.h
+++ b/fpdfsdk/include/formfiller/FFL_PushButton.h
@@ -17,7 +17,7 @@ public:
virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
FX_DWORD dwFlags);
diff --git a/fpdfsdk/include/formfiller/FFL_RadioButton.h b/fpdfsdk/include/formfiller/FFL_RadioButton.h
index e858533c6b..46332e07fd 100644
--- a/fpdfsdk/include/formfiller/FFL_RadioButton.h
+++ b/fpdfsdk/include/formfiller/FFL_RadioButton.h
@@ -16,10 +16,10 @@ public:
virtual ~CFFL_RadioButton();
virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
- virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual bool OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual bool IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
virtual void SaveData(CPDFSDK_PageView* pPageView);
};
diff --git a/fpdfsdk/include/formfiller/FFL_TextField.h b/fpdfsdk/include/formfiller/FFL_TextField.h
index 105b90cba9..10bd5c0e43 100644
--- a/fpdfsdk/include/formfiller/FFL_TextField.h
+++ b/fpdfsdk/include/formfiller/FFL_TextField.h
@@ -32,21 +32,21 @@ public:
virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual bool IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
virtual void SaveData(CPDFSDK_PageView* pPageView);
virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
PDFSDK_FieldAction& fa);
virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
const PDFSDK_FieldAction& fa);
- virtual bool IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+ virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
const PDFSDK_FieldAction& faNew);
virtual void SaveState(CPDFSDK_PageView* pPageView);
virtual void RestoreState(CPDFSDK_PageView* pPageView);
- virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue);
+ virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
public:
virtual void OnSetFocus(CPWL_Wnd* pWnd);
@@ -56,9 +56,9 @@ public:
virtual void OnAddUndo(CPWL_Edit* pEdit);
public:
- virtual bool CanCopy(CPDFSDK_Document* pDocument);
- virtual bool CanCut(CPDFSDK_Document* pDocument);
- virtual bool CanPaste(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
private:
CBA_FontMap* m_pFontMap;
diff --git a/fpdfsdk/include/formfiller/FFL_Utils.h b/fpdfsdk/include/formfiller/FFL_Utils.h
index 8dfc64eab0..fe025eca4b 100644
--- a/fpdfsdk/include/formfiller/FFL_Utils.h
+++ b/fpdfsdk/include/formfiller/FFL_Utils.h
@@ -17,7 +17,7 @@ public:
const FX_FLOAT& fSize);
static CPDF_Rect DeflateRect(const CPDF_Rect& crRect,
const FX_FLOAT& fSize);
- static bool TraceObject(CPDF_Object* pObj);
+ static FX_BOOL TraceObject(CPDF_Object* pObj);
};
#endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_UTILS_H_
diff --git a/fpdfsdk/include/fsdk_actionhandler.h b/fpdfsdk/include/fsdk_actionhandler.h
index 7c41a1d0dd..39ec4f41af 100644
--- a/fpdfsdk/include/fsdk_actionhandler.h
+++ b/fpdfsdk/include/fsdk_actionhandler.h
@@ -23,18 +23,18 @@ class IFXJS_Runtime;
class CPDFSDK_FormActionHandler
{
public:
- bool DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- bool DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- bool DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- bool DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument);
};
class CPDFSDK_MediaActionHandler
{
public:
- bool DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- bool DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- bool DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument);
};
class CPDFSDK_ActionHandler
@@ -44,31 +44,31 @@ public:
void SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler);
- bool DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- bool DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName, CPDFSDK_Document* pDocument);
- bool DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument);
- bool DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument);
- bool DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument);
- bool DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen);
- bool DoAction_Link(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- bool DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data);
- bool DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data);
+ FX_BOOL DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen);
+ FX_BOOL DoAction_Link(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data);
+ FX_BOOL DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data);
private:
- bool ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, CFX_PtrList& list);
- bool ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CFX_PtrList& list);
- bool ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data, CFX_PtrList& list);
- bool ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen, CFX_PtrList& list);
- bool ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument, CPDF_Bookmark* pBookmark, CFX_PtrList& list);
- bool ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, CFX_PtrList& list);
+ FX_BOOL ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, CFX_PtrList& list);
+ FX_BOOL ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CFX_PtrList& list);
+ FX_BOOL ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data, CFX_PtrList& list);
+ FX_BOOL ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen, CFX_PtrList& list);
+ FX_BOOL ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument, CPDF_Bookmark* pBookmark, CFX_PtrList& list);
+ FX_BOOL ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, CFX_PtrList& list);
void DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument);
void RunDocumentPageJavaScript(CPDFSDK_Document* pDocument, CPDF_AAction::AActionType type, const CFX_WideString& script);
void RunDocumentOpenJavaScript(CPDFSDK_Document* pDocument, const CFX_WideString& sScriptName, const CFX_WideString& script);
void RunFieldJavaScript(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, const CFX_WideString& script);
- bool IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict);
- bool IsValidDocView(CPDFSDK_Document* pDocument);
+ FX_BOOL IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict);
+ FX_BOOL IsValidDocView(CPDFSDK_Document* pDocument);
void DoAction_GoTo(CPDFSDK_Document* pDocument, const CPDF_Action& action);
void DoAction_GoToR(CPDFSDK_Document* pDocument, const CPDF_Action& action);
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index 6f3bee5038..b4705699c8 100644
--- a/fpdfsdk/include/fsdk_annothandler.h
+++ b/fpdfsdk/include/fsdk_annothandler.h
@@ -29,7 +29,7 @@ public:
virtual CFX_ByteString GetName() = 0;
- virtual bool CanAnswer(CPDFSDK_Annot* pAnnot) = 0;
+ virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) = 0;
virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) = 0;
@@ -41,7 +41,7 @@ public:
virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) = 0;
- virtual bool HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point) = 0;
+ virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point) = 0;
virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
@@ -68,24 +68,24 @@ public:
virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
- virtual bool OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual bool OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual bool OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual bool OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual bool OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point) = 0;
- virtual bool OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual bool OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual bool OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
//by wjm.
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags) = 0;
- virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0;
- virtual bool OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) =0 ;
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags) = 0;
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0;
+ virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) =0 ;
virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) = 0;
virtual void OnSelected(CPDFSDK_Annot* pAnnot) = 0;
- virtual bool OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
- virtual bool OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
+ virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
+ virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
};
@@ -101,7 +101,7 @@ public:
virtual CFX_ByteString GetName() {return CFX_ByteString("WidgetHandler");}
- virtual bool CanAnswer(CPDFSDK_Annot* pAnnot);
+ virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot);
virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage);
@@ -112,7 +112,7 @@ public:
virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) ;
- virtual bool HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point);
+ virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point);
virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
@@ -137,25 +137,25 @@ public:
virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) ;
- virtual bool OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual bool OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual bool OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual bool OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual bool OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point) ;
- virtual bool OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual bool OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual bool OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) {return false;}
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point) ;
+ virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) {return FALSE;}
//by wjm.
- virtual bool OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags);
- virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
- virtual bool OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags);
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
+ virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) {}
virtual void OnSelected(CPDFSDK_Annot* pAnnot) {}
- virtual bool OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
- virtual bool OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+ virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+ virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
void SetFormFiller(CFFL_IFormFiller* pFiller){m_pFormFiller = pFiller;}
CFFL_IFormFiller* GetFormFiller() {return m_pFormFiller;}
@@ -190,29 +190,29 @@ public:
virtual void Annot_OnMouseEnter(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags);
virtual void Annot_OnMouseExit(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags);
- virtual bool Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual bool Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual bool Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual bool Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual bool Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point);
- virtual bool Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual bool Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual bool Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags);
- virtual bool Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
- virtual bool Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
+ virtual FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags);
+ virtual FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
+ virtual FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
- virtual bool Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
- virtual bool Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+ virtual FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+ virtual FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
virtual CPDF_Rect Annot_OnGetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual bool Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point);
private:
IPDFSDK_AnnotHandler* GetAnnotHandler(const CFX_ByteString& sType) const;
- CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,bool bNext);
+ CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX_BOOL bNext);
private:
CBA_AnnotHandlerArray m_Handlers;
CFX_MapByteStringToPtr m_mapType2Handler;
@@ -224,8 +224,8 @@ typedef int (*AI_COMPARE) (CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
class CPDFSDK_AnnotIterator
{
public:
- CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView, bool bReverse,
- bool bIgnoreTopmost=false,bool bCircle=false,CFX_PtrArray* pList=NULL);
+ CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView, FX_BOOL bReverse,
+ FX_BOOL bIgnoreTopmost=FALSE,FX_BOOL bCircle=FALSE,CFX_PtrArray* pList=NULL);
virtual ~CPDFSDK_AnnotIterator() { }
virtual CPDFSDK_Annot* Next (const CPDFSDK_Annot* pCurrent) ;
@@ -234,7 +234,7 @@ public:
virtual CPDFSDK_Annot* Prev(int& index ) ;
virtual int Count(){return m_pIteratorAnnotList.GetSize();}
- virtual bool InitIteratorAnnotList(CPDFSDK_PageView * pPageView,CFX_PtrArray* pList=NULL);
+ virtual FX_BOOL InitIteratorAnnotList(CPDFSDK_PageView * pPageView,CFX_PtrArray* pList=NULL);
void InsertSort(CFX_PtrArray &arrayList, AI_COMPARE pCompare);
@@ -245,9 +245,9 @@ protected:
CPDFSDK_Annot* PrevAnnot(int& index ) ;
CFX_PtrArray m_pIteratorAnnotList;
- bool m_bReverse;
- bool m_bIgnoreTopmost;
- bool m_bCircle;
+ FX_BOOL m_bReverse;
+ FX_BOOL m_bIgnoreTopmost;
+ FX_BOOL m_bCircle;
};
#endif // FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_
diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h
index b9f1fcd4b1..dcd295de9f 100644
--- a/fpdfsdk/include/fsdk_baseannot.h
+++ b/fpdfsdk/include/fsdk_baseannot.h
@@ -38,12 +38,12 @@ public:
CPDFSDK_DateTime& operator = (const CPDFSDK_DateTime& datetime);
CPDFSDK_DateTime& operator = (const FX_SYSTEMTIME& st);
- bool operator == (CPDFSDK_DateTime& datetime);
- bool operator != (CPDFSDK_DateTime& datetime);
- bool operator > (CPDFSDK_DateTime& datetime);
- bool operator >= (CPDFSDK_DateTime& datetime);
- bool operator < (CPDFSDK_DateTime& datetime);
- bool operator <= (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator == (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator != (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator > (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator >= (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator < (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator <= (CPDFSDK_DateTime& datetime);
operator time_t();
CPDFSDK_DateTime& FromPDFDateTimeString(const CFX_ByteString& dtStr);
@@ -92,8 +92,8 @@ public:
void SetTabOrder(int iTabOrder);
// Selection
- bool IsSelected();
- void SetSelected(bool bSelected);
+ FX_BOOL IsSelected();
+ void SetSelected(FX_BOOL bSelected);
CFX_ByteString GetType() const;
virtual CFX_ByteString GetSubType() const;
@@ -146,9 +146,9 @@ public:
void SetColor(FX_COLORREF color);
void RemoveColor();
- bool GetColor(FX_COLORREF& color) const;
+ FX_BOOL GetColor(FX_COLORREF& color) const;
- bool IsVisible() const;
+ FX_BOOL IsVisible() const;
//action
CPDF_Action GetAction() const;
@@ -162,8 +162,8 @@ public:
virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT);
public:
- bool IsAppearanceValid();
- bool IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
+ FX_BOOL IsAppearanceValid();
+ FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
void DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions);
void DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
@@ -181,11 +181,11 @@ public:
private:
- bool CreateFormFiller();
+ FX_BOOL CreateFormFiller();
protected:
CPDF_Annot* m_pAnnot;
CPDFSDK_PageView* m_pPageView;
- bool m_bSelected;
+ FX_BOOL m_bSelected;
int m_nTabOrder;
};
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index 6b974c5535..edbd5e4efc 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -35,28 +35,28 @@ typedef struct _PDFSDK_FieldAction
{
_PDFSDK_FieldAction()
{
- bModifier = false;
- bShift = false;
+ bModifier = FALSE;
+ bShift = FALSE;
nCommitKey = 0;
- bKeyDown = false;
+ bKeyDown = FALSE;
nSelEnd = nSelStart = 0;
- bWillCommit = false;
- bFieldFull = false;
- bRC = true;
+ bWillCommit = FALSE;
+ bFieldFull = FALSE;
+ bRC = TRUE;
}
- bool bModifier; //in
- bool bShift; //in
+ FX_BOOL bModifier; //in
+ FX_BOOL bShift; //in
int nCommitKey; //in
CFX_WideString sChange; //in[out]
CFX_WideString sChangeEx; //in
- bool bKeyDown; //in
+ FX_BOOL bKeyDown; //in
int nSelEnd; //in[out]
int nSelStart; //in[out]
CFX_WideString sValue; //in[out]
- bool bWillCommit; //in
- bool bFieldFull; //in
- bool bRC; //in[out]
+ FX_BOOL bWillCommit; //in
+ FX_BOOL bFieldFull; //in
+ FX_BOOL bRC; //in[out]
}PDFSDK_FieldAction;
class CPDFSDK_Widget : public CPDFSDK_Annot
{
@@ -80,9 +80,9 @@ public:
int GetFieldFlags() const;
int GetRotate() const;
- bool GetFillColor(FX_COLORREF& color) const;
- bool GetBorderColor(FX_COLORREF& color) const;
- bool GetTextColor(FX_COLORREF& color) const;
+ FX_BOOL GetFillColor(FX_COLORREF& color) const;
+ FX_BOOL GetBorderColor(FX_COLORREF& color) const;
+ FX_BOOL GetTextColor(FX_COLORREF& color) const;
FX_FLOAT GetFontSize() const;
int GetSelectedIndex(int nIndex) const;
@@ -90,9 +90,9 @@ public:
CFX_WideString GetDefaultValue() const;
CFX_WideString GetOptionLabel(int nIndex) const;
int CountOptions() const;
- bool IsOptionSelected(int nIndex) const;
+ FX_BOOL IsOptionSelected(int nIndex) const;
int GetTopVisibleIndex() const;
- bool IsChecked() const;
+ FX_BOOL IsChecked() const;
/*
BF_ALIGN_LEFT
BF_ALIGN_MIDDL
@@ -103,20 +103,20 @@ public:
CFX_WideString GetAlternateName() const;
//Set Properties.
- void SetCheck(bool bChecked, bool bNotify);
- void SetValue(const CFX_WideString& sValue, bool bNotify);
+ void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify);
+ void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify);
void SetDefaultValue(const CFX_WideString& sValue);
- void SetOptionSelection(int index, bool bSelected, bool bNotify);
- void ClearSelection(bool bNotify);
+ void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify);
+ void ClearSelection(FX_BOOL bNotify);
void SetTopVisibleIndex(int index);
- void ResetAppearance(const FX_WCHAR* sValue, bool bValueChanged);
- void ResetFieldAppearance(bool bValueChanged);
+ void ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged);
+ void ResetFieldAppearance(FX_BOOL bValueChanged);
void UpdateField();
- CFX_WideString OnFormat(bool& bFormated);
+ CFX_WideString OnFormat(FX_BOOL& bFormated);
//Message.
- bool OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data,
+ FX_BOOL OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data,
CPDFSDK_PageView* pPageView);
CPDFSDK_InterForm* GetInterForm() const {return m_pInterForm;}
@@ -128,7 +128,7 @@ public:
void SetAppModified();
void ClearAppModified();
- bool IsAppModified() const;
+ FX_BOOL IsAppModified() const;
int32_t GetAppearanceAge() const;
int32_t GetValueAge() const;
@@ -155,14 +155,14 @@ private:
void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage);
void RemoveAppearance(const CFX_ByteString& sAPType);
public:
- bool IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode);
+ FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode);
void DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions);
public:
- bool HitTest(FX_FLOAT pageX, FX_FLOAT pageY);
+ FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY);
private:
CPDFSDK_InterForm* m_pInterForm;
- bool m_bAppModified;
+ FX_BOOL m_bAppModified;
int32_t m_nAppAge;
int32_t m_nValueAge;
};
@@ -176,9 +176,9 @@ public:
CPDF_InterForm* GetInterForm() const { return m_pInterForm; }
CPDFSDK_Document* GetDocument() const { return m_pDocument; }
- bool HighlightWidgets();
+ FX_BOOL HighlightWidgets();
- CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, bool bNext) const;
+ CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const;
CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const;
void GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArray& widgets);
void GetWidgets(CPDF_FormField* pField, CFX_PtrArray& widgets);
@@ -186,33 +186,33 @@ public:
void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget);
void RemoveMap(CPDF_FormControl* pControl);
- void EnableCalculate(bool bEnabled);
- bool IsCalculateEnabled() const;
+ void EnableCalculate(FX_BOOL bEnabled);
+ FX_BOOL IsCalculateEnabled() const;
#ifdef _WIN32
CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile);
#endif
- void OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, bool& bRC);
- void OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, bool& bRC);
+ void OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC);
+ void OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC);
void OnCalculate(CPDF_FormField* pFormField = NULL);
- CFX_WideString OnFormat(CPDF_FormField* pFormField, bool& bFormated);
+ CFX_WideString OnFormat(CPDF_FormField* pFormField, FX_BOOL& bFormated);
- void ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, bool bValueChanged);
+ void ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, FX_BOOL bValueChanged);
void UpdateField(CPDF_FormField* pFormField);
- bool DoAction_Hide(const CPDF_Action& action);
- bool DoAction_SubmitForm(const CPDF_Action& action);
- bool DoAction_ResetForm(const CPDF_Action& action);
- bool DoAction_ImportData(const CPDF_Action& action);
+ FX_BOOL DoAction_Hide(const CPDF_Action& action);
+ FX_BOOL DoAction_SubmitForm(const CPDF_Action& action);
+ FX_BOOL DoAction_ResetForm(const CPDF_Action& action);
+ FX_BOOL DoAction_ImportData(const CPDF_Action& action);
void GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields);
- bool IsValidField(CPDF_Dictionary* pFieldDict);
- bool SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
- bool bIncludeOrExclude, bool bUrlEncoded);
- bool SubmitForm(const CFX_WideString& sDestination, bool bUrlEncoded);
- bool ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf);
- bool ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,bool bIncludeOrExclude, CFX_ByteTextBuf& textBuf);
+ FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict);
+ FX_BOOL SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
+ FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded);
+ FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded);
+ FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf);
+ FX_BOOL ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf);
CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt);
private:
@@ -226,8 +226,8 @@ private:
virtual int BeforeFormImportData(const CPDF_InterForm* pForm);
virtual int AfterFormImportData(const CPDF_InterForm* pForm);
- bool FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile);
- bool FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize);
+ FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile);
+ FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize);
int GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const;
void DoFDFBuffer(CFX_ByteString sBuffer);
@@ -236,11 +236,11 @@ private:
CPDFSDK_Document* m_pDocument;
CPDF_InterForm* m_pInterForm;
CPDFSDK_WidgetMap m_Map;
- bool m_bCalculate;
- bool m_bBusy;
+ FX_BOOL m_bCalculate;
+ FX_BOOL m_bBusy;
public:
- bool IsNeedHighLight(int nFieldType);
+ FX_BOOL IsNeedHighLight(int nFieldType);
void RemoveAllHighLight();
void SetHighlightAlpha(uint8_t alpha) {m_iHighlightAlpha = alpha;}
uint8_t GetHighlightAlpha() {return m_iHighlightAlpha;}
@@ -249,7 +249,7 @@ public:
private:
FX_COLORREF m_aHighlightColor[6];
uint8_t m_iHighlightAlpha;
- bool m_bNeedHightlight[6];
+ FX_BOOL m_bNeedHightlight[6];
};
#define BAI_STRUCTURE 0
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h
index 41607929b4..29b265a428 100644
--- a/fpdfsdk/include/fsdk_define.h
+++ b/fpdfsdk/include/fsdk_define.h
@@ -49,7 +49,7 @@ public:
virtual void Release() override { delete this; }
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override;
private:
FPDF_FILEACCESS m_FileAccess;
@@ -60,7 +60,7 @@ void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy);
void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page,
int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags, bool bNeedToRestore,
+ int rotate, int flags, FX_BOOL bNeedToRestore,
IFSDK_PAUSE_Adapter* pause);
#endif // FPDFSDK_INCLUDE_FSDK_DEFINE_H_
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 1ce57c5687..d57138b350 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -92,24 +92,24 @@ public:
m_pInfo->FFI_OnChange(m_pInfo);
}
- bool FFI_IsSHIFTKeyDown(FX_DWORD nFlag) const
+ FX_BOOL FFI_IsSHIFTKeyDown(FX_DWORD nFlag) const
{
return (nFlag & FWL_EVENTFLAG_ShiftKey) != 0;
}
- bool FFI_IsCTRLKeyDown(FX_DWORD nFlag) const
+ FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag) const
{
return (nFlag & FWL_EVENTFLAG_ControlKey) != 0;
}
- bool FFI_IsALTKeyDown(FX_DWORD nFlag) const
+ FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag) const
{
return (nFlag & FWL_EVENTFLAG_AltKey) != 0;
}
- bool FFI_IsINSERTKeyDown(FX_DWORD nFlag) const
+ FX_BOOL FFI_IsINSERTKeyDown(FX_DWORD nFlag) const
{
- return false;
+ return FALSE;
}
int JS_appAlert(const FX_WCHAR* Msg, const FX_WCHAR* Title, FX_UINT Type, FX_UINT Icon);
@@ -174,7 +174,7 @@ public:
m_pInfo->FFI_ExecuteNamedAction(m_pInfo, namedAction);
}
- void FFI_OnSetFieldInputFocus(void* field,FPDF_WIDESTRING focusText, FPDF_DWORD nTextLen, bool bFocus)
+ void FFI_OnSetFieldInputFocus(void* field,FPDF_WIDESTRING focusText, FPDF_DWORD nTextLen, FX_BOOL bFocus)
{
if (m_pInfo && m_pInfo->FFI_SetTextFieldFocus)
m_pInfo->FFI_SetTextFieldFocus(m_pInfo, focusText, nTextLen, bFocus);
@@ -192,7 +192,7 @@ public:
m_pInfo->FFI_DoGoToAction(m_pInfo, nPageIndex, zoomMode, fPosArray, sizeOfArray);
}
- bool IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; }
+ FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; }
void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; }
CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; }
CPDF_Document* GetPDFDocument() const { return m_pPDFDoc; }
@@ -227,7 +227,7 @@ public:
CPDFSDK_InterForm* GetInterForm() ;
CPDF_Document* GetDocument() {return m_pDoc;}
- CPDFSDK_PageView* GetPageView(CPDF_Page* pPDFPage, bool ReNew = true);
+ CPDFSDK_PageView* GetPageView(CPDF_Page* pPDFPage, FX_BOOL ReNew = TRUE);
CPDFSDK_PageView* GetPageView(int nIndex);
CPDFSDK_PageView* GetCurrentView();
void ReMovePageView(CPDF_Page* pPDFPage);
@@ -237,25 +237,25 @@ public:
IFXJS_Runtime * GetJsRuntime();
- bool SetFocusAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag = 0);
- bool KillFocusAnnot(FX_UINT nFlag = 0);
+ FX_BOOL SetFocusAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag = 0);
+ FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0);
- bool ExtractPages(const CFX_WordArray &arrExtraPages, CPDF_Document* pDstDoc);
- bool InsertPages(int nInsertAt, const CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages);
- bool ReplacePages(int nPage, const CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages);
+ FX_BOOL ExtractPages(const CFX_WordArray &arrExtraPages, CPDF_Document* pDstDoc);
+ FX_BOOL InsertPages(int nInsertAt, const CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages);
+ FX_BOOL ReplacePages(int nPage, const CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages);
void OnCloseDocument();
int GetPageCount() {return m_pDoc->GetPageCount();}
- bool GetPermissions(int nFlag);
- bool GetChangeMark() {return m_bChangeMask;}
- void SetChangeMark() {m_bChangeMask = true;}
- void ClearChangeMark() {m_bChangeMask= false;}
+ FX_BOOL GetPermissions(int nFlag);
+ FX_BOOL GetChangeMark() {return m_bChangeMask;}
+ void SetChangeMark() {m_bChangeMask = TRUE;}
+ void ClearChangeMark() {m_bChangeMask= FALSE;}
CFX_WideString GetPath() ;
CPDF_Page* GetPage(int nIndex);
CPDFDoc_Environment * GetEnv() {return m_pEnv; }
void ProcJavascriptFun();
- bool ProcOpenAction();
+ FX_BOOL ProcOpenAction();
CPDF_OCContext* GetOCContext();
private:
std::map<CPDF_Page*, CPDFSDK_PageView*> m_pageMap;
@@ -264,7 +264,7 @@ private:
CPDFSDK_Annot* m_pFocusAnnot;
CPDFDoc_Environment* m_pEnv;
CPDF_OCContext* m_pOccontent;
- bool m_bChangeMask;
+ FX_BOOL m_bChangeMask;
};
class CPDFSDK_PageView final
{
@@ -278,28 +278,28 @@ public:
CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
CPDFSDK_Annot* GetFocusAnnot() ;
void SetFocusAnnot(CPDFSDK_Annot* pSDKAnnot,FX_UINT nFlag = 0) {m_pSDKDoc->SetFocusAnnot(pSDKAnnot, nFlag);}
- bool KillFocusAnnot(FX_UINT nFlag = 0) {return m_pSDKDoc->KillFocusAnnot(nFlag);}
- bool Annot_HasAppearance(CPDF_Annot* pAnnot);
+ FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0) {return m_pSDKDoc->KillFocusAnnot(nFlag);}
+ FX_BOOL Annot_HasAppearance(CPDF_Annot* pAnnot);
CPDFSDK_Annot* AddAnnot(CPDF_Dictionary * pDict);
CPDFSDK_Annot* AddAnnot(const FX_CHAR* lpSubType,CPDF_Dictionary * pDict);
CPDFSDK_Annot* AddAnnot(CPDF_Annot * pPDFAnnot);
- bool DeleteAnnot(CPDFSDK_Annot* pAnnot);
+ FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot);
int CountAnnots();
CPDFSDK_Annot* GetAnnot(int nIndex);
CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary * pDict);
CPDF_Page* GetPDFPage(){return m_page;}
CPDF_Document* GetPDFDocument();
CPDFSDK_Document* GetSDKDocument() {return m_pSDKDoc;}
- bool OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag);
- bool OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag);
- bool OnChar(int nChar, FX_UINT nFlag);
- bool OnKeyDown(int nKeyCode, int nFlag);
- bool OnKeyUp(int nKeyCode, int nFlag);
-
- bool OnMouseMove(const CPDF_Point & point, int nFlag);
- bool OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag);
- bool IsValidAnnot(void* p);
+ FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag);
+ FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag);
+ FX_BOOL OnChar(int nChar, FX_UINT nFlag);
+ FX_BOOL OnKeyDown(int nKeyCode, int nFlag);
+ FX_BOOL OnKeyUp(int nKeyCode, int nFlag);
+
+ FX_BOOL OnMouseMove(const CPDF_Point & point, int nFlag);
+ FX_BOOL OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag);
+ FX_BOOL IsValidAnnot(void* p);
void GetCurrentMatrix(CPDF_Matrix& matrix) {matrix = m_curMatrix;}
void UpdateRects(CFX_RectArray& rects);
void UpdateView(CPDFSDK_Annot* pAnnot);
@@ -308,11 +308,11 @@ public:
int GetPageIndex();
void LoadFXAnnots();
- void SetValid(bool bValid) {m_bValid = bValid;}
- bool IsValid() {return m_bValid;}
- void SetLock(bool bLocked) {m_bLocked= bLocked;}
- bool IsLocked() {return m_bLocked;}
- void TakeOverPage() {m_bTakeOverPage = true;}
+ void SetValid(FX_BOOL bValid) {m_bValid = bValid;}
+ FX_BOOL IsValid() {return m_bValid;}
+ void SetLock(FX_BOOL bLocked) {m_bLocked= bLocked;}
+ FX_BOOL IsLocked() {return m_bLocked;}
+ void TakeOverPage() {m_bTakeOverPage = TRUE;}
private:
void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, CPDFSDK_Widget* pWidget);
CPDF_Matrix m_curMatrix;
@@ -322,12 +322,12 @@ private:
CFX_PtrArray m_fxAnnotArray;
CPDFSDK_Document* m_pSDKDoc;
CPDFSDK_Widget* m_CaptureWidget;
- bool m_bEnterWidget;
- bool m_bExitWidget;
- bool m_bOnWidget;
- bool m_bValid;
- bool m_bLocked;
- bool m_bTakeOverPage;
+ FX_BOOL m_bEnterWidget;
+ FX_BOOL m_bExitWidget;
+ FX_BOOL m_bOnWidget;
+ FX_BOOL m_bValid;
+ FX_BOOL m_bLocked;
+ FX_BOOL m_bTakeOverPage;
};
@@ -340,14 +340,14 @@ public:
typedef int (*LP_COMPARE)(TYPE p1, TYPE p2);
- void Sort(LP_COMPARE pCompare, bool bAscent = true)
+ void Sort(LP_COMPARE pCompare, FX_BOOL bAscent = TRUE)
{
int nSize = this->GetSize();
QuickSort(0, nSize -1, bAscent, pCompare);
}
private:
- void QuickSort(FX_UINT nStartPos, FX_UINT nStopPos, bool bAscend, LP_COMPARE pCompare)
+ void QuickSort(FX_UINT nStartPos, FX_UINT nStopPos, FX_BOOL bAscend, LP_COMPARE pCompare)
{
if (nStartPos >= nStopPos) return;
diff --git a/fpdfsdk/include/fsdk_rendercontext.h b/fpdfsdk/include/fsdk_rendercontext.h
index 8945d181f9..b2bc163b49 100644
--- a/fpdfsdk/include/fsdk_rendercontext.h
+++ b/fpdfsdk/include/fsdk_rendercontext.h
@@ -34,7 +34,7 @@ class IFSDK_PAUSE_Adapter : public IFX_Pause
{
public:
IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause );
- bool NeedToPauseNow();
+ FX_BOOL NeedToPauseNow();
private:
IFSDK_PAUSE* m_IPause;
diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h
index 30168d48b6..bf59e452ea 100644
--- a/fpdfsdk/include/fx_systemhandler.h
+++ b/fpdfsdk/include/fx_systemhandler.h
@@ -47,10 +47,10 @@ public:
virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0;
virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect&rect) = 0;
- virtual bool IsSelectionImplemented() = 0;
+ virtual FX_BOOL IsSelectionImplemented() = 0;
virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0;
- virtual bool SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0;
+ virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0;
virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) = 0;
virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) = 0;
@@ -66,23 +66,23 @@ public:
virtual void SetCursor(int32_t nCursorType) = 0;
virtual FX_HMENU CreatePopupMenu() = 0;
- virtual bool AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) = 0;
- virtual bool EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, bool bEnabled) = 0;
+ virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) = 0;
+ virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, FX_BOOL bEnabled) = 0;
virtual int32_t TrackPopupMenu(FX_HMENU hMenu, int32_t x, int32_t y, FX_HWND hParent) = 0;
virtual void DestroyMenu(FX_HMENU hMenu) = 0;
virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset) = 0;
- virtual bool FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName) = 0;
+ virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName) = 0;
virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, uint8_t nCharset) = 0;
virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) = 0;
virtual void KillTimer(int32_t nID) = 0;
- virtual bool IsSHIFTKeyDown(FX_DWORD nFlag) = 0;
- virtual bool IsCTRLKeyDown(FX_DWORD nFlag) = 0;
- virtual bool IsALTKeyDown(FX_DWORD nFlag) = 0;
- virtual bool IsINSERTKeyDown(FX_DWORD nFlag) = 0;
+ virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) = 0;
+ virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) = 0;
+ virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) = 0;
+ virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) = 0;
virtual FX_SYSTEMTIME GetLocalTime() = 0;
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h
index 45d2646c19..bf46e91819 100644
--- a/fpdfsdk/include/fxedit/fx_edit.h
+++ b/fpdfsdk/include/fxedit/fx_edit.h
@@ -93,7 +93,7 @@ public:
//set the position of vertical scrollbar.
virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
//set the caret information.
- virtual void IOnSetCaret(bool bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place) = 0;
+ virtual void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place) = 0;
//if the caret position is changed ,send the information of current postion to user.
virtual void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps) = 0;
//if the text area is changed, send the information to user.
@@ -131,25 +131,25 @@ public:
virtual ~IFX_Edit_Iterator() {}
public:
//move the current position to the next word.
- virtual bool NextWord() = 0;
+ virtual FX_BOOL NextWord() = 0;
//move the current position to the next line.
- virtual bool NextLine() = 0;
+ virtual FX_BOOL NextLine() = 0;
//move the current position to the next section.
- virtual bool NextSection() = 0;
+ virtual FX_BOOL NextSection() = 0;
//move the current position to the previous word.
- virtual bool PrevWord() = 0;
+ virtual FX_BOOL PrevWord() = 0;
//move the current position to the previous line.
- virtual bool PrevLine() = 0;
+ virtual FX_BOOL PrevLine() = 0;
//move the current position to the previous section.
- virtual bool PrevSection() = 0;
+ virtual FX_BOOL PrevSection() = 0;
//get the information of the current word.
- virtual bool GetWord(CPVT_Word & word) const = 0;
+ virtual FX_BOOL GetWord(CPVT_Word & word) const = 0;
//get the information of the current line.
- virtual bool GetLine(CPVT_Line & line) const = 0;
+ virtual FX_BOOL GetLine(CPVT_Line & line) const = 0;
//get the information of the current section.
- virtual bool GetSection(CPVT_Section & section) const = 0;
+ virtual FX_BOOL GetSection(CPVT_Section & section) const = 0;
//set the current position.
virtual void SetAt(int32_t nWordIndex) = 0;
//set the current position.
@@ -195,69 +195,69 @@ public:
virtual void Initialize() = 0;
//set the bounding box of the text area.
- virtual void SetPlateRect(const CPDF_Rect & rect, bool bPaint = true) = 0;
+ virtual void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE) = 0;
//set the scroll origin
virtual void SetScrollPos(const CPDF_Point & point) = 0;
//set the horizontal text alignment in text box, nFormat (0:left 1:middle 2:right).
- virtual void SetAlignmentH(int32_t nFormat = 0, bool bPaint = true) = 0;
+ virtual void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
//set the vertical text alignment in text box, nFormat (0:top 1:center 2:bottom).
- virtual void SetAlignmentV(int32_t nFormat = 0, bool bPaint = true) = 0;
+ virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
//if the text is shown in secret , set a character for substitute.
- virtual void SetPasswordChar(FX_WORD wSubWord = '*', bool bPaint = true) = 0;
+ virtual void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) = 0;
//set the maximal count of words of the text.
- virtual void SetLimitChar(int32_t nLimitChar = 0, bool bPaint = true) = 0;
+ virtual void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0;
//if set the count of charArray , then all words is shown in equal space.
- virtual void SetCharArray(int32_t nCharArray = 0, bool bPaint = true) = 0;
+ virtual void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) = 0;
//set the space of two characters.
- virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, bool bPaint = true) = 0;
+ virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) = 0;
//set the horizontal scale of all characters.
- virtual void SetHorzScale(int32_t nHorzScale = 100, bool bPaint = true) = 0;
+ virtual void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0;
//set the leading of all lines
- virtual void SetLineLeading(FX_FLOAT fLineLeading, bool bPaint = true) = 0;
+ virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0;
//if set, CRLF is allowed.
- virtual void SetMultiLine(bool bMultiLine = true, bool bPaint = true) = 0;
+ virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE) = 0;
//if set, all words auto fit the width of the bounding box.
- virtual void SetAutoReturn(bool bAuto = true, bool bPaint = true) = 0;
+ virtual void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
//if set, a font size is calculated to full fit the bounding box.
- virtual void SetAutoFontSize(bool bAuto = true, bool bPaint = true) = 0;
+ virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
//is set, the text is allowed to scroll.
- virtual void SetAutoScroll(bool bAuto = true, bool bPaint = true) = 0;
+ virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
//set the font size of all words.
- virtual void SetFontSize(FX_FLOAT fFontSize, bool bPaint = true) = 0;
+ virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0;
//the text is allowed to auto-scroll, allow the text overflow?
- virtual void SetTextOverflow(bool bAllowed = false, bool bPaint = true) = 0;
+ virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE) = 0;
//query if the edit is richedit.
- virtual bool IsRichText() const = 0;
+ virtual FX_BOOL IsRichText() const = 0;
//set the edit is richedit.
- virtual void SetRichText(bool bRichText = true, bool bPaint = true) = 0;
+ virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0;
//set the fontsize of selected text.
- virtual bool SetRichFontSize(FX_FLOAT fFontSize) = 0;
+ virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0;
//set the fontindex of selected text, user can change the font of selected text.
- virtual bool SetRichFontIndex(int32_t nFontIndex) = 0;
+ virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0;
//set the textcolor of selected text.
- virtual bool SetRichTextColor(FX_COLORREF dwColor) = 0;
+ virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0;
//set the text script type of selected text. (0:normal 1:superscript 2:subscript)
- virtual bool SetRichTextScript(int32_t nScriptType) = 0;
+ virtual FX_BOOL SetRichTextScript(int32_t nScriptType) = 0;
//set the bold font style of selected text.
- virtual bool SetRichTextBold(bool bBold = true) = 0;
+ virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0;
//set the italic font style of selected text.
- virtual bool SetRichTextItalic(bool bItalic = true) = 0;
+ virtual FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0;
//set the underline style of selected text.
- virtual bool SetRichTextUnderline(bool bUnderline = true) = 0;
+ virtual FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0;
//set the crossout style of selected text.
- virtual bool SetRichTextCrossout(bool bCrossout = true) = 0;
+ virtual FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0;
//set the charspace of selected text, in user coordinate.
- virtual bool SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0;
+ virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0;
//set the horizontal scale of selected text, default value is 100.
- virtual bool SetRichTextHorzScale(int32_t nHorzScale = 100) = 0;
+ virtual FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) = 0;
//set the leading of selected section, in user coordinate.
- virtual bool SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0;
+ virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0;
//set the indent of selected section, in user coordinate.
- virtual bool SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0;
+ virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0;
//set the alignment of selected section, nAlignment(0:left 1:middle 2:right)
- virtual bool SetRichTextAlignment(int32_t nAlignment) = 0;
+ virtual FX_BOOL SetRichTextAlignment(int32_t nAlignment) = 0;
//set the selected range of text.
//if nStartChar == 0 and nEndChar == -1, select all the text.
@@ -276,7 +276,7 @@ public:
//get the text conent
virtual CFX_WideString GetText() const = 0;
//query if any text is selected.
- virtual bool IsSelected() const = 0;
+ virtual FX_BOOL IsSelected() const = 0;
//get the scroll origin
virtual CPDF_Point GetScrollPos() const = 0;
//get the bounding box of the text area.
@@ -291,44 +291,44 @@ public:
virtual CPVT_WordRange GetSelectWordRange() const = 0;
//send the mousedown message to edit for response.
- //if Shift key is hold, bShift is true, is Ctrl key is hold, bCtrl is true.
- virtual void OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl) = 0;
- //send the mousemove message to edit when mouse down is true.
- virtual void OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl) = 0;
+ //if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE.
+ virtual void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ //send the mousemove message to edit when mouse down is TRUE.
+ virtual void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
//send the UP key message to edit.
- virtual void OnVK_UP(bool bShift,bool bCtrl) = 0;
+ virtual void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
//send the DOWN key message to edit.
- virtual void OnVK_DOWN(bool bShift,bool bCtrl) = 0;
+ virtual void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
//send the LEFT key message to edit.
- virtual void OnVK_LEFT(bool bShift,bool bCtrl) = 0;
+ virtual void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
//send the RIGHT key message to edit.
- virtual void OnVK_RIGHT(bool bShift,bool bCtrl) = 0;
+ virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
//send the HOME key message to edit.
- virtual void OnVK_HOME(bool bShift,bool bCtrl) = 0;
+ virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
//send the END key message to edit.
- virtual void OnVK_END(bool bShift,bool bCtrl) = 0;
+ virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
//put text into edit.
virtual void SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET,
const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
//insert a word into the edit.
- virtual bool InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0;
+ virtual FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0;
//insert a return into the edit.
- virtual bool InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
+ virtual FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
//insert text into the edit.
- virtual bool InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET,
+ virtual FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET,
const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
//do backspace operation.
- virtual bool Backspace() = 0;
+ virtual FX_BOOL Backspace() = 0;
//do delete operation.
- virtual bool Delete() = 0;
+ virtual FX_BOOL Delete() = 0;
//delete the selected text.
- virtual bool Clear() = 0;
+ virtual FX_BOOL Clear() = 0;
//do Redo operation.
- virtual bool Redo() = 0;
+ virtual FX_BOOL Redo() = 0;
//do Undo operation.
- virtual bool Undo() = 0;
+ virtual FX_BOOL Undo() = 0;
//move caret
virtual void SetCaret(int32_t nPos) = 0;
@@ -336,18 +336,18 @@ public:
virtual void Paint() = 0;
//allow to refresh screen?
- virtual void EnableRefresh(bool bRefresh) = 0;
+ virtual void EnableRefresh(FX_BOOL bRefresh) = 0;
virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0;
//allow undo/redo?
- virtual void EnableUndo(bool bUndo) = 0;
+ virtual void EnableUndo(FX_BOOL bUndo) = 0;
//allow notify?
- virtual void EnableNotify(bool bNotify) = 0;
+ virtual void EnableNotify(FX_BOOL bNotify) = 0;
//allow opr notify?
- virtual void EnableOprNotify(bool bNotify) = 0;
+ virtual void EnableOprNotify(FX_BOOL bNotify) = 0;
//map word place to word index.
virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
@@ -382,11 +382,11 @@ public:
//get the latin words of specified range
virtual CFX_WideString GetRangeText(const CPVT_WordRange & range) const = 0;
//is the text full in bounding box
- virtual bool IsTextFull() const = 0;
- virtual bool CanUndo() const = 0;
- virtual bool CanRedo() const = 0;
+ virtual FX_BOOL IsTextFull() const = 0;
+ virtual FX_BOOL CanUndo() const = 0;
+ virtual FX_BOOL CanRedo() const = 0;
//if the content is changed after settext?
- virtual bool IsModified() const = 0;
+ virtual FX_BOOL IsModified() const = 0;
//get the total words in edit
virtual int32_t GetTotalWords() const = 0;
@@ -394,7 +394,7 @@ public:
static CFX_ByteString GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
const CPVT_WordRange* pRange = NULL,
- bool bContinuous = true, FX_WORD SubWord = 0);
+ FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
static CFX_ByteString GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange* pRange = NULL);
static void DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke,
const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData);
@@ -451,12 +451,12 @@ public:
virtual FX_FLOAT GetFontSize() const = 0;
virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0;
virtual int32_t GetCount() const = 0;
- virtual bool IsItemSelected(int32_t nIndex) const = 0;
+ virtual FX_BOOL IsItemSelected(int32_t nIndex) const = 0;
virtual FX_FLOAT GetFirstHeight() const = 0;
- virtual void SetMultipleSel(bool bMultiple) = 0;
- virtual bool IsMultipleSel() const = 0;
- virtual bool IsValid(int32_t nItemIndex) const = 0;
+ virtual void SetMultipleSel(FX_BOOL bMultiple) = 0;
+ virtual FX_BOOL IsMultipleSel() const = 0;
+ virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0;
virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const = 0;
virtual void SetScrollPos(const CPDF_Point & point) = 0;
@@ -477,16 +477,16 @@ public:
virtual CFX_WideString GetText() const = 0;
- virtual void OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl) = 0;
- virtual void OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl) = 0;
- virtual void OnVK_UP(bool bShift,bool bCtrl) = 0;
- virtual void OnVK_DOWN(bool bShift,bool bCtrl) = 0;
- virtual void OnVK_LEFT(bool bShift,bool bCtrl) = 0;
- virtual void OnVK_RIGHT(bool bShift,bool bCtrl) = 0;
- virtual void OnVK_HOME(bool bShift,bool bCtrl) = 0;
- virtual void OnVK_END(bool bShift,bool bCtrl) = 0;
- virtual void OnVK(int32_t nItemIndex,bool bShift,bool bCtrl) = 0;
- virtual bool OnChar(FX_WORD nChar,bool bShift,bool bCtrl) = 0;
+ virtual void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
protected:
~IFX_List() { }
diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h
index f728d8735e..7a2742f0ee 100644
--- a/fpdfsdk/include/fxedit/fxet_edit.h
+++ b/fpdfsdk/include/fxedit/fxet_edit.h
@@ -68,27 +68,27 @@ struct CFX_Edit_LineRect
{
}
- bool operator != (const CFX_Edit_LineRect & linerect) const
+ FX_BOOL operator != (const CFX_Edit_LineRect & linerect) const
{
return FXSYS_memcmp(this, &linerect, sizeof(CFX_Edit_LineRect)) != 0;
}
- bool IsSameHeight(const CFX_Edit_LineRect & linerect) const
+ FX_BOOL IsSameHeight(const CFX_Edit_LineRect & linerect) const
{
return FX_EDIT_IsFloatZero((m_rcLine.top - m_rcLine.bottom) - (linerect.m_rcLine.top -linerect.m_rcLine.bottom));
}
- bool IsSameTop(const CFX_Edit_LineRect & linerect) const
+ FX_BOOL IsSameTop(const CFX_Edit_LineRect & linerect) const
{
return FX_EDIT_IsFloatZero(m_rcLine.top - linerect.m_rcLine.top);
}
- bool IsSameLeft(const CFX_Edit_LineRect & linerect) const
+ FX_BOOL IsSameLeft(const CFX_Edit_LineRect & linerect) const
{
return FX_EDIT_IsFloatZero(m_rcLine.left - linerect.m_rcLine.left);
}
- bool IsSameRight(const CFX_Edit_LineRect & linerect) const
+ FX_BOOL IsSameRight(const CFX_Edit_LineRect & linerect) const
{
return FX_EDIT_IsFloatZero(m_rcLine.right - linerect.m_rcLine.right);
}
@@ -267,12 +267,12 @@ public:
EndPos = end;
}
- bool IsExist() const
+ FX_BOOL IsExist() const
{
return BeginPos != EndPos;
}
- bool operator != (const CPVT_WordRange & wr) const
+ FX_BOOL operator != (const CPVT_WordRange & wr) const
{
return wr.BeginPos != BeginPos || wr.EndPos != EndPos;
}
@@ -293,10 +293,10 @@ public:
void AddItem(IFX_Edit_UndoItem* pItem);
- bool CanUndo() const;
- bool CanRedo() const;
- bool IsModified() const;
- bool IsWorking() const;
+ FX_BOOL CanUndo() const;
+ FX_BOOL CanRedo() const;
+ FX_BOOL IsModified() const;
+ FX_BOOL IsWorking() const;
void Reset();
@@ -316,26 +316,26 @@ private:
int32_t m_nCurUndoPos;
int32_t m_nBufSize;
- bool m_bModified;
- bool m_bVirgin;
- bool m_bWorking;
+ FX_BOOL m_bModified;
+ FX_BOOL m_bVirgin;
+ FX_BOOL m_bWorking;
};
class CFX_Edit_UndoItem : public IFX_Edit_UndoItem
{
public:
- CFX_Edit_UndoItem() : m_bFirst(true), m_bLast(true) {}
+ CFX_Edit_UndoItem() : m_bFirst(TRUE), m_bLast(TRUE) {}
CFX_WideString GetUndoTitle() override { return L""; }
- void SetFirst(bool bFirst){m_bFirst = bFirst;}
- bool IsFirst(){return m_bFirst;}
- void SetLast(bool bLast){m_bLast = bLast;}
- bool IsLast(){return m_bLast;}
+ void SetFirst(FX_BOOL bFirst){m_bFirst = bFirst;}
+ FX_BOOL IsFirst(){return m_bFirst;}
+ void SetLast(FX_BOOL bLast){m_bLast = bLast;}
+ FX_BOOL IsLast(){return m_bLast;}
private:
- bool m_bFirst;
- bool m_bLast;
+ FX_BOOL m_bFirst;
+ FX_BOOL m_bLast;
};
class CFX_Edit_GroupUndoItem : public IFX_Edit_UndoItem
@@ -424,7 +424,7 @@ class CFXEU_Delete : public CFX_Edit_UndoItem
public:
CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
FX_WORD word, int32_t charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, bool bSecEnd);
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd);
virtual ~CFXEU_Delete();
void Redo();
@@ -439,7 +439,7 @@ private:
int32_t m_nCharset;
CPVT_SecProps m_SecProps;
CPVT_WordProps m_WordProps;
- bool m_bSecEnd;
+ FX_BOOL m_bSecEnd;
};
class CFXEU_Clear : public CFX_Edit_UndoItem
@@ -575,61 +575,61 @@ public:
IFX_Edit_FontMap* GetFontMap();
void Initialize();
- void SetPlateRect(const CPDF_Rect & rect, bool bPaint = true);
+ void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE);
void SetScrollPos(const CPDF_Point & point);
- void SetAlignmentH(int32_t nFormat = 0, bool bPaint = true);
- void SetAlignmentV(int32_t nFormat = 0, bool bPaint = true);
- void SetPasswordChar(FX_WORD wSubWord = '*', bool bPaint = true);
- void SetLimitChar(int32_t nLimitChar = 0, bool bPaint = true);
- void SetCharArray(int32_t nCharArray = 0, bool bPaint = true);
- void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, bool bPaint = true);
- void SetHorzScale(int32_t nHorzScale = 100, bool bPaint = true);
- void SetLineLeading(FX_FLOAT fLineLeading, bool bPaint = true);
- void SetMultiLine(bool bMultiLine = true, bool bPaint = true);
- void SetAutoReturn(bool bAuto = true, bool bPaint = true);
- void SetAutoFontSize(bool bAuto = true, bool bPaint = true);
- void SetAutoScroll(bool bAuto = true, bool bPaint = true);
- void SetFontSize(FX_FLOAT fFontSize, bool bPaint = true);
- void SetTextOverflow(bool bAllowed = false, bool bPaint = true);
-
- bool IsRichText() const;
- void SetRichText(bool bRichText = true, bool bPaint = true);
- bool SetRichFontSize(FX_FLOAT fFontSize);
- bool SetRichFontIndex(int32_t nFontIndex);
- bool SetRichTextColor(FX_COLORREF dwColor);
- bool SetRichTextScript(int32_t nScriptType);
- bool SetRichTextBold(bool bBold = true);
- bool SetRichTextItalic(bool bItalic = true);
- bool SetRichTextUnderline(bool bUnderline = true);
- bool SetRichTextCrossout(bool bCrossout = true);
- bool SetRichTextCharSpace(FX_FLOAT fCharSpace);
- bool SetRichTextHorzScale(int32_t nHorzScale = 100);
- bool SetRichTextLineLeading(FX_FLOAT fLineLeading);
- bool SetRichTextLineIndent(FX_FLOAT fLineIndent);
- bool SetRichTextAlignment(int32_t nAlignment);
-
- void OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl);
- void OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl);
- void OnVK_UP(bool bShift,bool bCtrl);
- void OnVK_DOWN(bool bShift,bool bCtrl);
- void OnVK_LEFT(bool bShift,bool bCtrl);
- void OnVK_RIGHT(bool bShift,bool bCtrl);
- void OnVK_HOME(bool bShift,bool bCtrl);
- void OnVK_END(bool bShift,bool bCtrl);
+ void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE);
+ void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE);
+ void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE);
+ void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE);
+ void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE);
+ void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE);
+ void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE);
+ void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE);
+ void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE);
+ void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
+ void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
+ void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
+ void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE);
+ void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE);
+
+ FX_BOOL IsRichText() const;
+ void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE);
+ FX_BOOL SetRichFontSize(FX_FLOAT fFontSize);
+ FX_BOOL SetRichFontIndex(int32_t nFontIndex);
+ FX_BOOL SetRichTextColor(FX_COLORREF dwColor);
+ FX_BOOL SetRichTextScript(int32_t nScriptType);
+ FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE);
+ FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE);
+ FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE);
+ FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE);
+ FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace);
+ FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100);
+ FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading);
+ FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent);
+ FX_BOOL SetRichTextAlignment(int32_t nAlignment);
+
+ void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl);
void SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET,
const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
- bool InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL);
- bool InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
- bool Backspace();
- bool Delete();
- bool Clear();
- bool Empty();
- bool InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET,
+ FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL);
+ FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
+ FX_BOOL Backspace();
+ FX_BOOL Delete();
+ FX_BOOL Clear();
+ FX_BOOL Empty();
+ FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET,
const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
- bool Redo();
- bool Undo();
+ FX_BOOL Redo();
+ FX_BOOL Undo();
CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, const FX_WCHAR* text, int32_t charset,
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
int32_t GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset);
@@ -666,7 +666,7 @@ private:
void SelectAll();
void SelectNone();
void SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end);
- bool IsSelected() const;
+ FX_BOOL IsSelected() const;
void RearrangeAll();
void RearrangePart(const CPVT_WordRange & range);
@@ -677,23 +677,23 @@ private:
void SetScrollPosY(FX_FLOAT fy);
void SetScrollLimit();
void SetContentChanged();
- void EnableNotify(bool bNotify);
+ void EnableNotify(FX_BOOL bNotify);
void SetText(const FX_WCHAR* text,int32_t charset,
- const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,bool bAddUndo, bool bPaint);
- bool InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps,bool bAddUndo, bool bPaint);
- bool InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,bool bAddUndo, bool bPaint);
- bool Backspace(bool bAddUndo, bool bPaint);
- bool Delete(bool bAddUndo, bool bPaint);
- bool Clear(bool bAddUndo, bool bPaint);
- bool InsertText(const FX_WCHAR* text, int32_t charset,
- const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,bool bAddUndo, bool bPaint);
- bool SetRichTextProps(EDIT_PROPS_E eProps,
+ const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL Delete(FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL Clear(FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset,
+ const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL SetRichTextProps(EDIT_PROPS_E eProps,
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
- bool SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, bool bAddUndo);
- bool SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
- const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, bool bAddUndo);
+ FX_BOOL SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo);
+ FX_BOOL SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+ const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo);
void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr);
void PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew);
@@ -702,7 +702,7 @@ private:
inline CPDF_Rect VTToEdit(const CPDF_Rect & rect) const;
inline CPDF_Rect EditToVT(const CPDF_Rect & rect) const;
- void EnableRefresh(bool bRefresh);
+ void EnableRefresh(FX_BOOL bRefresh);
void Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1 = NULL,const CPVT_WordRange * pRange2 = NULL);
void RefreshPushLineRects(const CPVT_WordRange & wr);
void RefreshPushRandomRects(const CPVT_WordRange & wr);
@@ -720,14 +720,14 @@ private:
CPVT_WordRange CombineWordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2);
CPVT_WordRange GetSelectWordRange() const;
- void EnableUndo(bool bUndo);
- void EnableOprNotify(bool bNotify);
+ void EnableUndo(FX_BOOL bUndo);
+ void EnableOprNotify(FX_BOOL bNotify);
- bool IsTextFull() const;
- bool IsTextOverflow() const;
- bool CanUndo() const;
- bool CanRedo() const;
- bool IsModified() const;
+ FX_BOOL IsTextFull() const;
+ FX_BOOL IsTextOverflow() const;
+ FX_BOOL CanUndo() const;
+ FX_BOOL CanRedo() const;
+ FX_BOOL IsModified() const;
void BeginGroupUndo(const CFX_WideString& sTitle);
void EndGroupUndo();
@@ -751,19 +751,19 @@ private:
CPDF_Point m_ptScrollPos;
CPDF_Point m_ptRefreshScrollPos;
- bool m_bEnableScroll;
+ FX_BOOL m_bEnableScroll;
IFX_Edit_Iterator * m_pIterator;
CFX_Edit_Refresh m_Refresh;
CPDF_Point m_ptCaret;
CFX_Edit_Undo m_Undo;
int32_t m_nAlignment;
- bool m_bNotifyFlag;
- bool m_bEnableOverflow;
- bool m_bEnableRefresh;
+ FX_BOOL m_bNotifyFlag;
+ FX_BOOL m_bEnableOverflow;
+ FX_BOOL m_bEnableRefresh;
CPDF_Rect m_rcOldContent;
- bool m_bEnableUndo;
- bool m_bNotify;
- bool m_bOprNotify;
+ FX_BOOL m_bEnableUndo;
+ FX_BOOL m_bNotify;
+ FX_BOOL m_bOprNotify;
CFX_Edit_GroupUndoItem* m_pGroupUndoItem;
};
@@ -775,16 +775,16 @@ public:
CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTIterator);
virtual ~CFX_Edit_Iterator();
- bool NextWord();
- bool NextLine();
- bool NextSection();
- bool PrevWord();
- bool PrevLine();
- bool PrevSection();
+ FX_BOOL NextWord();
+ FX_BOOL NextLine();
+ FX_BOOL NextSection();
+ FX_BOOL PrevWord();
+ FX_BOOL PrevLine();
+ FX_BOOL PrevSection();
- bool GetWord(CPVT_Word & word) const;
- bool GetLine(CPVT_Line & line) const;
- bool GetSection(CPVT_Section & section) const;
+ FX_BOOL GetWord(CPVT_Word & word) const;
+ FX_BOOL GetLine(CPVT_Line & line) const;
+ FX_BOOL GetSection(CPVT_Section & section) const;
void SetAt(int32_t nWordIndex);
void SetAt(const CPVT_WordPlace & place);
const CPVT_WordPlace & GetAt() const;
@@ -808,7 +808,7 @@ public:
int32_t GetTypeDescent(int32_t nFontIndex);
int32_t GetWordFontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex);
int32_t GetDefaultFontIndex();
- bool IsLatinWord(FX_WORD word);
+ FX_BOOL IsLatinWord(FX_WORD word);
private:
IFX_Edit_FontMap* m_pFontMap;
diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h
index 07edb46887..fe75b0fc35 100644
--- a/fpdfsdk/include/fxedit/fxet_list.h
+++ b/fpdfsdk/include/fxedit/fxet_list.h
@@ -31,7 +31,7 @@ public:
y = 0.0f;
}
- bool operator != (const CLST_Size & size) const
+ FX_BOOL operator != (const CLST_Size & size) const
{
return FXSYS_memcmp(this, &size, sizeof(CLST_Size)) != 0;
}
@@ -81,12 +81,12 @@ public:
return *this;
}
- bool operator == (const CLST_Rect & rect) const
+ FX_BOOL operator == (const CLST_Rect & rect) const
{
return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) == 0;
}
- bool operator != (const CLST_Rect & rect) const
+ FX_BOOL operator != (const CLST_Rect & rect) const
{
return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) != 0;
}
@@ -162,22 +162,22 @@ public:
public:
void SetRect(const CLST_Rect & rect);
- void SetSelect(bool bSelected);
- void SetCaret(bool bCaret);
+ void SetSelect(FX_BOOL bSelected);
+ void SetCaret(FX_BOOL bCaret);
void SetText(const FX_WCHAR* text);
void SetFontSize(FX_FLOAT fFontSize);
CFX_WideString GetText() const;
CLST_Rect GetRect() const;
- bool IsSelected() const;
- bool IsCaret() const;
+ FX_BOOL IsSelected() const;
+ FX_BOOL IsCaret() const;
FX_FLOAT GetItemHeight() const;
FX_WORD GetFirstChar() const;
private:
IFX_Edit* m_pEdit;
- bool m_bSelected;
- bool m_bCaret;
+ FX_BOOL m_bSelected;
+ FX_BOOL m_bCaret;
CLST_Rect m_rcListItem;
};
@@ -209,7 +209,7 @@ private:
template<class TYPE> class CLST_ArrayTemplate : public CFX_ArrayTemplate<TYPE>
{
public:
- bool IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; }
+ FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; }
TYPE GetAt(int32_t nIndex) const { if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); return NULL;}
void RemoveAt(int32_t nIndex){if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);}
};
@@ -230,12 +230,12 @@ public:
virtual FX_FLOAT GetFontSize() const;
virtual IFX_Edit* GetItemEdit(int32_t nIndex) const;
virtual int32_t GetCount() const;
- virtual bool IsItemSelected(int32_t nIndex) const;
+ virtual FX_BOOL IsItemSelected(int32_t nIndex) const;
virtual FX_FLOAT GetFirstHeight() const;
- virtual void SetMultipleSel(bool bMultiple);
- virtual bool IsMultipleSel() const;
- virtual bool IsValid(int32_t nItemIndex) const;
+ virtual void SetMultipleSel(FX_BOOL bMultiple);
+ virtual FX_BOOL IsMultipleSel() const;
+ virtual FX_BOOL IsValid(int32_t nItemIndex) const;
virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const;
protected:
@@ -247,8 +247,8 @@ protected:
virtual CPDF_Rect GetItemRect(int32_t nIndex) const;
CFX_WideString GetItemText(int32_t nIndex) const;
- void SetItemSelect(int32_t nItemIndex, bool bSelected);
- void SetItemCaret(int32_t nItemIndex, bool bCaret);
+ void SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected);
+ void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret);
virtual int32_t GetItemIndex(const CPDF_Point & point) const;
int32_t GetFirstSelected() const;
@@ -259,7 +259,7 @@ private:
CLST_ArrayTemplate<CFX_ListItem*> m_aListItems;
FX_FLOAT m_fFontSize;
IFX_Edit_FontMap* m_pFontMap;
- bool m_bMultiple;
+ FX_BOOL m_bMultiple;
};
struct CPLST_Select_Item
@@ -285,7 +285,7 @@ public:
void Add(int32_t nBeginIndex, int32_t nEndIndex);
void Sub(int32_t nItemIndex);
void Sub(int32_t nBeginIndex, int32_t nEndIndex);
- bool IsExist(int32_t nItemIndex) const;
+ FX_BOOL IsExist(int32_t nItemIndex) const;
int32_t Find(int32_t nItemIndex) const;
int32_t GetCount() const;
int32_t GetItemIndex(int32_t nIndex) const;
@@ -306,16 +306,16 @@ public:
public:
void SetNotify(IFX_List_Notify * pNotify);
- void OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl);
- void OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl);
- void OnVK_UP(bool bShift,bool bCtrl);
- void OnVK_DOWN(bool bShift,bool bCtrl);
- void OnVK_LEFT(bool bShift,bool bCtrl);
- void OnVK_RIGHT(bool bShift,bool bCtrl);
- void OnVK_HOME(bool bShift,bool bCtrl);
- void OnVK_END(bool bShift,bool bCtrl);
- void OnVK(int32_t nItemIndex,bool bShift,bool bCtrl);
- bool OnChar(FX_WORD nChar,bool bShift,bool bCtrl);
+ void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl);
+ FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl);
virtual CPDF_Point InToOut(const CPDF_Point & point) const;
virtual CPDF_Point OutToIn(const CPDF_Point & point) const;
@@ -341,23 +341,23 @@ public:
CFX_WideString GetText() const;
private:
- void SetMultipleSelect(int32_t nItemIndex, bool bSelected);
+ void SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected);
void SetSingleSelect(int32_t nItemIndex);
void InvalidateItem(int32_t nItemIndex);
void SelectItems();
- bool IsItemVisible(int32_t nItemIndex) const;
+ FX_BOOL IsItemVisible(int32_t nItemIndex) const;
void SetScrollInfo();
void SetScrollPosY(FX_FLOAT fy);
virtual void ReArrange(int32_t nItemIndex);
private:
IFX_List_Notify* m_pNotify;
- bool m_bNotifyFlag;
+ FX_BOOL m_bNotifyFlag;
CPDF_Point m_ptScrollPos;
CPLST_Select m_aSelItems; //for multiple
int32_t m_nSelItem; //for single
int32_t m_nFootIndex; //for multiple
- bool m_bCtrlSel; //for multiple
+ FX_BOOL m_bCtrlSel; //for multiple
int32_t m_nCaretIndex; //for multiple
};
diff --git a/fpdfsdk/include/javascript/Document.h b/fpdfsdk/include/javascript/Document.h
index eae3e0730d..b6447fda2a 100644
--- a/fpdfsdk/include/javascript/Document.h
+++ b/fpdfsdk/include/javascript/Document.h
@@ -16,14 +16,14 @@ public:
virtual ~PrintParamsObj(){}
public:
- bool bUI;
+ FX_BOOL bUI;
int nStart;
int nEnd;
- bool bSilent;
- bool bShrinkToFit;
- bool bPrintAsImage;
- bool bReverse;
- bool bAnnotations;
+ FX_BOOL bSilent;
+ FX_BOOL bShrinkToFit;
+ FX_BOOL bPrintAsImage;
+ FX_BOOL bReverse;
+ FX_BOOL bAnnotations;
};
class CJS_PrintParamsObj : public CJS_Object
@@ -85,84 +85,84 @@ public:
virtual ~Document();
public:
- bool ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
public:
void AttachDoc(CPDFSDK_Document* pDoc);
CPDFSDK_Document* GetReaderDoc();
- static bool ExtractFileName(CPDFSDK_Document* pDoc, CFX_ByteString& strFileName);
- static bool ExtractFolderName(CPDFSDK_Document* pDoc, CFX_ByteString& strFolderName);
+ static FX_BOOL ExtractFileName(CPDFSDK_Document* pDoc, CFX_ByteString& strFileName);
+ static FX_BOOL ExtractFolderName(CPDFSDK_Document* pDoc, CFX_ByteString& strFolderName);
void AddDelayData(CJS_DelayData* pData);
void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex);
void AddDelayAnnotData(CJS_AnnotObj *pData);
@@ -176,7 +176,7 @@ private:
bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
int CountWords(CPDF_TextObject* pTextObj);
CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
- bool ParserParams(JSObject *pObj,CJS_AnnotObj& annotobj);
+ FX_BOOL ParserParams(JSObject *pObj,CJS_AnnotObj& annotobj);
v8::Isolate* m_isolate;
IconTree* m_pIconTree;
@@ -193,7 +193,7 @@ public:
CJS_Document(JSFXObject pObject) : CJS_Object(pObject) {};
virtual ~CJS_Document(){};
- virtual bool InitInstance(IFXJS_Context* cc);
+ virtual FX_BOOL InitInstance(IFXJS_Context* cc);
DECLARE_JS_CLASS(CJS_Document);
diff --git a/fpdfsdk/include/javascript/Field.h b/fpdfsdk/include/javascript/Field.h
index 2a6ba7d1ce..70d1d39b48 100644
--- a/fpdfsdk/include/javascript/Field.h
+++ b/fpdfsdk/include/javascript/Field.h
@@ -103,85 +103,85 @@ public:
Field(CJS_Object* pJSObject);
virtual ~Field(void);
- bool alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
public:
static void SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
@@ -225,9 +225,9 @@ public:
const CFX_WideString& sName, const CPDF_Rect& rcCoords);
public:
static void UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
- bool bChangeMark, bool bResetAP, bool bRefresh);
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh);
static void UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
- bool bChangeMark, bool bResetAP, bool bRefresh);
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh);
static CPDFSDK_Widget* GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl);
static void GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldsArray);
@@ -235,14 +235,14 @@ public:
static void DoDelay(CPDFSDK_Document* pDocument, CJS_DelayData* pData);
public:
- bool AttachField(Document* pDocument, const CFX_WideString& csFieldName);
- void SetDelay(bool bDelay);
+ FX_BOOL AttachField(Document* pDocument, const CFX_WideString& csFieldName);
+ void SetDelay(FX_BOOL bDelay);
void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;}
protected:
void ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &strFieldName,int & iControlNo);
void GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& FieldsArray);
CPDF_FormControl* GetSmartFieldControl(CPDF_FormField* pFormField);
- bool ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel);
+ FX_BOOL ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel);
void AddDelay_Int(enum FIELD_PROP prop, int32_t n);
void AddDelay_Bool(enum FIELD_PROP prop,bool b);
@@ -259,9 +259,9 @@ public:
CPDFSDK_Document* m_pDocument;
CFX_WideString m_FieldName;
int m_nFormControlIndex;
- bool m_bCanSet;
+ FX_BOOL m_bCanSet;
- bool m_bDelay;
+ FX_BOOL m_bDelay;
v8::Isolate* m_isolate;
};
@@ -271,7 +271,7 @@ public:
CJS_Field(JSFXObject pObject) : CJS_Object(pObject) {};
virtual ~CJS_Field(void){};
- virtual bool InitInstance(IFXJS_Context* cc);
+ virtual FX_BOOL InitInstance(IFXJS_Context* cc);
DECLARE_JS_CLASS(CJS_Field);
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index 37e12dccf8..783b249ff6 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -19,8 +19,8 @@ class IFXJS_Context
{
public:
virtual ~IFXJS_Context() { }
- virtual bool Compile(const CFX_WideString& script, CFX_WideString& info) = 0;
- virtual bool RunScript(const CFX_WideString& script, CFX_WideString& info) = 0;
+ virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info) = 0;
+ virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info) = 0;
virtual void OnApp_Init() = 0;
@@ -36,32 +36,32 @@ public:
virtual void OnPage_InView(CPDFSDK_Document* pTarget) = 0;
virtual void OnPage_OutView(CPDFSDK_Document* pTarget) = 0;
- virtual void OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField* pTarget) = 0;
- virtual void OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField* pTarget) = 0;
- virtual void OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField* pTarget) = 0;
- virtual void OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField* pTarget) = 0;
- virtual void OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0;
- virtual void OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0;
+ virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
+ virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
+ virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
+ virtual void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
+ virtual void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0;
+ virtual void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0;
- virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc) = 0;
- virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit) = 0;
+ virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0;
+ virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit) = 0;
virtual void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- bool KeyDown, bool bModifier, int &nSelEnd,int &nSelStart, bool bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit,
- bool bFieldFull, bool &bRc) = 0;
- virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, bool bKeyDown,
- bool bModifier, bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc) = 0;
-
- virtual void OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen) = 0;
+ FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
+ FX_BOOL bFieldFull, FX_BOOL &bRc) = 0;
+ virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
+ FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0;
+
+ virtual void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
virtual void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark) = 0;
virtual void OnLink_MouseUp(CPDFSDK_Document* pTarget) = 0;
@@ -71,7 +71,7 @@ public:
virtual void OnConsole_Exec() = 0;
virtual void OnExternal_Exec() = 0;
- virtual void EnableMessageBox(bool bEnable) = 0;
+ virtual void EnableMessageBox(FX_BOOL bEnable) = 0;
};
class IFXJS_Runtime
@@ -94,7 +94,7 @@ class CJS_GlobalData;
class CJS_RuntimeFactory
{
public:
- CJS_RuntimeFactory():m_bInit(false),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {}
+ CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {}
~CJS_RuntimeFactory();
IFXJS_Runtime* NewJSRuntime(CPDFDoc_Environment* pApp);
void DeleteJSRuntime(IFXJS_Runtime* pRuntime);
@@ -104,7 +104,7 @@ public:
CJS_GlobalData* NewGlobalData(CPDFDoc_Environment* pApp);
void ReleaseGlobalData();
private:
- bool m_bInit;
+ FX_BOOL m_bInit;
int m_nRef;
CJS_GlobalData* m_pGlobalData;
int32_t m_nGlobalDataCount;
diff --git a/fpdfsdk/include/javascript/Icon.h b/fpdfsdk/include/javascript/Icon.h
index 367db7bc49..0298005f00 100644
--- a/fpdfsdk/include/javascript/Icon.h
+++ b/fpdfsdk/include/javascript/Icon.h
@@ -14,7 +14,7 @@ class Icon : public CJS_EmbedObj
public:
Icon(CJS_Object* pJSObject);
virtual ~Icon();
- bool name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
void SetStream(CPDF_Stream* pIconStream);
CPDF_Stream* GetStream();
void SetIconName(CFX_WideString name);
diff --git a/fpdfsdk/include/javascript/JS_Context.h b/fpdfsdk/include/javascript/JS_Context.h
index 79d01a02f8..2e2cf37a5e 100644
--- a/fpdfsdk/include/javascript/JS_Context.h
+++ b/fpdfsdk/include/javascript/JS_Context.h
@@ -21,8 +21,8 @@ public:
virtual ~CJS_Context();
public:
- virtual bool Compile(const CFX_WideString& script, CFX_WideString& info);
- virtual bool RunScript(const CFX_WideString& script, CFX_WideString& info);
+ virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info);
+ virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info);
public:
virtual void OnApp_Init();
@@ -39,32 +39,32 @@ public:
virtual void OnPage_InView(CPDFSDK_Document* pTarget);
virtual void OnPage_OutView(CPDFSDK_Document* pTarget);
- virtual void OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField *pTarget);
- virtual void OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget);
- virtual void OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget);
- virtual void OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget);
- virtual void OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
- virtual void OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
+ virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ virtual void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ virtual void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
+ virtual void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
- virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc);
- virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit);
+ virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
+ virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit);
virtual void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- bool bKeyDown, bool bModifier, int &nSelEnd,int &nSelStart, bool bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit,
- bool bFieldFull, bool &bRc);
- virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, bool bKeyDown,
- bool bModifier, bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc);
-
- virtual void OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
+ FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
+ FX_BOOL bFieldFull, FX_BOOL &bRc);
+ virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
+ FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
+
+ virtual void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
virtual void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark);
virtual void OnLink_MouseUp(CPDFSDK_Document* pTarget);
@@ -74,14 +74,14 @@ public:
virtual void OnConsole_Exec();
virtual void OnExternal_Exec();
- virtual void EnableMessageBox(bool bEnable) {m_bMsgBoxEnable = bEnable;}
- bool IsMsgBoxEnabled() const {return m_bMsgBoxEnable;}
+ virtual void EnableMessageBox(FX_BOOL bEnable) {m_bMsgBoxEnable = bEnable;}
+ FX_BOOL IsMsgBoxEnabled() const {return m_bMsgBoxEnable;}
public:
CPDFDoc_Environment* GetReaderApp();
CJS_Runtime* GetJSRuntime(){return m_pRuntime;}
- bool DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info);
+ FX_BOOL DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info);
CJS_EventHandler* GetEventHandler(){return m_pEventHandler;};
CPDFSDK_Document* GetReaderDocument();
@@ -90,8 +90,8 @@ private:
CJS_Runtime* m_pRuntime;
CJS_EventHandler* m_pEventHandler;
- bool m_bBusy;
- bool m_bMsgBoxEnable;
+ FX_BOOL m_bBusy;
+ FX_BOOL m_bMsgBoxEnable;
};
#endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_CONTEXT_H_
diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h
index 087f489126..f1b36bf3d0 100644
--- a/fpdfsdk/include/javascript/JS_Define.h
+++ b/fpdfsdk/include/javascript/JS_Define.h
@@ -51,7 +51,7 @@ struct JSMethodSpec
/* ======================================== PROP CALLBACK ============================================ */
-template <class C, bool (C::*M)(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)>
+template <class C, FX_BOOL (C::*M)(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)>
void JSPropGetter(const char* prop_name_string,
const char* class_name_string,
v8::Local<v8::String> property,
@@ -74,7 +74,7 @@ void JSPropGetter(const char* prop_name_string,
info.GetReturnValue().Set((v8::Local<v8::Value>)value);
}
-template <class C, bool (C::*M)(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)>
+template <class C, FX_BOOL (C::*M)(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)>
void JSPropSetter(const char* prop_name_string,
const char* class_name_string,
v8::Local<v8::String> property,
@@ -113,7 +113,7 @@ void JSPropSetter(const char* prop_name_string,
/* ========================================= METHOD CALLBACK =========================================== */
-template <class C, bool (C::*M)(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)>
+template <class C, FX_BOOL (C::*M)(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)>
void JSMethod(const char* method_name_string,
const char* class_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) {
@@ -240,7 +240,7 @@ void JSSpecialPropQuery(const char *, v8::Local<v8::String> property,const v8::P
CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());
CJS_Object* pJSObj = reinterpret_cast<CJS_Object*>(JS_GetPrivate(isolate, info.Holder()));
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- bool bRet = pObj->QueryProperty(propname.c_str());
+ FX_BOOL bRet = pObj->QueryProperty(propname.c_str());
info.GetReturnValue().Set(bRet ? 4 : 0);
}
@@ -382,7 +382,7 @@ int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
/* ======================================== GLOBAL METHODS ============================================ */
-template <bool (*F)(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)>
+template <FX_BOOL (*F)(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)>
void JSGlobalFunc(const char *func_name_string,
const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Isolate* isolate = info.GetIsolate();
diff --git a/fpdfsdk/include/javascript/JS_EventHandler.h b/fpdfsdk/include/javascript/JS_EventHandler.h
index 9977462094..62afb829e7 100644
--- a/fpdfsdk/include/javascript/JS_EventHandler.h
+++ b/fpdfsdk/include/javascript/JS_EventHandler.h
@@ -79,32 +79,32 @@ public:
void OnPage_InView(CPDFSDK_Document* pTarget);
void OnPage_OutView(CPDFSDK_Document* pTarget);
- void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc);
- void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit);
+ void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
+ void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit);
void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- bool KeyDown, bool bModifier, int &nSelEnd,int &nSelStart, bool bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit,
- bool bFieldFull, bool &bRc);
- void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, bool bKeyDown,
- bool bModifier, bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc);
-
- void OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField *pTarget);
- void OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget);
- void OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget);
- void OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget);
- void OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
- void OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
-
- void OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen);
+ FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
+ FX_BOOL bFieldFull, FX_BOOL &bRc);
+ void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
+ FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
+
+ void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
+ void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
+
+ void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark);
void OnLink_MouseUp(CPDFSDK_Document* pTarget);
@@ -117,25 +117,25 @@ public:
public:
void Initial(JS_EVENT_T type);
void Destroy();
- bool IsValid();
+ FX_BOOL IsValid();
CFX_WideString& Change();
CFX_WideString ChangeEx();
int CommitKey();
- bool FieldFull();
- bool KeyDown();
- bool Modifier();
+ FX_BOOL FieldFull();
+ FX_BOOL KeyDown();
+ FX_BOOL Modifier();
const FX_WCHAR* Name();
const FX_WCHAR* Type();
- bool& Rc();
+ FX_BOOL& Rc();
int& SelEnd();
int& SelStart();
- bool Shift();
+ FX_BOOL Shift();
Field* Source();
Field* Target_Field();
CFX_WideString& Value();
- bool WillCommit();
+ FX_BOOL WillCommit();
CFX_WideString TargetName();
JS_EVENT_T EventType() {return m_eEventType;};
@@ -143,7 +143,7 @@ public:
public:
CJS_Context* m_pJSContext;
JS_EVENT_T m_eEventType;
- bool m_bValid;
+ FX_BOOL m_bValid;
CFX_WideString m_strTargetName;
CFX_WideString m_strSourceName;
@@ -151,18 +151,18 @@ public:
CFX_WideString m_WideStrChangeDu;
CFX_WideString m_WideStrChangeEx;
int m_nCommitKey;
- bool m_bKeyDown;
- bool m_bModifier;
- bool m_bShift;
+ FX_BOOL m_bKeyDown;
+ FX_BOOL m_bModifier;
+ FX_BOOL m_bShift;
int* m_pISelEnd;
int m_nSelEndDu;
int* m_pISelStart;
int m_nSelStartDu;
- bool m_bWillCommit;
+ FX_BOOL m_bWillCommit;
CFX_WideString* m_pValue;
- bool m_bFieldFull;
- bool* m_pbRc;
- bool m_bRcDu;
+ FX_BOOL m_bFieldFull;
+ FX_BOOL* m_pbRc;
+ FX_BOOL m_bRcDu;
CPDFSDK_Document* m_pSourceDoc;
CPDF_Bookmark* m_pTargetBookMark;
diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h
index 987de95666..b3637b93d5 100644
--- a/fpdfsdk/include/javascript/JS_GlobalData.h
+++ b/fpdfsdk/include/javascript/JS_GlobalData.h
@@ -56,7 +56,7 @@ public:
virtual ~CJS_GlobalData_Element(){}
CJS_KeyValue data;
- bool bPersistent;
+ FX_BOOL bPersistent;
};
class CJS_GlobalData
@@ -72,8 +72,8 @@ public:
void SetGlobalVariableObject(const FX_CHAR* propname, const CJS_GlobalVariableArray& array);
void SetGlobalVariableNull(const FX_CHAR* propname);
- bool SetGlobalVariablePersistent(const FX_CHAR* propname, bool bPersistent);
- bool DeleteGlobalVariable(const FX_CHAR* propname);
+ FX_BOOL SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent);
+ FX_BOOL DeleteGlobalVariable(const FX_CHAR* propname);
int32_t GetSize() const;
CJS_GlobalData_Element* GetAt(int index) const;
diff --git a/fpdfsdk/include/javascript/JS_Object.h b/fpdfsdk/include/javascript/JS_Object.h
index f8ec90e3c4..3898d184d1 100644
--- a/fpdfsdk/include/javascript/JS_Object.h
+++ b/fpdfsdk/include/javascript/JS_Object.h
@@ -48,11 +48,11 @@ public:
void MakeWeak();
void Dispose();
- virtual bool IsType(const FX_CHAR* sClassName){return true;};
+ virtual FX_BOOL IsType(const FX_CHAR* sClassName){return TRUE;};
virtual CFX_ByteString GetClassName(){return "";};
- virtual bool InitInstance(IFXJS_Context* cc){return true;};
- virtual bool ExitInstance(){return true;};
+ virtual FX_BOOL InitInstance(IFXJS_Context* cc){return TRUE;};
+ virtual FX_BOOL ExitInstance(){return TRUE;};
operator JSFXObject () {return v8::Local<v8::Object>::New(m_pIsolate, m_pObject);}
operator CJS_EmbedObj* (){return m_pEmbedObj;};
@@ -172,7 +172,7 @@ public:
CJS_Timer(CJS_EmbedObj * pObj,CPDFDoc_Environment* pApp):
m_nTimerID(0),
m_pEmbedObj(pObj),
- m_bProcessing(false),
+ m_bProcessing(FALSE),
m_dwStartTime(0),
m_dwTimeOut(0),
m_dwElapse(0),
@@ -265,9 +265,9 @@ public:
{
if (!pTimer->m_bProcessing)
{
- pTimer->m_bProcessing = true;
+ pTimer->m_bProcessing = TRUE;
if (pTimer->m_pEmbedObj) pTimer->m_pEmbedObj->TimerProc(pTimer);
- pTimer->m_bProcessing = false;
+ pTimer->m_bProcessing = FALSE;
}
else
{
@@ -279,7 +279,7 @@ public:
private:
FX_UINT m_nTimerID;
CJS_EmbedObj* m_pEmbedObj;
- bool m_bProcessing;
+ FX_BOOL m_bProcessing;
//data
FX_DWORD m_dwStartTime;
diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h
index b9ad6efc47..8fdfa8b733 100644
--- a/fpdfsdk/include/javascript/JS_Runtime.h
+++ b/fpdfsdk/include/javascript/JS_Runtime.h
@@ -44,15 +44,15 @@ public:
CPDFDoc_Environment * GetReaderApp(){return m_pApp;}
- bool InitJSObjects();
+ FX_BOOL InitJSObjects();
- bool AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
+ FX_BOOL AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
void RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
void RemoveEventsInLoop(CJS_FieldEvent* pStart);
- void BeginBlock(){m_bBlocking = true;}
- void EndBlock(){m_bBlocking = false;}
- bool IsBlocking(){return m_bBlocking;}
+ void BeginBlock(){m_bBlocking = TRUE;}
+ void EndBlock(){m_bBlocking = FALSE;}
+ FX_BOOL IsBlocking(){return m_bBlocking;}
operator IJS_Runtime*() {return (IJS_Runtime*)m_isolate;}
v8::Isolate* GetIsolate(){return m_isolate;};
@@ -63,7 +63,7 @@ protected:
CFX_ArrayTemplate<CJS_Context*> m_ContextArray;
CPDFDoc_Environment* m_pApp;
CPDFSDK_Document* m_pDocument;
- bool m_bBlocking;
+ FX_BOOL m_bBlocking;
CJS_FieldEvent* m_pFieldEventPath;
v8::Isolate* m_isolate;
diff --git a/fpdfsdk/include/javascript/JS_Value.h b/fpdfsdk/include/javascript/JS_Value.h
index 035cef064d..6186817fa5 100644
--- a/fpdfsdk/include/javascript/JS_Value.h
+++ b/fpdfsdk/include/javascript/JS_Value.h
@@ -63,12 +63,12 @@ public:
void operator = (const FX_CHAR* pStr);
void operator = (CJS_Value value);
- bool IsArrayObject() const;
- bool IsDateObject() const;
+ FX_BOOL IsArrayObject() const;
+ FX_BOOL IsDateObject() const;
FXJSVALUETYPE GetType() const;
- bool ConvertToArray(CJS_Array &) const;
- bool ConvertToDate(CJS_Date &) const;
+ FX_BOOL ConvertToArray(CJS_Array &) const;
+ FX_BOOL ConvertToDate(CJS_Date &) const;
v8::Isolate* GetIsolate() {return m_isolate;}
protected:
@@ -95,8 +95,8 @@ public:
CJS_PropValue(v8::Isolate* isolate);
~CJS_PropValue();
public:
- bool IsSetting();
- bool IsGetting();
+ FX_BOOL IsSetting();
+ FX_BOOL IsGetting();
void operator<<(int);
void operator>>(int&) const;
void operator<<(bool);
@@ -122,7 +122,7 @@ public:
void StartSetting();
void StartGetting();
private:
- bool m_bIsSetting;
+ FX_BOOL m_bIsSetting;
};
class CJS_Array
@@ -135,7 +135,7 @@ public:
void GetElement(unsigned index,CJS_Value &value);
void SetElement(unsigned index,CJS_Value value);
int GetLength();
- bool IsAttached();
+ FX_BOOL IsAttached();
operator v8::Local<v8::Array>();
v8::Isolate* GetIsolate() {return m_isolate;}
@@ -179,7 +179,7 @@ public:
static double MakeDate(int year, int mon, int mday,int hour, int min, int sec,int ms);
- bool IsValidDate();
+ FX_BOOL IsValidDate();
protected:
v8::Local<v8::Value> m_pDate;
diff --git a/fpdfsdk/include/javascript/PublicMethods.h b/fpdfsdk/include/javascript/PublicMethods.h
index 7fca363a11..cff9e11479 100644
--- a/fpdfsdk/include/javascript/PublicMethods.h
+++ b/fpdfsdk/include/javascript/PublicMethods.h
@@ -16,28 +16,28 @@ public:
virtual ~CJS_PublicMethods(void){};
public:
- static bool AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); //
- static bool AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);//
- static bool AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- static bool AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); //
+ static FX_BOOL AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);//
+ static FX_BOOL AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ static FX_BOOL AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
public:
JS_STATIC_GLOBAL_FUN(AFNumber_Format);
@@ -68,13 +68,13 @@ public:
public:
static int ParseStringInteger(const CFX_WideString & string,int nStart,int & nSkip, int nMaxStep);
static CFX_WideString ParseStringString(const CFX_WideString& string, int nStart, int& nSkip);
- static double MakeRegularDate(const CFX_WideString & value,const CFX_WideString & format, bool& bWrongFormat);
+ static double MakeRegularDate(const CFX_WideString & value,const CFX_WideString & format, FX_BOOL& bWrongFormat);
static CFX_WideString MakeFormatDate(double dDate,const CFX_WideString & format);
- static bool ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, bool & bDot);
+ static FX_BOOL ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot);
static double ParseStringToNumber(const FX_WCHAR* swSource);
- static double ParseNormalDate(const CFX_WideString & value, bool& bWrongFormat);
+ static double ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat);
static double MakeInterDate(CFX_WideString strValue);
- static double ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits, bool& bDot, bool& bSign, bool& bKXJS);
+ static double ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS);
public:
static CFX_WideString StrLTrim(const FX_WCHAR* pStr);
@@ -85,16 +85,16 @@ public:
static CFX_ByteString StrRTrim(const FX_CHAR* pStr);
static CFX_ByteString StrTrim(const FX_CHAR* pStr);
- static bool IsNumber(const FX_CHAR* string);
- static bool IsNumber(const FX_WCHAR* string);
+ static FX_BOOL IsNumber(const FX_CHAR* string);
+ static FX_BOOL IsNumber(const FX_WCHAR* string);
- static bool IsDigit(char ch);
- static bool IsDigit(wchar_t ch);
- static bool IsAlphabetic(wchar_t ch);
- static bool IsAlphaNumeric(wchar_t ch);
+ static FX_BOOL IsDigit(char ch);
+ static FX_BOOL IsDigit(wchar_t ch);
+ static FX_BOOL IsAlphabetic(wchar_t ch);
+ static FX_BOOL IsAlphaNumeric(wchar_t ch);
- static bool maskSatisfied(wchar_t c_Change,wchar_t c_Mask);
- static bool isReservedMaskChar(wchar_t ch);
+ static FX_BOOL maskSatisfied(wchar_t c_Change,wchar_t c_Mask);
+ static FX_BOOL isReservedMaskChar(wchar_t ch);
static double AF_Simple(const FX_WCHAR* sFuction, double dValue1, double dValue2);
static CJS_Array AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Value val);
diff --git a/fpdfsdk/include/javascript/app.h b/fpdfsdk/include/javascript/app.h
index ffd7edb4d4..ac90e62b0d 100644
--- a/fpdfsdk/include/javascript/app.h
+++ b/fpdfsdk/include/javascript/app.h
@@ -110,41 +110,41 @@ public:
virtual ~app();
public:
- bool activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
-
-
- bool alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+
+
+ FX_BOOL alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
private:
// FX_DWORD AppGetTickCount();
diff --git a/fpdfsdk/include/javascript/color.h b/fpdfsdk/include/javascript/color.h
index ab7bbae088..df863b552f 100644
--- a/fpdfsdk/include/javascript/color.h
+++ b/fpdfsdk/include/javascript/color.h
@@ -16,21 +16,21 @@ public:
color(CJS_Object* pJSObject);
virtual ~color(void);
- bool black(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool blue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool cyan(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool dkGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool gray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool green(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool ltGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool magenta(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool transparent(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL black(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL blue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL cyan(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL dkGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL gray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL green(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL ltGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL magenta(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL transparent(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
public:
static void ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array);
diff --git a/fpdfsdk/include/javascript/console.h b/fpdfsdk/include/javascript/console.h
index 424f0e246b..0cbc291b44 100644
--- a/fpdfsdk/include/javascript/console.h
+++ b/fpdfsdk/include/javascript/console.h
@@ -16,10 +16,10 @@ public:
virtual ~console(void);
public:
- bool clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
};
class CJS_Console : public CJS_Object
diff --git a/fpdfsdk/include/javascript/event.h b/fpdfsdk/include/javascript/event.h
index e980a96e74..91a38ba487 100644
--- a/fpdfsdk/include/javascript/event.h
+++ b/fpdfsdk/include/javascript/event.h
@@ -16,26 +16,26 @@ public:
virtual ~event(void);
public:
- bool change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
- bool willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
+ FX_BOOL willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError);
};
diff --git a/fpdfsdk/include/javascript/global.h b/fpdfsdk/include/javascript/global.h
index 4c6ccd97b0..83e07f67c3 100644
--- a/fpdfsdk/include/javascript/global.h
+++ b/fpdfsdk/include/javascript/global.h
@@ -19,10 +19,10 @@ struct js_global_data
{
nType = 0;
dData = 0;
- bData = false;
+ bData = FALSE;
sData = "";
- bPersistent = false;
- bDeleted = false;
+ bPersistent = FALSE;
+ bDeleted = FALSE;
}
~js_global_data()
@@ -45,12 +45,12 @@ public:
virtual ~global_alternate();
public:
- bool setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
public:
- bool QueryProperty(const FX_WCHAR* propname);
- bool DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue & vp, CFX_WideString & sError);
- bool DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString & sError);
+ FX_BOOL QueryProperty(const FX_WCHAR* propname);
+ FX_BOOL DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue & vp, CFX_WideString & sError);
+ FX_BOOL DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString & sError);
void Initial(CPDFDoc_Environment* pApp);
@@ -58,7 +58,7 @@ private:
void UpdateGlobalPersistentVariables();
void CommitGlobalPersisitentVariables();
void DestroyGlobalPersisitentVariables();
- bool SetGlobalVariables(const FX_CHAR* propname, int nType,
+ FX_BOOL SetGlobalVariables(const FX_CHAR* propname, int nType,
double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent);
void ObjectToArray(v8::Local<v8::Object> pObj, CJS_GlobalVariableArray& array);
@@ -78,7 +78,7 @@ public:
CJS_Global(JSFXObject pObject) : CJS_Object(pObject) {};
virtual ~CJS_Global(void){};
- virtual bool InitInstance(IFXJS_Context* cc);
+ virtual FX_BOOL InitInstance(IFXJS_Context* cc);
DECLARE_SPECIAL_JS_CLASS(CJS_Global);
diff --git a/fpdfsdk/include/javascript/report.h b/fpdfsdk/include/javascript/report.h
index e54583385f..56f742ce08 100644
--- a/fpdfsdk/include/javascript/report.h
+++ b/fpdfsdk/include/javascript/report.h
@@ -16,8 +16,8 @@ public:
virtual ~Report();
public:
- bool save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
};
class CJS_Report : public CJS_Object
diff --git a/fpdfsdk/include/javascript/util.h b/fpdfsdk/include/javascript/util.h
index a2d6749eec..ca4db349da 100644
--- a/fpdfsdk/include/javascript/util.h
+++ b/fpdfsdk/include/javascript/util.h
@@ -18,11 +18,11 @@ public:
virtual ~util(void);
public:
- bool printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
- bool byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
+ FX_BOOL byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError);
public:
static void printd(const std::wstring &cFormat,CJS_Date Date,bool bXFAPicture, std::wstring &cPurpose);
diff --git a/fpdfsdk/include/pdfwindow/PWL_Button.h b/fpdfsdk/include/pdfwindow/PWL_Button.h
index 322b9d4366..2bf2eea865 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Button.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Button.h
@@ -17,11 +17,11 @@ public:
virtual CFX_ByteString GetClassName() const;
virtual void OnCreate(PWL_CREATEPARAM & cp);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
protected:
- bool m_bMouseDown;
+ FX_BOOL m_bMouseDown;
};
#endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_BUTTON_H_
diff --git a/fpdfsdk/include/pdfwindow/PWL_Caret.h b/fpdfsdk/include/pdfwindow/PWL_Caret.h
index 42743657b7..6838bc49e7 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Caret.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Caret.h
@@ -12,11 +12,11 @@
struct PWL_CARET_INFO
{
public:
- PWL_CARET_INFO() : bVisible(false), ptHead(0,0), ptFoot(0,0)
+ PWL_CARET_INFO() : bVisible(FALSE), ptHead(0,0), ptFoot(0,0)
{
}
- bool bVisible;
+ FX_BOOL bVisible;
CPDF_Point ptHead;
CPDF_Point ptFoot;
};
@@ -32,9 +32,9 @@ public:
virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
virtual void InvalidateRect(CPDF_Rect * pRect = NULL);
- virtual void SetVisible(bool bVisible) {}
+ virtual void SetVisible(FX_BOOL bVisible) {}
virtual void TimerProc();
- void SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
+ void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset);
void SetInvalidRect(CPDF_Rect rc) {m_rcInvalid = rc;}
@@ -42,7 +42,7 @@ private:
void GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptOffset);
CPDF_Rect GetCaretRect() const;
- bool m_bFlash;
+ FX_BOOL m_bFlash;
CPDF_Point m_ptHead;
CPDF_Point m_ptFoot;
FX_FLOAT m_fWidth;
diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
index 21d4e4a041..3f8604fb62 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
@@ -25,10 +25,10 @@ public:
virtual ~CPWL_CBListBox(){};
public:
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- bool OnKeyDownWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFlag);
- bool OnCharWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFlag);
+ FX_BOOL OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
+ FX_BOOL OnCharWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
};
#define PWL_COMBOBOX_BUTTON_WIDTH 13
@@ -43,8 +43,8 @@ public:
virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
};
@@ -58,8 +58,8 @@ public:
virtual CFX_ByteString GetClassName() const;
virtual void OnCreate(PWL_CREATEPARAM & cp);
- virtual bool OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0);
@@ -71,7 +71,7 @@ public:
virtual void SetFocus();
virtual void KillFocus();
- bool IsModified() const;
+ FX_BOOL IsModified() const;
public:
void SetFillerNotify(IPWL_Filler_Notify* pNotify);
@@ -87,7 +87,7 @@ public:
void GetEditSel(int32_t & nStartChar, int32_t & nEndChar ) const;
void Clear();
void SelectAll();
- bool IsPopup() const;
+ FX_BOOL IsPopup() const;
void SetSelectText();
@@ -96,14 +96,14 @@ private:
void CreateButton(const PWL_CREATEPARAM & cp);
void CreateListBox(const PWL_CREATEPARAM & cp);
- void SetPopup(bool bPopup);
+ void SetPopup(FX_BOOL bPopup);
private:
CPWL_CBEdit* m_pEdit;
CPWL_CBButton* m_pButton;
CPWL_CBListBox* m_pList;
- bool m_bPopup;
+ FX_BOOL m_bPopup;
CPDF_Rect m_rcOldWindow;
int32_t m_nPopupWhere;
int32_t m_nSelectItem;
diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h
index 50e1ebee3c..97147a964d 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h
@@ -21,11 +21,11 @@ public:
virtual ~IPWL_Filler_Notify() { }
virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax,
int32_t & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top)
- virtual void OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, int32_t nKeyCode,
+ virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode,
CFX_WideString & strChange, const CFX_WideString& strChangeEx,
int nSelStart, int nSelEnd,
- bool bKeyDown, bool & bRC, bool & bExit, FX_DWORD nFlag) = 0;
- virtual void OnAfterKeyStroke(bool bEditOrList, void* pPrivateData, bool & bExit, FX_DWORD nFlag) = 0;
+ FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag) = 0;
+ virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) = 0;
};
class PWL_CLASS CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify
@@ -44,35 +44,35 @@ public:
virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
virtual CPDF_Rect GetFocusRect() const;
public:
- void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, bool bPaint = true); //0:left 1:right 2:middle
- void SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, bool bPaint = true); //0:top 1:bottom 2:center
+ void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, FX_BOOL bPaint = TRUE); //0:left 1:right 2:middle
+ void SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, FX_BOOL bPaint = TRUE); //0:top 1:bottom 2:center
void SetCharArray(int32_t nCharArray);
void SetLimitChar(int32_t nLimitChar);
- void SetHorzScale(int32_t nHorzScale, bool bPaint = true);
- void SetCharSpace(FX_FLOAT fCharSpace, bool bPaint = true);
+ void SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint = TRUE);
+ void SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint = TRUE);
- void SetLineLeading(FX_FLOAT fLineLeading, bool bPaint = true);
+ void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE);
- void EnableSpellCheck(bool bEnabled);
+ void EnableSpellCheck(FX_BOOL bEnabled);
- bool CanSelectAll() const;
- bool CanClear() const;
- bool CanCopy() const;
- bool CanCut() const;
- bool CanPaste() const;
+ FX_BOOL CanSelectAll() const;
+ FX_BOOL CanClear() const;
+ FX_BOOL CanCopy() const;
+ FX_BOOL CanCut() const;
+ FX_BOOL CanPaste() const;
virtual void CopyText();
virtual void PasteText();
@@ -85,7 +85,7 @@ public:
CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset) const;
CFX_ByteString GetSelectAppearanceStream(const CPDF_Point & ptOffset) const;
- bool IsTextFull() const;
+ FX_BOOL IsTextFull() const;
static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, int32_t nCharArray);
@@ -112,8 +112,8 @@ protected:
private:
CPVT_WordRange GetSelectWordRange() const;
- virtual void ShowVScrollBar(bool bShow);
- bool IsVScrollBarVisible() const;
+ virtual void ShowVScrollBar(FX_BOOL bShow);
+ FX_BOOL IsVScrollBarVisible() const;
void SetParamByFlag();
FX_FLOAT GetCharArrayAutoFontSize(int32_t nCharArray);
@@ -123,15 +123,15 @@ private:
CPVT_WordRange GetLatinWordsRange(const CPDF_Point & point) const;
CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace & place) const;
CPVT_WordRange GetArabicWordsRange(const CPVT_WordPlace & place) const;
- CPVT_WordRange GetSameWordsRange(const CPVT_WordPlace & place, bool bLatin, bool bArabic) const;
+ CPVT_WordRange GetSameWordsRange(const CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const;
void AjustArabicWords(const CPVT_WordRange& wr);
public:
- bool IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag);
+ FX_BOOL IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag);
private:
IPWL_Filler_Notify* m_pFillerNotify;
IPWL_SpellCheck* m_pSpellCheck;
- bool m_bFocus;
+ FX_BOOL m_bFocus;
CPDF_Rect m_rcOldWindow;
public:
void AttachFFLData(void* pData) {m_pFormFiller = pData;}
diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
index e5123fd1b9..9b088b1162 100644
--- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
+++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
@@ -68,11 +68,11 @@ public:
virtual void OnCreate(PWL_CREATEPARAM & cp);
virtual void OnCreated();
- virtual bool OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnChar(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0);
virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
@@ -89,7 +89,7 @@ public:
CPDF_Rect GetContentRect() const;
void GetCaretPos(int32_t& x, int32_t& y) const;
- bool IsModified() const;
+ FX_BOOL IsModified() const;
CFX_WideString GetText() const;
void SetSel(int32_t nStartChar,int32_t nEndChar);
@@ -105,7 +105,7 @@ public:
void Paint();
- void EnableRefresh(bool bRefresh);
+ void EnableRefresh(FX_BOOL bRefresh);
CPDF_Point GetScrollPos() const;
void SetScrollPos(const CPDF_Point& point);
@@ -120,30 +120,30 @@ public:
CPDF_Font * GetCaretFont() const;
FX_FLOAT GetCaretFontSize() const;
- bool CanUndo() const;
- bool CanRedo() const;
+ FX_BOOL CanUndo() const;
+ FX_BOOL CanRedo() const;
void Redo();
void Undo();
void SetReadyToInput();
protected:
- virtual void ShowVScrollBar(bool bShow);
+ virtual void ShowVScrollBar(FX_BOOL bShow);
virtual void InsertWord(FX_WORD word, int32_t nCharset);
virtual void InsertReturn();
virtual void InsertText(const FX_WCHAR* csText);
virtual void SetCursor();
- bool IsWndHorV();
+ FX_BOOL IsWndHorV();
void Delete();
void Backspace();
protected:
void GetCaretInfo(CPDF_Point & ptHead, CPDF_Point & ptFoot) const;
- void SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
+ void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
- void SetEditCaret(bool bVisible);
+ void SetEditCaret(FX_BOOL bVisible);
protected:
virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
@@ -154,7 +154,7 @@ protected:
FX_FLOAT fSmallStep, FX_FLOAT fBigStep);
virtual void IOnSetScrollPosX(FX_FLOAT fx){}
virtual void IOnSetScrollPosY(FX_FLOAT fy);
- virtual void IOnSetCaret(bool bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place);
+ virtual void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place);
virtual void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps);
virtual void IOnContentChange(const CPDF_Rect& rcContent);
virtual void IOnInvalidateRect(CPDF_Rect * pRect);
@@ -165,7 +165,7 @@ private:
protected:
IFX_Edit* m_pEdit;
CPWL_Caret* m_pEditCaret;
- bool m_bMouseDown;
+ FX_BOOL m_bMouseDown;
IPWL_Edit_Notify* m_pEditNotify;
private:
diff --git a/fpdfsdk/include/pdfwindow/PWL_FontMap.h b/fpdfsdk/include/pdfwindow/PWL_FontMap.h
index e4bbbf2664..d32cc93078 100644
--- a/fpdfsdk/include/pdfwindow/PWL_FontMap.h
+++ b/fpdfsdk/include/pdfwindow/PWL_FontMap.h
@@ -85,7 +85,7 @@ public:
static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset);
CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, uint8_t nCharset);
- static bool IsStandardFont(const CFX_ByteString& sFontName);
+ static FX_BOOL IsStandardFont(const CFX_ByteString& sFontName);
CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName);
CPDF_Font* AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName,
uint8_t nCharset);
@@ -93,12 +93,12 @@ public:
protected:
virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, int32_t nCharset);
virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias);
- bool KnowWord(int32_t nFontIndex, FX_WORD word);
+ FX_BOOL KnowWord(int32_t nFontIndex, FX_WORD word);
virtual CPDF_Document* GetDocument();
void Empty();
- int32_t GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, bool bFind);
+ int32_t GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, FX_BOOL bFind);
int32_t GetPWLFontIndex(FX_WORD word, int32_t nCharset);
int32_t AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, int32_t nCharset = DEFAULT_CHARSET);
diff --git a/fpdfsdk/include/pdfwindow/PWL_Icon.h b/fpdfsdk/include/pdfwindow/PWL_Icon.h
index b6331b6e09..44a5c0cbaf 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Icon.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Icon.h
@@ -46,9 +46,9 @@ public:
virtual void GetImageOffset(FX_FLOAT & x,FX_FLOAT & y);
int32_t GetScaleMethod();
- bool IsProportionalScale();
+ FX_BOOL IsProportionalScale();
void GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom);
- bool GetFittingBounds();
+ FX_BOOL GetFittingBounds();
void SetIconFit(CPDF_IconFit * pIconFit){m_pIconFit = pIconFit;};
diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h
index 3c71e57b49..2f6b323773 100644
--- a/fpdfsdk/include/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h
@@ -34,8 +34,8 @@ public:
virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
virtual void RePosChildWnd();
- void SetSelect(bool bSelected);
- bool IsSelected() const;
+ void SetSelect(FX_BOOL bSelected);
+ FX_BOOL IsSelected() const;
void SetData(void* pData);
void SetIcon(int32_t nIconIndex);
void SetText(const CFX_WideString& str);
@@ -52,7 +52,7 @@ protected:
private:
int32_t m_nIconIndex;
void* m_pData;
- bool m_bSelected;
+ FX_BOOL m_bSelected;
CPWL_Label* m_pText;
CPWL_Color m_crIcon;
};
@@ -66,7 +66,7 @@ public:
void SetSelect(int32_t nIndex);
int32_t GetSelect() const;
void SetNotify(IPWL_IconList_Notify* pNotify);
- void EnableNotify(bool bNotify);
+ void EnableNotify(FX_BOOL bNotify);
void SetListData(int32_t nItemIndex, void* pData);
void SetListIcon(int32_t nItemIndex, int32_t nIconIndex);
void SetListString(int32_t nItemIndex, const CFX_WideString& str);
@@ -77,20 +77,20 @@ public:
protected:
virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
private:
CPWL_IconList_Item* GetListItem(int32_t nItemIndex) const;
- void SelectItem(int32_t nItemIndex, bool bSelect);
+ void SelectItem(int32_t nItemIndex, FX_BOOL bSelect);
int32_t FindItemIndex(const CPDF_Point& point);
- bool m_nSelectIndex;
+ FX_BOOL m_nSelectIndex;
IPWL_IconList_Notify* m_pNotify;
- bool m_bEnableNotify;
- bool m_bMouseDown;
+ FX_BOOL m_bEnableNotify;
+ FX_BOOL m_bMouseDown;
int32_t m_nListCount;
};
@@ -100,13 +100,13 @@ public:
CPWL_IconList(int32_t nListCount);
virtual ~CPWL_IconList();
- virtual bool OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
void SetSelect(int32_t nIndex);
void SetTopItem(int32_t nIndex);
int32_t GetSelect() const;
void SetNotify(IPWL_IconList_Notify* pNotify);
- void EnableNotify(bool bNotify);
+ void EnableNotify(FX_BOOL bNotify);
void SetListData(int32_t nItemIndex, void* pData);
void SetListIcon(int32_t nItemIndex, int32_t nIconIndex);
void SetListString(int32_t nItemIndex, const CFX_WideString& str);
diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h
index 43d60a2f09..97a4529af9 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ListBox.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ListBox.h
@@ -29,7 +29,7 @@ public:
FX_FLOAT fSmallStep, FX_FLOAT fBigStep);
void IOnSetScrollPosX(FX_FLOAT fx){}
void IOnSetScrollPosY(FX_FLOAT fy);
- void IOnSetCaret(bool bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place);
+ void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place);
void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps);
void IOnInvalidateRect(CPDF_Rect * pRect);
@@ -49,12 +49,12 @@ public:
virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual bool OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnChar(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
virtual void KillFocus();
virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0);
@@ -64,7 +64,7 @@ public:
virtual void SetFontSize(FX_FLOAT fFontSize);
virtual FX_FLOAT GetFontSize() const;
- void OnNotifySelChanged(bool bKeyDown, bool & bExit , FX_DWORD nFlag);
+ void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit , FX_DWORD nFlag);
void AddString(const FX_WCHAR* string);
void SetTopVisibleIndex(int32_t nItemIndex);
@@ -73,13 +73,13 @@ public:
void Reset();
void Select(int32_t nItemIndex);
void SetCaret(int32_t nItemIndex);
- void SetHoverSel(bool bHoverSel);
+ void SetHoverSel(FX_BOOL bHoverSel);
int32_t GetCount() const;
- bool IsMultipleSel() const;
+ FX_BOOL IsMultipleSel() const;
int32_t GetCaretIndex() const;
int32_t GetCurSel() const;
- bool IsItemSelected(int32_t nItemIndex) const;
+ FX_BOOL IsItemSelected(int32_t nItemIndex) const;
int32_t GetTopVisibleIndex() const;
int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const;
CPDF_Rect GetContentRect() const;
@@ -91,8 +91,8 @@ public:
protected:
IFX_List* m_pList;
CPWL_List_Notify* m_pListNotify;
- bool m_bMouseDown;
- bool m_bHoverSel;
+ FX_BOOL m_bMouseDown;
+ FX_BOOL m_bHoverSel;
IPWL_Filler_Notify* m_pFillerNotify;
public:
void AttachFFLData(void* pData) {m_pFormFiller = pData;}
diff --git a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
index 3beee19230..c107a0cf5e 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
@@ -35,7 +35,7 @@ protected:
virtual void DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
private:
- void ResetAll(bool bMove,int32_t nStart);
+ void ResetAll(FX_BOOL bMove,int32_t nStart);
CPDF_Rect m_rcContent;
CPDF_Point m_ptScroll;
diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h
index b1e61c4aa4..a60eba30dd 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Note.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Note.h
@@ -33,8 +33,8 @@ class IPWL_NoteNotify
public:
virtual ~IPWL_NoteNotify() { }
virtual void OnNoteMove(const FX_RECT& rtWin) = 0;
- virtual void OnNoteShow(bool bShow) = 0;
- virtual void OnNoteActivate(bool bActive) = 0;
+ virtual void OnNoteShow(FX_BOOL bShow) = 0;
+ virtual void OnNoteActivate(FX_BOOL bActive) = 0;
virtual void OnNoteClose() = 0;
virtual void OnItemCreate(IPWL_NoteItem* pItem) = 0;
virtual void OnItemDelete(IPWL_NoteItem* pItem) = 0;
@@ -107,11 +107,11 @@ public:
protected:
virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
private:
- bool m_bMouseDown;
+ FX_BOOL m_bMouseDown;
};
class CPWL_Note_LBBox : public CPWL_Wnd
@@ -140,7 +140,7 @@ public:
CPWL_Note_Edit();
virtual ~CPWL_Note_Edit();
- void EnableNotify(bool bEnable) {m_bEnableNotify = bEnable;}
+ void EnableNotify(FX_BOOL bEnable) {m_bEnableNotify = bEnable;}
virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth);
FX_FLOAT GetItemLeftMargin();
FX_FLOAT GetItemRightMargin();
@@ -154,9 +154,9 @@ protected:
virtual void OnKillFocus();
private:
- bool m_bEnableNotify;
+ FX_BOOL m_bEnableNotify;
FX_FLOAT m_fOldItemHeight;
- bool m_bSizeChanged;
+ FX_BOOL m_bSizeChanged;
FX_FLOAT m_fOldMin;
FX_FLOAT m_fOldMax;
};
@@ -188,9 +188,9 @@ public:
virtual CFX_ByteString GetClassName() const;
virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0);
- virtual bool OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag);
- void SetEditFocus(bool bLast);
+ void SetEditFocus(FX_BOOL bLast);
CPWL_Edit* GetEdit() const;
public:
@@ -203,8 +203,8 @@ public:
IPWL_NoteItem* GetSubItems(int32_t index) const;
virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point);
- void EnableRead(bool bEnabled);
- void EnableModify(bool bEnabled);
+ void EnableRead(FX_BOOL bEnabled);
+ void EnableModify(FX_BOOL bEnabled);
protected:
virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
@@ -231,7 +231,7 @@ public:
virtual int32_t CountSubItems() const;
virtual IPWL_NoteItem* GetSubItems(int32_t index) const;
virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem);
- virtual void SetFocus(){SetNoteFocus(false);}
+ virtual void SetFocus(){SetNoteFocus(FALSE);}
virtual IPWL_NoteItem* GetParentItem() const;
virtual void* GetPrivateData() const;
@@ -240,19 +240,19 @@ public:
virtual CFX_WideString GetContents() const;
virtual FX_SYSTEMTIME GetDateTime() const;
virtual CFX_WideString GetSubjectName() const;
- virtual bool IsTopItem() const { return false;}
+ virtual FX_BOOL IsTopItem() const { return FALSE;}
virtual CPWL_Edit* GetEdit() const;
public:
- virtual bool OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag);
- virtual bool OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
virtual CFX_ByteString GetClassName() const;
virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point);
virtual IPWL_NoteItem* GetFocusedNoteItem() const;
virtual void ResetSubjectName(int32_t nItemIndex);
- void EnableRead(bool bEnabled);
- void EnableModify(bool bEnabled);
+ void EnableRead(FX_BOOL bEnabled);
+ void EnableModify(FX_BOOL bEnabled);
protected:
virtual void RePosChildWnd();
@@ -267,7 +267,7 @@ public:
CPWL_NoteItem* CreateNoteItem();
CPWL_NoteItem* GetParentNoteItem() const;
- void SetNoteFocus(bool bLast);
+ void SetNoteFocus(FX_BOOL bLast);
void OnContentsValidate();
void OnCreateNoteItem();
@@ -289,8 +289,8 @@ private:
CFX_WideString m_sAuthor;
FX_FLOAT m_fOldItemHeight;
- bool m_bSizeChanged;
- bool m_bAllowModify;
+ FX_BOOL m_bSizeChanged;
+ FX_BOOL m_bAllowModify;
};
class PWL_CLASS CPWL_Note : public CPWL_NoteItem
@@ -305,17 +305,17 @@ public:
virtual CFX_WideString GetAuthorName() const;
virtual void SetBkColor(const CPWL_Color& color);
virtual void ResetSubjectName(int32_t nItemIndex){}
- virtual bool IsTopItem() const {return true;}
+ virtual FX_BOOL IsTopItem() const {return TRUE;}
virtual const CPWL_Note* GetNote() const;
virtual IPWL_NoteNotify* GetNoteNotify() const;
public:
IPWL_NoteItem* Reply();
- void EnableNotify(bool bEnabled);
+ void EnableNotify(FX_BOOL bEnabled);
void SetIconType(int32_t nType);
void SetOptionsText(const CFX_WideString& sText);
- void EnableRead(bool bEnabled);
- void EnableModify(bool bEnabled);
+ void EnableRead(FX_BOOL bEnabled);
+ void EnableModify(FX_BOOL bEnabled);
CFX_WideString GetReplyString() const;
void SetReplyString(const CFX_WideString& string);
@@ -326,9 +326,9 @@ public:
IPopup_Note* GetPopupNote() const {return m_pPopupNote;}
public:
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
protected:
virtual void RePosChildWnd();
@@ -336,9 +336,9 @@ protected:
virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0);
- bool ResetScrollBar();
+ FX_BOOL ResetScrollBar();
void RePosNoteChildren();
- bool ScrollBarShouldVisible();
+ FX_BOOL ScrollBarShouldVisible();
private:
CPWL_Label* m_pAuthor;
@@ -349,10 +349,10 @@ private:
CPWL_ScrollBar* m_pContentsBar;
CPWL_Note_Options* m_pOptions;
IPWL_NoteNotify* m_pNoteNotify;
- bool m_bResizing;
+ FX_BOOL m_bResizing;
PWL_SCROLL_INFO m_OldScrollInfo;
CPDF_Rect m_rcCaption;
- bool m_bEnalbleNotify;
+ FX_BOOL m_bEnalbleNotify;
IPopup_Note* m_pPopupNote;
CFX_WideString m_sReplyString;
};
diff --git a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
index 4735922039..0390222545 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
@@ -49,15 +49,15 @@ public:
virtual void OnCreate(PWL_CREATEPARAM & cp);
virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
protected:
PWL_SCROLLBAR_TYPE m_eScrollBarType;
PWL_SBBUTTON_TYPE m_eSBButtonType;
- bool m_bMouseDown;
+ FX_BOOL m_bMouseDown;
};
struct PWL_FLOATRANGE
@@ -67,7 +67,7 @@ public:
PWL_FLOATRANGE(FX_FLOAT min,FX_FLOAT max);
void Default();
void Set(FX_FLOAT min,FX_FLOAT max);
- bool In(FX_FLOAT x) const;
+ FX_BOOL In(FX_FLOAT x) const;
FX_FLOAT GetWidth() const;
FX_FLOAT fMin,fMax;
@@ -83,7 +83,7 @@ public:
void SetClientWidth(FX_FLOAT width);
void SetSmallStep(FX_FLOAT step);
void SetBigStep(FX_FLOAT step);
- bool SetPos(FX_FLOAT pos);
+ FX_BOOL SetPos(FX_FLOAT pos);
void AddSmall();
void SubSmall();
@@ -110,8 +110,8 @@ public:
virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0);
virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
@@ -119,12 +119,12 @@ public:
FX_FLOAT GetScrollBarWidth() const;
PWL_SCROLLBAR_TYPE GetScrollBarType() const {return m_sbType;};
- void SetNotifyForever(bool bForever) {m_bNotifyForever = bForever;}
+ void SetNotifyForever(FX_BOOL bForever) {m_bNotifyForever = bForever;}
protected:
void SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClientWidth);
void SetScrollPos(FX_FLOAT fPos);
- void MovePosButton(bool bRefresh);
+ void MovePosButton(FX_BOOL bRefresh);
void SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep);
void NotifyScrollWindow();
CPDF_Rect GetScrollArea() const;
@@ -156,9 +156,9 @@ private:
CPWL_SBButton* m_pMaxButton;
CPWL_SBButton* m_pPosButton;
PWL_SCROLL_PRIVATEDATA m_sData;
- bool m_bMouseDown;
- bool m_bMinOrMax;
- bool m_bNotifyForever;
+ FX_BOOL m_bMouseDown;
+ FX_BOOL m_bMinOrMax;
+ FX_BOOL m_bNotifyForever;
FX_FLOAT m_nOldPos;
FX_FLOAT m_fOldPosButton;
};
diff --git a/fpdfsdk/include/pdfwindow/PWL_Signature.h b/fpdfsdk/include/pdfwindow/PWL_Signature.h
index c5557d6c6e..c94527772e 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Signature.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Signature.h
@@ -43,9 +43,9 @@ public:
void SetImage(CFX_DIBSource* pImage);
void SetImageStream(CPDF_Stream * pStream, const FX_CHAR* sImageAlias);
- void SetTextFlag(bool bTextExist);
- void SetImageFlag(bool bImageExist);
- void SetFoxitFlag(bool bFlagExist);
+ void SetTextFlag(FX_BOOL bTextExist);
+ void SetImageFlag(FX_BOOL bImageExist);
+ void SetFoxitFlag(FX_BOOL bFlagExist);
protected:
virtual void RePosChildWnd();
@@ -59,9 +59,9 @@ private:
CPWL_Label* m_pDescription;
CPWL_Signature_Image* m_pImage;
- bool m_bTextExist;
- bool m_bImageExist;
- bool m_bFlagExist;
+ FX_BOOL m_bTextExist;
+ FX_BOOL m_bImageExist;
+ FX_BOOL m_bFlagExist;
};
#endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_SIGNATURE_H_
diff --git a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
index 14e576d868..f6659dfb00 100644
--- a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
+++ b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
@@ -26,14 +26,14 @@ public:
virtual ~CPWL_CheckBox();
virtual CFX_ByteString GetClassName() const;
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
- void SetCheck(bool bCheck);
- bool IsChecked() const;
+ void SetCheck(FX_BOOL bCheck);
+ FX_BOOL IsChecked() const;
private:
- bool m_bChecked;
+ FX_BOOL m_bChecked;
};
class PWL_CLASS CPWL_RadioButton : public CPWL_Button
@@ -43,14 +43,14 @@ public:
virtual ~CPWL_RadioButton();
virtual CFX_ByteString GetClassName() const;
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
- void SetCheck(bool bCheck);
- bool IsChecked() const;
+ void SetCheck(FX_BOOL bCheck);
+ FX_BOOL IsChecked() const;
private:
- bool m_bChecked;
+ FX_BOOL m_bChecked;
};
#endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_SPECIALBUTTON_H_
diff --git a/fpdfsdk/include/pdfwindow/PWL_Utils.h b/fpdfsdk/include/pdfwindow/PWL_Utils.h
index f1e34c9060..2da0f42180 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Utils.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Utils.h
@@ -109,8 +109,8 @@ class PWL_CLASS CPWL_Utils
public:
static CPDF_Rect InflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize);
static CPDF_Rect DeflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize);
- static bool IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2);
- static bool ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild);
+ static FX_BOOL IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2);
+ static FX_BOOL ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild);
static CPDF_Rect ScaleRect(const CPDF_Rect& rcRect,FX_FLOAT fScale);
static CPVT_WordRange OverlapWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2);
static CPDF_Rect GetCenterSquare(const CPDF_Rect & rect);
@@ -120,10 +120,10 @@ public:
static CPDF_Rect OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y);
static CPDF_Point OffsetPoint(const CPDF_Point & point,FX_FLOAT x,FX_FLOAT y);
static FX_COLORREF PWLColorToFXColor(const CPWL_Color& color, int32_t nTransparancy = 255);
- static bool IsBlackOrWhite(const CPWL_Color& color);
+ static FX_BOOL IsBlackOrWhite(const CPWL_Color& color);
static CPWL_Color GetReverseColor(const CPWL_Color& color);
- static CFX_ByteString GetColorAppStream(const CPWL_Color & color,const bool & bFillOrStroke = true);
+ static CFX_ByteString GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke = TRUE);
static CFX_ByteString GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
int32_t nStyle, const CPWL_Dash & dash);
@@ -149,7 +149,7 @@ public:
const CPWL_Color & crText);
static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange = NULL,
- bool bContinuous = true, FX_WORD SubWord = 0);
+ FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
static CFX_ByteString GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
const CPVT_WordRange * pRange = NULL);
static CFX_ByteString GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellCheck* pSpellCheck,
@@ -157,7 +157,7 @@ public:
const CPVT_WordRange * pRange = NULL);
static CFX_ByteString GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap,
const CFX_WideString & sText, int32_t nAlignmentH, int32_t nAlignmentV,
- FX_FLOAT fFontSize, bool bMultiLine, bool bAutoReturn, const CPWL_Color & crText);
+ FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText);
static CFX_ByteString GetDropButtonAppStream(const CPDF_Rect & rcBBox);
static void DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
@@ -175,7 +175,7 @@ public:
static void DrawFillArea(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
const CPDF_Point* pPts, int32_t nCount, const FX_COLORREF& color);
static void DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- bool bVertical, bool bHorizontal, CPDF_Rect rect,
+ FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect,
int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray);
static void DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange,
diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
index 3b1d299dfb..c5b6ca4be1 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
@@ -137,7 +137,7 @@ struct PWL_CLASS CPWL_Color
FX_FLOAT fColor1,fColor2,fColor3,fColor4;
};
-inline bool operator == (const CPWL_Color &c1, const CPWL_Color &c2)
+inline FX_BOOL operator == (const CPWL_Color &c1, const CPWL_Color &c2)
{
return c1.nColorType == c2.nColorType &&
c1.fColor1 - c2.fColor1 < 0.0001 && c1.fColor1 - c2.fColor1 > -0.0001 &&
@@ -146,7 +146,7 @@ inline bool operator == (const CPWL_Color &c1, const CPWL_Color &c2)
c1.fColor4 - c2.fColor4 < 0.0001 && c1.fColor4 - c2.fColor4 > -0.0001;
}
-inline bool operator != (const CPWL_Color &c1, const CPWL_Color &c2)
+inline FX_BOOL operator != (const CPWL_Color &c1, const CPWL_Color &c2)
{
return !operator == (c1, c2);
}
@@ -173,7 +173,7 @@ class IPWL_SpellCheck
{
public:
virtual ~IPWL_SpellCheck() { }
- virtual bool CheckWord(const FX_CHAR* sWord) = 0;
+ virtual FX_BOOL CheckWord(const FX_CHAR* sWord) = 0;
virtual void SuggestWords(const FX_CHAR* sWord, CFX_ByteStringArray & sSuggest) = 0;
};
@@ -298,25 +298,25 @@ public:
void Create(const PWL_CREATEPARAM & cp);
virtual CFX_ByteString GetClassName() const;
void Destroy();
- void Move(const CPDF_Rect & rcNew,bool bReset,bool bRefresh);
+ void Move(const CPDF_Rect & rcNew,FX_BOOL bReset,FX_BOOL bRefresh);
virtual void InvalidateRect(CPDF_Rect* pRect = NULL);
void GetAppearanceStream(CFX_ByteString & sAppStream);
void DrawAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual bool OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnKeyUp(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnChar(FX_WORD nChar, FX_DWORD nFlag);
- virtual bool OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnRButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
- virtual bool OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyUp(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
virtual void SetFocus();
virtual void KillFocus();
@@ -326,7 +326,7 @@ public:
virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0);
virtual void SetTextColor(const CPWL_Color & color);
virtual void SetTextStrokeColor(const CPWL_Color & color);
- virtual void SetVisible(bool bVisible);
+ virtual void SetVisible(FX_BOOL bVisible);
virtual CPDF_Rect GetFocusRect() const;
virtual CPWL_Color GetBackgroundColor() const;
@@ -338,7 +338,7 @@ public:
virtual CPWL_Color GetBorderLeftTopColor(int32_t nBorderStyle) const;
virtual CPWL_Color GetBorderRightBottomColor(int32_t nBorderStyle) const;
- virtual bool IsModified() const {return false;}
+ virtual FX_BOOL IsModified() const {return FALSE;}
virtual void SetFontSize(FX_FLOAT fFontSize);
@@ -356,8 +356,8 @@ public:
CPDF_Rect GetClientCenterSquare() const;
CPDF_Rect GetWindowCenterSquare() const;
int32_t GetBorderWidth() const;
- bool IsVisible() const {return m_bVisible;}
- bool HasFlag(FX_DWORD dwFlags) const;
+ FX_BOOL IsVisible() const {return m_bVisible;}
+ FX_BOOL HasFlag(FX_DWORD dwFlags) const;
void AddFlag(FX_DWORD dwFlags);
void RemoveFlag(FX_DWORD dwFlags);
CPDF_Rect GetClipRect() const;
@@ -366,13 +366,13 @@ public:
CPWL_Dash GetBorderDash() const;
void* GetAttachedData() const;
- bool WndHitTest(const CPDF_Point & point) const;
- bool ClientHitTest(const CPDF_Point & point) const;
- bool IsCaptureMouse() const;
+ FX_BOOL WndHitTest(const CPDF_Point & point) const;
+ FX_BOOL ClientHitTest(const CPDF_Point & point) const;
+ FX_BOOL IsCaptureMouse() const;
const CPWL_Wnd* GetFocused() const;
- bool IsFocused() const;
- bool IsReadOnly() const;
+ FX_BOOL IsFocused() const;
+ FX_BOOL IsReadOnly() const;
CPWL_ScrollBar* GetVScrollBar() const;
IFX_Edit_FontMap* GetFontMap() const;
@@ -398,8 +398,8 @@ public:
virtual FX_FLOAT GetItemLeftMargin() {return 0;}
virtual FX_FLOAT GetItemRightMargin() {return 0;}
- void EnableWindow(bool bEnable);
- bool IsEnabled();
+ void EnableWindow(FX_BOOL bEnable);
+ FX_BOOL IsEnabled();
virtual void SetCursor();
protected:
@@ -422,11 +422,11 @@ protected:
virtual void OnEnabled();
virtual void OnDisabled();
- void SetNotifyFlag(bool bNotifying = true){m_bNotifying = bNotifying;};
+ void SetNotifyFlag(FX_BOOL bNotifying = TRUE){m_bNotifying = bNotifying;};
- bool IsValid() const;
+ FX_BOOL IsValid() const;
PWL_CREATEPARAM GetCreationParam() const;
- bool IsNotifying() const {return m_bNotifying;}
+ FX_BOOL IsNotifying() const {return m_bNotifying;}
void InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rcNew);
@@ -434,14 +434,14 @@ protected:
FX_RECT PWLtoWnd(const CPDF_Rect & rect) const;
FX_HWND GetAttachedHWnd() const;
- bool IsWndCaptureMouse(const CPWL_Wnd * pWnd) const;
- bool IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const;
+ FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const;
+ FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const;
const CPWL_Wnd* GetRootWnd() const;
- bool IsCTRLpressed(FX_DWORD nFlag) const;
- bool IsSHIFTpressed(FX_DWORD nFlag) const;
- bool IsALTpressed(FX_DWORD nFlag) const;
- bool IsINSERTpressed(FX_DWORD nFlag) const;
+ FX_BOOL IsCTRLpressed(FX_DWORD nFlag) const;
+ FX_BOOL IsSHIFTpressed(FX_DWORD nFlag) const;
+ FX_BOOL IsALTpressed(FX_DWORD nFlag) const;
+ FX_BOOL IsINSERTpressed(FX_DWORD nFlag) const;
private:
void AddChild(CPWL_Wnd * pWnd);
@@ -467,10 +467,10 @@ private:
CPDF_Rect m_rcWindow;
CPDF_Rect m_rcClip;
- bool m_bCreated;
- bool m_bVisible;
- bool m_bNotifying;
- bool m_bEnabled;
+ FX_BOOL m_bCreated;
+ FX_BOOL m_bVisible;
+ FX_BOOL m_bNotifying;
+ FX_BOOL m_bEnabled;
};
#endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_WND_H_
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
index 6570b3ee15..699a7e4ffe 100644
--- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
@@ -230,7 +230,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString &sAlias)
CPDF_Dictionary* pAcroFormDict = NULL;
- bool bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget");
+ FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget");
if (bWidget)
{
diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
index 72ff575c11..55d2d45bc2 100644
--- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
@@ -31,18 +31,18 @@ CPWL_Wnd* CFFL_CheckBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVie
return pWnd;
}
-bool CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+FX_BOOL CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
{
switch (nKeyCode)
{
case FWL_VKEY_Return:
case FWL_VKEY_Space:
- return true;
+ return TRUE;
default:
return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
}
}
-bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
switch (nChar)
{
@@ -55,57 +55,57 @@ bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
ASSERT(pPageView != NULL);
- bool bReset = false;
- bool bExit = false;
+ FX_BOOL bReset = FALSE;
+ FX_BOOL bExit = FALSE;
pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags);
- if (bReset) return true;
- if (bExit) return true;
+ if (bReset) return TRUE;
+ if (bExit) return TRUE;
CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
- if (CPWL_CheckBox * pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, true))
+ if (CPWL_CheckBox * pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE))
pWnd->SetCheck(!pWnd->IsChecked());
CommitData(pPageView,nFlags);
- return true;
+ return TRUE;
}
default:
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
}
-bool CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
if (IsValid())
{
- if (CPWL_CheckBox * pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, true))
+ if (CPWL_CheckBox * pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE))
{
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
pWnd->SetCheck(!pWidget->IsChecked());
// pWnd->SetCheck(!pWnd->IsChecked());
}
- if (!CommitData(pPageView, nFlags)) return false;
+ if (!CommitData(pPageView, nFlags)) return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+FX_BOOL CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView)
{
ASSERT(m_pWidget != NULL);
- if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE))
{
return pWnd->IsChecked() != m_pWidget->IsChecked();
}
- return false;
+ return FALSE;
}
void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView)
@@ -113,10 +113,10 @@ void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView)
ASSERT(m_pWidget != NULL);
- if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE))
{
- bool bNewChecked = pWnd->IsChecked();
+ FX_BOOL bNewChecked = pWnd->IsChecked();
if (bNewChecked)
@@ -136,7 +136,7 @@ void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView)
}
}
- m_pWidget->SetCheck(bNewChecked, false);
+ m_pWidget->SetCheck(bNewChecked, FALSE);
m_pWidget->UpdateField();
SetChangeMark();
}
diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
index d6d4d3da4e..841b45ecba 100644
--- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
@@ -78,16 +78,16 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVie
}
-bool CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+FX_BOOL CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-bool CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
{
- CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, false);
+ CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE);
if (!pWnd)
- return false;
+ return FALSE;
int32_t nCurSel = pWnd->GetSelect();
if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT))
@@ -103,28 +103,28 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
{
ASSERT(m_pWidget != NULL);
- if (CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
{
CFX_WideString swText = pWnd->GetText();
int32_t nCurSel = pWnd->GetSelect();
//mantis:0004157
- bool bSetValue = true;
+ FX_BOOL bSetValue = TRUE;
if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT)
{
if (nCurSel >= 0)
{
if (swText != m_pWidget->GetOptionLabel(nCurSel))
- bSetValue = true;
+ bSetValue = TRUE;
else
- bSetValue = false;
+ bSetValue = FALSE;
}
else
- bSetValue = true;
+ bSetValue = TRUE;
}
else
- bSetValue = false;
+ bSetValue = FALSE;
CFX_WideString sOldValue;
@@ -132,15 +132,15 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
if (bSetValue)
{
sOldValue = m_pWidget->GetValue();
- m_pWidget->SetValue(swText, false);
+ m_pWidget->SetValue(swText, FALSE);
}
else
{
m_pWidget->GetSelectedIndex(0);
- m_pWidget->SetOptionSelection(nCurSel, true, false);
+ m_pWidget->SetOptionSelection(nCurSel, TRUE, FALSE);
}
- m_pWidget->ResetFieldAppearance(true);
+ m_pWidget->ResetFieldAppearance(TRUE);
m_pWidget->UpdateField();
SetChangeMark();
@@ -155,7 +155,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
switch (type)
{
case CPDF_AAction::KeyStroke:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
{
if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
{
@@ -177,7 +177,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
}
break;
case CPDF_AAction::Validate:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
{
if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
{
@@ -203,7 +203,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAc
switch (type)
{
case CPDF_AAction::KeyStroke:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
{
if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
{
@@ -217,7 +217,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAc
}
}
-bool CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
const PDFSDK_FieldAction& faNew)
{
switch (type)
@@ -229,14 +229,14 @@ bool CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PD
break;
}
- return false;
+ return FALSE;
}
void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView)
{
ASSERT(pPageView != NULL);
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
{
m_State.nIndex = pComboBox->GetSelect();
@@ -252,7 +252,7 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView)
{
ASSERT(pPageView != NULL);
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, true))
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, TRUE))
{
if (m_State.nIndex >= 0)
pComboBox->SetSelect(m_State.nIndex);
@@ -267,7 +267,7 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView)
}
}
-CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue)
+CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
{
if (bRestoreValue)
SaveState(pPageView);
@@ -279,17 +279,17 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bResto
if (bRestoreValue)
{
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, false);
+ pRet = GetPDFWindow(pPageView, FALSE);
}
else
- pRet = GetPDFWindow(pPageView, true);
+ pRet = GetPDFWindow(pPageView, TRUE);
m_pWidget->UpdateField();
return pRet;
}
-void CFFL_ComboBox::OnKeyStroke(bool bKeyDown, FX_UINT nFlag)
+void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag)
{
ASSERT(m_pWidget != NULL);
@@ -305,7 +305,7 @@ void CFFL_ComboBox::OnKeyStroke(bool bKeyDown, FX_UINT nFlag)
if (CommitData(pPageView, nFlag))
{
DestroyPDFWindow(pPageView);
- m_bValid = false;
+ m_bValid = FALSE;
}
}
}
@@ -328,7 +328,7 @@ void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd)
int nCharacters = wsText.GetLength();
CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str();
- m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, true);
+ m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE);
pEdit->SetEditNotify(this);
}
@@ -339,25 +339,25 @@ void CFFL_ComboBox::OnKillFocus(CPWL_Wnd* pWnd)
ASSERT(m_pApp != NULL);
}
-bool CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return false;
+ return FALSE;
}
-bool CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return false;
+ return FALSE;
}
-bool CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return false;
+ return FALSE;
}
void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit)
@@ -371,7 +371,7 @@ CFX_WideString CFFL_ComboBox::GetSelectExportText()
int nExport = -1;
CPDFSDK_PageView *pPageView = GetCurPageView();
- if (CPWL_ComboBox * pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ComboBox * pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
{
nExport = pComboBox->GetSelect();
}
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
index 34aa17cf06..1811cb0424 100644
--- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
@@ -20,7 +20,7 @@
CFFL_FormFiller::CFFL_FormFiller(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot)
: m_pApp(pApp),
m_pAnnot(pAnnot),
- m_bValid(false),
+ m_bValid(FALSE),
m_ptOldPos(0,0)
{
m_pWidget = (CPDFSDK_Widget*) pAnnot;
@@ -40,15 +40,15 @@ CFFL_FormFiller::~CFFL_FormFiller()
void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow)
{
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
{
- pWnd->Move(CPDF_Rect(rcWindow), true, false);
+ pWnd->Move(CPDF_Rect(rcWindow), TRUE, FALSE);
}
}
CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView)
{
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
{
return pWnd->GetWindowRect();
}
@@ -63,7 +63,7 @@ FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot*
CPDF_Rect rcAnnot = m_pWidget->GetRect();
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
{
CPDF_Rect rcWindow = pWnd->GetWindowRect();
rcAnnot = PWLtoFFL(rcWindow);
@@ -86,7 +86,7 @@ void CFFL_FormFiller::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
{
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
{
CPDF_Matrix mt = GetCurMatrix();
mt.Concat(*pUser2Device);
@@ -131,153 +131,153 @@ void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pA
ASSERT(m_pWidget != NULL);
}
-bool CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, true))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
{
- m_bValid = true;
+ m_bValid = TRUE;
FX_RECT rect = GetViewBBox(pPageView,pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
if(!rect.Contains((int)point.x, (int)point.y))
- return false;
+ return FALSE;
return pWnd->OnLButtonDown(WndtoPWL(pPageView, point),nFlags);
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
{
FX_RECT rcFFL = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom);
pWnd->OnLButtonUp(WndtoPWL(pPageView, point),nFlags);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
{
pWnd->OnLButtonDblClk(WndtoPWL(pPageView, point),nFlags);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
if ((m_ptOldPos.x != point.x) || (m_ptOldPos.y != point.y))
{
m_ptOldPos = point;
}
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
{
pWnd->OnMouseMove(WndtoPWL(pPageView, point),nFlags);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
+FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
{
- if (!IsValid()) return false;
+ if (!IsValid()) return FALSE;
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, true))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
{
return pWnd->OnMouseWheel(zDelta, WndtoPWL(pPageView, point),nFlags);
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, true))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
{
pWnd->OnRButtonDown(WndtoPWL(pPageView, point),nFlags);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
{
pWnd->OnRButtonUp(WndtoPWL(pPageView, point),nFlags);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
{
if (IsValid())
{
CPDFSDK_PageView* pPageView = GetCurPageView();
ASSERT(pPageView != NULL);
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
{
return pWnd->OnKeyDown(nKeyCode,nFlags);
}
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
if (IsValid())
{
CPDFSDK_PageView* pPageView = GetCurPageView();
ASSERT(pPageView != NULL);
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
{
return pWnd->OnChar(nChar,nFlags);
}
}
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
+FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
{
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
CPDF_Page* pPage = pWidget->GetPDFPage();
CPDFSDK_Document* pDoc = m_pApp->GetSDKDocument();
CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage);
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
pWnd->SetFocus();
- m_bValid = true;
+ m_bValid = TRUE;
FX_RECT rcRect = GetViewBBox(pPageView,pAnnot);
InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
- return true;
+ return TRUE;
}
-bool CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
+FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
{
if (!IsValid())
- return true;
+ return TRUE;
CPDFSDK_PageView* pPageView = GetCurPageView();
CommitData(pPageView, nFlag);
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
pWnd->KillFocus();
switch (m_pWidget->GetFieldType())
@@ -285,16 +285,16 @@ bool CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
case FIELDTYPE_PUSHBUTTON:
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
- EscapeFiller(pPageView, true);
+ EscapeFiller(pPageView, TRUE);
break;
default:
- EscapeFiller(pPageView, false);
+ EscapeFiller(pPageView, FALSE);
break;
}
- return true;
+ return TRUE;
}
-bool CFFL_FormFiller::IsValid() const
+FX_BOOL CFFL_FormFiller::IsValid() const
{
return m_bValid;
}
@@ -370,7 +370,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam()
return cp;
}
-CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, bool bNew)
+CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew)
{
ASSERT(pPageView);
@@ -499,7 +499,7 @@ CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView()
CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView)
{
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
{
CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox();
@@ -561,44 +561,44 @@ CPDF_Rect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect
return rect;
}
-bool CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag)
+FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag)
{
if (IsDataChanged(pPageView))
{
- bool bRC = true;
- bool bExit = false;
+ FX_BOOL bRC = TRUE;
+ FX_BOOL bExit = FALSE;
CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
pIFormFiller->OnKeyStrokeCommit(m_pWidget, pPageView, bRC, bExit, nFlag);
if (bExit)
- return true;
+ return TRUE;
if (!bRC)
{
- ResetPDFWindow(pPageView, false);
- return true;
+ ResetPDFWindow(pPageView, FALSE);
+ return TRUE;
}
pIFormFiller->OnValidate(m_pWidget, pPageView, bRC, bExit, nFlag);
if (bExit)
- return true;
+ return TRUE;
if (!bRC)
{
- ResetPDFWindow(pPageView, false);
- return true;
+ ResetPDFWindow(pPageView, FALSE);
+ return TRUE;
}
SaveData(pPageView);
pIFormFiller->OnCalculate(m_pWidget, pPageView, bExit,nFlag);
if (bExit)
- return true;
+ return TRUE;
pIFormFiller->OnFormat(m_pWidget, pPageView, bExit,nFlag);
}
- return true;
+ return TRUE;
}
-bool CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView)
+FX_BOOL CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView)
{
- return false;
+ return FALSE;
}
void CFFL_FormFiller::SaveData(CPDFSDK_PageView* pPageView)
@@ -621,10 +621,10 @@ void CFFL_FormFiller::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::A
{
}
-bool CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+FX_BOOL CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
const PDFSDK_FieldAction& faNew)
{
- return false;
+ return FALSE;
}
void CFFL_FormFiller::SaveState(CPDFSDK_PageView* pPageView)
@@ -635,9 +635,9 @@ void CFFL_FormFiller::RestoreState(CPDFSDK_PageView* pPageView)
{
}
-CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue)
+CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
{
- return GetPDFWindow(pPageView, false);
+ return GetPDFWindow(pPageView, FALSE);
}
void CFFL_FormFiller::TimerProc()
@@ -650,13 +650,13 @@ IFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const
return m_pApp->GetSysHandler();
}
-void CFFL_FormFiller::OnKeyStroke(bool bKeyDown)
+void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown)
{
}
-void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, bool bDestroyPDFWindow)
+void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow)
{
- m_bValid = false;
+ m_bValid = FALSE;
FX_RECT rcRect = GetViewBBox(pPageView, m_pWidget);
InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
@@ -665,19 +665,19 @@ void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, bool bDestroyPDF
DestroyPDFWindow(pPageView);
}
-bool CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
-bool CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
void CFFL_FormFiller::DoCopy(CPDFSDK_Document* pDocument)
@@ -702,8 +702,8 @@ void CFFL_FormFiller::InvalidateRect(double left, double top, double right, doub
CFFL_Button::CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
CFFL_FormFiller(pApp, pWidget),
- m_bMouseIn(false),
- m_bMouseDown(false)
+ m_bMouseIn(FALSE),
+ m_bMouseDown(FALSE)
{
}
@@ -713,14 +713,14 @@ CFFL_Button::~CFFL_Button()
void CFFL_Button::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
{
- m_bMouseIn = true;
+ m_bMouseIn = TRUE;
FX_RECT rect = GetViewBBox(pPageView,pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
}
void CFFL_Button::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
{
- m_bMouseIn = false;
+ m_bMouseIn = FALSE;
FX_RECT rect = GetViewBBox(pPageView,pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
@@ -728,39 +728,39 @@ void CFFL_Button::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot
ASSERT(m_pWidget != NULL);
}
-bool CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
CPDF_Rect rcAnnot = pAnnot->GetRect();
if(!rcAnnot.Contains(point.x, point.y))
- return false;
+ return FALSE;
- m_bMouseDown = true;
- m_bValid = true;
+ m_bMouseDown = TRUE;
+ m_bValid = TRUE;
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
- return true;
+ return TRUE;
}
-bool CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
CPDF_Rect rcAnnot = pAnnot->GetRect();
if(!rcAnnot.Contains(point.x, point.y))
- return false;
+ return FALSE;
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
m_pWidget->GetPDFPage();
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
- return true;
+ return TRUE;
}
-bool CFFL_Button::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
ASSERT(m_pApp != NULL);
- return true;
+ return TRUE;
}
void CFFL_Button::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index 922d8c037e..7ce811e85b 100644
--- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
@@ -22,7 +22,7 @@
CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp) :
m_pApp(pApp),
- m_bNotifying(false)
+ m_bNotifying(FALSE)
{
}
@@ -33,17 +33,17 @@ CFFL_IFormFiller::~CFFL_IFormFiller()
m_Maps.clear();
}
-bool CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point)
+FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point)
{
CPDF_Rect rc = pAnnot->GetRect();
if(rc.Contains(point.x, point.y))
- return true;
- return false;
+ return TRUE;
+ return FALSE;
}
FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
return pFormFiller->GetViewBBox(pPageView, pAnnot);
ASSERT(pPageView != NULL);
@@ -65,7 +65,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_
if (IsVisible(pWidget))
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
if (pFormFiller->IsValid())
{
@@ -98,7 +98,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
else
pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
@@ -110,7 +110,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_
void CFFL_IFormFiller::OnCreate(CPDFSDK_Annot* pAnnot)
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
pFormFiller->OnCreate(pAnnot);
}
@@ -118,7 +118,7 @@ void CFFL_IFormFiller::OnCreate(CPDFSDK_Annot* pAnnot)
void CFFL_IFormFiller::OnLoad(CPDFSDK_Annot* pAnnot)
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
pFormFiller->OnLoad(pAnnot);
}
@@ -126,7 +126,7 @@ void CFFL_IFormFiller::OnLoad(CPDFSDK_Annot* pAnnot)
void CFFL_IFormFiller::OnDelete(CPDFSDK_Annot* pAnnot)
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
pFormFiller->OnDelete(pAnnot);
}
@@ -144,7 +144,7 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot*
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (pWidget->GetAAction(CPDF_AAction::CursorEnter))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
int nValueAge = pWidget->GetValueAge();
@@ -158,13 +158,13 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot*
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView );
- m_bNotifying = false;
+ m_bNotifying = FALSE;
//if ( !IsValidAnnot(pPageView, pAnnot) ) return;
if (pWidget->IsAppModified())
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
{
pFormFiller->ResetPDFWindow(pPageView, pWidget->GetValueAge() == nValueAge);
}
@@ -172,7 +172,7 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot*
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, true))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
{
pFormFiller->OnMouseEnter(pPageView, pAnnot);
}
@@ -188,7 +188,7 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (pWidget->GetAAction(CPDF_AAction::CursorExit))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
pWidget->ClearAppModified();
@@ -202,13 +202,13 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView);
- m_bNotifying = false;
+ m_bNotifying = FALSE;
//if (!IsValidAnnot(pPageView, pAnnot)) return;
if (pWidget->IsAppModified())
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
{
pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
}
@@ -216,13 +216,13 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
pFormFiller->OnMouseExit(pPageView, pAnnot);
}
}
-bool CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
@@ -232,7 +232,7 @@ bool CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot*
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (Annot_HitTest(pPageView, pAnnot, point) && pWidget->GetAAction(CPDF_AAction::ButtonDown))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
pWidget->ClearAppModified();
@@ -245,13 +245,13 @@ bool CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot*
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags);
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlags);
pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView);
- m_bNotifying = false;
+ m_bNotifying = FALSE;
- if (!IsValidAnnot(pPageView, pAnnot)) return true;
+ if (!IsValidAnnot(pPageView, pAnnot)) return TRUE;
if (pWidget->IsAppModified())
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
{
pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
}
@@ -259,15 +259,15 @@ bool CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot*
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
return pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
@@ -286,24 +286,24 @@ bool CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p
break;
}
- bool bRet = false;
+ FX_BOOL bRet = FALSE;
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
}
if (pDocument->GetFocusAnnot() == pAnnot)
{
- bool bExit = false;
- bool bReset = false;
+ FX_BOOL bExit = FALSE;
+ FX_BOOL bReset = FALSE;
OnButtonUp(pWidget, pPageView, bReset, bExit,nFlags);
- if (bExit) return true;
+ if (bExit) return TRUE;
}
return bRet;
}
-void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bReset, bool& bExit,FX_UINT nFlag)
+void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag)
{
ASSERT(pWidget != NULL);
@@ -311,7 +311,7 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa
{
if (pWidget->GetAAction(CPDF_AAction::ButtonUp))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
int nAge = pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -326,122 +326,122 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView);
- m_bNotifying = false;
+ m_bNotifying = FALSE;
if (!IsValidAnnot(pPageView, pWidget))
{
- bExit = true;
+ bExit = TRUE;
return;
}
if (nAge != pWidget->GetAppearanceAge())
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
{
pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
}
- bReset = true;
+ bReset = TRUE;
}
}
}
}
-bool CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
return pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
//change cursor
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, true))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
{
return pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
+FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
return pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, point);
}
- return false;
+ return FALSE;
}
-bool CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
return pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
return pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
{
ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags);
}
- return false;
+ return FALSE;
}
-bool CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (nChar == FWL_VKEY_Tab)
- return true;
+ return TRUE;
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
return pFormFiller->OnChar(pAnnot, nChar, nFlags);
- return false;
+ return FALSE;
}
-bool CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
{
if (!pAnnot)
- return false;
+ return FALSE;
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
@@ -450,7 +450,7 @@ bool CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (pWidget->GetAAction(CPDF_AAction::GetFocus))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
pWidget->GetAppearanceAge();
int nValueAge = pWidget->GetValueAge();
@@ -463,15 +463,15 @@ bool CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, true);
- if(!pFormFiller) return false;
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE);
+ if(!pFormFiller) return FALSE;
pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa);
pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView);
- m_bNotifying = false;
+ m_bNotifying = FALSE;
if (pWidget->IsAppModified())
{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
{
pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
}
@@ -479,18 +479,18 @@ bool CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
}
}
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, true))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
return pFormFiller->OnSetFocus(pAnnot, nFlag);
- return true;
+ return TRUE;
}
-bool CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
{
- if(!pAnnot) return false;
+ if(!pAnnot) return FALSE;
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false))
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
{
if (pFormFiller->OnKillFocus(pAnnot, nFlag))
{
@@ -499,7 +499,7 @@ bool CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (pWidget->GetAAction(CPDF_AAction::LoseFocus))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
pWidget->ClearAppModified();
CPDFSDK_PageView* pPageView = pWidget->GetPageView();
@@ -512,24 +512,24 @@ bool CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa);
pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView);
- m_bNotifying = false;
+ m_bNotifying = FALSE;
}
}
}
else
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget)
+FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget)
{
return pWidget->IsVisible();
}
-bool CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget)
+FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget)
{
ASSERT(pWidget != NULL);
@@ -538,12 +538,12 @@ bool CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget)
return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY;
}
-bool CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget)
+FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget)
{
ASSERT(pWidget != NULL);
if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return true;
+ return TRUE;
else
{
CPDF_Page* pPage = pWidget->GetPDFPage();
@@ -557,10 +557,10 @@ bool CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget)
(dwPermissions&FPDFPERM_ANNOT_FORM) ||
(dwPermissions&FPDFPERM_MODIFY);
}
- return true;
+ return TRUE;
}
-CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, bool bRegister)
+CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister)
{
auto it = m_Maps.find(pAnnot);
if (it != m_Maps.end())
@@ -666,7 +666,7 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX
}
FX_FLOAT fFactHeight = 0;
- bool bBottom = true;
+ FX_BOOL bBottom = TRUE;
FX_FLOAT fMaxListBoxHeight = 0;
if (fPopupMax > FFL_MAXLISTBOXHEIGHT)
{
@@ -685,26 +685,26 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX
if (fBottom > fMaxListBoxHeight)
{
fFactHeight = fMaxListBoxHeight;
- bBottom = true;
+ bBottom = TRUE;
}
else
{
if (fTop > fMaxListBoxHeight)
{
fFactHeight = fMaxListBoxHeight;
- bBottom = false;
+ bBottom = FALSE;
}
else
{
if (fTop > fBottom)
{
fFactHeight = fTop;
- bBottom = false;
+ bBottom = FALSE;
}
else
{
fFactHeight = fBottom;
- bBottom = true;
+ bBottom = TRUE;
}
}
}
@@ -713,14 +713,14 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX
fPopupRet = fFactHeight;
}
-void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bRC, bool& bExit, FX_DWORD nFlag)
+void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
{
if (!m_bNotifying)
{
ASSERT(pWidget != NULL);
if (pWidget->GetAAction(CPDF_AAction::KeyStroke))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
pWidget->ClearAppModified();
ASSERT(pPageView != NULL);
@@ -728,11 +728,11 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageVi
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
- fa.bWillCommit = true;
- fa.bKeyDown = true;
- fa.bRC = true;
+ fa.bWillCommit = TRUE;
+ fa.bKeyDown = TRUE;
+ fa.bRC = TRUE;
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
ASSERT(pFormFiller != NULL);
pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa);
@@ -744,19 +744,19 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageVi
bRC = fa.bRC;
// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
- m_bNotifying = false;
+ m_bNotifying = FALSE;
}
}
}
-void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bRC, bool& bExit, FX_DWORD nFlag)
+void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
{
if (!m_bNotifying)
{
ASSERT(pWidget != NULL);
if (pWidget->GetAAction(CPDF_AAction::Validate))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
pWidget->ClearAppModified();
ASSERT(pPageView != NULL);
@@ -768,10 +768,10 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
- fa.bKeyDown = true;
- fa.bRC = true;
+ fa.bKeyDown = TRUE;
+ fa.bRC = TRUE;
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
ASSERT(pFormFiller != NULL);
pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa);
@@ -783,12 +783,12 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa
bRC = fa.bRC;
// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
- m_bNotifying = false;
+ m_bNotifying = FALSE;
}
}
}
-void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bExit, FX_DWORD nFlag)
+void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag)
{
if (!m_bNotifying)
{
@@ -806,11 +806,11 @@ void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pP
// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
- m_bNotifying = false;
+ m_bNotifying = FALSE;
}
}
-void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, bool& bExit, FX_DWORD nFlag)
+void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag)
{
if (!m_bNotifying)
{
@@ -824,7 +824,7 @@ void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPage
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
- bool bFormated = false;
+ FX_BOOL bFormated = FALSE;
CFX_WideString sValue = pInterForm->OnFormat(pWidget->GetFormField(), bFormated);
// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
@@ -833,15 +833,15 @@ void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPage
if (bFormated)
{
- pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), true);
+ pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), TRUE);
pInterForm->UpdateField(pWidget->GetFormField());
}
- m_bNotifying = false;
+ m_bNotifying = FALSE;
}
}
-bool CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
+FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
{
ASSERT(pPageView != NULL);
@@ -850,26 +850,26 @@ bool CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot*
if(pPageView)
return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot());
else
- return false;
+ return FALSE;
}
-void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, int32_t nKeyCode,
+void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode,
CFX_WideString & strChange, const CFX_WideString& strChangeEx,
int nSelStart, int nSelEnd,
- bool bKeyDown, bool & bRC, bool & bExit, FX_DWORD nFlag)
+ FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag)
{
ASSERT(pPrivateData != NULL);
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData->pWidget != NULL);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, false);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
ASSERT(pFormFiller != NULL);
if (!m_bNotifying)
{
if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke))
{
- m_bNotifying = true;
+ m_bNotifying = TRUE;
int nAge = pData->pWidget->GetAppearanceAge();
int nValueAge = pData->pWidget->GetValueAge();
@@ -882,8 +882,8 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, i
fa.sChange = strChange;
fa.sChangeEx = strChangeEx;
fa.bKeyDown = bKeyDown;
- fa.bWillCommit = false;
- fa.bRC = true;
+ fa.bWillCommit = FALSE;
+ fa.bRC = TRUE;
fa.nSelStart = nSelStart;
fa.nSelEnd = nSelEnd;
@@ -895,8 +895,8 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, i
{
if (!IsValidAnnot(pData->pPageView, pData->pWidget))
{
- bExit = true;
- m_bNotifying = false;
+ bExit = TRUE;
+ m_bNotifying = FALSE;
return;
}
@@ -904,48 +904,48 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(bool bEditOrList, void* pPrivateData, i
{
CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(pData->pPageView, nValueAge == pData->pWidget->GetValueAge());
pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
- bExit = true;
+ bExit = TRUE;
}
if (fa.bRC)
{
pFormFiller->SetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa);
- bRC = false;
+ bRC = FALSE;
}
else
{
pFormFiller->RestoreState(pData->pPageView);
- bRC = false;
+ bRC = FALSE;
}
if (pDocument->GetFocusAnnot() != pData->pWidget)
{
pFormFiller->CommitData(pData->pPageView,nFlag);
- bExit = true;
+ bExit = TRUE;
}
}
else
{
if (!IsValidAnnot(pData->pPageView, pData->pWidget))
{
- bExit = true;
- m_bNotifying = false;
+ bExit = TRUE;
+ m_bNotifying = FALSE;
return;
}
}
- m_bNotifying = false;
+ m_bNotifying = FALSE;
}
}
}
-void CFFL_IFormFiller::OnAfterKeyStroke(bool bEditOrList, void* pPrivateData, bool & bExit,FX_DWORD nFlag)
+void CFFL_IFormFiller::OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit,FX_DWORD nFlag)
{
ASSERT(pPrivateData != NULL);
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData->pWidget != NULL);
- CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, false);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
ASSERT(pFormFiller != NULL);
if (!bEditOrList)
diff --git a/fpdfsdk/src/formfiller/FFL_ListBox.cpp b/fpdfsdk/src/formfiller/FFL_ListBox.cpp
index ef113dad96..c105cfcbdd 100644
--- a/fpdfsdk/src/formfiller/FFL_ListBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ListBox.cpp
@@ -73,7 +73,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView
{
m_OriginSelections.clear();
- bool bSetCaret = false;
+ FX_BOOL bSetCaret = FALSE;
for (int32_t i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
{
if (m_pWidget->IsOptionSelected(i))
@@ -81,7 +81,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView
if (!bSetCaret)
{
pWnd->SetCaret(i);
- bSetCaret = true;
+ bSetCaret = TRUE;
}
pWnd->Select(i);
m_OriginSelections.insert(i);
@@ -106,23 +106,23 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView
}
-bool CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+FX_BOOL CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-bool CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView)
{
- CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false);
+ CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE);
if (!pListBox)
- return false;
+ return FALSE;
if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) {
int nSelCount = 0;
for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; ++i) {
if (pListBox->IsItemSelected(i)) {
if (m_OriginSelections.count(i) == 0)
- return true;
+ return TRUE;
nSelCount++;
}
@@ -137,7 +137,7 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView)
{
ASSERT(m_pWidget != NULL);
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
{
CFX_IntArray aOldSelect, aNewSelect;
@@ -154,7 +154,7 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView)
int32_t nNewTopIndex = pListBox->GetTopVisibleIndex();
- m_pWidget->ClearSelection(false);
+ m_pWidget->ClearSelection(FALSE);
if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
{
@@ -162,19 +162,19 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView)
{
if (pListBox->IsItemSelected(i))
{
- m_pWidget->SetOptionSelection(i, true, false);
+ m_pWidget->SetOptionSelection(i, TRUE, FALSE);
aNewSelect.Add(i);
}
}
}
else
{
- m_pWidget->SetOptionSelection(pListBox->GetCurSel(), true, false);
+ m_pWidget->SetOptionSelection(pListBox->GetCurSel(), TRUE, FALSE);
aNewSelect.Add(pListBox->GetCurSel());
}
m_pWidget->SetTopVisibleIndex(nNewTopIndex);
- m_pWidget->ResetFieldAppearance(true);
+ m_pWidget->ResetFieldAppearance(TRUE);
m_pWidget->UpdateField();
SetChangeMark();
}
@@ -192,7 +192,7 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAct
}
else
{
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
{
ASSERT(m_pWidget != NULL);
int32_t nCurSel = pListBox->GetCurSel();
@@ -230,7 +230,7 @@ void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView)
{
ASSERT(pPageView != NULL);
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
{
for (int32_t i=0,sz=pListBox->GetCount(); i<sz; i++)
{
@@ -244,14 +244,14 @@ void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView)
void CFFL_ListBox::RestoreState(CPDFSDK_PageView* pPageView)
{
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false))
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
{
for (int i=0,sz=m_State.GetSize(); i<sz; i++)
pListBox->Select(m_State[i]);
}
}
-CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue)
+CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
{
if (bRestoreValue)
SaveState(pPageView);
@@ -263,17 +263,17 @@ CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestor
if (bRestoreValue)
{
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, false);
+ pRet = GetPDFWindow(pPageView, FALSE);
}
else
- pRet = GetPDFWindow(pPageView, true);
+ pRet = GetPDFWindow(pPageView, TRUE);
m_pWidget->UpdateField();
return pRet;
}
-void CFFL_ListBox::OnKeyStroke(bool bKeyDown, FX_DWORD nFlag)
+void CFFL_ListBox::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag)
{
ASSERT(m_pWidget != NULL);
@@ -289,7 +289,7 @@ void CFFL_ListBox::OnKeyStroke(bool bKeyDown, FX_DWORD nFlag)
if (CommitData(pPageView, nFlag))
{
DestroyPDFWindow(pPageView);
- m_bValid = false;
+ m_bValid = FALSE;
}
}
}
diff --git a/fpdfsdk/src/formfiller/FFL_Notify.cpp b/fpdfsdk/src/formfiller/FFL_Notify.cpp
index fdc4bcf7b1..58a2202b61 100644
--- a/fpdfsdk/src/formfiller/FFL_Notify.cpp
+++ b/fpdfsdk/src/formfiller/FFL_Notify.cpp
@@ -15,7 +15,7 @@
//#pragma warning(disable: 4800)
CFFL_Notify::CFFL_Notify(CFFL_FormFiller * pFormFiller) :
- m_bDoActioning(false),
+ m_bDoActioning(FALSE),
m_nNotifyFlag(0)
{
ASSERT(pFormFiller != NULL);
@@ -36,116 +36,116 @@ void CFFL_Notify::AfterNotify()
m_nNotifyFlag --;
}
-bool CFFL_Notify::OnMouseUp(bool & bExit)
+FX_BOOL CFFL_Notify::OnMouseUp(FX_BOOL & bExit)
{
BeforeNotify();
- bool bRet = false;//DoAAction(CPDF_AAction::AActionType::ButtonUp, bExit);
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonUp, bExit);
AfterNotify();
return bRet;
}
-bool CFFL_Notify::OnMouseDown(bool & bExit)
+FX_BOOL CFFL_Notify::OnMouseDown(FX_BOOL & bExit)
{
BeforeNotify();
- bool bRet = false;//DoAAction(CPDF_AAction::AActionType::ButtonDown, bExit);
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonDown, bExit);
AfterNotify();
return bRet;
}
-bool CFFL_Notify::OnMouseEnter(bool & bExit)
+FX_BOOL CFFL_Notify::OnMouseEnter(FX_BOOL & bExit)
{
BeforeNotify();
- bool bRet = false;//DoAAction(CPDF_AAction::AActionType::CursorEnter, bExit);
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorEnter, bExit);
AfterNotify();
return bRet;
}
-bool CFFL_Notify::OnMouseExit(bool & bExit)
+FX_BOOL CFFL_Notify::OnMouseExit(FX_BOOL & bExit)
{
BeforeNotify();
- bool bRet = false;//DoAAction(CPDF_AAction::AActionType::CursorExit, bExit);
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorExit, bExit);
AfterNotify();
return bRet;
}
-bool CFFL_Notify::OnSetFocus(bool & bExit)
+FX_BOOL CFFL_Notify::OnSetFocus(FX_BOOL & bExit)
{
BeforeNotify();
- bool bRet = false;//DoAAction(CPDF_AAction::AActionType::GetFocus, bExit);
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::GetFocus, bExit);
AfterNotify();
return bRet;
}
-bool CFFL_Notify::OnKillFocus(bool & bExit)
+FX_BOOL CFFL_Notify::OnKillFocus(FX_BOOL & bExit)
{
BeforeNotify();
- bool bRet = false;//DoAAction(CPDF_AAction::AActionType::LoseFocus, bExit);
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::LoseFocus, bExit);
AfterNotify();
return bRet;
}
-bool CFFL_Notify::OnCalculate()
+FX_BOOL CFFL_Notify::OnCalculate()
{
- return true;
+ return TRUE;
}
-bool CFFL_Notify::OnFormat(int iCommitKey)
+FX_BOOL CFFL_Notify::OnFormat(int iCommitKey)
{
- return true;
+ return TRUE;
}
-bool CFFL_Notify::OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
- const CFX_WideString& strChangeEx, bool bKeyDown, bool bModifier,
- bool bShift, bool bWillCommit, bool bFieldFull,
- int& nSelStart, int& nSelEnd, bool& bRC)
+FX_BOOL CFFL_Notify::OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
+ FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull,
+ int& nSelStart, int& nSelEnd, FX_BOOL& bRC)
{
- return true;
+ return TRUE;
}
-bool CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
- const CFX_WideString& strChangeEx, bool bKeyDown, bool bModifier,
- bool bShift, bool & bRC)
+FX_BOOL CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
+ FX_BOOL bShift, FX_BOOL & bRC)
{
- return true;
+ return TRUE;
}
-bool CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, bool & bExit)
+FX_BOOL CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit)
{
if (m_bDoActioning)
- return false;
+ return FALSE;
CPDF_Action action;
if (!FindAAction(eAAT, action))
- return false;
+ return FALSE;
- m_bDoActioning = true;
+ m_bDoActioning = TRUE;
ExecuteActionTree(eAAT,action,bExit);
- m_bDoActioning = false;
- return true;
+ m_bDoActioning = FALSE;
+ return TRUE;
}
-bool CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, bool& bExit)
+FX_BOOL CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, FX_BOOL& bExit)
{
- if (!ExecuteAction(eAAT,action,bExit)) return false;
- if (bExit) return true;
+ if (!ExecuteAction(eAAT,action,bExit)) return FALSE;
+ if (bExit) return TRUE;
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteActionTree(eAAT,subaction,bExit)) return false;
+ if (!ExecuteActionTree(eAAT,subaction,bExit)) return FALSE;
if (bExit) break;
}
- return true;
+ return TRUE;
}
-bool CFFL_Notify::FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action)
+FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action)
{
- return false;
+ return FALSE;
}
-bool CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action)
+FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action)
{
CPDF_Action MyAction;
@@ -154,20 +154,20 @@ bool CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAA
MyAction = aaction.GetAction(eAAT);
}
else
- return false;
+ return FALSE;
if (MyAction.GetType() == CPDF_Action::Unknown)
- return false;
+ return FALSE;
action = MyAction;
- return true;
+ return TRUE;
}
-bool CFFL_Notify::ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,bool& bExit)
+FX_BOOL CFFL_Notify::ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit)
{
- return false;
+ return FALSE;
}
//#pragma warning(default: 4800)
diff --git a/fpdfsdk/src/formfiller/FFL_PushButton.cpp b/fpdfsdk/src/formfiller/FFL_PushButton.cpp
index 44e4ed03f3..a5df48840c 100644
--- a/fpdfsdk/src/formfiller/FFL_PushButton.cpp
+++ b/fpdfsdk/src/formfiller/FFL_PushButton.cpp
@@ -28,7 +28,7 @@ CPWL_Wnd* CFFL_PushButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageV
}
-bool CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+FX_BOOL CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
index e7b334828a..1f73e8ccaa 100644
--- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
+++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
@@ -31,19 +31,19 @@ CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_Page
return pWnd;
}
-bool CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+FX_BOOL CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
{
switch (nKeyCode)
{
case FWL_VKEY_Return:
case FWL_VKEY_Space:
- return true;
+ return TRUE;
default:
return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
}
}
-bool CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
switch (nChar)
{
@@ -56,61 +56,61 @@ bool CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFla
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
ASSERT(pPageView != NULL);
- bool bReset = false;
- bool bExit = false;
+ FX_BOOL bReset = FALSE;
+ FX_BOOL bExit = FALSE;
pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags);
- if (bReset) return true;
- if (bExit) return true;
+ if (bReset) return TRUE;
+ if (bExit) return TRUE;
CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
- if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, true))
- pWnd->SetCheck(true);
+ if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE))
+ pWnd->SetCheck(TRUE);
CommitData(pPageView,nFlags);
- return true;
+ return TRUE;
}
default:
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
}
-bool CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
if (IsValid())
{
- if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, true))
- pWnd->SetCheck(true);
+ if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE))
+ pWnd->SetCheck(TRUE);
- if (!CommitData(pPageView,nFlags)) return false;
+ if (!CommitData(pPageView,nFlags)) return FALSE;
}
- return true;
+ return TRUE;
}
-bool CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView)
+FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView)
{
ASSERT(m_pWidget != NULL);
- if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, false))
+ if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE))
{
return pWnd->IsChecked() != m_pWidget->IsChecked();
}
- return false;
+ return FALSE;
}
void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView)
{
ASSERT(m_pWidget != NULL);
- if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, false))
+ if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE))
{
- bool bNewChecked = pWnd->IsChecked();
+ FX_BOOL bNewChecked = pWnd->IsChecked();
if (bNewChecked)
{
@@ -129,7 +129,7 @@ void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView)
}
}
- m_pWidget->SetCheck(bNewChecked, false);
+ m_pWidget->SetCheck(bNewChecked, FALSE);
m_pWidget->UpdateField();
SetChangeMark();
}
diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp
index a8695f4aa5..a4b87263ed 100644
--- a/fpdfsdk/src/formfiller/FFL_TextField.cpp
+++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp
@@ -129,7 +129,7 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVi
}
-bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
switch (nChar)
{
@@ -144,7 +144,7 @@ bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags
if (m_bValid)
{
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true))
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
pWnd->SetFocus();
}
else
@@ -152,9 +152,9 @@ bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags
if (CommitData(pPageView, nFlags))
{
DestroyPDFWindow(pPageView);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
}
break;
@@ -162,35 +162,35 @@ bool CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags
{
CPDFSDK_PageView* pPageView = GetCurPageView();
ASSERT(pPageView != NULL);
- EscapeFiller(pPageView,true);
- return true;
+ EscapeFiller(pPageView,TRUE);
+ return TRUE;
}
}
return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}
-bool CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView)
+FX_BOOL CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView)
{
ASSERT(m_pWidget != NULL);
- if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, false))
+ if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
return pEdit->GetText() != m_pWidget->GetValue();
- return false;
+ return FALSE;
}
void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView)
{
ASSERT(m_pWidget != NULL);
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false))
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
{
CFX_WideString sOldValue = m_pWidget->GetValue();
CFX_WideString sNewValue = pWnd->GetText();
- m_pWidget->SetValue(sNewValue, false);
- m_pWidget->ResetFieldAppearance(true);
+ m_pWidget->SetValue(sNewValue, FALSE);
+ m_pWidget->ResetFieldAppearance(TRUE);
m_pWidget->UpdateField();
SetChangeMark();
}
@@ -202,7 +202,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA
switch (type)
{
case CPDF_AAction::KeyStroke:
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false))
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
{
fa.bFieldFull = pWnd->IsTextFull();
@@ -216,7 +216,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA
}
break;
case CPDF_AAction::Validate:
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false))
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
{
fa.sValue = pWnd->GetText();
}
@@ -237,7 +237,7 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA
switch (type)
{
case CPDF_AAction::KeyStroke:
- if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, false))
+ if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
{
pEdit->SetFocus();
pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
@@ -250,7 +250,7 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA
}
-bool CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
const PDFSDK_FieldAction& faNew)
{
switch (type)
@@ -262,14 +262,14 @@ bool CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const P
break;
}
- return false;
+ return FALSE;
}
void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView)
{
ASSERT(pPageView != NULL);
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, false))
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
{
pWnd->GetSel(m_State.nStart, m_State.nEnd);
m_State.sValue = pWnd->GetText();
@@ -280,14 +280,14 @@ void CFFL_TextField::RestoreState(CPDFSDK_PageView* pPageView)
{
ASSERT(pPageView != NULL);
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, true))
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, TRUE))
{
pWnd->SetText(m_State.sValue.c_str());
pWnd->SetSel(m_State.nStart, m_State.nEnd);
}
}
-CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRestoreValue)
+CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
{
if (bRestoreValue)
SaveState(pPageView);
@@ -299,10 +299,10 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, bool bRest
if (bRestoreValue)
{
RestoreState(pPageView);
- pRet = GetPDFWindow(pPageView, false);
+ pRet = GetPDFWindow(pPageView, FALSE);
}
else
- pRet = GetPDFWindow(pPageView, true);
+ pRet = GetPDFWindow(pPageView, TRUE);
m_pWidget->UpdateField();
@@ -326,7 +326,7 @@ void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd)
int nCharacters = wsText.GetLength();
CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str();
- m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, true);
+ m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE);
pEdit->SetEditNotify(this);
//pUndo->BeginEdit(pDocument);
@@ -338,19 +338,19 @@ void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd)
}
-bool CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
-bool CFFL_TextField::CanCut(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_TextField::CanCut(CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
-bool CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument)
+FX_BOOL CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit)
diff --git a/fpdfsdk/src/formfiller/FFL_Utils.cpp b/fpdfsdk/src/formfiller/FFL_Utils.cpp
index 0e5022c9c1..8d2d76d73c 100644
--- a/fpdfsdk/src/formfiller/FFL_Utils.cpp
+++ b/fpdfsdk/src/formfiller/FFL_Utils.cpp
@@ -41,9 +41,9 @@ CPDF_Rect CFFL_Utils::DeflateRect(const CPDF_Rect & crRect,const FX_FLOAT & fSiz
return crNew;
}
-bool CFFL_Utils::TraceObject(CPDF_Object* pObj)
+FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj)
{
- if (!pObj) return false;
+ if (!pObj) return FALSE;
FX_DWORD dwObjNum = pObj->GetObjNum();
switch (pObj->GetType())
@@ -71,7 +71,7 @@ bool CFFL_Utils::TraceObject(CPDF_Object* pObj)
//TRACE(csKey + "\n");
if (!pElement) break;
TraceObject(pElement);
- }while (true);
+ }while (TRUE);
}
break;
@@ -107,8 +107,8 @@ bool CFFL_Utils::TraceObject(CPDF_Object* pObj)
default:
break;
}
- if (dwObjNum == 0) return false;
+ if (dwObjNum == 0) return FALSE;
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index 85eba55212..b26d2af10a 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -21,7 +21,7 @@ public:
m_pfileAvail = pfileAvail;
}
- virtual bool IsDataAvail( FX_FILESIZE offset, FX_DWORD size)
+ virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size)
{
return m_pfileAvail->IsDataAvail(m_pfileAvail, offset, size);
}
@@ -48,7 +48,7 @@ public:
return m_pFileAccess->m_FileLen;
}
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
return m_pFileAccess->m_GetBlock(m_pFileAccess->m_Param, offset, (uint8_t*)buffer, size);
}
diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp
index 741347474c..0d8db417ac 100644
--- a/fpdfsdk/src/fpdf_ext.cpp
+++ b/fpdfsdk/src/fpdf_ext.cpp
@@ -14,7 +14,7 @@ class CFSDK_UnsupportInfo_Adapter
{
public:
CFSDK_UnsupportInfo_Adapter(UNSUPPORT_INFO* unsp_info){ m_unsp_info = unsp_info;}
-// bool NeedToPauseNow();
+// FX_BOOL NeedToPauseNow();
void ReportError(int nErrorType);
private:
@@ -35,25 +35,25 @@ void FreeUnsupportInfo(void* pData)
delete pAdapter;
}
-bool FPDF_UnSupportError(int nError)
+FX_BOOL FPDF_UnSupportError(int nError)
{
CFSDK_UnsupportInfo_Adapter * pAdapter = (CFSDK_UnsupportInfo_Adapter *)CPDF_ModuleMgr::Get()->GetPrivateData((void *)FPDFSDK_UNSUPPORT_CALL);
if(!pAdapter)
- return false;
+ return FALSE;
pAdapter->ReportError(nError);
- return true;
+ return TRUE;
}
DLLEXPORT FPDF_BOOL STDCALL FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info)
{
if (!unsp_info || unsp_info->version!=1)
- return false;
+ return FALSE;
CFSDK_UnsupportInfo_Adapter * pAdapter = new CFSDK_UnsupportInfo_Adapter(unsp_info);
CPDF_ModuleMgr::Get()->SetPrivateData((void *)FPDFSDK_UNSUPPORT_CALL,pAdapter, &FreeUnsupportInfo);
- return true;
+ return TRUE;
}
void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot)
@@ -104,7 +104,7 @@ void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot)
}
-bool CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName)
+FX_BOOL CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName)
{
int count = pElement->CountAttrs();
int i=0;
@@ -143,10 +143,10 @@ bool CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName)
{
CXML_Element * pChild = pElement->GetElement(i);
if(CheckSharedForm(pChild, cbName))
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code)
@@ -206,7 +206,7 @@ void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code)
CheckSharedForm(pElement, "workflowType");
// XFA Forms
- CPDF_InterForm * pInterForm = new CPDF_InterForm(pDoc,false);
+ CPDF_InterForm * pInterForm = new CPDF_InterForm(pDoc,FALSE);
if (pInterForm->HasXFAForm())
{
FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM);
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index 3dbb0a1e69..988d7f46b5 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -13,17 +13,17 @@ typedef CFX_ArrayTemplate<CPDF_Rect> CPDF_RectArray;
enum FPDF_TYPE { MAX, MIN };
enum FPDF_VALUE { TOP, LEFT, RIGHT, BOTTOM };
-bool IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage)
+FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage)
{
if ( rect.left - rect.right > 0.000001f ||
rect.bottom - rect.top > 0.000001f)
- return false;
+ return FALSE;
if (rect.left == 0.0f &&
rect.top == 0.0f &&
rect.right == 0.0f &&
rect.bottom == 0.0f)
- return false;
+ return FALSE;
if (!rcPage.IsEmpty())
{
@@ -31,17 +31,17 @@ bool IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage)
rect.right - rcPage.right > 10.000001f ||
rect.top - rcPage.top > 10.000001f ||
rect.bottom - rcPage.bottom < -10.000001f)
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_RectArray * pRectArray )
+FX_BOOL GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_RectArray * pRectArray )
{
CPDF_Page* pPDFPage = new CPDF_Page;
- pPDFPage->Load( pDoc, pDict, false );
+ pPDFPage->Load( pDoc, pDict, FALSE );
pPDFPage->ParseContent();
FX_POSITION pos = pPDFPage->GetFirstObjectPosition();
@@ -64,7 +64,7 @@ bool GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_RectArr
}
delete pPDFPage;
- return true;
+ return TRUE;
}
@@ -217,7 +217,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document*
CFX_ByteString sStream;
sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str());
- pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), false, false);
+ pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE);
}
return;
}
@@ -237,7 +237,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document*
CFX_ByteString sStream = "q\n";
CFX_ByteString sBody = CFX_ByteString((const FX_CHAR*)acc.GetData(), acc.GetSize());
sStream = sStream + sBody + "\nQ";
- pContents->SetData((const uint8_t*)sStream, sStream.GetLength(), false, false);
+ pContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE);
pContentsArray->AddReference(pDocument, dwObjNum);
break;
}
@@ -264,7 +264,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document*
CFX_ByteString sStream;
sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str());
- pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), false, false);
+ pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE);
}
}
@@ -538,7 +538,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag)
sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, sFormName.c_str());
sStream += sTemp;
- pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), false, false);
+ pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE);
}
pPageDict->RemoveAt( "Annots" );
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp
index 0c49df6c84..4ec73ac2ba 100644
--- a/fpdfsdk/src/fpdf_progressive.cpp
+++ b/fpdfsdk/src/fpdf_progressive.cpp
@@ -29,20 +29,20 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE
#ifdef _SKIA_SUPPORT_
pContext->m_pDevice = new CFX_SkiaDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,true);
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
else
((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
#else
pContext->m_pDevice = new CFX_FxgeDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,true);
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
else
((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
#endif
IFSDK_PAUSE_Adapter IPauseAdapter(pause);
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
- rotate, flags,false, &IPauseAdapter);
+ rotate, flags,FALSE, &IPauseAdapter);
if (pContext->m_pRenderer)
return CPDF_ProgressiveRenderer::ToFPDFStatus(pContext->m_pRenderer->GetStatus());
diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp
index 691710798c..cf0cdd915b 100644
--- a/fpdfsdk/src/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp
@@ -20,16 +20,16 @@ public:
delete this;
}
- virtual bool EnumFontList(CFX_FontMapper* pMapper) override
+ virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) override
{
if (m_pInfo->EnumFonts) {
m_pInfo->EnumFonts(m_pInfo, pMapper);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
- virtual void* MapFont(int weight, bool bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, int& iExact) override
{
if (m_pInfo->MapFont)
return m_pInfo->MapFont(m_pInfo, weight, bItalic, charset, pitch_family, family, &iExact);
@@ -50,25 +50,25 @@ public:
return 0;
}
- virtual bool GetFaceName(void* hFont, CFX_ByteString& name) override
+ virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override
{
- if (m_pInfo->GetFaceName == NULL) return false;
+ if (m_pInfo->GetFaceName == NULL) return FALSE;
FX_DWORD size = m_pInfo->GetFaceName(m_pInfo, hFont, NULL, 0);
- if (size == 0) return false;
+ if (size == 0) return FALSE;
char* buffer = FX_Alloc(char, size);
size = m_pInfo->GetFaceName(m_pInfo, hFont, buffer, size);
name = CFX_ByteString(buffer, size);
FX_Free(buffer);
- return true;
+ return TRUE;
}
- virtual bool GetFontCharset(void* hFont, int& charset) override
+ virtual FX_BOOL GetFontCharset(void* hFont, int& charset) override
{
if (m_pInfo->GetFontCharset) {
charset = m_pInfo->GetFontCharset(m_pInfo, hFont);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
virtual void DeleteFont(void* hFont) override
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp
index cf17f20ddc..a29db5a9dc 100644
--- a/fpdfsdk/src/fpdf_transformpage.cpp
+++ b/fpdfsdk/src/fpdf_transformpage.cpp
@@ -42,7 +42,7 @@ DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bot
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top)
{
if(!page)
- return false;
+ return FALSE;
CPDF_Page* pPage = (CPDF_Page*)page;
CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
CPDF_Array* pArray = pPageDict->GetArray("MediaBox");
@@ -52,15 +52,15 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, fl
*bottom = pArray->GetFloat(1);
*right = pArray->GetFloat(2);
*top = pArray->GetFloat(3);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top)
{
if(!page)
- return false;
+ return FALSE;
CPDF_Page* pPage = (CPDF_Page*)page;
CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
CPDF_Array* pArray = pPageDict->GetArray("CropBox");
@@ -70,15 +70,15 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, flo
*bottom = pArray->GetFloat(1);
*right = pArray->GetFloat(2);
*top = pArray->GetFloat(3);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX* matrix, FS_RECTF* clipRect)
{
if(!page)
- return false;
+ return FALSE;
CFX_ByteTextBuf textBuf;
textBuf<<"q ";
@@ -99,19 +99,19 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX
if(!pContentObj)
pContentObj = pPageDic ? pPageDic->GetArray("Contents") : NULL;
if(!pContentObj)
- return false;
+ return FALSE;
CPDF_Dictionary* pDic = new CPDF_Dictionary;
CPDF_Stream* pStream = new CPDF_Stream(NULL,0, pDic);
- pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), false, false);
+ pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), FALSE, FALSE);
CPDF_Document* pDoc = pPage->m_pDocument;
if(!pDoc)
- return false;
+ return FALSE;
pDoc->AddIndirectObject(pStream);
pDic = new CPDF_Dictionary;
CPDF_Stream* pEndStream = new CPDF_Stream(NULL,0, pDic);
- pEndStream->SetData((const uint8_t*)" Q", 2, false, false);
+ pEndStream->SetData((const uint8_t*)" Q", 2, FALSE, FALSE);
pDoc->AddIndirectObject(pEndStream);
CPDF_Array* pContentArray = NULL;
@@ -181,7 +181,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX
}
}
- return true;
+ return TRUE;
}
DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,double a, double b, double c, double d, double e, double f)
@@ -205,7 +205,7 @@ DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, fl
CPDF_Path Path;
Path.GetModify();
Path.AppendRect(left, bottom, right, top);
- pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, false);
+ pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE);
return pNewClipPath;
}
@@ -282,7 +282,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip
}
CPDF_Dictionary* pDic = new CPDF_Dictionary;
CPDF_Stream* pStream = new CPDF_Stream(NULL,0, pDic);
- pStream->SetData(strClip.GetBuffer(), strClip.GetSize(), false, false);
+ pStream->SetData(strClip.GetBuffer(), strClip.GetSize(), FALSE, FALSE);
CPDF_Document* pDoc = pPage->m_pDocument;
if(!pDoc)
return;
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index e2640697bb..f75197bdbf 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -208,13 +208,13 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict)
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot)
{
if(!page || !startPos || !linkAnnot)
- return false;
+ return FALSE;
CPDF_Page* pPage = (CPDF_Page*)page;
if(!pPage->m_pFormDict)
- return false;
+ return FALSE;
CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots");
if(!pAnnots)
- return false;
+ return FALSE;
for (int i = *startPos; i < (int)pAnnots->GetCount(); i++) {
CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
if (!pDict || pDict->GetType() != PDFOBJ_DICTIONARY)
@@ -222,23 +222,23 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FP
if(pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link"))) {
*startPos = i + 1;
*linkAnnot = (FPDF_LINK)pDict;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect)
{
if(!linkAnnot || !rect)
- return false;
+ return FALSE;
CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
CPDF_Rect rt = pAnnotDict->GetRect(FX_BSTRC("Rect"));
rect->left = rt.left;
rect->bottom = rt.bottom;
rect->right = rt.right;
rect->top = rt.top;
- return true;
+ return TRUE;
}
DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot)
@@ -255,12 +255,12 @@ DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot)
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quadIndex, FS_QUADPOINTSF* quadPoints)
{
if(!linkAnnot || !quadPoints)
- return false;
+ return FALSE;
CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints"));
if (pArray) {
if (quadIndex < 0 || quadIndex >= (int)pArray->GetCount()/8 || ((quadIndex*8+7) >= (int)pArray->GetCount()))
- return false;
+ return FALSE;
quadPoints->x1 = pArray->GetNumber(quadIndex*8);
quadPoints->y1 = pArray->GetNumber(quadIndex*8+1);
quadPoints->x2 = pArray->GetNumber(quadIndex*8+2);
@@ -269,9 +269,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quad
quadPoints->y3 = pArray->GetNumber(quadIndex*8+5);
quadPoints->x4 = pArray->GetNumber(quadIndex*8+6);
quadPoints->y4 = pArray->GetNumber(quadIndex*8+7);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, FPDF_BYTESTRING tag,
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp
index cec3e2296d..96cfba4194 100644
--- a/fpdfsdk/src/fpdfeditimg.cpp
+++ b/fpdfsdk/src/fpdfeditimg.cpp
@@ -21,7 +21,7 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document)
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess)
{
if (!image_object || !fileAccess)
- return false;
+ return FALSE;
IFX_FileRead* pFile = new CPDF_CustomAccess(fileAccess);
CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
@@ -33,7 +33,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCou
}
pImgObj->m_pImage->SetJpegImage(pFile);
- return true;
+ return TRUE;
}
@@ -41,7 +41,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix (FPDF_PAGEOBJECT image_object
double a, double b, double c, double d, double e, double f)
{
if (!image_object)
- return false;
+ return FALSE;
CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
pImgObj->m_Matrix.a = (FX_FLOAT)a;
pImgObj->m_Matrix.b = (FX_FLOAT)b;
@@ -50,13 +50,13 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix (FPDF_PAGEOBJECT image_object
pImgObj->m_Matrix.e = (FX_FLOAT)e;
pImgObj->m_Matrix.f = (FX_FLOAT)f;
pImgObj->CalcBoundingBox();
- return true;
+ return TRUE;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object,FPDF_BITMAP bitmap)
{
if (!image_object || !bitmap)
- return false;
+ return FALSE;
CFX_DIBitmap* pBmp = NULL;
pBmp = (CFX_DIBitmap*)bitmap;
CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
@@ -66,8 +66,8 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,F
CPDF_Page* pPage = (CPDF_Page*)pages[index];
pImgObj->m_pImage->ResetCache(pPage,NULL);
}
- pImgObj->m_pImage->SetImage(pBmp,false);
+ pImgObj->m_pImage->SetImage(pBmp,FALSE);
pImgObj->CalcBoundingBox();
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp
index 8236cb206d..12c2cce1e2 100644
--- a/fpdfsdk/src/fpdfeditpage.cpp
+++ b/fpdfsdk/src/fpdfeditpage.cpp
@@ -215,7 +215,7 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index)
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page)
{
- if(!page) return false;
+ if(!page) return FALSE;
CPDF_Page* pPage = (CPDF_Page*)page;
return pPage->BackgroundAlphaNeeded();
@@ -223,34 +223,34 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page)
DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject)
{
- if(!pageObject) return false;
+ if(!pageObject) return FALSE;
CPDF_PageObject* pPageObj = (CPDF_PageObject*)pageObject;
const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
- if (blend_type != FXDIB_BLEND_NORMAL) return true;
+ if (blend_type != FXDIB_BLEND_NORMAL) return TRUE;
CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL;
- if(pSMaskDict) return true;
+ if(pSMaskDict) return TRUE;
if(pGeneralState && pGeneralState->m_FillAlpha != 1.0f)
- return true;
+ return TRUE;
if(pPageObj->m_Type == PDFPAGE_PATH)
{
if(pGeneralState && pGeneralState->m_StrokeAlpha != 1.0f)
- return true;
+ return TRUE;
}
if(pPageObj->m_Type == PDFPAGE_FORM)
{
CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
if(pFormObj->m_pForm && (pFormObj->m_pForm->m_Transparency & PDFTRANS_ISOLATED))
- return true;
+ return TRUE;
if(pFormObj->m_pForm && (!(pFormObj->m_pForm->m_Transparency & PDFTRANS_ISOLATED) && (pFormObj->m_pForm->m_Transparency & PDFTRANS_GROUP)))
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page)
@@ -259,12 +259,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page)
if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") || !pPage->m_pFormDict->GetElement("Type")->GetDirect()
|| pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
{
- return false;
+ return FALSE;
}
CPDF_PageContentGenerate CG(pPage);
CG.GenerateContent();
- return true;
+ return TRUE;
}
DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object,
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 21a441ca57..d21d5d209d 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -28,7 +28,7 @@ CPDFSDK_InterForm* FormHandleToInterForm(FPDF_FORMHANDLE hHandle)
CPDFSDK_PageView* FormHandleToPageView(FPDF_FORMHANDLE hHandle, FPDF_PAGE page)
{
CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle);
- return pSDKDoc ? pSDKDoc->GetPageView((CPDF_Page*)page, true) : nullptr;
+ return pSDKDoc ? pSDKDoc->GetPageView((CPDF_Page*)page, TRUE) : nullptr;
}
} // namespace
@@ -41,7 +41,7 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(
CPDF_Page* pPage = (CPDF_Page*) page;
nonstd::unique_ptr<CPDF_InterForm> pInterForm(
- new CPDF_InterForm(pPage->m_pDocument, false));
+ new CPDF_InterForm(pPage->m_pDocument, FALSE));
CPDF_FormControl* pFormCtrl = pInterForm->GetControlAtPoint(
pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y);
if (!pFormCtrl)
@@ -84,7 +84,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, FPDF_PAGE
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return false;
+ return FALSE;
CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
return pPageView->OnMouseMove(pt, modifier);
@@ -94,7 +94,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAG
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return false;
+ return FALSE;
CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
return pPageView->OnLButtonDown(pt, modifier);
@@ -104,7 +104,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return false;
+ return FALSE;
CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
return pPageView->OnLButtonUp(pt, modifier);
@@ -114,7 +114,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE pa
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return false;
+ return FALSE;
return pPageView->OnKeyDown(nKeyCode, modifier);
}
@@ -123,7 +123,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return false;
+ return FALSE;
return pPageView->OnKeyUp(nKeyCode, modifier);
}
@@ -132,7 +132,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, FPDF_PAGE page,
{
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
- return false;
+ return FALSE;
return pPageView->OnChar(nChar, modifier);
}
@@ -141,7 +141,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle)
{
CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle);
if (!pSDKDoc)
- return false;
+ return FALSE;
return pSDKDoc->KillFocusAnnot(0);
}
@@ -216,7 +216,7 @@ DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle)
DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
{
if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page))
- pPageView->SetValid(true);
+ pPageView->SetValid(TRUE);
}
DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
@@ -229,10 +229,10 @@ DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hH
return;
CPDF_Page* pPage = (CPDF_Page*)page;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, false);
+ CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
if (pPageView)
{
- pPageView->SetValid(false);
+ pPageView->SetValid(FALSE);
// ReMovePageView() takes care of the delete for us.
pSDKDoc->ReMovePageView(pPage);
}
@@ -279,7 +279,7 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandl
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
CPDF_Page* pPage = (CPDF_Page*)page;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, false);
+ CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
if(pPageView)
{
CPDFDoc_Environment *pEnv = pSDKDoc->GetEnv();
@@ -293,8 +293,8 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandl
CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA"));
- bool bExistOAAction = false;
- bool bExistCAAction = false;
+ FX_BOOL bExistOAAction = FALSE;
+ FX_BOOL bExistCAAction = FALSE;
if (FPDFPAGE_AACTION_OPEN == aaType)
{
bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage);
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index 1ef69bf032..40d56b304d 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -15,14 +15,14 @@ public:
CPDF_PageOrganizer();
~CPDF_PageOrganizer();
- bool PDFDocInit(CPDF_Document* pDestPDFDoc, CPDF_Document* pSrcPDFDoc);
- bool ExportPage(CPDF_Document* pSrcPDFDoc,
+ FX_BOOL PDFDocInit(CPDF_Document* pDestPDFDoc, CPDF_Document* pSrcPDFDoc);
+ FX_BOOL ExportPage(CPDF_Document* pSrcPDFDoc,
CFX_WordArray* nPageNum,
CPDF_Document* pDestPDFDoc,
int nIndex);
CPDF_Object* PageDictGetInheritableTag(CPDF_Dictionary* pDict,
CFX_ByteString nSrctag);
- bool UpdateReference(CPDF_Object* pObj,
+ FX_BOOL UpdateReference(CPDF_Object* pObj,
CPDF_Document* pDoc,
ObjectNumberMap* pObjNumberMap);
FX_DWORD GetNewObjId(CPDF_Document* pDoc,
@@ -39,21 +39,21 @@ CPDF_PageOrganizer::~CPDF_PageOrganizer()
{
}
-bool CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
+FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
CPDF_Document* pSrcPDFDoc)
{
if (!pDestPDFDoc || !pSrcPDFDoc)
- return false;
+ return FALSE;
CPDF_Dictionary* pNewRoot = pDestPDFDoc->GetRoot();
if (!pNewRoot)
- return false;
+ return FALSE;
//Set the document information////////////////////////////////////////////
CPDF_Dictionary* DInfoDict = pDestPDFDoc->GetInfo();
if (!DInfoDict)
- return false;
+ return FALSE;
CFX_ByteString producerstr;
producerstr.Format("PDFium");
@@ -89,10 +89,10 @@ bool CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
pNewPages->SetAt("Count", new CPDF_Number(0));
}
- return true;
+ return TRUE;
}
-bool CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
+FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
CFX_WordArray* nPageNum,
CPDF_Document* pDestPDFDoc,
int nIndex)
@@ -106,7 +106,7 @@ bool CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
CPDF_Dictionary* pSrcPageDict =
pSrcPDFDoc->GetPage(nPageNum->GetAt(i) - 1);
if (!pSrcPageDict || !pCurPageDict)
- return false;
+ return FALSE;
// Clone the page dictionary///////////
FX_POSITION SrcPos = pSrcPageDict->GetStartPos();
@@ -151,7 +151,7 @@ bool CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
if (!pCurPageDict->KeyExist("Resources")) {
pInheritable = PageDictGetInheritableTag(pSrcPageDict, "Resources");
if (!pInheritable)
- return false;
+ return FALSE;
pCurPageDict->SetAt("Resources", pInheritable->Clone());
}
//3 CropBox //Optional
@@ -178,7 +178,7 @@ bool CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
++curpage;
}
- return true;
+ return TRUE;
}
CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(
@@ -220,7 +220,7 @@ CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(
return nullptr;
}
-bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
+FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
CPDF_Document* pDoc,
ObjectNumberMap* pObjNumberMap)
{
@@ -229,7 +229,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
CPDF_Reference* pReference = (CPDF_Reference*)pObj;
FX_DWORD newobjnum = GetNewObjId(pDoc, pObjNumberMap, pReference);
if (newobjnum == 0)
- return false;
+ return FALSE;
pReference->SetRef(pDoc, newobjnum);
break;
}
@@ -249,7 +249,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
pDict->RemoveAt(key);
} else {
- return false;
+ return FALSE;
}
}
break;
@@ -260,9 +260,9 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
for (FX_DWORD i = 0; i < count; ++i) {
CPDF_Object* pNextObj = pArray->GetElement(i);
if (!pNextObj)
- return false;
+ return FALSE;
if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
- return false;
+ return FALSE;
}
break;
}
@@ -271,9 +271,9 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
CPDF_Dictionary* pDict = pStream->GetDict();
if (pDict) {
if (!UpdateReference(pDict, pDoc, pObjNumberMap))
- return false;
+ return FALSE;
} else {
- return false;
+ return FALSE;
}
break;
}
@@ -281,7 +281,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
break;
}
- return true;
+ return TRUE;
}
FX_DWORD CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
@@ -341,7 +341,7 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring,
CFX_ByteString cbCompareString("0123456789-,");
for (int i = 0; i < nLength; ++i) {
if (cbCompareString.Find(rangstring[i]) == -1)
- return false;
+ return FALSE;
}
CFX_ByteString cbMidRange;
int nStringFrom = 0;
@@ -355,23 +355,23 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring,
if (nMid == -1) {
long lPageNum = atol(cbMidRange);
if (lPageNum <= 0 || lPageNum > nCount)
- return false;
+ return FALSE;
pageArray->Add((FX_WORD)lPageNum);
} else {
int nStartPageNum = atol(cbMidRange.Mid(0, nMid));
if (nStartPageNum == 0)
- return false;
+ return FALSE;
++nMid;
int nEnd = cbMidRange.GetLength() - nMid;
if (nEnd == 0)
- return false;
+ return FALSE;
int nEndPageNum = atol(cbMidRange.Mid(nMid, nEnd));
if (nStartPageNum < 0 ||
nStartPageNum >nEndPageNum ||
nEndPageNum > nCount) {
- return false;
+ return FALSE;
}
for (int i = nStartPageNum; i <= nEndPageNum; ++i) {
pageArray->Add(i);
@@ -380,7 +380,7 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring,
nStringFrom = nStringTo + 1;
}
}
- return true;
+ return TRUE;
}
DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
@@ -389,14 +389,14 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,
int index)
{
if (!dest_doc || !src_doc)
- return false;
+ return FALSE;
CFX_WordArray pageArray;
CPDF_Document* pSrcDoc = (CPDF_Document*)src_doc;
int nCount = pSrcDoc->GetPageCount();
if (pagerange) {
if (!ParserPageRangeString(pagerange,&pageArray,nCount))
- return false;
+ return FALSE;
} else {
for (int i = 1; i <= nCount; ++i) {
pageArray.Add(i);
@@ -421,12 +421,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc,
CPDF_Dictionary* pSrcDict = pSrcDoc->GetRoot();
pSrcDict = pSrcDict->GetDict(FX_BSTRC("ViewerPreferences"));;
if (!pSrcDict)
- return false;
+ return FALSE;
CPDF_Document* pDstDoc = (CPDF_Document*)dest_doc;
CPDF_Dictionary* pDstDict = pDstDoc->GetRoot();
if (!pDstDict)
- return false;
- pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(true));
- return true;
+ return FALSE;
+ pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE));
+ return TRUE;
}
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index 8e5e476ca2..ddd6f6e90e 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -19,8 +19,8 @@ class CFX_IFileWrite final : public IFX_StreamWrite
public:
CFX_IFileWrite();
- bool Init( FPDF_FILEWRITE * pFileWriteStruct );
- virtual bool WriteBlock(const void* pData, size_t size) override;
+ FX_BOOL Init( FPDF_FILEWRITE * pFileWriteStruct );
+ virtual FX_BOOL WriteBlock(const void* pData, size_t size) override;
virtual void Release() override {}
protected:
@@ -32,22 +32,22 @@ CFX_IFileWrite::CFX_IFileWrite()
m_pFileWriteStruct = NULL;
}
-bool CFX_IFileWrite::Init( FPDF_FILEWRITE * pFileWriteStruct )
+FX_BOOL CFX_IFileWrite::Init( FPDF_FILEWRITE * pFileWriteStruct )
{
if (!pFileWriteStruct)
- return false;
+ return FALSE;
m_pFileWriteStruct = pFileWriteStruct;
- return true;
+ return TRUE;
}
-bool CFX_IFileWrite::WriteBlock(const void* pData, size_t size)
+FX_BOOL CFX_IFileWrite::WriteBlock(const void* pData, size_t size)
{
if (!m_pFileWriteStruct)
- return false;
+ return FALSE;
m_pFileWriteStruct->WriteBlock( m_pFileWriteStruct, pData, size );
- return true;
+ return TRUE;
}
FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF_DWORD flags, FPDF_BOOL bSetVersion,
@@ -71,7 +71,7 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF
FileMaker.RemoveSecurity();
}
CFX_IFileWrite* pStreamWrite = NULL;
- bool bRet;
+ FX_BOOL bRet;
pStreamWrite = new CFX_IFileWrite;
pStreamWrite->Init( pFileWrite );
bRet = FileMaker.Create(pStreamWrite, flags);
@@ -82,12 +82,12 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF
DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
FPDF_DWORD flags )
{
- return _FPDF_Doc_Save(document, pFileWrite, flags, false , 0);
+ return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE , 0);
}
DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
FPDF_DWORD flags, int fileVersion)
{
- return _FPDF_Doc_Save(document, pFileWrite, flags, true , fileVersion);
+ return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE , fileVersion);
}
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index 4fecef4452..4a6571531c 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -154,13 +154,13 @@ DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page,FPDF
}
DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle)
{
- if (!handle) return false;
+ if (!handle) return FALSE;
IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
return textpageFind->FindNext();
}
DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle)
{
- if (!handle) return false;
+ if (!handle) return FALSE;
IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
return textpageFind->FindPrev();
}
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 5a72e8ff14..9edd5d90ec 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -21,15 +21,15 @@ CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess)
m_FileAccess = *pFileAccess;
}
-bool CPDF_CustomAccess::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+FX_BOOL CPDF_CustomAccess::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
if (offset < 0) {
- return false;
+ return FALSE;
}
FX_SAFE_FILESIZE newPos = pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
newPos += offset;
if (!newPos.IsValid() || newPos.ValueOrDie() > m_FileAccess.m_FileLen) {
- return false;
+ return FALSE;
}
return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, offset,(uint8_t*) buffer, size);
}
@@ -59,9 +59,9 @@ FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy)
switch(policy)
{
case FPDF_POLICY_MACHINETIME_ACCESS:
- return (foxit_sandbox_policy & 0x01) ? true : false;
+ return (foxit_sandbox_policy & 0x01) ? TRUE : FALSE;
default:
- return false;
+ return FALSE;
}
}
@@ -81,11 +81,11 @@ public:
virtual FT_Face FindSubstFont(
CPDF_Document* pDoc, // [IN] The PDF document
const CFX_ByteString& face_name, // [IN] Original name
- bool bTrueType, // [IN] TrueType or Type1
+ FX_BOOL bTrueType, // [IN] TrueType or Type1
FX_DWORD flags, // [IN] PDF font flags (see PDF Reference section 5.7.1)
int font_weight, // [IN] original font weight. 0 for not specified
int CharsetCP, // [IN] code page for charset (see Win32 GetACP())
- bool bVertical,
+ FX_BOOL bVertical,
CPDF_SubstFont* pSubstFont // [OUT] Subst font data
);
@@ -191,18 +191,18 @@ public:
virtual void Release() {delete this;}
virtual FX_FILESIZE GetSize() {return m_size;}
- virtual bool ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
if (offset < 0) {
- return false;
+ return FALSE;
}
FX_SAFE_FILESIZE newPos = pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
newPos += offset;
if (!newPos.IsValid() || newPos.ValueOrDie() > (FX_DWORD)m_size) {
- return false;
+ return FALSE;
}
FXSYS_memcpy(buffer, m_pBuf+offset, size);
- return true;
+ return TRUE;
}
private:
uint8_t* m_pBuf;
@@ -244,14 +244,14 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAc
DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, int* fileVersion)
{
- if(!doc||!fileVersion) return false;
+ if(!doc||!fileVersion) return FALSE;
*fileVersion = 0;
CPDF_Document* pDoc = (CPDF_Document*)doc;
CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
if(!pParser)
- return false;
+ return FALSE;
*fileVersion = pParser->GetFileVersion();
- return true;
+ return TRUE;
}
// jabdelmalek: changed return type from FX_DWORD to build on Linux (and match header).
@@ -332,7 +332,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
#ifndef _WIN32_WCE
CFX_DIBitmap* pBitmap = NULL;
- bool bBackgroundAlphaNeeded=false;
+ FX_BOOL bBackgroundAlphaNeeded=FALSE;
bBackgroundAlphaNeeded = pPage->BackgroundAlphaNeeded();
if (bBackgroundAlphaNeeded)
{
@@ -352,7 +352,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
pContext->m_pDevice = new CFX_WindowsDevice(dc);
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
- rotate, flags, true, NULL);
+ rotate, flags, TRUE, NULL);
if (bBackgroundAlphaNeeded)
{
@@ -366,7 +366,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
int pitch = pBitmap->GetPitch();
pDst->Create(size_x, size_y, FXDIB_Rgb32);
FXSYS_memset(pDst->GetBuffer(), -1, pitch*size_y);
- pDst->CompositeBitmap(0, 0, size_x, size_y, pBitmap, 0, 0, FXDIB_BLEND_NORMAL, NULL, false, NULL);
+ pDst->CompositeBitmap(0, 0, size_x, size_y, pBitmap, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, NULL);
WinDC.StretchDIBits(pDst,0,0,size_x,size_y);
delete pDst;
}
@@ -492,20 +492,20 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page,
pContext->m_pDevice = new CFX_SkiaDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,true);
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
else
((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
#else
pContext->m_pDevice = new CFX_FxgeDevice;
if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,true);
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
else
((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
#endif
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
- rotate, flags, true, NULL);
+ rotate, flags, TRUE, NULL);
delete pContext;
pPage->RemovePrivateData((void*)1);
@@ -653,7 +653,7 @@ DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap)
}
void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags,bool bNeedToRestore, IFSDK_PAUSE_Adapter * pause )
+ int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause )
{
CPDF_Page* pPage = (CPDF_Page*)page;
if (pPage == NULL) return;
@@ -705,8 +705,8 @@ void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_
if (flags & FPDF_ANNOT) {
pContext->m_pAnnots = new CPDF_AnnotList(pPage);
- bool bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
- pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, &matrix, true, NULL);
+ FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
+ pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, &matrix, TRUE, NULL);
}
pContext->m_pRenderer = new CPDF_ProgressiveRenderer(
@@ -720,23 +720,23 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i
{
CPDF_Document* pDoc = (CPDF_Document*)document;
if(pDoc == NULL)
- return false;
+ return FALSE;
CPDF_Dictionary* pDict = pDoc->GetPage(page_index);
- if (pDict == NULL) return false;
+ if (pDict == NULL) return FALSE;
CPDF_Page page;
page.Load(pDoc, pDict);
*width = page.GetPageWidth();
*height = page.GetPageHeight();
- return true;
+ return TRUE;
}
DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document)
{
CPDF_Document* pDoc = (CPDF_Document*)document;
- if (!pDoc) return true;
+ if (!pDoc) return TRUE;
CPDF_ViewerPreferences viewRef(pDoc);
return viewRef.PrintScaling();
}
diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp
index 7ba227f0c2..145559e057 100644
--- a/fpdfsdk/src/fsdk_actionhandler.cpp
+++ b/fpdfsdk/src/fsdk_actionhandler.cpp
@@ -24,14 +24,14 @@ void CPDFSDK_ActionHandler::SetMediaActionHandler(CPDFSDK_MediaActionHandler* pH
}
//document open
-bool CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteDocumentOpenAction(action, pDocument, list);
}
//document open
-bool CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName,
+FX_BOOL CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName,
CPDFSDK_Document* pDocument)
{
if (JsAction.GetType() == CPDF_Action::JavaScript)
@@ -40,14 +40,14 @@ bool CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_
if (!swJS.IsEmpty())
{
RunDocumentOpenJavaScript(pDocument, csJSName, swJS);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type,
+FX_BOOL CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
PDFSDK_FieldAction& data)
{
@@ -59,48 +59,48 @@ bool CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction
if (!swJS.IsEmpty())
{
RunFieldJavaScript(pDocument, pFormField, type, data, swJS);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_ActionHandler::DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteDocumentPageAction(action, eType, pDocument, list);
}
-bool CPDFSDK_ActionHandler::DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteDocumentPageAction(action, eType, pDocument, list);
}
-bool CPDFSDK_ActionHandler::DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type,
+FX_BOOL CPDFSDK_ActionHandler::DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteBookMark(action, pDocument, pBookMark, list);
}
-bool CPDFSDK_ActionHandler::DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type,
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen)
{
CFX_PtrList list;
return ExecuteScreenAction(action, type, pDocument, pScreen, list);
}
-bool CPDFSDK_ActionHandler::DoAction_Link(const CPDF_Action& action,
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Link(const CPDF_Action& action,
CPDFSDK_Document* pDocument)
{
CFX_PtrList list;
return ExecuteLinkAction(action, pDocument, list);
}
-bool CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type,
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument,
CPDF_FormField* pFormField, PDFSDK_FieldAction& data)
{
@@ -108,12 +108,12 @@ bool CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AActi
return ExecuteFieldAction(action, type, pDocument, pFormField, data, list);
}
-bool CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
CFX_PtrList& list)
{
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return false;
+ return FALSE;
list.AddTail(pDict);
@@ -138,20 +138,20 @@ bool CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action,
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteDocumentOpenAction(subaction, pDocument, list)) return false;
+ if (!ExecuteDocumentOpenAction(subaction, pDocument, list)) return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
CFX_PtrList& list)
{
ASSERT(pDocument != NULL);
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return false;
+ return FALSE;
list.AddTail(pDict);
@@ -175,7 +175,7 @@ bool CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK
pContext->OnLink_MouseUp(pDocument);
CFX_WideString csInfo;
- bool bRet = pContext->RunScript(swJS, csInfo);
+ FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
if (!bRet)
{
// FIXME: return error.
@@ -193,20 +193,20 @@ bool CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteLinkAction(subaction, pDocument, list)) return false;
+ if (!ExecuteLinkAction(subaction, pDocument, list)) return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CFX_PtrList& list)
{
ASSERT(pDocument != NULL);
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return false;
+ return FALSE;
list.AddTail(pDict);
@@ -229,18 +229,18 @@ bool CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& action,
}
if (!IsValidDocView(pDocument))
- return false;
+ return FALSE;
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteDocumentPageAction(subaction, type, pDocument, list)) return false;
+ if (!ExecuteDocumentPageAction(subaction, type, pDocument, list)) return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict)
+FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict)
{
ASSERT(pDocument != NULL);
ASSERT(pFieldDict != NULL);
@@ -254,7 +254,7 @@ bool CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Dicti
return pPDFInterForm->GetFieldByDict(pFieldDict) != NULL;
}
-bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
PDFSDK_FieldAction& data, CFX_PtrList& list)
{
@@ -262,7 +262,7 @@ bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_A
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return false;
+ return FALSE;
list.AddTail(pDict);
@@ -277,7 +277,7 @@ bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_A
{
RunFieldJavaScript(pDocument, pFormField, type, data, swJS);
if (!IsValidField(pDocument, pFormField->GetFieldDict()))
- return false;
+ return FALSE;
}
}
}
@@ -289,20 +289,20 @@ bool CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_A
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteFieldAction(subaction, type, pDocument, pFormField, data, list)) return false;
+ if (!ExecuteFieldAction(subaction, type, pDocument, pFormField, data, list)) return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen, CFX_PtrList& list)
{
ASSERT(pDocument != NULL);
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return false;
+ return FALSE;
list.AddTail(pDict);
@@ -356,12 +356,12 @@ bool CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_
// pContext->OnScreen_OutView(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
// break;
// default:
- // ASSERT(false);
+ // ASSERT(FALSE);
// break;
// }
CFX_WideString csInfo;
- bool bRet = pContext->RunScript(swJS, csInfo);
+ FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -379,20 +379,20 @@ bool CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteScreenAction(subaction, type, pDocument, pScreen, list)) return false;
+ if (!ExecuteScreenAction(subaction, type, pDocument, pScreen, list)) return FALSE;
}
- return true;
+ return TRUE;
}
-bool CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument,
CPDF_Bookmark* pBookmark, CFX_PtrList& list)
{
ASSERT(pDocument != NULL);
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
- return false;
+ return FALSE;
list.AddTail(pDict);
@@ -416,7 +416,7 @@ bool CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_D
pContext->OnBookmark_MouseUp(pBookmark);
CFX_WideString csInfo;
- bool bRet = pContext->RunScript(swJS, csInfo);
+ FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -434,10 +434,10 @@ bool CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_D
for (int32_t i=0,sz=action.GetSubActionsCount(); i<sz; i++)
{
CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteBookMark(subaction, pDocument, pBookmark, list)) return false;
+ if (!ExecuteBookMark(subaction, pDocument, pBookmark, list)) return FALSE;
}
- return true;
+ return TRUE;
}
void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument)
@@ -502,7 +502,7 @@ void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Doc
}
break;
case CPDF_Action::JavaScript:
- ASSERT(false);
+ ASSERT(FALSE);
break;
case CPDF_Action::SetOCGState:
DoAction_SetOCGState(pDocument, action);
@@ -522,10 +522,10 @@ void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Doc
}
}
-bool CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
- return true;
+ return TRUE;
}
void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument,
@@ -639,12 +639,12 @@ void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument, CPDF
data.bShift, pFormField, data.sValue, data.bRC);
break;
default:
- ASSERT(false);
+ ASSERT(FALSE);
break;
}
CFX_WideString csInfo;
- bool bRet = pContext->RunScript(script, csInfo);
+ FX_BOOL bRet = pContext->RunScript(script, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -668,7 +668,7 @@ void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript(CPDFSDK_Document* pDocumen
pContext->OnDoc_Open(pDocument, sScriptName);
CFX_WideString csInfo;
- bool bRet = pContext->RunScript(script, csInfo);
+ FX_BOOL bRet = pContext->RunScript(script, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -719,12 +719,12 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(CPDFSDK_Document* pDocumen
pContext->OnPage_OutView(pDocument);
break;
default:
- ASSERT(false);
+ ASSERT(FALSE);
break;
}
CFX_WideString csInfo;
- bool bRet = pContext->RunScript(script, csInfo);
+ FX_BOOL bRet = pContext->RunScript(script, csInfo);
if (!bRet)
{
//CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
@@ -734,7 +734,7 @@ void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(CPDFSDK_Document* pDocumen
}
-bool CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
@@ -744,13 +744,13 @@ bool CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK
if (pInterForm->DoAction_Hide(action))
{
pDocument->SetChangeMark();
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
@@ -760,7 +760,7 @@ bool CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, C
return pInterForm->DoAction_SubmitForm(action);
}
-bool CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
@@ -769,13 +769,13 @@ bool CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CP
if (pInterForm->DoAction_ResetForm(action))
{
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
ASSERT(pDocument != NULL);
@@ -785,23 +785,23 @@ bool CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, C
if (pInterForm->DoAction_ImportData(action))
{
pDocument->SetChangeMark();
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_MediaActionHandler::DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
-bool CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
-bool CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument)
{
- return false;
+ return FALSE;
}
diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp
index 6695fe0c89..9b008cd762 100644
--- a/fpdfsdk/src/fsdk_annothandler.cpp
+++ b/fpdfsdk/src/fsdk_annothandler.cpp
@@ -144,7 +144,7 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -152,9 +152,9 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(CPDFSDK_PageView * pPageView,
{
return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -162,9 +162,9 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CP
{
return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -172,9 +172,9 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView
{
return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -182,9 +182,9 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CP
{
return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -192,9 +192,9 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, C
{
return pAnnotHandler->OnMouseWheel(pPageView, pAnnot,nFlags,zDelta, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -202,9 +202,9 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(CPDFSDK_PageView * pPageView,
{
return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
@@ -212,7 +212,7 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CP
{
return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
@@ -237,18 +237,18 @@ void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView * pPageView, CP
return;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
{
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
{
return pAnnotHandler->OnChar(pAnnot,nChar, nFlags);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
{
if (!m_pApp->FFI_IsCTRLKeyDown(nFlag) && !m_pApp->FFI_IsALTKeyDown(nFlag))
@@ -263,7 +263,7 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int
{
CPDFSDK_Document* pDocument = pPage->GetSDKDocument();
pDocument->SetFocusAnnot(pNext);
- return true;
+ return TRUE;
}
}
}
@@ -272,14 +272,14 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int
{
return pAnnotHandler->OnKeyDown(pAnnot,nKeyCode, nFlag);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
{
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
{
ASSERT(pAnnot != NULL);
@@ -289,19 +289,19 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX
{
CPDFSDK_PageView* pPage = pAnnot->GetPageView();
pPage->GetSDKDocument();
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
{
ASSERT(pAnnot);
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
return pAnnotHandler->OnKillFocus(pAnnot, nFlag);
- return false;
+ return FALSE;
}
CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
@@ -313,7 +313,7 @@ CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox(CPDFSDK_PageView *pPage
return pAnnot->GetRect();
}
-bool CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
{
ASSERT(pAnnot);
if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
@@ -321,31 +321,31 @@ bool CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFS
if (pAnnotHandler->CanAnswer(pAnnot))
return pAnnotHandler->HitTest(pPageView, pAnnot, point);
}
- return false;
+ return FALSE;
}
-CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,bool bNext)
+CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX_BOOL bNext)
{
CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget", "");
return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
}
-bool CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot)
+FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot)
{
ASSERT(pAnnot->GetType() == "Widget");
if (pAnnot->GetSubType() == BFFT_SIGNATURE)
- return false;
+ return FALSE;
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (!pWidget->IsVisible())
- return false;
+ return FALSE;
int nFieldFlags = pWidget->GetFieldFlags();
if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
- return false;
+ return FALSE;
if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return true;
+ return TRUE;
CPDF_Page* pPage = pWidget->GetPDFPage();
CPDF_Document* pDocument = pPage->m_pDocument;
@@ -366,7 +366,7 @@ CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_Page
pInterForm->AddMap(pCtrl, pWidget);
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
if (pPDFInterForm && pPDFInterForm->NeedConstructAP())
- pWidget->ResetAppearance(nullptr, false);
+ pWidget->ResetAppearance(nullptr, FALSE);
return pWidget;
}
@@ -439,7 +439,7 @@ void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_An
}
}
-bool CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -453,10 +453,10 @@ bool CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_
return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -470,10 +470,10 @@ bool CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_An
return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -487,10 +487,10 @@ bool CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSD
return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -504,12 +504,12 @@ bool CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_An
return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -523,10 +523,10 @@ bool CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_A
return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta,point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -540,9 +540,9 @@ bool CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_
return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -556,10 +556,10 @@ bool CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_An
return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -573,10 +573,10 @@ bool CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DW
return m_pFormFiller->OnChar(pAnnot,nChar, nFlags);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -590,13 +590,13 @@ bool CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int
return m_pFormFiller->OnKeyDown(pAnnot,nKeyCode, nFlag);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
{
- return false;
+ return FALSE;
}
void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot)
{
@@ -626,16 +626,16 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot)
{
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (!pWidget->IsAppearanceValid())
- pWidget->ResetAppearance(NULL, false);
+ pWidget->ResetAppearance(NULL, FALSE);
int nFieldType = pWidget->GetFieldType();
if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX)
{
- bool bFormated = false;
+ FX_BOOL bFormated = FALSE;
CFX_WideString sValue = pWidget->OnFormat(bFormated);
if (bFormated && nFieldType == FIELDTYPE_COMBOBOX)
{
- pWidget->ResetAppearance(sValue.c_str(), false);
+ pWidget->ResetAppearance(sValue.c_str(), FALSE);
}
}
@@ -644,7 +644,7 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot)
}
}
-bool CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -658,9 +658,9 @@ bool CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
return m_pFormFiller->OnSetFocus(pAnnot,nFlag);
}
- return true;
+ return TRUE;
}
-bool CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
{
ASSERT(pAnnot != NULL);
CFX_ByteString sSubType = pAnnot->GetSubType();
@@ -674,7 +674,7 @@ bool CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
return m_pFormFiller->OnKillFocus(pAnnot,nFlag);
}
- return true;
+ return TRUE;
}
CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
@@ -695,7 +695,7 @@ CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFS
return CPDF_Rect(0,0,0,0);
}
-bool CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
+FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
{
ASSERT(pPageView);
ASSERT(pAnnot);
@@ -706,9 +706,9 @@ bool CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot*
//CReader_AnnotIteratorEx
-CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView,bool bReverse,
- bool bIgnoreTopmost/*=false*/,
- bool bCircle/*=false*/,
+CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView,FX_BOOL bReverse,
+ FX_BOOL bIgnoreTopmost/*=FALSE*/,
+ FX_BOOL bCircle/*=FALSE*/,
CFX_PtrArray *pList/*=NULL*/)
{
ASSERT(pPageView);
@@ -850,7 +850,7 @@ int LyOrderCompare(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2)
return 0;
}
-bool CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView,CFX_PtrArray * pAnnotList)
+FX_BOOL CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView,CFX_PtrArray * pAnnotList)
{
ASSERT(pPageView);
@@ -859,7 +859,7 @@ bool CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView,CF
}
m_pIteratorAnnotList.RemoveAll();
- if(!pAnnotList) return false;
+ if(!pAnnotList) return FALSE;
CPDFSDK_Annot * pTopMostAnnot= (m_bIgnoreTopmost) ? NULL : pPageView->GetFocusAnnot();
@@ -888,5 +888,5 @@ bool CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView,CF
}
}
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp
index bbdfc19323..d0dc4ef738 100644
--- a/fpdfsdk/src/fsdk_baseannot.cpp
+++ b/fpdfsdk/src/fsdk_baseannot.cpp
@@ -17,14 +17,14 @@ int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute)
return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60);
}
-bool _gAfxIsLeapYear(int16_t year)
+FX_BOOL _gAfxIsLeapYear(int16_t year)
{
return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)));
}
FX_WORD _gAfxGetYearDays(int16_t year)
{
- return (_gAfxIsLeapYear(year) == true ? 366 : 365);
+ return (_gAfxIsLeapYear(year) == TRUE ? 366 : 365);
}
uint8_t _gAfxGetMonthDays(int16_t year, uint8_t month)
@@ -50,7 +50,7 @@ uint8_t _gAfxGetMonthDays(int16_t year, uint8_t month)
break;
case 2:
- if (_gAfxIsLeapYear(year) == true)
+ if (_gAfxIsLeapYear(year) == TRUE)
mDays = 29;
else
mDays = 28;
@@ -128,17 +128,17 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::operator = (const FX_SYSTEMTIME& st)
return *this;
}
-bool CPDFSDK_DateTime::operator == (CPDFSDK_DateTime& datetime)
+FX_BOOL CPDFSDK_DateTime::operator == (CPDFSDK_DateTime& datetime)
{
return (FXSYS_memcmp(&dt, &datetime.dt, sizeof(FX_DATETIME)) == 0);
}
-bool CPDFSDK_DateTime::operator != (CPDFSDK_DateTime& datetime)
+FX_BOOL CPDFSDK_DateTime::operator != (CPDFSDK_DateTime& datetime)
{
return (FXSYS_memcmp(&dt, &datetime.dt, sizeof(FX_DATETIME)) != 0);
}
-bool CPDFSDK_DateTime::operator > (CPDFSDK_DateTime& datetime)
+FX_BOOL CPDFSDK_DateTime::operator > (CPDFSDK_DateTime& datetime)
{
CPDFSDK_DateTime dt1 = ToGMT();
CPDFSDK_DateTime dt2 = datetime.ToGMT();
@@ -147,12 +147,12 @@ bool CPDFSDK_DateTime::operator > (CPDFSDK_DateTime& datetime)
int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
- if (d1 > d3) return true;
- if (d2 > d4) return true;
- return false;
+ if (d1 > d3) return TRUE;
+ if (d2 > d4) return TRUE;
+ return FALSE;
}
-bool CPDFSDK_DateTime::operator >= (CPDFSDK_DateTime& datetime)
+FX_BOOL CPDFSDK_DateTime::operator >= (CPDFSDK_DateTime& datetime)
{
CPDFSDK_DateTime dt1 = ToGMT();
CPDFSDK_DateTime dt2 = datetime.ToGMT();
@@ -161,12 +161,12 @@ bool CPDFSDK_DateTime::operator >= (CPDFSDK_DateTime& datetime)
int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
- if (d1 >= d3) return true;
- if (d2 >= d4) return true;
- return false;
+ if (d1 >= d3) return TRUE;
+ if (d2 >= d4) return TRUE;
+ return FALSE;
}
-bool CPDFSDK_DateTime::operator < (CPDFSDK_DateTime& datetime)
+FX_BOOL CPDFSDK_DateTime::operator < (CPDFSDK_DateTime& datetime)
{
CPDFSDK_DateTime dt1 = ToGMT();
CPDFSDK_DateTime dt2 = datetime.ToGMT();
@@ -175,12 +175,12 @@ bool CPDFSDK_DateTime::operator < (CPDFSDK_DateTime& datetime)
int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
- if (d1 < d3) return true;
- if (d2 < d4) return true;
- return false;
+ if (d1 < d3) return TRUE;
+ if (d2 < d4) return TRUE;
+ return FALSE;
}
-bool CPDFSDK_DateTime::operator <= (CPDFSDK_DateTime& datetime)
+FX_BOOL CPDFSDK_DateTime::operator <= (CPDFSDK_DateTime& datetime)
{
CPDFSDK_DateTime dt1 = ToGMT();
CPDFSDK_DateTime dt2 = datetime.ToGMT();
@@ -189,9 +189,9 @@ bool CPDFSDK_DateTime::operator <= (CPDFSDK_DateTime& datetime)
int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
- if (d1 <= d3) return true;
- if (d2 <= d4) return true;
- return false;
+ if (d1 <= d3) return TRUE;
+ if (d2 <= d4) return TRUE;
+ return FALSE;
}
CPDFSDK_DateTime::operator time_t()
@@ -506,7 +506,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::AddSeconds(int seconds)
CPDFSDK_Annot::CPDFSDK_Annot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView) :
m_pAnnot(pAnnot),
m_pPageView(pPageView),
-m_bSelected(false),
+m_bSelected(FALSE),
m_nTabOrder(-1)
{
}
@@ -539,12 +539,12 @@ CPDFSDK_PageView* CPDFSDK_Annot::GetPageView()
return m_pPageView;
}
-bool CPDFSDK_Annot::IsSelected()
+FX_BOOL CPDFSDK_Annot::IsSelected()
{
return m_bSelected;
}
-void CPDFSDK_Annot::SetSelected(bool bSelected)
+void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected)
{
m_bSelected = bSelected;
}
@@ -606,15 +606,15 @@ void CPDFSDK_Annot::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix*
m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, mode, pOptions);
}
-bool CPDFSDK_Annot::IsAppearanceValid()
+FX_BOOL CPDFSDK_Annot::IsAppearanceValid()
{
return m_pAnnot->GetAnnotDict()->GetDict("AP") != NULL;
}
-bool CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
+FX_BOOL CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
{
CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP");
- if (pAP == NULL) return false;
+ if (pAP == NULL) return FALSE;
// Choose the right sub-ap
const FX_CHAR* ap_entry = "N";
@@ -627,9 +627,9 @@ bool CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
// Get the AP stream or subdirectory
CPDF_Object* psub = pAP->GetElementValue(ap_entry);
- if (psub == NULL) return false;
+ if (psub == NULL) return FALSE;
- return true;
+ return TRUE;
}
void CPDFSDK_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
@@ -875,7 +875,7 @@ void CPDFSDK_Annot::RemoveColor()
m_pAnnot->GetAnnotDict()->RemoveAt("C");
}
-bool CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
+FX_BOOL CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
{
if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArray("C"))
{
@@ -886,7 +886,7 @@ bool CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
color = FXSYS_RGB((int)g, (int)g, (int)g);
- return true;
+ return TRUE;
}
else if (nCount == 3)
{
@@ -896,7 +896,7 @@ bool CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
color = FXSYS_RGB((int)r, (int)g, (int)b);
- return true;
+ return TRUE;
}
else if (nCount == 4)
{
@@ -911,11 +911,11 @@ bool CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255));
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
@@ -976,7 +976,7 @@ void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Re
pStreamDict->SetAtRect("BBox", rcBBox);
}
- pStream->SetData((uint8_t*)sContents.c_str(), sContents.GetLength(), false, false);
+ pStream->SetData((uint8_t*)sContents.c_str(), sContents.GetLength(), FALSE, FALSE);
}
#define BA_ANNOT_MINWIDTH 1
@@ -992,11 +992,11 @@ FX_FLOAT CPDFSDK_Annot::GetMinHeight() const
return BA_ANNOT_MINHEIGHT;
}
-bool CPDFSDK_Annot::CreateFormFiller()
+FX_BOOL CPDFSDK_Annot::CreateFormFiller()
{
- return true;
+ return TRUE;
}
-bool CPDFSDK_Annot::IsVisible() const
+FX_BOOL CPDFSDK_Annot::IsVisible() const
{
int nFlags = GetFlags();
return !((nFlags & ANNOTFLAG_INVISIBLE) || (nFlags & ANNOTFLAG_HIDDEN) || (nFlags & ANNOTFLAG_NOVIEW));
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index 4933a05c24..ee16212f46 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -37,10 +37,10 @@ CPDFSDK_Widget::~CPDFSDK_Widget()
}
-bool CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode)
+FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode)
{
CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP");
- if (pAP == NULL) return false;
+ if (pAP == NULL) return FALSE;
// Choose the right sub-ap
const FX_CHAR* ap_entry = "N";
@@ -53,7 +53,7 @@ bool CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode
// Get the AP stream or subdirectory
CPDF_Object* psub = pAP->GetElementValue(ap_entry);
- if (psub == NULL) return false;
+ if (psub == NULL) return FALSE;
int nFieldType = GetFieldType();
switch (nFieldType)
@@ -70,10 +70,10 @@ bool CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode
CPDF_Dictionary* pSubDict = (CPDF_Dictionary*)psub;
return pSubDict->GetStream(GetAppState()) != NULL;
}
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
int CPDFSDK_Widget::GetFieldType() const
@@ -141,7 +141,7 @@ int CPDFSDK_Widget::GetRotate() const
return pCtrl->GetRotation() % 360;
}
-bool CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const
+FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -152,7 +152,7 @@ bool CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const
return iColorType != COLORTYPE_TRANSPARENT;
}
-bool CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const
+FX_BOOL CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -163,7 +163,7 @@ bool CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const
return iColorType != COLORTYPE_TRANSPARENT;
}
-bool CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const
+FX_BOOL CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -179,7 +179,7 @@ bool CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const
return iColorType != COLORTYPE_TRANSPARENT;
}
- return false;
+ return FALSE;
}
FX_FLOAT CPDFSDK_Widget::GetFontSize() const
@@ -235,7 +235,7 @@ int CPDFSDK_Widget::CountOptions() const
return pFormField->CountOptions();
}
-bool CPDFSDK_Widget::IsOptionSelected(int nIndex) const
+FX_BOOL CPDFSDK_Widget::IsOptionSelected(int nIndex) const
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -251,7 +251,7 @@ int CPDFSDK_Widget::GetTopVisibleIndex() const
return pFormField->GetTopVisibleIndex();
}
-bool CPDFSDK_Widget::IsChecked() const
+FX_BOOL CPDFSDK_Widget::IsChecked() const
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -275,7 +275,7 @@ int CPDFSDK_Widget::GetMaxLen() const
return pFormField->GetMaxLen();
}
-void CPDFSDK_Widget::SetCheck(bool bChecked, bool bNotify)
+void CPDFSDK_Widget::SetCheck(FX_BOOL bChecked, FX_BOOL bNotify)
{
CPDF_FormControl* pFormCtrl = GetFormControl();
ASSERT(pFormCtrl != NULL);
@@ -286,7 +286,7 @@ void CPDFSDK_Widget::SetCheck(bool bChecked, bool bNotify)
pFormField->CheckControl(pFormField->GetControlIndex(pFormCtrl), bChecked, bNotify);
}
-void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, bool bNotify)
+void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, FX_BOOL bNotify)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -297,7 +297,7 @@ void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, bool bNotify)
void CPDFSDK_Widget::SetDefaultValue(const CFX_WideString& sValue)
{
}
-void CPDFSDK_Widget::SetOptionSelection(int index, bool bSelected, bool bNotify)
+void CPDFSDK_Widget::SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -305,7 +305,7 @@ void CPDFSDK_Widget::SetOptionSelection(int index, bool bSelected, bool bNotify)
pFormField->SetItemSelection(index, bSelected, bNotify);
}
-void CPDFSDK_Widget::ClearSelection(bool bNotify)
+void CPDFSDK_Widget::ClearSelection(FX_BOOL bNotify)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -319,20 +319,20 @@ void CPDFSDK_Widget::SetTopVisibleIndex(int index)
void CPDFSDK_Widget::SetAppModified()
{
- m_bAppModified = true;
+ m_bAppModified = TRUE;
}
void CPDFSDK_Widget::ClearAppModified()
{
- m_bAppModified = false;
+ m_bAppModified = FALSE;
}
-bool CPDFSDK_Widget::IsAppModified() const
+FX_BOOL CPDFSDK_Widget::IsAppModified() const
{
return m_bAppModified;
}
-void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, bool bValueChanged)
+void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged)
{
SetAppModified();
@@ -370,14 +370,14 @@ void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, bool bValueChanged)
m_pAnnot->ClearCachedAP();
}
-CFX_WideString CPDFSDK_Widget::OnFormat(bool& bFormated)
+CFX_WideString CPDFSDK_Widget::OnFormat(FX_BOOL& bFormated)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
return m_pInterForm->OnFormat(pFormField, bFormated);
}
-void CPDFSDK_Widget::ResetFieldAppearance(bool bValueChanged)
+void CPDFSDK_Widget::ResetFieldAppearance(FX_BOOL bValueChanged)
{
CPDF_FormField* pFormField = GetFormField();
ASSERT(pFormField != NULL);
@@ -1017,7 +1017,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue)
if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
{
- pEdit->EnableRefresh(false);
+ pEdit->EnableRefresh(FALSE);
CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
ASSERT(pDoc != NULL);
@@ -1035,7 +1035,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue)
FX_FLOAT fFontSize = GetFontSize();
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(true);
+ pEdit->SetAutoFontSize(TRUE);
else
pEdit->SetFontSize(fFontSize);
@@ -1093,7 +1093,7 @@ void CPDFSDK_Widget::ResetAppearance_ListBox()
if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
{
- pEdit->EnableRefresh(false);
+ pEdit->EnableRefresh(FALSE);
CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
ASSERT(pDoc != NULL);
@@ -1123,12 +1123,12 @@ void CPDFSDK_Widget::ResetAppearance_ListBox()
for (int32_t i=nTop; i<nCount; i++)
{
- bool bSelected = false;
+ FX_BOOL bSelected = FALSE;
for (int32_t j=0; j<nSelCount; j++)
{
if (pField->GetSelectedIndex(j) == i)
{
- bSelected = true;
+ bSelected = TRUE;
break;
}
}
@@ -1141,16 +1141,16 @@ void CPDFSDK_Widget::ResetAppearance_ListBox()
if (bSelected)
{
CPDF_Rect rcItem = CPDF_Rect(rcClient.left,fy-fItemHeight,rcClient.right,fy);
- sList << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f),true)
+ sList << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f),TRUE)
<< rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n";
- sList << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1),true) <<
+ sList << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1),TRUE) <<
CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n";
}
else
{
CPWL_Color crText = GetTextPWLColor();
- sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText,true) <<
+ sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) <<
CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n";
}
@@ -1183,7 +1183,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
{
- pEdit->EnableRefresh(false);
+ pEdit->EnableRefresh(FALSE);
CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
ASSERT(pDoc != NULL);
@@ -1198,12 +1198,12 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
pEdit->SetAlignmentH(pControl->GetControlAlignment());
FX_DWORD dwFieldFlags = pField->GetFieldFlags();
- bool bMultiLine = (dwFieldFlags >> 12) & 1;
+ FX_BOOL bMultiLine = (dwFieldFlags >> 12) & 1;
if (bMultiLine)
{
- pEdit->SetMultiLine(true);
- pEdit->SetAutoReturn(true);
+ pEdit->SetMultiLine(TRUE);
+ pEdit->SetAutoReturn(TRUE);
}
else
{
@@ -1218,7 +1218,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
}
int nMaxLen = pField->GetMaxLen();
- bool bCharArray = (dwFieldFlags >> 24) & 1;
+ FX_BOOL bCharArray = (dwFieldFlags >> 24) & 1;
FX_FLOAT fFontSize = GetFontSize();
if (nMaxLen > 0)
@@ -1241,7 +1241,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
}
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(true);
+ pEdit->SetAutoFontSize(TRUE);
else
pEdit->SetFontSize(fFontSize);
@@ -1276,11 +1276,11 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
{
case BBS_SOLID:
{
- CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),false);
+ CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE);
if (sColor.GetLength() > 0)
{
sLines << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),false) << " 2 J 0 j\n";
+ << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n";
for (int32_t i=1;i<nMaxLen;i++)
{
@@ -1296,13 +1296,13 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue)
break;
case BBS_DASH:
{
- CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),false);
+ CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE);
if (sColor.GetLength() > 0)
{
CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0);
sLines << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),false)
+ << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE)
<< "[" << dsBorder.nDash << " "
<< dsBorder.nGap << "] "
<< dsBorder.nPhase << " d\n";
@@ -1549,7 +1549,7 @@ void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType)
}
}
-bool CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, CPDFSDK_PageView* pPageView)
+FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, CPDFSDK_PageView* pPageView)
{
CPDF_Action action = GetAAction(type);
@@ -1567,7 +1567,7 @@ bool CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldActio
return pActionHandler->DoAction_Field(action, type, pDocument, GetFormField(), data);
}
- return false;
+ return FALSE;
}
CPDF_Action CPDFSDK_Widget::GetAAction(CPDF_AAction::AActionType eAAT)
@@ -1624,37 +1624,37 @@ int32_t CPDFSDK_Widget::GetValueAge() const
}
-bool CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY)
+FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY)
{
CPDF_Annot* pAnnot = GetPDFAnnot();
CFX_FloatRect annotRect;
pAnnot->GetRect(annotRect);
if(annotRect.Contains(pageX, pageY))
{
- if (!IsVisible()) return false;
+ if (!IsVisible()) return FALSE;
int nFieldFlags = GetFieldFlags();
if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
- return false;
+ return FALSE;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_Document* pDocument)
:m_pDocument(pDocument),
m_pInterForm(NULL),
- m_bCalculate(true),
- m_bBusy(false)
+ m_bCalculate(TRUE),
+ m_bBusy(FALSE)
{
ASSERT(m_pDocument != NULL);
- m_pInterForm = new CPDF_InterForm(m_pDocument->GetDocument(), false);
+ m_pInterForm = new CPDF_InterForm(m_pDocument->GetDocument(), FALSE);
ASSERT(m_pInterForm != NULL);
m_pInterForm->SetFormNotify(this);
for(int i=0; i<6; i++)
- m_bNeedHightlight[i] = false;
+ m_bNeedHightlight[i] = FALSE;
m_iHighlightAlpha = 0;
}
@@ -1665,12 +1665,12 @@ CPDFSDK_InterForm::~CPDFSDK_InterForm()
m_Map.clear();
}
-bool CPDFSDK_InterForm::HighlightWidgets()
+FX_BOOL CPDFSDK_InterForm::HighlightWidgets()
{
- return false;
+ return FALSE;
}
-CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, bool bNext) const
+CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const
{
nonstd::unique_ptr<CBA_AnnotIterator> pIterator(
new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", ""));
@@ -1782,12 +1782,12 @@ void CPDFSDK_InterForm::RemoveMap(CPDF_FormControl* pControl)
m_Map.erase(pControl);
}
-void CPDFSDK_InterForm::EnableCalculate(bool bEnabled)
+void CPDFSDK_InterForm::EnableCalculate(FX_BOOL bEnabled)
{
m_bCalculate = bEnabled;
}
-bool CPDFSDK_InterForm::IsCalculateEnabled() const
+FX_BOOL CPDFSDK_InterForm::IsCalculateEnabled() const
{
return m_bCalculate;
}
@@ -1807,7 +1807,7 @@ CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile)
int nHeight = pBmp->GetHeight();
CPDF_Image Image(pDocument);
- Image.SetImage(pBmp, false);
+ Image.SetImage(pBmp, FALSE);
CPDF_Stream* pImageStream = Image.GetStream();
if (pImageStream)
{
@@ -1867,7 +1867,7 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
if (m_bBusy) return;
- m_bBusy = true;
+ m_bBusy = TRUE;
if (IsCalculateEnabled())
{
@@ -1899,11 +1899,11 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
CFX_WideString sOldValue = pField->GetValue();
CFX_WideString sValue = sOldValue;
- bool bRC = true;
+ FX_BOOL bRC = TRUE;
pContext->OnField_Calculate(pFormField, pField, sValue, bRC);
CFX_WideString sInfo;
- bool bRet = pContext->RunScript(csJS, sInfo);
+ FX_BOOL bRet = pContext->RunScript(csJS, sInfo);
pRuntime->ReleaseContext(pContext);
if (bRet)
@@ -1911,7 +1911,7 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
if (bRC)
{
if (sValue.Compare(sOldValue) != 0)
- pField->SetValue(sValue, true);
+ pField->SetValue(sValue, TRUE);
}
}
}
@@ -1924,10 +1924,10 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
}
- m_bBusy = false;
+ m_bBusy = FALSE;
}
-CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, bool& bFormated)
+CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL& bFormated)
{
ASSERT(m_pDocument != NULL);
ASSERT(pFormField != NULL);
@@ -1937,7 +1937,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, bool& bFo
ASSERT(pEnv);
if(!pEnv->IsJSInitiated())
{
- bFormated = false;
+ bFormated = FALSE;
return sValue;
}
@@ -1956,7 +1956,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, bool& bFo
}
}
- bFormated = false;
+ bFormated = FALSE;
CPDF_AAction aAction = pFormField->GetAdditionalAction();
if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Format))
@@ -1972,16 +1972,16 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, bool& bFo
IFXJS_Context* pContext = pRuntime->NewContext();
ASSERT(pContext != NULL);
- pContext->OnField_Format(pFormField, Value, true);
+ pContext->OnField_Format(pFormField, Value, TRUE);
CFX_WideString sInfo;
- bool bRet = pContext->RunScript(script, sInfo);
+ FX_BOOL bRet = pContext->RunScript(script, sInfo);
pRuntime->ReleaseContext(pContext);
if (bRet)
{
sValue = Value;
- bFormated = true;
+ bFormated = TRUE;
}
}
}
@@ -1990,7 +1990,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, bool& bFo
return sValue;
}
-void CPDFSDK_InterForm::ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, bool bValueChanged)
+void CPDFSDK_InterForm::ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, FX_BOOL bValueChanged)
{
ASSERT(pFormField != NULL);
@@ -2020,7 +2020,7 @@ void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField)
CFFL_IFormFiller* pIFormFiller = pEnv->GetIFormFiller();
CPDF_Page * pPage = pWidget->GetPDFPage();
- CPDFSDK_PageView * pPageView = m_pDocument->GetPageView(pPage,false);
+ CPDFSDK_PageView * pPageView = m_pDocument->GetPageView(pPage,FALSE);
FX_RECT rcBBox = pIFormFiller->GetViewBBox(pPageView, pWidget);
@@ -2029,7 +2029,7 @@ void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField)
}
}
-void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, bool& bRC)
+void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC)
{
ASSERT(pFormField != NULL);
@@ -2058,7 +2058,7 @@ void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideSt
}
}
-void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, bool& bRC)
+void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC)
{
ASSERT(pFormField != NULL);
@@ -2089,7 +2089,7 @@ void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& c
/* ----------------------------- action ----------------------------- */
-bool CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
+FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
{
ASSERT(action);
@@ -2100,9 +2100,9 @@ bool CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
CFX_PtrArray fields;
GetFieldFromObjects(fieldObjects, fields);
- bool bHide = action.GetHideStatus();
+ FX_BOOL bHide = action.GetHideStatus();
- bool bChanged = false;
+ FX_BOOL bChanged = FALSE;
for (int i=0, sz=fields.GetSize(); i<sz; i++)
{
@@ -2137,7 +2137,7 @@ bool CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
pPageView->UpdateView(pWidget);
- bChanged = true;
+ bChanged = TRUE;
}
}
}
@@ -2145,12 +2145,12 @@ bool CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
return bChanged;
}
-bool CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
+FX_BOOL CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
{
ASSERT(m_pInterForm != NULL);
CFX_WideString sDestination = action.GetFilePath();
if (sDestination.IsEmpty())
- return false;
+ return FALSE;
CPDF_Dictionary* pActionDict = action.GetDict();
if (pActionDict->KeyExist("Fields"))
@@ -2164,21 +2164,21 @@ bool CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
GetFieldFromObjects(fieldObjects, fields);
if (fields.GetSize() != 0)
{
- bool bIncludeOrExclude = !(dwFlags & 0x01);
+ FX_BOOL bIncludeOrExclude = !(dwFlags & 0x01);
if (m_pInterForm->CheckRequiredFields(&fields, bIncludeOrExclude))
- return false;
+ return FALSE;
- return SubmitFields(sDestination, fields, bIncludeOrExclude, false);
+ return SubmitFields(sDestination, fields, bIncludeOrExclude, FALSE);
}
}
if (m_pInterForm->CheckRequiredFields())
- return false;
+ return FALSE;
- return SubmitForm(sDestination, false);
+ return SubmitForm(sDestination, FALSE);
}
-bool CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
- bool bIncludeOrExclude, bool bUrlEncoded)
+FX_BOOL CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
+ FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded)
{
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
ASSERT(pEnv != NULL);
@@ -2192,12 +2192,12 @@ bool CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, const
if (bUrlEncoded)
{
if(!FDFToURLEncodedData(pBuffer, nBufSize))
- return false;
+ return FALSE;
}
pEnv->JS_docSubmitForm(pBuffer, nBufSize, csDestination.c_str());
- return true;
+ return TRUE;
}
void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer)
@@ -2236,22 +2236,22 @@ void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer)
sBuffer.ReleaseBuffer();
}
-bool CPDFSDK_InterForm::FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile)
+FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile)
{
- return true;
+ return TRUE;
}
-bool CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize)
+FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize)
{
CFDF_Document* pFDF = CFDF_Document::ParseMemory(pBuf, nBufSize);
if (pFDF)
{
CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
- if (pMainDict == NULL) return false;
+ if (pMainDict == NULL) return FALSE;
// Get fields
CPDF_Array* pFields = pMainDict->GetArray("Fields");
- if (pFields == NULL) return false;
+ if (pFields == NULL) return FALSE;
CFX_ByteTextBuf fdfEncodedData;
@@ -2279,17 +2279,17 @@ bool CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize
pBuf = FX_Alloc(uint8_t, nBufSize);
FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize);
}
- return true;
+ return TRUE;
}
-bool CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,bool bIncludeOrExclude, CFX_ByteTextBuf& textBuf)
+FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf)
{
ASSERT(m_pDocument != NULL);
ASSERT(m_pInterForm != NULL);
CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(CFX_PtrArray&)fields, bIncludeOrExclude);
- if (!pFDF) return false;
- bool bRet = pFDF->WriteBuf(textBuf); // = false;//
+ if (!pFDF) return FALSE;
+ FX_BOOL bRet = pFDF->WriteBuf(textBuf); // = FALSE;//
delete pFDF;
return bRet;
@@ -2301,24 +2301,24 @@ CFX_WideString CPDFSDK_InterForm::GetTemporaryFileName(const CFX_WideString& sFi
return L"";
}
-bool CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, bool bUrlEncoded)
+FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded)
{
- if (sDestination.IsEmpty()) return false;
+ if (sDestination.IsEmpty()) return FALSE;
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
ASSERT(pEnv != NULL);
- if(NULL == m_pDocument) return false;
+ if(NULL == m_pDocument) return FALSE;
CFX_WideString wsPDFFilePath = m_pDocument->GetPath();
- if(NULL == m_pInterForm) return false;
+ if(NULL == m_pInterForm) return FALSE;
CFDF_Document* pFDFDoc = m_pInterForm->ExportToFDF(wsPDFFilePath);
- if (NULL == pFDFDoc) return false;
+ if (NULL == pFDFDoc) return FALSE;
CFX_ByteTextBuf FdfBuffer;
- bool bRet = pFDFDoc->WriteBuf(FdfBuffer);
+ FX_BOOL bRet = pFDFDoc->WriteBuf(FdfBuffer);
delete pFDFDoc;
- if (!bRet) return false;
+ if (!bRet) return FALSE;
uint8_t* pBuffer = FdfBuffer.GetBuffer();
FX_STRSIZE nBufSize = FdfBuffer.GetLength();
@@ -2326,7 +2326,7 @@ bool CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, bool bUrl
if (bUrlEncoded)
{
if(!FDFToURLEncodedData(pBuffer, nBufSize))
- return false;
+ return FALSE;
}
pEnv->JS_docSubmitForm(pBuffer, nBufSize, sDestination.c_str());
@@ -2337,26 +2337,26 @@ bool CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, bool bUrl
pBuffer = NULL;
}
- return true;
+ return TRUE;
}
-bool CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf)
+FX_BOOL CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf)
{
ASSERT(m_pInterForm != NULL);
ASSERT(m_pDocument != NULL);
CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath());
- if (!pFDF) return false;
+ if (!pFDF) return FALSE;
- bool bRet = pFDF->WriteBuf(textBuf);
+ FX_BOOL bRet = pFDF->WriteBuf(textBuf);
delete pFDF;
return bRet;
}
-bool CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
+FX_BOOL CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
{
ASSERT(action);
@@ -2370,15 +2370,15 @@ bool CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
af.GetAllFields(fieldObjects);
CFX_PtrArray fields;
GetFieldFromObjects(fieldObjects, fields);
- return m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), true);
+ return m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), TRUE);
}
- return m_pInterForm->ResetForm(true);
+ return m_pInterForm->ResetForm(TRUE);
}
-bool CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action)
+FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action)
{
- return false;
+ return FALSE;
}
void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields)
@@ -2415,7 +2415,7 @@ int CPDFSDK_InterForm::BeforeValueChange(const CPDF_FormField* pField, CFX_WideS
int nType = pFormField->GetFieldType();
if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
{
- bool bRC = true;
+ FX_BOOL bRC = TRUE;
OnKeyStrokeCommit(pFormField, csValue, bRC);
if (bRC)
{
@@ -2434,12 +2434,12 @@ int CPDFSDK_InterForm::AfterValueChange(const CPDF_FormField* pField)
if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
{
OnCalculate(pFormField);
- bool bFormated = false;
+ FX_BOOL bFormated = FALSE;
CFX_WideString sValue = OnFormat(pFormField, bFormated);
if (bFormated)
- ResetFieldAppearance(pFormField, sValue.c_str(), true);
+ ResetFieldAppearance(pFormField, sValue.c_str(), TRUE);
else
- ResetFieldAppearance(pFormField, NULL, true);
+ ResetFieldAppearance(pFormField, NULL, TRUE);
UpdateField(pFormField);
}
return 0;
@@ -2451,7 +2451,7 @@ int CPDFSDK_InterForm::BeforeSelectionChange(const CPDF_FormField* pField, CFX_W
if (pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
return 0;
- bool bRC = true;
+ FX_BOOL bRC = TRUE;
OnKeyStrokeCommit(pFormField, csValue, bRC);
if (!bRC)
return -1;
@@ -2469,7 +2469,7 @@ int CPDFSDK_InterForm::AfterSelectionChange(const CPDF_FormField* pField)
if (pFormField->GetFieldType() == FIELDTYPE_LISTBOX)
{
OnCalculate(pFormField);
- ResetFieldAppearance(pFormField, NULL, true);
+ ResetFieldAppearance(pFormField, NULL, TRUE);
UpdateField(pFormField);
}
return 0;
@@ -2509,16 +2509,16 @@ int CPDFSDK_InterForm::AfterFormImportData(const CPDF_InterForm* pForm)
return 0;
}
-bool CPDFSDK_InterForm::IsNeedHighLight(int nFieldType)
+FX_BOOL CPDFSDK_InterForm::IsNeedHighLight(int nFieldType)
{
if(nFieldType <1 || nFieldType > 6)
- return false;
+ return FALSE;
return m_bNeedHightlight[nFieldType-1];
}
void CPDFSDK_InterForm::RemoveAllHighLight()
{
- memset((void*)m_bNeedHightlight, 0, 6*sizeof(bool));
+ memset((void*)m_bNeedHightlight, 0, 6*sizeof(FX_BOOL));
}
void CPDFSDK_InterForm::SetHighlightColor(FX_COLORREF clr, int nFieldType)
{
@@ -2530,14 +2530,14 @@ void CPDFSDK_InterForm::SetHighlightColor(FX_COLORREF clr, int nFieldType)
for(int i=0; i<6; i++)
{
m_aHighlightColor[i] = clr;
- m_bNeedHightlight[i] = true;
+ m_bNeedHightlight[i] = TRUE;
}
break;
}
default:
{
m_aHighlightColor[nFieldType-1] = clr;
- m_bNeedHightlight[nFieldType-1] = true;
+ m_bNeedHightlight[nFieldType-1] = TRUE;
break;
}
}
@@ -2783,7 +2783,7 @@ void CBA_AnnotIterator::GenerateResults()
if (sa.GetSize() > 0)
{
- sa.Sort(CBA_AnnotIterator::CompareByTop, false);
+ sa.Sort(CBA_AnnotIterator::CompareByTop, FALSE);
}
while (sa.GetSize() > 0)
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index da405cd8ef..05c1a3dd89 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -26,10 +26,10 @@ public:
virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) ;
virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect);
- virtual bool IsSelectionImplemented();
+ virtual FX_BOOL IsSelectionImplemented();
virtual CFX_WideString GetClipboardText(FX_HWND hWnd){return L"";}
- virtual bool SetClipboardText(FX_HWND hWnd, CFX_WideString string) {return false;}
+ virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) {return FALSE;}
virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) {}
virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) {}
@@ -45,23 +45,23 @@ public:
virtual void SetCursor(int32_t nCursorType);
virtual FX_HMENU CreatePopupMenu() {return NULL;}
- virtual bool AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) {return false;}
- virtual bool EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, bool bEnabled) {return false;}
+ virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) {return FALSE;}
+ virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, FX_BOOL bEnabled) {return FALSE;}
virtual int32_t TrackPopupMenu(FX_HMENU hMenu, int32_t x, int32_t y, FX_HWND hParent) {return -1;}
virtual void DestroyMenu(FX_HMENU hMenu) {}
virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset);
- virtual bool FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName);
+ virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName);
virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, uint8_t nCharset);
virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) ;
virtual void KillTimer(int32_t nID) ;
- virtual bool IsSHIFTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);}
- virtual bool IsCTRLKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsCTRLKeyDown(nFlag);}
- virtual bool IsALTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsALTKeyDown(nFlag);}
- virtual bool IsINSERTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsINSERTKeyDown(nFlag);}
+ virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);}
+ virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsCTRLKeyDown(nFlag);}
+ virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsALTKeyDown(nFlag);}
+ virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsINSERTKeyDown(nFlag);}
virtual FX_SYSTEMTIME GetLocalTime();
@@ -122,15 +122,15 @@ void CFX_SystemHandler::OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect)
}
-bool CFX_SystemHandler::IsSelectionImplemented()
+FX_BOOL CFX_SystemHandler::IsSelectionImplemented()
{
if(m_pEnv)
{
FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo();
if(pInfo && pInfo->FFI_OutputSelectedRect)
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(int32_t nCharset)
@@ -138,7 +138,7 @@ CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(int32_t nCharset)
return "";
}
-bool CFX_SystemHandler::FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName)
+FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName)
{
CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
if(pFontMgr)
@@ -156,13 +156,13 @@ bool CFX_SystemHandler::FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString
for(int i=0; i<nSize; i++)
{
if(pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
- return true;
+ return TRUE;
}
}
}
- return false;
+ return FALSE;
}
static int CharSet2CP(int charset)
@@ -183,8 +183,8 @@ CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CF
if(pDoc)
{
CFX_Font* pFXFont = new CFX_Font();
- pFXFont->LoadSubst(sFontFaceName,true,0,0,0,CharSet2CP(nCharset),false);
- CPDF_Font* pFont = pDoc->AddFont(pFXFont,nCharset,false);
+ pFXFont->LoadSubst(sFontFaceName,TRUE,0,0,0,CharSet2CP(nCharset),FALSE);
+ CPDF_Font* pFont = pDoc->AddFont(pFXFont,nCharset,FALSE);
delete pFXFont;
return pFont;
}
@@ -409,7 +409,7 @@ CPDFSDK_Document::CPDFSDK_Document(CPDF_Document* pDoc,CPDFDoc_Environment* pEnv
m_pFocusAnnot(nullptr),
m_pEnv(pEnv),
m_pOccontent(nullptr),
- m_bChangeMask(false)
+ m_bChangeMask(FALSE)
{
}
@@ -426,7 +426,7 @@ CPDFSDK_Document::~CPDFSDK_Document()
m_pOccontent = nullptr;
}
-CPDFSDK_PageView* CPDFSDK_Document::GetPageView(CPDF_Page* pPDFPage, bool ReNew)
+CPDFSDK_PageView* CPDFSDK_Document::GetPageView(CPDF_Page* pPDFPage, FX_BOOL ReNew)
{
auto it = m_pageMap.find(pPDFPage);
if (it != m_pageMap.end())
@@ -445,7 +445,7 @@ CPDFSDK_PageView* CPDFSDK_Document::GetPageView(CPDF_Page* pPDFPage, bool ReNew)
CPDFSDK_PageView* CPDFSDK_Document::GetCurrentView()
{
CPDF_Page* pPage = (CPDF_Page*)m_pEnv->FFI_GetCurrentPage(m_pDoc);
- return pPage ? GetPageView(pPage, true) : nullptr;
+ return pPage ? GetPageView(pPage, TRUE) : nullptr;
}
CPDFSDK_PageView* CPDFSDK_Document::GetPageView(int nIndex)
@@ -474,24 +474,24 @@ void CPDFSDK_Document:: ProcJavascriptFun()
}
-bool CPDFSDK_Document::ProcOpenAction()
+FX_BOOL CPDFSDK_Document::ProcOpenAction()
{
if(!m_pDoc)
- return false;
+ return FALSE;
CPDF_Dictionary* pRoot = m_pDoc->GetRoot();
if (!pRoot)
- return false;
+ return FALSE;
CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");
if(!pOpenAction)
pOpenAction = pRoot->GetArray("OpenAction");
if(!pOpenAction)
- return false;
+ return FALSE;
if(pOpenAction->GetType()==PDFOBJ_ARRAY)
- return true;
+ return TRUE;
if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
{
@@ -499,9 +499,9 @@ bool CPDFSDK_Document::ProcOpenAction()
CPDF_Action action(pDict);
if(m_pEnv->GetActionHander())
m_pEnv->GetActionHander()->DoAction_DocOpen(action, this);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CPDF_OCContext* CPDFSDK_Document::GetOCContext()
@@ -555,14 +555,14 @@ CPDFSDK_Annot* CPDFSDK_Document::GetFocusAnnot()
return m_pFocusAnnot;
}
-bool CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+FX_BOOL CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
{
- if(m_pFocusAnnot==pAnnot) return true;
+ if(m_pFocusAnnot==pAnnot) return TRUE;
if(m_pFocusAnnot)
{
- if(!KillFocusAnnot(nFlag) ) return false;
+ if(!KillFocusAnnot(nFlag) ) return FALSE;
}
CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
if(pAnnot && pPageView->IsValid())
@@ -572,18 +572,18 @@ bool CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
if(pAnnotHandler&&!m_pFocusAnnot)
{
if (!pAnnotHandler->Annot_OnSetFocus(pAnnot,nFlag))
- return false;
+ return FALSE;
if(!m_pFocusAnnot)
{
m_pFocusAnnot=pAnnot;
- return true;
+ return TRUE;
}
}
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
+FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
{
if(m_pFocusAnnot)
{
@@ -600,11 +600,11 @@ bool CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pFocusAnnot;
int nFieldType = pWidget->GetFieldType();
if(FIELDTYPE_TEXTFIELD == nFieldType || FIELDTYPE_COMBOBOX == nFieldType)
- m_pEnv->FFI_OnSetFieldInputFocus(NULL, NULL, 0, false);
+ m_pEnv->FFI_OnSetFieldInputFocus(NULL, NULL, 0, FALSE);
}
if(!m_pFocusAnnot)
- return true;
+ return TRUE;
}
else
{
@@ -612,7 +612,7 @@ bool CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
}
}
}
- return false;
+ return FALSE;
}
void CPDFSDK_Document::OnCloseDocument()
@@ -620,7 +620,7 @@ void CPDFSDK_Document::OnCloseDocument()
KillFocusAnnot();
}
-bool CPDFSDK_Document::GetPermissions(int nFlag)
+FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag)
{
FX_DWORD dwPermissions = m_pDoc->GetUserPermissions();
return dwPermissions&nFlag;
@@ -650,13 +650,13 @@ CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page):m_
m_page->SetPrivateData((void*)m_page, (void*)this, NULL);
m_fxAnnotArray.RemoveAll();
- m_bEnterWidget = false;
- m_bExitWidget = false;
- m_bOnWidget = false;
+ m_bEnterWidget = FALSE;
+ m_bExitWidget = FALSE;
+ m_bOnWidget = FALSE;
m_CaptureWidget = NULL;
- m_bValid = false;
- m_bLocked = false;
- m_bTakeOverPage = false;
+ m_bValid = FALSE;
+ m_bLocked = FALSE;
+ m_bTakeOverPage = FALSE;
}
CPDFSDK_PageView::~CPDFSDK_PageView()
@@ -690,7 +690,7 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* p
m_curMatrix = *pUser2Device;
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotIterator annotIterator(this, true);
+ CPDFSDK_AnnotIterator annotIterator(this, TRUE);
CPDFSDK_Annot* pSDKAnnot = nullptr;
int index = -1;
while ((pSDKAnnot = annotIterator.Next(index))) {
@@ -737,7 +737,7 @@ CPDF_Annot* CPDFSDK_PageView::GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY
CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
{
- CPDFSDK_AnnotIterator annotIterator(this, false);
+ CPDFSDK_AnnotIterator annotIterator(this, FALSE);
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pSDKAnnot = NULL;
@@ -755,7 +755,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT page
CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
{
- CPDFSDK_AnnotIterator annotIterator(this, false);
+ CPDFSDK_AnnotIterator annotIterator(this, FALSE);
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pSDKAnnot = NULL;
@@ -775,12 +775,12 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pag
}
-bool CPDFSDK_PageView::Annot_HasAppearance(CPDF_Annot* pAnnot)
+FX_BOOL CPDFSDK_PageView::Annot_HasAppearance(CPDF_Annot* pAnnot)
{
CPDF_Dictionary* pAnnotDic = pAnnot->GetAnnotDict();
if(pAnnotDic)
return pAnnotDic->KeyExist("AS");
- return false;
+ return FALSE;
}
CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot * pPDFAnnot)
@@ -819,9 +819,9 @@ CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType,CPDF_Dictiona
return NULL;
}
-bool CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot)
+FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot)
{
- return false;
+ return FALSE;
}
CPDF_Document* CPDFSDK_PageView::GetPDFDocument()
@@ -861,7 +861,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByDict(CPDF_Dictionary * pDict)
return NULL;
}
-bool CPDFSDK_PageView::OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag)
+FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
ASSERT(pEnv);
@@ -875,18 +875,18 @@ bool CPDFSDK_PageView::OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag)
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
ASSERT(pAnnotHandlerMgr);
- bool bRet = pAnnotHandlerMgr->Annot_OnLButtonDown(this, pFXAnnot, nFlag,point);
+ FX_BOOL bRet = pAnnotHandlerMgr->Annot_OnLButtonDown(this, pFXAnnot, nFlag,point);
if(bRet)
{
SetFocusAnnot(pFXAnnot);
}
return bRet;
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
+FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
ASSERT(pEnv);
@@ -894,7 +894,7 @@ bool CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
ASSERT(pAnnotHandlerMgr);
CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
CPDFSDK_Annot* pFocusAnnot = GetFocusAnnot();
- bool bRet = false;
+ FX_BOOL bRet = FALSE;
if(pFocusAnnot && pFocusAnnot != pFXAnnot)
{
//Last focus Annot gets a chance to handle the event.
@@ -908,7 +908,7 @@ bool CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
return bRet;
}
-bool CPDFSDK_PageView::OnMouseMove(const CPDF_Point & point, int nFlag)
+FX_BOOL CPDFSDK_PageView::OnMouseMove(const CPDF_Point & point, int nFlag)
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
@@ -918,36 +918,36 @@ bool CPDFSDK_PageView::OnMouseMove(const CPDF_Point & point, int nFlag)
{
if(m_CaptureWidget && m_CaptureWidget != pFXAnnot)
{
- m_bExitWidget = true;
- m_bEnterWidget = false;
+ m_bExitWidget = TRUE;
+ m_bEnterWidget = FALSE;
pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
}
m_CaptureWidget = (CPDFSDK_Widget*)pFXAnnot;
- m_bOnWidget = true;
+ m_bOnWidget = TRUE;
if(!m_bEnterWidget)
{
- m_bEnterWidget = true;
- m_bExitWidget = false;
+ m_bEnterWidget = TRUE;
+ m_bExitWidget = FALSE;
pAnnotHandlerMgr->Annot_OnMouseEnter(this, pFXAnnot,nFlag);
}
pAnnotHandlerMgr->Annot_OnMouseMove(this, pFXAnnot, nFlag, point);
- return true;
+ return TRUE;
}
if(m_bOnWidget)
{
- m_bOnWidget = false;
- m_bExitWidget = true;
- m_bEnterWidget = false;
+ m_bOnWidget = FALSE;
+ m_bExitWidget = TRUE;
+ m_bEnterWidget = FALSE;
if(m_CaptureWidget)
{
pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
m_CaptureWidget = NULL;
}
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag)
+FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag)
{
if(CPDFSDK_Annot* pAnnot = GetFXWidgetAtPoint(point.x, point.y))
{
@@ -956,11 +956,11 @@ bool CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_Poin
ASSERT(pAnnotHandlerMgr);
return pAnnotHandlerMgr->Annot_OnMouseWheel(this, pAnnot, nFlag, (int)deltaY, point);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag)
+FX_BOOL CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag)
{
if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
{
@@ -970,10 +970,10 @@ bool CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag)
return pAnnotHandlerMgr->Annot_OnChar(pAnnot, nChar, nFlag);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag)
+FX_BOOL CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag)
{
if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
{
@@ -982,17 +982,17 @@ bool CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag)
ASSERT(pAnnotHandlerMgr);
return pAnnotHandlerMgr->Annot_OnKeyDown(pAnnot, nKeyCode, nFlag);
}
- return false;
+ return FALSE;
}
-bool CPDFSDK_PageView::OnKeyUp(int nKeyCode, int nFlag)
+FX_BOOL CPDFSDK_PageView::OnKeyUp(int nKeyCode, int nFlag)
{
// if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
// {
// CFFL_IFormFiller* pIFormFiller = g_pFormFillApp->GetIFormFiller();
// return pIFormFiller->OnKeyUp(pAnnot, nKeyCode, nFlag);
// }
- return false;
+ return FALSE;
}
extern void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot);
@@ -1001,13 +1001,13 @@ void CPDFSDK_PageView::LoadFXAnnots()
{
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- bool enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
+ FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
//Disable the default AP construction.
- CPDF_InterForm::EnableUpdateAP(false);
+ CPDF_InterForm::EnableUpdateAP(FALSE);
m_pAnnotList = new CPDF_AnnotList(m_page);
CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
int nCount = m_pAnnotList->Count();
- SetLock(true);
+ SetLock(TRUE);
for(int i=0; i<nCount; i++)
{
CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i);
@@ -1029,7 +1029,7 @@ void CPDFSDK_PageView::LoadFXAnnots()
}
}
- SetLock(false);
+ SetLock(FALSE);
}
void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects)
@@ -1064,16 +1064,16 @@ int CPDFSDK_PageView::GetPageIndex()
return -1;
}
-bool CPDFSDK_PageView::IsValidAnnot(void* p)
+FX_BOOL CPDFSDK_PageView::IsValidAnnot(void* p)
{
- if (p == NULL) return false;
+ if (p == NULL) return FALSE;
int iCount = m_pAnnotList->Count();
for (int i = 0; i < iCount; i++)
{
if (m_pAnnotList->GetAt(i) == p)
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
diff --git a/fpdfsdk/src/fsdk_rendercontext.cpp b/fpdfsdk/src/fsdk_rendercontext.cpp
index 2bc3ea812b..f96db94150 100644
--- a/fpdfsdk/src/fsdk_rendercontext.cpp
+++ b/fpdfsdk/src/fsdk_rendercontext.cpp
@@ -38,10 +38,10 @@ IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause )
m_IPause = IPause;
}
-bool IFSDK_PAUSE_Adapter::NeedToPauseNow()
+FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow()
{
if (m_IPause->NeedToPauseNow) {
return m_IPause->NeedToPauseNow(m_IPause);
}
- return false;
+ return FALSE;
}
diff --git a/fpdfsdk/src/fxedit/fxet_ap.cpp b/fpdfsdk/src/fxedit/fxet_ap.cpp
index 7f2843cc29..309a98f41e 100644
--- a/fpdfsdk/src/fxedit/fxet_ap.cpp
+++ b/fpdfsdk/src/fxedit/fxet_ap.cpp
@@ -66,7 +66,7 @@ static CFX_ByteString GetFontSetString(IFX_Edit_FontMap * pFontMap, int32_t nFon
}
CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
- const CPVT_WordRange * pRange /* = NULL*/, bool bContinuous/* = true*/, FX_WORD SubWord/* = 0*/)
+ const CPVT_WordRange * pRange /* = NULL*/, FX_BOOL bContinuous/* = TRUE*/, FX_WORD SubWord/* = 0*/)
{
CFX_ByteTextBuf sEditStream, sWords;
diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp
index b1ad59dedb..63115c2626 100644
--- a/fpdfsdk/src/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/src/fxedit/fxet_edit.cpp
@@ -21,70 +21,70 @@ CFX_Edit_Iterator::~CFX_Edit_Iterator()
{
}
-bool CFX_Edit_Iterator::NextWord()
+FX_BOOL CFX_Edit_Iterator::NextWord()
{
return m_pVTIterator->NextWord();
}
-bool CFX_Edit_Iterator::NextLine()
+FX_BOOL CFX_Edit_Iterator::NextLine()
{
return m_pVTIterator->NextLine();
}
-bool CFX_Edit_Iterator::NextSection()
+FX_BOOL CFX_Edit_Iterator::NextSection()
{
return m_pVTIterator->NextSection();
}
-bool CFX_Edit_Iterator::PrevWord()
+FX_BOOL CFX_Edit_Iterator::PrevWord()
{
return m_pVTIterator->PrevWord();
}
-bool CFX_Edit_Iterator::PrevLine()
+FX_BOOL CFX_Edit_Iterator::PrevLine()
{
return m_pVTIterator->PrevLine();
}
-bool CFX_Edit_Iterator::PrevSection()
+FX_BOOL CFX_Edit_Iterator::PrevSection()
{
return m_pVTIterator->PrevSection();
}
-bool CFX_Edit_Iterator::GetWord(CPVT_Word & word) const
+FX_BOOL CFX_Edit_Iterator::GetWord(CPVT_Word & word) const
{
ASSERT(m_pEdit);
if (m_pVTIterator->GetWord(word))
{
word.ptWord = m_pEdit->VTToEdit(word.ptWord);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFX_Edit_Iterator::GetLine(CPVT_Line & line) const
+FX_BOOL CFX_Edit_Iterator::GetLine(CPVT_Line & line) const
{
ASSERT(m_pEdit);
if (m_pVTIterator->GetLine(line))
{
line.ptLine = m_pEdit->VTToEdit(line.ptLine);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFX_Edit_Iterator::GetSection(CPVT_Section & section) const
+FX_BOOL CFX_Edit_Iterator::GetSection(CPVT_Section & section) const
{
ASSERT(m_pEdit);
if (m_pVTIterator->GetSection(section))
{
section.rcSection = m_pEdit->VTToEdit(section.rcSection);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void CFX_Edit_Iterator::SetAt(int32_t nWordIndex)
@@ -167,7 +167,7 @@ int32_t CFX_Edit_Provider::GetDefaultFontIndex()
return 0;
}
-bool CFX_Edit_Provider::IsLatinWord(FX_WORD word)
+FX_BOOL CFX_Edit_Provider::IsLatinWord(FX_WORD word)
{
return FX_EDIT_ISLATINWORD(word);
}
@@ -210,7 +210,7 @@ void CFX_Edit_Refresh::NoAnalyse()
void CFX_Edit_Refresh::Analyse(int32_t nAlignment)
{
- bool bLineTopChanged = false;
+ FX_BOOL bLineTopChanged = FALSE;
CPDF_Rect rcResult;
FX_FLOAT fWidthDiff;
@@ -238,7 +238,7 @@ void CFX_Edit_Refresh::Analyse(int32_t nAlignment)
{
if (!pNewRect->IsSameTop(*pOldRect) || !pNewRect->IsSameHeight(*pOldRect))
{
- bLineTopChanged = true;
+ bLineTopChanged = TRUE;
continue;
}
@@ -324,9 +324,9 @@ void CFX_Edit_Refresh::EndRefresh()
CFX_Edit_Undo::CFX_Edit_Undo(int32_t nBufsize) : m_nCurUndoPos(0),
m_nBufSize(nBufsize),
- m_bModified(false),
- m_bVirgin(true),
- m_bWorking(false)
+ m_bModified(FALSE),
+ m_bVirgin(TRUE),
+ m_bWorking(FALSE)
{
}
@@ -335,14 +335,14 @@ CFX_Edit_Undo::~CFX_Edit_Undo()
Reset();
}
-bool CFX_Edit_Undo::CanUndo() const
+FX_BOOL CFX_Edit_Undo::CanUndo() const
{
return m_nCurUndoPos > 0;
}
void CFX_Edit_Undo::Undo()
{
- m_bWorking = true;
+ m_bWorking = TRUE;
if (m_nCurUndoPos > 0)
{
@@ -355,17 +355,17 @@ void CFX_Edit_Undo::Undo()
m_bModified = (m_nCurUndoPos != 0);
}
- m_bWorking = false;
+ m_bWorking = FALSE;
}
-bool CFX_Edit_Undo::CanRedo() const
+FX_BOOL CFX_Edit_Undo::CanRedo() const
{
return m_nCurUndoPos < m_UndoItemStack.GetSize();
}
void CFX_Edit_Undo::Redo()
{
- m_bWorking = true;
+ m_bWorking = TRUE;
int32_t nStackSize = m_UndoItemStack.GetSize();
@@ -380,10 +380,10 @@ void CFX_Edit_Undo::Redo()
m_bModified = (m_nCurUndoPos != 0);
}
- m_bWorking = false;
+ m_bWorking = FALSE;
}
-bool CFX_Edit_Undo::IsWorking() const
+FX_BOOL CFX_Edit_Undo::IsWorking() const
{
return m_bWorking;
}
@@ -400,7 +400,7 @@ void CFX_Edit_Undo::AddItem(IFX_Edit_UndoItem* pItem)
if (m_UndoItemStack.GetSize() >= m_nBufSize)
{
RemoveHeads();
- m_bVirgin = false;
+ m_bVirgin = FALSE;
}
m_UndoItemStack.Add(pItem);
@@ -409,9 +409,9 @@ void CFX_Edit_Undo::AddItem(IFX_Edit_UndoItem* pItem)
m_bModified = (m_nCurUndoPos != 0);
}
-bool CFX_Edit_Undo::IsModified() const
+FX_BOOL CFX_Edit_Undo::IsModified() const
{
- return m_bVirgin ? m_bModified : true;
+ return m_bVirgin ? m_bModified : TRUE;
}
IFX_Edit_UndoItem* CFX_Edit_Undo::GetItem(int32_t nIndex)
@@ -469,8 +469,8 @@ void CFX_Edit_GroupUndoItem::AddUndoItem(CFX_Edit_UndoItem* pUndoItem)
{
ASSERT(pUndoItem != NULL);
- pUndoItem->SetFirst(false);
- pUndoItem->SetLast(false);
+ pUndoItem->SetFirst(FALSE);
+ pUndoItem->SetLast(FALSE);
m_Items.Add(pUndoItem);
@@ -484,11 +484,11 @@ void CFX_Edit_GroupUndoItem::UpdateItems()
{
CFX_Edit_UndoItem* pFirstItem = m_Items[0];
ASSERT(pFirstItem != NULL);
- pFirstItem->SetFirst(true);
+ pFirstItem->SetFirst(TRUE);
CFX_Edit_UndoItem* pLastItem = m_Items[m_Items.GetSize() - 1];
ASSERT(pLastItem != NULL);
- pLastItem->SetLast(true);
+ pLastItem->SetLast(TRUE);
}
}
@@ -539,7 +539,7 @@ void CFXEU_InsertWord::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,false,true);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
}
}
@@ -549,7 +549,7 @@ void CFXEU_InsertWord::Undo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpNew);
- m_pEdit->Backspace(false,true);
+ m_pEdit->Backspace(FALSE,TRUE);
}
}
@@ -579,7 +579,7 @@ void CFXEU_InsertReturn::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,false,true);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
}
}
@@ -589,7 +589,7 @@ void CFXEU_InsertReturn::Undo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpNew);
- m_pEdit->Backspace(false,true);
+ m_pEdit->Backspace(FALSE,TRUE);
}
}
@@ -619,7 +619,7 @@ void CFXEU_Backspace::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->Backspace(false,true);
+ m_pEdit->Backspace(FALSE,TRUE);
}
}
@@ -631,11 +631,11 @@ void CFXEU_Backspace::Undo()
m_pEdit->SetCaret(m_wpNew);
if (m_wpNew.SecCmp(m_wpOld) != 0)
{
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,false,true);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
}
else
{
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,false,true);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
}
}
}
@@ -645,7 +645,7 @@ void CFXEU_Backspace::Undo()
CFXEU_Delete::CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
FX_WORD word, int32_t charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, bool bSecEnd) :
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd) :
m_pEdit(pEdit),
m_wpOld(wpOldPlace),
m_wpNew(wpNewPlace),
@@ -667,7 +667,7 @@ void CFXEU_Delete::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->Delete(false,true);
+ m_pEdit->Delete(FALSE,TRUE);
}
}
@@ -679,11 +679,11 @@ void CFXEU_Delete::Undo()
m_pEdit->SetCaret(m_wpNew);
if (m_bSecEnd)
{
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,false,true);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
}
else
{
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,false,true);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
}
}
}
@@ -708,7 +708,7 @@ void CFXEU_Clear::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
- m_pEdit->Clear(false,true);
+ m_pEdit->Clear(FALSE,TRUE);
}
}
@@ -718,7 +718,7 @@ void CFXEU_Clear::Undo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wrSel.BeginPos);
- m_pEdit->InsertText(m_swText.c_str(), DEFAULT_CHARSET, NULL, NULL, false, true);
+ m_pEdit->InsertText(m_swText.c_str(), DEFAULT_CHARSET, NULL, NULL, FALSE, TRUE);
m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
}
}
@@ -750,7 +750,7 @@ void CFXEU_ClearRich::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
- m_pEdit->Clear(false,true);
+ m_pEdit->Clear(FALSE,TRUE);
}
}
@@ -762,11 +762,11 @@ void CFXEU_ClearRich::Undo()
m_pEdit->SetCaret(m_wpOld);
if (m_wpNew.SecCmp(m_wpOld) != 0)
{
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,false,false);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,FALSE);
}
else
{
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,false,false);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,FALSE);
}
if (IsFirst())
@@ -806,7 +806,7 @@ void CFXEU_InsertText::Redo()
{
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertText(m_swText.c_str(), m_nCharset, &m_SecProps, &m_WordProps, false, true);
+ m_pEdit->InsertText(m_swText.c_str(), m_nCharset, &m_SecProps, &m_WordProps, FALSE, TRUE);
}
}
@@ -816,7 +816,7 @@ void CFXEU_InsertText::Undo()
{
m_pEdit->SelectNone();
m_pEdit->SetSel(m_wpOld,m_wpNew);
- m_pEdit->Clear(false,true);
+ m_pEdit->Clear(FALSE,TRUE);
}
}
@@ -844,7 +844,7 @@ void CFXEU_SetSecProps::Redo()
{
if (m_pEdit)
{
- m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_NewSecProps,&m_NewWordProps,m_wrPlace,false);
+ m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_NewSecProps,&m_NewWordProps,m_wrPlace,FALSE);
if (IsLast())
{
m_pEdit->SelectNone();
@@ -858,7 +858,7 @@ void CFXEU_SetSecProps::Undo()
{
if (m_pEdit)
{
- m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_OldSecProps,&m_OldWordProps,m_wrPlace,false);
+ m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_OldSecProps,&m_OldWordProps,m_wrPlace,FALSE);
if (IsFirst())
{
m_pEdit->SelectNone();
@@ -889,7 +889,7 @@ void CFXEU_SetWordProps::Redo()
{
if (m_pEdit)
{
- m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_NewWordProps,m_wrPlace,false);
+ m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_NewWordProps,m_wrPlace,FALSE);
if (IsLast())
{
m_pEdit->SelectNone();
@@ -903,7 +903,7 @@ void CFXEU_SetWordProps::Undo()
{
if (m_pEdit)
{
- m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_OldWordProps,m_wrPlace,false);
+ m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_OldWordProps,m_wrPlace,FALSE);
if (IsFirst())
{
m_pEdit->SelectNone();
@@ -925,18 +925,18 @@ CFX_Edit::CFX_Edit(IPDF_VariableText * pVT) :
m_SelState(),
m_ptScrollPos(0,0),
m_ptRefreshScrollPos(0,0),
- m_bEnableScroll(false),
+ m_bEnableScroll(FALSE),
m_pIterator(NULL),
m_ptCaret(0.0f,0.0f),
m_Undo(FX_EDIT_UNDO_MAXITEM),
m_nAlignment(0),
- m_bNotifyFlag(false),
- m_bEnableOverflow(false),
- m_bEnableRefresh(true),
+ m_bNotifyFlag(FALSE),
+ m_bEnableOverflow(FALSE),
+ m_bEnableRefresh(TRUE),
m_rcOldContent(0.0f,0.0f,0.0f,0.0f),
- m_bEnableUndo(true),
- m_bNotify(true),
- m_bOprNotify(false),
+ m_bEnableUndo(TRUE),
+ m_bNotify(TRUE),
+ m_bOprNotify(FALSE),
m_pGroupUndoItem(NULL)
{
ASSERT(pVT != NULL);
@@ -1002,92 +1002,92 @@ IFX_Edit_FontMap* CFX_Edit::GetFontMap()
return NULL;
}
-void CFX_Edit::SetPlateRect(const CPDF_Rect & rect, bool bPaint/* = true*/)
+void CFX_Edit::SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetPlateRect(rect);
m_ptScrollPos = CPDF_Point(rect.left,rect.top);
if (bPaint) Paint();
}
-void CFX_Edit::SetAlignmentH(int32_t nFormat/* =0 */, bool bPaint/* = true*/)
+void CFX_Edit::SetAlignmentH(int32_t nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetAlignment(nFormat);
if (bPaint) Paint();
}
-void CFX_Edit::SetAlignmentV(int32_t nFormat/* =0 */, bool bPaint/* = true*/)
+void CFX_Edit::SetAlignmentV(int32_t nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/)
{
m_nAlignment = nFormat;
if (bPaint) Paint();
}
-void CFX_Edit::SetPasswordChar(FX_WORD wSubWord/* ='*' */, bool bPaint/* = true*/)
+void CFX_Edit::SetPasswordChar(FX_WORD wSubWord/* ='*' */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetPasswordChar(wSubWord);
if (bPaint) Paint();
}
-void CFX_Edit::SetLimitChar(int32_t nLimitChar/* =0 */, bool bPaint/* = true*/)
+void CFX_Edit::SetLimitChar(int32_t nLimitChar/* =0 */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetLimitChar(nLimitChar);
if (bPaint) Paint();
}
-void CFX_Edit::SetCharArray(int32_t nCharArray/* =0 */, bool bPaint/* = true*/)
+void CFX_Edit::SetCharArray(int32_t nCharArray/* =0 */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetCharArray(nCharArray);
if (bPaint) Paint();
}
-void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace/* =0.0f */, bool bPaint/* = true*/)
+void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace/* =0.0f */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetCharSpace(fCharSpace);
if (bPaint) Paint();
}
-void CFX_Edit::SetHorzScale(int32_t nHorzScale/* =100 */, bool bPaint/* = true*/)
+void CFX_Edit::SetHorzScale(int32_t nHorzScale/* =100 */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetHorzScale(nHorzScale);
if (bPaint) Paint();
}
-void CFX_Edit::SetMultiLine(bool bMultiLine/* =true */, bool bPaint/* = true*/)
+void CFX_Edit::SetMultiLine(FX_BOOL bMultiLine/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetMultiLine(bMultiLine);
if (bPaint) Paint();
}
-void CFX_Edit::SetAutoReturn(bool bAuto/* =true */, bool bPaint/* = true*/)
+void CFX_Edit::SetAutoReturn(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetAutoReturn(bAuto);
if (bPaint) Paint();
}
-void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading/* =true */, bool bPaint/* = true*/)
+void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetLineLeading(fLineLeading);
if (bPaint) Paint();
}
-void CFX_Edit::SetAutoFontSize(bool bAuto/* =true */, bool bPaint/* = true*/)
+void CFX_Edit::SetAutoFontSize(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetAutoFontSize(bAuto);
if (bPaint) Paint();
}
-void CFX_Edit::SetFontSize(FX_FLOAT fFontSize, bool bPaint/* = true*/)
+void CFX_Edit::SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetFontSize(fFontSize);
if (bPaint) Paint();
}
-void CFX_Edit::SetAutoScroll(bool bAuto/* =true */, bool bPaint/* = true*/)
+void CFX_Edit::SetAutoScroll(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
{
m_bEnableScroll = bAuto;
if (bPaint) Paint();
}
-void CFX_Edit::SetTextOverflow(bool bAllowed /*= false*/, bool bPaint/* = true*/)
+void CFX_Edit::SetTextOverflow(FX_BOOL bAllowed /*= FALSE*/, FX_BOOL bPaint/* = TRUE*/)
{
m_bEnableOverflow = bAllowed;
if (bPaint) Paint();
@@ -1193,7 +1193,7 @@ CFX_WideString CFX_Edit::GetText() const
{
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
{
- bool bRich = m_pVT->IsRichText();
+ FX_BOOL bRich = m_pVT->IsRichText();
pIterator->SetAt(0);
@@ -1235,7 +1235,7 @@ CFX_WideString CFX_Edit::GetRangeText(const CPVT_WordRange & range) const
if (m_pVT->IsValid())
{
- bool bRich = m_pVT->IsRichText();
+ FX_BOOL bRich = m_pVT->IsRichText();
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
{
@@ -1331,46 +1331,46 @@ CPVT_WordRange CFX_Edit::CombineWordRange(const CPVT_WordRange & wr1, const CPVT
return wrRet;
}
-bool CFX_Edit::IsRichText() const
+FX_BOOL CFX_Edit::IsRichText() const
{
return m_pVT->IsRichText();
}
-void CFX_Edit::SetRichText(bool bRichText/* =true */, bool bPaint/* = true*/)
+void CFX_Edit::SetRichText(FX_BOOL bRichText/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
{
m_pVT->SetRichText(bRichText);
if (bPaint) Paint();
}
-bool CFX_Edit::SetRichFontIndex(int32_t nFontIndex)
+FX_BOOL CFX_Edit::SetRichFontIndex(int32_t nFontIndex)
{
CPVT_WordProps WordProps;
WordProps.nFontIndex = nFontIndex;
return SetRichTextProps(EP_FONTINDEX,NULL,&WordProps);
}
-bool CFX_Edit::SetRichFontSize(FX_FLOAT fFontSize)
+FX_BOOL CFX_Edit::SetRichFontSize(FX_FLOAT fFontSize)
{
CPVT_WordProps WordProps;
WordProps.fFontSize = fFontSize;
return SetRichTextProps(EP_FONTSIZE,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextColor(FX_COLORREF dwColor)
+FX_BOOL CFX_Edit::SetRichTextColor(FX_COLORREF dwColor)
{
CPVT_WordProps WordProps;
WordProps.dwWordColor = dwColor;
return SetRichTextProps(EP_WORDCOLOR,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextScript(int32_t nScriptType)
+FX_BOOL CFX_Edit::SetRichTextScript(int32_t nScriptType)
{
CPVT_WordProps WordProps;
WordProps.nScriptType = nScriptType;
return SetRichTextProps(EP_SCRIPTTYPE,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextBold(bool bBold)
+FX_BOOL CFX_Edit::SetRichTextBold(FX_BOOL bBold)
{
CPVT_WordProps WordProps;
if (bBold)
@@ -1378,7 +1378,7 @@ bool CFX_Edit::SetRichTextBold(bool bBold)
return SetRichTextProps(EP_BOLD,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextItalic(bool bItalic)
+FX_BOOL CFX_Edit::SetRichTextItalic(FX_BOOL bItalic)
{
CPVT_WordProps WordProps;
if (bItalic)
@@ -1386,7 +1386,7 @@ bool CFX_Edit::SetRichTextItalic(bool bItalic)
return SetRichTextProps(EP_ITALIC,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextUnderline(bool bUnderline)
+FX_BOOL CFX_Edit::SetRichTextUnderline(FX_BOOL bUnderline)
{
CPVT_WordProps WordProps;
if (bUnderline)
@@ -1394,7 +1394,7 @@ bool CFX_Edit::SetRichTextUnderline(bool bUnderline)
return SetRichTextProps(EP_UNDERLINE,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextCrossout(bool bCrossout)
+FX_BOOL CFX_Edit::SetRichTextCrossout(FX_BOOL bCrossout)
{
CPVT_WordProps WordProps;
if (bCrossout)
@@ -1402,45 +1402,45 @@ bool CFX_Edit::SetRichTextCrossout(bool bCrossout)
return SetRichTextProps(EP_CROSSOUT,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace)
+FX_BOOL CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace)
{
CPVT_WordProps WordProps;
WordProps.fCharSpace = fCharSpace;
return SetRichTextProps(EP_CHARSPACE,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale /*= 100*/)
+FX_BOOL CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale /*= 100*/)
{
CPVT_WordProps WordProps;
WordProps.nHorzScale = nHorzScale;
return SetRichTextProps(EP_HORZSCALE,NULL,&WordProps);
}
-bool CFX_Edit::SetRichTextLineLeading(FX_FLOAT fLineLeading)
+FX_BOOL CFX_Edit::SetRichTextLineLeading(FX_FLOAT fLineLeading)
{
CPVT_SecProps SecProps;
SecProps.fLineLeading = fLineLeading;
return SetRichTextProps(EP_LINELEADING,&SecProps,NULL);
}
-bool CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent)
+FX_BOOL CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent)
{
CPVT_SecProps SecProps;
SecProps.fLineIndent = fLineIndent;
return SetRichTextProps(EP_LINEINDENT,&SecProps,NULL);
}
-bool CFX_Edit::SetRichTextAlignment(int32_t nAlignment)
+FX_BOOL CFX_Edit::SetRichTextAlignment(int32_t nAlignment)
{
CPVT_SecProps SecProps;
SecProps.nAlignment = nAlignment;
return SetRichTextProps(EP_ALIGNMENT,&SecProps,NULL);
}
-bool CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps)
+FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps)
{
- bool bSet = false;
- bool bSet1,bSet2;
+ FX_BOOL bSet = FALSE;
+ FX_BOOL bSet1,bSet2;
if (m_pVT->IsValid() && m_pVT->IsRichText())
{
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
@@ -1453,14 +1453,14 @@ bool CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecP
BeginGroupUndo(L"");;
- bSet = SetSecProps(eProps,wrTemp.BeginPos,pSecProps,pWordProps,wrTemp,true);
+ bSet = SetSecProps(eProps,wrTemp.BeginPos,pSecProps,pWordProps,wrTemp,TRUE);
while (pIterator->NextWord())
{
CPVT_WordPlace place = pIterator->GetAt();
if (place.WordCmp(wrTemp.EndPos) > 0) break;
- bSet1 = SetSecProps(eProps,place,pSecProps,pWordProps,wrTemp,true);
- bSet2 = SetWordProps(eProps,place,pWordProps,wrTemp,true);
+ bSet1 = SetSecProps(eProps,place,pSecProps,pWordProps,wrTemp,TRUE);
+ bSet2 = SetWordProps(eProps,place,pWordProps,wrTemp,TRUE);
if (!bSet)
bSet = (bSet1 || bSet2);
@@ -1516,15 +1516,15 @@ void CFX_Edit::PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr)
}
}
-bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps,
- const CPVT_WordRange & wr, bool bAddUndo)
+ const CPVT_WordRange & wr, FX_BOOL bAddUndo)
{
if (m_pVT->IsValid() && m_pVT->IsRichText())
{
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
{
- bool bSet = false;
+ FX_BOOL bSet = FALSE;
CPVT_Section secinfo;
CPVT_Section OldSecinfo;
@@ -1545,21 +1545,21 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineLeading,pSecProps->fLineLeading))
{
secinfo.SecProps.fLineLeading = pSecProps->fLineLeading;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_LINEINDENT:
if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineIndent,pSecProps->fLineIndent))
{
secinfo.SecProps.fLineIndent = pSecProps->fLineIndent;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_ALIGNMENT:
if (secinfo.SecProps.nAlignment != pSecProps->nAlignment)
{
secinfo.SecProps.nAlignment = pSecProps->nAlignment;
- bSet = true;
+ bSet = TRUE;
}
break;
default:
@@ -1583,42 +1583,42 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if (secinfo.WordProps.nFontIndex != pWordProps->nFontIndex)
{
secinfo.WordProps.nFontIndex = pWordProps->nFontIndex;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_FONTSIZE:
if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fFontSize,pWordProps->fFontSize))
{
secinfo.WordProps.fFontSize = pWordProps->fFontSize;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_WORDCOLOR:
if (secinfo.WordProps.dwWordColor != pWordProps->dwWordColor)
{
secinfo.WordProps.dwWordColor = pWordProps->dwWordColor;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_SCRIPTTYPE:
if (secinfo.WordProps.nScriptType != pWordProps->nScriptType)
{
secinfo.WordProps.nScriptType = pWordProps->nScriptType;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_CHARSPACE:
if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fCharSpace,pWordProps->fCharSpace))
{
secinfo.WordProps.fCharSpace = pWordProps->fCharSpace;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_HORZSCALE:
if (secinfo.WordProps.nHorzScale != pWordProps->nHorzScale)
{
secinfo.WordProps.nHorzScale = pWordProps->nHorzScale;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_UNDERLINE:
@@ -1627,7 +1627,7 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0)
{
secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
- bSet = true;
+ bSet = TRUE;
}
}
else
@@ -1635,7 +1635,7 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) != 0)
{
secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_UNDERLINE;
- bSet = true;
+ bSet = TRUE;
}
}
break;
@@ -1645,7 +1645,7 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0)
{
secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
- bSet = true;
+ bSet = TRUE;
}
}
else
@@ -1653,7 +1653,7 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) != 0)
{
secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_CROSSOUT;
- bSet = true;
+ bSet = TRUE;
}
}
break;
@@ -1663,7 +1663,7 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0)
{
secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
- bSet = true;
+ bSet = TRUE;
}
}
else
@@ -1671,7 +1671,7 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) != 0)
{
secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_BOLD;
- bSet = true;
+ bSet = TRUE;
}
}
break;
@@ -1681,7 +1681,7 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0)
{
secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
- bSet = true;
+ bSet = TRUE;
}
}
else
@@ -1689,7 +1689,7 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) != 0)
{
secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_ITALIC;
- bSet = true;
+ bSet = TRUE;
}
}
break;
@@ -1717,17 +1717,17 @@ bool CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
}
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
- const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, bool bAddUndo)
+FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+ const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo)
{
if (m_pVT->IsValid() && m_pVT->IsRichText())
{
if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
{
- bool bSet = false;
+ FX_BOOL bSet = FALSE;
CPVT_Word wordinfo;
CPVT_Word OldWordinfo;
@@ -1749,42 +1749,42 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
{
wordinfo.WordProps.nFontIndex = pFontMap->GetWordFontIndex(wordinfo.Word,wordinfo.nCharset,pWordProps->nFontIndex);
}
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_FONTSIZE:
if (!FX_EDIT_IsFloatEqual(wordinfo.WordProps.fFontSize,pWordProps->fFontSize))
{
wordinfo.WordProps.fFontSize = pWordProps->fFontSize;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_WORDCOLOR:
if (wordinfo.WordProps.dwWordColor != pWordProps->dwWordColor)
{
wordinfo.WordProps.dwWordColor = pWordProps->dwWordColor;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_SCRIPTTYPE:
if (wordinfo.WordProps.nScriptType != pWordProps->nScriptType)
{
wordinfo.WordProps.nScriptType = pWordProps->nScriptType;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_CHARSPACE:
if (!FX_EDIT_IsFloatEqual(wordinfo.WordProps.fCharSpace,pWordProps->fCharSpace))
{
wordinfo.WordProps.fCharSpace = pWordProps->fCharSpace;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_HORZSCALE:
if (wordinfo.WordProps.nHorzScale != pWordProps->nHorzScale)
{
wordinfo.WordProps.nHorzScale = pWordProps->nHorzScale;
- bSet = true;
+ bSet = TRUE;
}
break;
case EP_UNDERLINE:
@@ -1793,7 +1793,7 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0)
{
wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
- bSet = true;
+ bSet = TRUE;
}
}
else
@@ -1801,7 +1801,7 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) != 0)
{
wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_UNDERLINE;
- bSet = true;
+ bSet = TRUE;
}
}
break;
@@ -1811,7 +1811,7 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0)
{
wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
- bSet = true;
+ bSet = TRUE;
}
}
else
@@ -1819,7 +1819,7 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) != 0)
{
wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_CROSSOUT;
- bSet = true;
+ bSet = TRUE;
}
}
break;
@@ -1829,7 +1829,7 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0)
{
wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
- bSet = true;
+ bSet = TRUE;
}
}
else
@@ -1837,7 +1837,7 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) != 0)
{
wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_BOLD;
- bSet = true;
+ bSet = TRUE;
}
}
break;
@@ -1847,7 +1847,7 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0)
{
wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
- bSet = true;
+ bSet = TRUE;
}
}
else
@@ -1855,7 +1855,7 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) != 0)
{
wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_ITALIC;
- bSet = true;
+ bSet = TRUE;
}
}
break;
@@ -1881,44 +1881,44 @@ bool CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
}
}
- return false;
+ return FALSE;
}
void CFX_Edit::SetText(const FX_WCHAR* text,int32_t charset /*= DEFAULT_CHARSET*/,
const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
{
- SetText(text,charset,pSecProps,pWordProps,true,true);
+ SetText(text,charset,pSecProps,pWordProps,TRUE,TRUE);
}
-bool CFX_Edit::InsertWord(FX_WORD word, int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_WordProps * pWordProps /*= NULL*/)
+FX_BOOL CFX_Edit::InsertWord(FX_WORD word, int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_WordProps * pWordProps /*= NULL*/)
{
- return InsertWord(word,charset,pWordProps,true,true);
+ return InsertWord(word,charset,pWordProps,TRUE,TRUE);
}
-bool CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
+FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
{
- return InsertReturn(pSecProps,pWordProps,true,true);
+ return InsertReturn(pSecProps,pWordProps,TRUE,TRUE);
}
-bool CFX_Edit::Backspace()
+FX_BOOL CFX_Edit::Backspace()
{
- return Backspace(true,true);
+ return Backspace(TRUE,TRUE);
}
-bool CFX_Edit::Delete()
+FX_BOOL CFX_Edit::Delete()
{
- return Delete(true,true);
+ return Delete(TRUE,TRUE);
}
-bool CFX_Edit::Clear()
+FX_BOOL CFX_Edit::Clear()
{
- return Clear(true,true);
+ return Clear(TRUE,TRUE);
}
-bool CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset /*= DEFAULT_CHARSET*/,
+FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset /*= DEFAULT_CHARSET*/,
const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
{
- return InsertText(text,charset,pSecProps,pWordProps,true,true);
+ return InsertText(text,charset,pSecProps,pWordProps,TRUE,TRUE);
}
FX_FLOAT CFX_Edit::GetFontSize() const
@@ -2039,9 +2039,9 @@ void CFX_Edit::SetContentChanged()
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
m_pNotify->IOnContentChange(rcContent);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
m_rcOldContent = rcContent;
}
@@ -2075,7 +2075,7 @@ void CFX_Edit::SelectNone()
}
}
-bool CFX_Edit::IsSelected() const
+FX_BOOL CFX_Edit::IsSelected() const
{
return m_SelState.IsExist();
}
@@ -2153,13 +2153,13 @@ void CFX_Edit::SetScrollInfo()
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollInfoX(rcPlate.left, rcPlate.right,
rcContent.left, rcContent.right, rcPlate.Width() / 3, rcPlate.Width());
m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
rcContent.bottom, rcContent.top, rcPlate.Height() / 3, rcPlate.Height());
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
}
@@ -2179,9 +2179,9 @@ void CFX_Edit::SetScrollPosX(FX_FLOAT fx)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollPosX(fx);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
}
@@ -2203,9 +2203,9 @@ void CFX_Edit::SetScrollPosY(FX_FLOAT fy)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollPosY(fy);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
}
@@ -2373,13 +2373,13 @@ void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1,const
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
if (const CFX_Edit_RectArray * pRects = m_Refresh.GetRefreshRects())
{
for (int32_t i = 0, sz = pRects->GetSize(); i < sz; i++)
m_pNotify->IOnInvalidateRect(pRects->GetAt(i));
}
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
@@ -2499,10 +2499,10 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
CPDF_Rect rcRefresh = VTToEdit(rcWord);
m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
}
@@ -2517,10 +2517,10 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
CPDF_Rect rcRefresh = VTToEdit(rcLine);
m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
@@ -2565,9 +2565,9 @@ void CFX_Edit::SetCaretInfo()
}
}
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
m_pNotify->IOnSetCaret(!m_SelState.IsExist(),VTToEdit(ptHead),VTToEdit(ptFoot), m_wpCaret);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
@@ -2603,9 +2603,9 @@ void CFX_Edit::SetCaretChange()
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
m_pNotify->IOnCaretChange(SecProps,WordProps);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
}
@@ -2624,7 +2624,7 @@ void CFX_Edit::SetCaret(int32_t nPos)
}
}
-void CFX_Edit::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl)
+void CFX_Edit::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2638,7 +2638,7 @@ void CFX_Edit::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl)
}
}
-void CFX_Edit::OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl)
+void CFX_Edit::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2657,7 +2657,7 @@ void CFX_Edit::OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl)
}
}
-void CFX_Edit::OnVK_UP(bool bShift,bool bCtrl)
+void CFX_Edit::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2688,7 +2688,7 @@ void CFX_Edit::OnVK_UP(bool bShift,bool bCtrl)
}
}
-void CFX_Edit::OnVK_DOWN(bool bShift,bool bCtrl)
+void CFX_Edit::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2719,7 +2719,7 @@ void CFX_Edit::OnVK_DOWN(bool bShift,bool bCtrl)
}
}
-void CFX_Edit::OnVK_LEFT(bool bShift,bool bCtrl)
+void CFX_Edit::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2773,7 +2773,7 @@ void CFX_Edit::OnVK_LEFT(bool bShift,bool bCtrl)
}
}
-void CFX_Edit::OnVK_RIGHT(bool bShift,bool bCtrl)
+void CFX_Edit::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2827,7 +2827,7 @@ void CFX_Edit::OnVK_RIGHT(bool bShift,bool bCtrl)
}
}
-void CFX_Edit::OnVK_HOME(bool bShift,bool bCtrl)
+void CFX_Edit::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2876,7 +2876,7 @@ void CFX_Edit::OnVK_HOME(bool bShift,bool bCtrl)
}
}
-void CFX_Edit::OnVK_END(bool bShift,bool bCtrl)
+void CFX_Edit::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
{
if (m_pVT->IsValid())
{
@@ -2926,7 +2926,7 @@ void CFX_Edit::OnVK_END(bool bShift,bool bCtrl)
}
void CFX_Edit::SetText(const FX_WCHAR* text,int32_t charset,
- const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, bool bAddUndo, bool bPaint)
+ const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
{
Empty();
DoInsertText(CPVT_WordPlace(0,0,-1), text, charset, pSecProps, pWordProps);
@@ -2936,9 +2936,9 @@ void CFX_Edit::SetText(const FX_WCHAR* text,int32_t charset,
//if (bAddUndo)
}
-bool CFX_Edit::InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps, bool bAddUndo, bool bPaint)
+FX_BOOL CFX_Edit::InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
{
- if (IsTextOverflow()) return false;
+ if (IsTextOverflow()) return FALSE;
if (m_pVT->IsValid())
{
@@ -2960,17 +2960,17 @@ bool CFX_Edit::InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps *
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnInsertWord(m_wpCaret, m_wpOldCaret);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,
- bool bAddUndo, bool bPaint)
+FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,
+ FX_BOOL bAddUndo, FX_BOOL bPaint)
{
- if (IsTextOverflow()) return false;
+ if (IsTextOverflow()) return FALSE;
if (m_pVT->IsValid())
{
@@ -2998,18 +2998,18 @@ bool CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnInsertReturn(m_wpCaret, m_wpOldCaret);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::Backspace(bool bAddUndo, bool bPaint)
+FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint)
{
if (m_pVT->IsValid())
{
- if (m_wpCaret == m_pVT->GetBeginWordPlace()) return false;
+ if (m_wpCaret == m_pVT->GetBeginWordPlace()) return FALSE;
CPVT_Section section;
CPVT_Word word;
@@ -3062,18 +3062,18 @@ bool CFX_Edit::Backspace(bool bAddUndo, bool bPaint)
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnBackSpace(m_wpCaret, m_wpOldCaret);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::Delete(bool bAddUndo, bool bPaint)
+FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint)
{
if (m_pVT->IsValid())
{
- if (m_wpCaret == m_pVT->GetEndWordPlace()) return false;
+ if (m_wpCaret == m_pVT->GetEndWordPlace()) return FALSE;
CPVT_Section section;
CPVT_Word word;
@@ -3089,7 +3089,7 @@ bool CFX_Edit::Delete(bool bAddUndo, bool bPaint)
}
m_pVT->UpdateWordPlace(m_wpCaret);
- bool bSecEnd = (m_wpCaret == m_pVT->GetSectionEndPlace(m_wpCaret));
+ FX_BOOL bSecEnd = (m_wpCaret == m_pVT->GetSectionEndPlace(m_wpCaret));
SetCaret(m_pVT->DeleteWord(m_wpCaret));
m_SelState.Set(m_wpCaret,m_wpCaret);
@@ -3126,26 +3126,26 @@ bool CFX_Edit::Delete(bool bAddUndo, bool bPaint)
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnDelete(m_wpCaret, m_wpOldCaret);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::Empty()
+FX_BOOL CFX_Edit::Empty()
{
if (m_pVT->IsValid())
{
m_pVT->DeleteWords(GetWholeWordRange());
SetCaret(m_pVT->GetBeginWordPlace());
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::Clear(bool bAddUndo, bool bPaint)
+FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint)
{
if (m_pVT->IsValid())
{
@@ -3184,8 +3184,8 @@ bool CFX_Edit::Clear(bool bAddUndo, bool bPaint)
{
if (pIterator->GetWord(wordinfo))
{
- oldplace = m_pVT->AjustLineHeader(oldplace,true);
- place = m_pVT->AjustLineHeader(place,true);
+ oldplace = m_pVT->AjustLineHeader(oldplace,TRUE);
+ place = m_pVT->AjustLineHeader(place,TRUE);
AddEditUndoItem(new CFXEU_ClearRich(this,oldplace,place,range,wordinfo.Word,
wordinfo.nCharset,secinfo.SecProps,wordinfo.WordProps));
@@ -3220,17 +3220,17 @@ bool CFX_Edit::Clear(bool bAddUndo, bool bPaint)
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnClear(m_wpCaret, m_wpOldCaret);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, bool bAddUndo, bool bPaint)
+FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
{
- if (IsTextOverflow()) return false;
+ if (IsTextOverflow()) return FALSE;
m_pVT->UpdateWordPlace(m_wpCaret);
SetCaret(DoInsertText(m_wpCaret, text, charset, pSecProps, pWordProps));
@@ -3249,9 +3249,9 @@ bool CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset,
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnInsertText(m_wpCaret, m_wpOldCaret);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void CFX_Edit::PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew)
@@ -3272,32 +3272,32 @@ void CFX_Edit::PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlac
}
}
-bool CFX_Edit::Redo()
+FX_BOOL CFX_Edit::Redo()
{
if (m_bEnableUndo)
{
if (m_Undo.CanRedo())
{
m_Undo.Redo();
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::Undo()
+FX_BOOL CFX_Edit::Undo()
{
if (m_bEnableUndo)
{
if (m_Undo.CanUndo())
{
m_Undo.Undo();
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
void CFX_Edit::SetCaretOrigin()
@@ -3339,7 +3339,7 @@ CPVT_WordPlace CFX_Edit::WordIndexToWordPlace(int32_t index) const
return CPVT_WordPlace();
}
-bool CFX_Edit::IsTextFull() const
+FX_BOOL CFX_Edit::IsTextFull() const
{
int32_t nTotalWords = m_pVT->GetTotalWords();
int32_t nLimitChar = m_pVT->GetLimitChar();
@@ -3349,7 +3349,7 @@ bool CFX_Edit::IsTextFull() const
|| (nCharArray>0 && nTotalWords >= nCharArray);
}
-bool CFX_Edit::IsTextOverflow() const
+FX_BOOL CFX_Edit::IsTextOverflow() const
{
if (!m_bEnableScroll && !m_bEnableOverflow)
{
@@ -3358,13 +3358,13 @@ bool CFX_Edit::IsTextOverflow() const
if (m_pVT->IsMultiLine() && GetTotalLines() > 1)
{
- if (FX_EDIT_IsFloatBigger(rcContent.Height(),rcPlate.Height())) return true;
+ if (FX_EDIT_IsFloatBigger(rcContent.Height(),rcPlate.Height())) return TRUE;
}
- if (FX_EDIT_IsFloatBigger(rcContent.Width(),rcPlate.Width())) return true;
+ if (FX_EDIT_IsFloatBigger(rcContent.Width(),rcPlate.Width())) return TRUE;
}
- return false;
+ return FALSE;
}
CPVT_WordPlace CFX_Edit::GetLineBeginPlace(const CPVT_WordPlace & place) const
@@ -3387,52 +3387,52 @@ CPVT_WordPlace CFX_Edit::GetSectionEndPlace(const CPVT_WordPlace & place) const
return m_pVT->GetSectionEndPlace(place);
}
-bool CFX_Edit::CanUndo() const
+FX_BOOL CFX_Edit::CanUndo() const
{
if (m_bEnableUndo)
{
return m_Undo.CanUndo();
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::CanRedo() const
+FX_BOOL CFX_Edit::CanRedo() const
{
if (m_bEnableUndo)
{
return m_Undo.CanRedo();
}
- return false;
+ return FALSE;
}
-bool CFX_Edit::IsModified() const
+FX_BOOL CFX_Edit::IsModified() const
{
if (m_bEnableUndo)
{
return m_Undo.IsModified();
}
- return false;
+ return FALSE;
}
-void CFX_Edit::EnableRefresh(bool bRefresh)
+void CFX_Edit::EnableRefresh(FX_BOOL bRefresh)
{
m_bEnableRefresh = bRefresh;
}
-void CFX_Edit::EnableUndo(bool bUndo)
+void CFX_Edit::EnableUndo(FX_BOOL bUndo)
{
m_bEnableUndo = bUndo;
}
-void CFX_Edit::EnableNotify(bool bNotify)
+void CFX_Edit::EnableNotify(FX_BOOL bNotify)
{
m_bNotify = bNotify;
}
-void CFX_Edit::EnableOprNotify(bool bNotify)
+void CFX_Edit::EnableOprNotify(FX_BOOL bNotify)
{
m_bOprNotify = bNotify;
}
diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp
index c84db4d029..d94cc16c86 100644
--- a/fpdfsdk/src/fxedit/fxet_list.cpp
+++ b/fpdfsdk/src/fxedit/fxet_list.cpp
@@ -11,8 +11,8 @@
/* ------------------------------- CFX_ListItem ---------------------------------- */
CFX_ListItem::CFX_ListItem() : m_pEdit(NULL),
- m_bSelected(false),
- m_bCaret(false),
+ m_bSelected(FALSE),
+ m_bCaret(FALSE),
m_rcListItem(0.0f,0.0f,0.0f,0.0f)
{
m_pEdit = IFX_Edit::NewEdit();
@@ -56,22 +56,22 @@ CLST_Rect CFX_ListItem::GetRect() const
return m_rcListItem;
}
-bool CFX_ListItem::IsSelected() const
+FX_BOOL CFX_ListItem::IsSelected() const
{
return m_bSelected;
}
-void CFX_ListItem::SetSelect(bool bSelected)
+void CFX_ListItem::SetSelect(FX_BOOL bSelected)
{
m_bSelected = bSelected;
}
-bool CFX_ListItem::IsCaret() const
+FX_BOOL CFX_ListItem::IsCaret() const
{
return m_bCaret;
}
-void CFX_ListItem::SetCaret(bool bCaret)
+void CFX_ListItem::SetCaret(FX_BOOL bCaret)
{
m_bCaret = bCaret;
}
@@ -119,7 +119,7 @@ CFX_WideString CFX_ListItem::GetText() const
/* ------------------------------------ CFX_List --------------------------------- */
-CFX_List::CFX_List() : m_fFontSize(0.0f), m_pFontMap(NULL), m_bMultiple(false)
+CFX_List::CFX_List() : m_fFontSize(0.0f), m_pFontMap(NULL), m_bMultiple(FALSE)
{
}
@@ -211,8 +211,8 @@ int32_t CFX_List::GetItemIndex(const CPDF_Point & point) const
{
CPDF_Point pt = OuterToInner(point);
- bool bFirst = true;
- bool bLast = true;
+ FX_BOOL bFirst = TRUE;
+ FX_BOOL bLast = TRUE;
for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++)
{
@@ -222,12 +222,12 @@ int32_t CFX_List::GetItemIndex(const CPDF_Point & point) const
if (FX_EDIT_IsFloatBigger(pt.y, rcListItem.top))
{
- bFirst = false;
+ bFirst = FALSE;
}
if (FX_EDIT_IsFloatSmaller(pt.y, rcListItem.bottom))
{
- bLast = false;
+ bLast = FALSE;
}
if (pt.y >= rcListItem.top && pt.y < rcListItem.bottom)
@@ -318,17 +318,17 @@ CPDF_Rect CFX_List::GetItemRect(int32_t nIndex) const
return CPDF_Rect();
}
-bool CFX_List::IsItemSelected(int32_t nIndex) const
+FX_BOOL CFX_List::IsItemSelected(int32_t nIndex) const
{
if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
{
return pListItem->IsSelected();
}
- return false;
+ return FALSE;
}
-void CFX_List::SetItemSelect(int32_t nItemIndex, bool bSelected)
+void CFX_List::SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected)
{
if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex))
{
@@ -336,7 +336,7 @@ void CFX_List::SetItemSelect(int32_t nItemIndex, bool bSelected)
}
}
-void CFX_List::SetItemCaret(int32_t nItemIndex, bool bCaret)
+void CFX_List::SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret)
{
if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex))
{
@@ -344,17 +344,17 @@ void CFX_List::SetItemCaret(int32_t nItemIndex, bool bCaret)
}
}
-void CFX_List::SetMultipleSel(bool bMultiple)
+void CFX_List::SetMultipleSel(FX_BOOL bMultiple)
{
m_bMultiple = bMultiple;
}
-bool CFX_List::IsMultipleSel() const
+FX_BOOL CFX_List::IsMultipleSel() const
{
return m_bMultiple;
}
-bool CFX_List::IsValid(int32_t nItemIndex) const
+FX_BOOL CFX_List::IsValid(int32_t nItemIndex) const
{
return nItemIndex >= 0 && nItemIndex < m_aListItems.GetSize();
}
@@ -446,7 +446,7 @@ int32_t CPLST_Select::Find(int32_t nItemIndex) const
return -1;
}
-bool CPLST_Select::IsExist(int32_t nItemIndex) const
+FX_BOOL CPLST_Select::IsExist(int32_t nItemIndex) const
{
return Find(nItemIndex) >= 0;
}
@@ -507,11 +507,11 @@ void CPLST_Select::Done()
/* ------------------------------------ CFX_ListCtrl --------------------------------- */
CFX_ListCtrl::CFX_ListCtrl() : m_pNotify(NULL),
- m_bNotifyFlag(false),
+ m_bNotifyFlag(FALSE),
m_ptScrollPos(0.0f,0.0f),
m_nSelItem(-1),
m_nFootIndex(-1),
- m_bCtrlSel(false),
+ m_bCtrlSel(FALSE),
m_nCaretIndex(-1)
{
}
@@ -557,7 +557,7 @@ CPDF_Rect CFX_ListCtrl::OutToIn(const CPDF_Rect & rect) const
return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
}
-void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
{
int32_t nHitIndex = GetItemIndex(point);
@@ -569,13 +569,13 @@ void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl)
{
m_aSelItems.Sub(nHitIndex);
SelectItems();
- m_bCtrlSel = false;
+ m_bCtrlSel = FALSE;
}
else
{
m_aSelItems.Add(nHitIndex);
SelectItems();
- m_bCtrlSel = true;
+ m_bCtrlSel = TRUE;
}
m_nFootIndex = nHitIndex;
@@ -606,7 +606,7 @@ void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl)
ScrollToListItem(nHitIndex);
}
-void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
{
int32_t nHitIndex = GetItemIndex(point);
@@ -639,7 +639,7 @@ void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl)
ScrollToListItem(nHitIndex);
}
-void CFX_ListCtrl::OnVK(int32_t nItemIndex,bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl)
{
if (IsMultipleSel())
{
@@ -674,37 +674,37 @@ void CFX_ListCtrl::OnVK(int32_t nItemIndex,bool bShift,bool bCtrl)
ScrollToListItem(nItemIndex);
}
-void CFX_ListCtrl::OnVK_UP(bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
{
OnVK(IsMultipleSel() ? GetCaret()-1 : GetSelect()-1, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_DOWN(bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
{
OnVK(IsMultipleSel() ? GetCaret()+1 : GetSelect()+1, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_LEFT(bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
{
OnVK(0, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_RIGHT(bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
{
OnVK(GetCount()-1, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_HOME(bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
{
OnVK(0, bShift, bCtrl);
}
-void CFX_ListCtrl::OnVK_END(bool bShift,bool bCtrl)
+void CFX_ListCtrl::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
{
OnVK(GetCount()-1, bShift, bCtrl);
}
-bool CFX_ListCtrl::OnChar(FX_WORD nChar,bool bShift,bool bCtrl)
+FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl)
{
int32_t nIndex = GetLastSelected();
int32_t nFindIndex = FindNext(nIndex,nChar);
@@ -712,9 +712,9 @@ bool CFX_ListCtrl::OnChar(FX_WORD nChar,bool bShift,bool bCtrl)
if (nFindIndex != nIndex)
{
OnVK(nFindIndex, bShift, bCtrl);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
/* -------- inner methods ------- */
@@ -739,7 +739,7 @@ void CFX_ListCtrl::AddString(const FX_WCHAR* string)
ReArrange(GetCount() - 1);
}
-void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, bool bSelected)
+void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected)
{
if (!IsValid(nItemIndex)) return;
@@ -747,12 +747,12 @@ void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, bool bSelected)
{
if (bSelected)
{
- SetItemSelect(nItemIndex,true);
+ SetItemSelect(nItemIndex,TRUE);
InvalidateItem(nItemIndex);
}
else
{
- SetItemSelect(nItemIndex,false);
+ SetItemSelect(nItemIndex,FALSE);
InvalidateItem(nItemIndex);
}
}
@@ -766,11 +766,11 @@ void CFX_ListCtrl::SetSingleSelect(int32_t nItemIndex)
{
if (m_nSelItem >= 0)
{
- SetItemSelect(m_nSelItem,false);
+ SetItemSelect(m_nSelItem,FALSE);
InvalidateItem(m_nSelItem);
}
- SetItemSelect(nItemIndex,true);
+ SetItemSelect(nItemIndex,TRUE);
InvalidateItem(nItemIndex);
m_nSelItem = nItemIndex;
}
@@ -788,8 +788,8 @@ void CFX_ListCtrl::SetCaret(int32_t nItemIndex)
{
m_nCaretIndex = nItemIndex;
- SetItemCaret(nOldIndex, false);
- SetItemCaret(nItemIndex,true);
+ SetItemCaret(nOldIndex, FALSE);
+ SetItemCaret(nItemIndex,TRUE);
InvalidateItem(nOldIndex);
InvalidateItem(nItemIndex);
@@ -805,17 +805,17 @@ void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
CPDF_Rect rcRefresh = GetPlateRect();
m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
else
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
CPDF_Rect rcRefresh = GetItemRect(nItemIndex);
rcRefresh.left -= 1.0f;
rcRefresh.right += 1.0f;
@@ -823,7 +823,7 @@ void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex)
rcRefresh.top += 1.0f;
m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
}
@@ -839,10 +839,10 @@ void CFX_ListCtrl::SelectItems()
switch(nState)
{
case 1:
- SetMultipleSelect(nItemIndex, true);
+ SetMultipleSelect(nItemIndex, TRUE);
break;
case -1:
- SetMultipleSelect(nItemIndex, false);
+ SetMultipleSelect(nItemIndex, FALSE);
break;
}
}
@@ -863,7 +863,7 @@ void CFX_ListCtrl::Select(int32_t nItemIndex)
SetSingleSelect(nItemIndex);
}
-bool CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const
+FX_BOOL CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const
{
CPDF_Rect rcPlate = GetPlateRect();
CPDF_Rect rcItem = GetItemRect(nItemIndex);
@@ -904,10 +904,10 @@ void CFX_ListCtrl::SetScrollInfo()
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
rcContent.bottom, rcContent.top, GetFirstHeight(), rcPlate.Height());
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
}
@@ -947,9 +947,9 @@ void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy)
{
if (!m_bNotifyFlag)
{
- m_bNotifyFlag = true;
+ m_bNotifyFlag = TRUE;
m_pNotify->IOnSetScrollPosY(fy);
- m_bNotifyFlag = false;
+ m_bNotifyFlag = FALSE;
}
}
}
diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
index 04809a46f1..1c0269b682 100644
--- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
+++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
@@ -132,9 +132,9 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF
const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData)
{
- bool bContinuous = pEdit->GetCharArray() == 0;
+ FX_BOOL bContinuous = pEdit->GetCharArray() == 0;
if (pEdit->GetCharSpace() > 0.0f)
- bContinuous = false;
+ bContinuous = FALSE;
FX_WORD SubWord = pEdit->GetPasswordChar();
FX_FLOAT fFontSize = pEdit->GetFontSize();
@@ -144,7 +144,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF
FX_COLORREF crCurFill = crTextFill;
FX_COLORREF crOldFill = crCurFill;
- bool bSelect = false;
+ FX_BOOL bSelect = FALSE;
const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
@@ -278,7 +278,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device
FX_COLORREF crCurText = ArgbEncode(255, 0,0,0);
FX_COLORREF crOld = crCurText;
- bool bSelect = false;
+ FX_BOOL bSelect = FALSE;
const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
@@ -410,7 +410,7 @@ static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill
pPathObj->m_ColorState.SetFillColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
pPathObj->m_FillType = FXFILL_ALTERNATE;
- pPathObj->m_bStroke = false;
+ pPathObj->m_bStroke = FALSE;
pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj);
}
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 668032dcba..59816f091f 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -45,14 +45,14 @@ IMPLEMENT_JS_CLASS(CJS_PrintParamsObj, PrintParamsObj)
PrintParamsObj::PrintParamsObj(CJS_Object* pJSObject)
: CJS_EmbedObj(pJSObject)
{
- bUI = true;
+ bUI = TRUE;
nStart = 0;
nEnd = 0;
- bSilent = false;
- bShrinkToFit = false;
- bPrintAsImage = false;
- bReverse = false;
- bAnnotations = true;
+ bSilent = FALSE;
+ bShrinkToFit = FALSE;
+ bPrintAsImage = FALSE;
+ bReverse = FALSE;
+ bAnnotations = TRUE;
}
/* ---------------------- Document ---------------------- */
@@ -142,7 +142,7 @@ END_JS_STATIC_METHOD()
IMPLEMENT_JS_CLASS(CJS_Document, Document)
-bool CJS_Document::InitInstance(IFXJS_Context* cc)
+FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -152,7 +152,7 @@ bool CJS_Document::InitInstance(IFXJS_Context* cc)
pDoc->AttachDoc(pContext->GetReaderDocument());
pDoc->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
- return true;
+ return TRUE;
};
/* --------------------------------- Document --------------------------------- */
@@ -162,7 +162,7 @@ Document::Document(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject),
m_pIconTree(NULL),
m_pDocument(NULL),
m_cwBaseURL(L""),
- m_bDelay(false)
+ m_bDelay(FALSE)
{
}
@@ -190,20 +190,20 @@ Document::~Document()
}
//the total number of fileds in document.
-bool Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::numFields(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return false;
+ return FALSE;
}
CPDFSDK_InterForm *pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm *pPDFForm = pInterForm->GetInterForm();
vp << (int)pPDFForm->CountFields();
- return true;
+ return TRUE;
}
-bool Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -226,10 +226,10 @@ bool Document::dirty(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
m_pDocument->ClearChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -241,10 +241,10 @@ bool Document::ADBE(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
{
}
- return true;
+ return TRUE;
}
-bool Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -276,55 +276,55 @@ bool Document::pageNum(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
}
}
- return true;
+ return TRUE;
}
-bool Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj)
+FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::addAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::addField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::exportAsText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::exportAsFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::exportAsXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
//Maps a field object in PDF document to a JavaScript variable
//comment:
//note: the paremter cName, this is clue how to treat if the cName is not a valiable filed name in this document
-bool Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() < 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_WideString wideName = params[0].ToCFXWideString();
@@ -334,7 +334,7 @@ bool Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
if (pPDFForm->CountFields(wideName) <= 0)
{
vRet.SetNull();
- return true;
+ return TRUE;
}
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
@@ -346,66 +346,66 @@ bool Document::getField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
pField->AttachField(this, wideName);
vRet = pJSField;
- return true;
+ return TRUE;
}
//Gets the name of the nth field in the document
-bool Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() != 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
int nIndex = params[0].ToInt();
if (nIndex < 0) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR);
- return false;
+ return FALSE;
}
CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
CPDF_FormField* pField = pPDFForm->GetField(nIndex);
if (!pField)
- return false;
+ return FALSE;
vRet = pField->GetFullName().c_str();
- return true;
+ return TRUE;
}
-bool Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::importAnFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::importAnXFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::importTextData(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
//exports the form data and mails the resulting fdf file as an attachment to all recipients.
//comment: need reader supports
//note:
-//int CPDFSDK_Document::mailForm(bool bUI,String cto,string ccc,string cbcc,string cSubject,string cms);
+//int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,string cSubject,string cms);
-bool Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false;
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
int iLength = params.size();
- bool bUI = iLength > 0 ? params[0].ToBool() : true;
+ FX_BOOL bUI = iLength > 0 ? params[0].ToBool() : TRUE;
CFX_WideString cTo = iLength > 1 ? params[1].ToCFXWideString() : L"";
CFX_WideString cCc = iLength > 2 ? params[2].ToCFXWideString() : L"";
CFX_WideString cBcc = iLength > 3 ? params[3].ToCFXWideString() : L"";
@@ -417,7 +417,7 @@ bool Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
CFX_ByteTextBuf textBuf;
if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
- return false;
+ return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -429,24 +429,24 @@ bool Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
pRuntime->BeginBlock();
pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
pRuntime->EndBlock();
- return true;
+ return TRUE;
}
-bool Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
ASSERT(pRuntime != NULL);
- bool bUI = true;
+ FX_BOOL bUI = TRUE;
int nStart = 0;
int nEnd = 0;
- bool bSilent = false;
- bool bShrinkToFit = false;
- bool bPrintAsImage = false;
- bool bReverse = false;
- bool bAnnotations = false;
+ FX_BOOL bSilent = FALSE;
+ FX_BOOL bShrinkToFit = FALSE;
+ FX_BOOL bPrintAsImage = FALSE;
+ FX_BOOL bReverse = FALSE;
+ FX_BOOL bAnnotations = FALSE;
int nlength = params.size();
if(nlength ==9)
@@ -500,26 +500,26 @@ bool Document::print(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
if (CPDFDoc_Environment* pEnv = m_pDocument->GetEnv())
{
pEnv->JS_docprint(bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotations);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
//removes the specified field from the document.
//comment:
//note: if the filed name is not retional, adobe is dumb for it.
-bool Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return false;
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() != 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_WideString sFieldName = params[0].ToCFXWideString();
@@ -558,20 +558,20 @@ bool Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
//reset filed values within a document.
//comment:
//note: if the fields names r not rational, aodbe is dumb for it.
-bool Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return false;
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
@@ -610,42 +610,42 @@ bool Document::resetForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
if (aFields.GetSize() > 0)
{
- pPDFForm->ResetForm(aFields, true, true);
+ pPDFForm->ResetForm(aFields, TRUE, TRUE);
m_pDocument->SetChangeMark();
}
}
else
{
- pPDFForm->ResetForm(true);
+ pPDFForm->ResetForm(TRUE);
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::saveAs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CJS_Context* pContext = (CJS_Context*)cc;
int nSize = params.size();
if (nSize < 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_WideString strURL;
- bool bFDF = true;
- bool bEmpty = false;
+ FX_BOOL bFDF = TRUE;
+ FX_BOOL bEmpty = FALSE;
v8::Isolate* isolate = GetIsolate(cc);
CJS_Array aFields(isolate);
@@ -677,16 +677,16 @@ bool Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
- bool bAll = (aFields.GetLength() == 0);
+ FX_BOOL bAll = (aFields.GetLength() == 0);
if (bAll && bEmpty)
{
if (pPDFInterForm->CheckRequiredFields())
{
pRuntime->BeginBlock();
- pInterForm->SubmitForm(strURL, false);
+ pInterForm->SubmitForm(strURL, FALSE);
pRuntime->EndBlock();
}
- return true;
+ return TRUE;
}
CFX_PtrArray fieldObjects;
@@ -707,13 +707,13 @@ bool Document::submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
}
}
- if (pPDFInterForm->CheckRequiredFields(&fieldObjects, true))
+ if (pPDFInterForm->CheckRequiredFields(&fieldObjects, TRUE))
{
pRuntime->BeginBlock();
- pInterForm->SubmitFields(strURL, fieldObjects, true, !bFDF);
+ pInterForm->SubmitFields(strURL, fieldObjects, TRUE, !bFDF);
pRuntime->EndBlock();
}
- return true;
+ return TRUE;
}
//////////////////////////////////////////////////////////////////////////////////////////////
@@ -728,26 +728,26 @@ CPDFSDK_Document * Document::GetReaderDoc()
return m_pDocument;
}
-bool Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName)
+FX_BOOL Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName)
{
- return false;
+ return FALSE;
}
-bool Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName)
+FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName)
{
- return false;
+ return FALSE;
}
-bool Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::bookmarkRoot(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- bool bUI = true;
+ FX_BOOL bUI = TRUE;
CFX_WideString cTo = L"";
CFX_WideString cCc = L"";
CFX_WideString cBcc = L"";
@@ -803,40 +803,40 @@ bool Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
pEnv->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
pRuntime->EndBlock();
- return true;
+ return TRUE;
}
-bool Document::author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::author(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return false;
+ if (!pDictionary)return FALSE;
if (vp.IsGetting())
{
vp << pDictionary->GetUnicodeText("Author");
- return true;
+ return TRUE;
}
else
{
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return false;
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
CFX_WideString csAuthor;
vp >> csAuthor;
pDictionary->SetAtString("Author", PDF_EncodeText(csAuthor));
m_pDocument->SetChangeMark();
- return true;
+ return TRUE;
}
}
-bool Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return false;
+ return FALSE;
CFX_WideString cwAuthor = pDictionary->GetUnicodeText("Author");
CFX_WideString cwTitle = pDictionary->GetUnicodeText("Title");
@@ -880,14 +880,14 @@ bool Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
}
vp << pObj;
}
- return true;
+ return TRUE;
}
-bool Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return false;
+ return FALSE;
if (vp.IsGetting())
{
@@ -896,21 +896,21 @@ bool Document::creationDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
CFX_WideString csCreationDate;
vp >> csCreationDate;
pDictionary->SetAtString("CreationDate", PDF_EncodeText(csCreationDate));
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return false;
+ return FALSE;
if (vp.IsGetting())
{
@@ -919,17 +919,17 @@ bool Document::creator(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
CFX_WideString csCreator;
vp >> csCreator;
pDictionary->SetAtString("Creator", PDF_EncodeText(csCreator));
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
@@ -938,7 +938,7 @@ bool Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
vp >> m_bDelay;
if (m_bDelay)
@@ -969,14 +969,14 @@ bool Document::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
}
}
}
- return true;
+ return TRUE;
}
-bool Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return false;
+ return FALSE;
if (vp.IsGetting())
{
@@ -985,21 +985,21 @@ bool Document::keywords(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
CFX_WideString csKeywords;
vp >> csKeywords;
pDictionary->SetAtString("Keywords", PDF_EncodeText(csKeywords));
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return false;
+ return FALSE;
if (vp.IsGetting())
{
@@ -1008,21 +1008,21 @@ bool Document::modDate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
CFX_WideString csmodDate;
vp >> csmodDate;
pDictionary->SetAtString("ModDate", PDF_EncodeText(csmodDate));
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return false;
+ return FALSE;
if (vp.IsGetting())
{
@@ -1031,21 +1031,21 @@ bool Document::producer(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
CFX_WideString csproducer;
vp >> csproducer;
pDictionary->SetAtString("Producer", PDF_EncodeText(csproducer));
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return false;
+ return FALSE;
if (vp.IsGetting())
{
@@ -1054,24 +1054,24 @@ bool Document::subject(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
CFX_WideString cssubject;
vp >> cssubject;
pDictionary->SetAtString("Subject", PDF_EncodeText(cssubject));
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL)
- return false;
+ return FALSE;
CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
if (!pDictionary)
- return false;
+ return FALSE;
if (vp.IsGetting())
{
@@ -1080,58 +1080,58 @@ bool Document::title(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
else
{
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
- return false;
+ return FALSE;
CFX_WideString cstitle;
vp >> cstitle;
pDictionary->SetAtString("Title", PDF_EncodeText(cstitle));
m_pDocument->SetChangeMark();
}
- return true;
+ return TRUE;
}
-bool Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::numPages(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return false;
+ return FALSE;
}
vp << m_pDocument->GetPageCount();
- return true;
+ return TRUE;
}
-bool Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::external(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
//In Chrome case,should always return true.
if (vp.IsGetting()) {
vp << true;
}
- return true;
+ return TRUE;
}
-bool Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::filesize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return false;
+ return FALSE;
}
vp << 0;
- return true;
+ return TRUE;
}
-bool Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::mouseX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::mouseY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
@@ -1141,10 +1141,10 @@ bool Document::baseURL(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
{
vp >> m_cwBaseURL;
}
- return true;
+ return TRUE;
}
-bool Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -1166,15 +1166,15 @@ bool Document::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
pInterForm->EnableCalculate(bCalculate);
}
- return true;
+ return TRUE;
}
-bool Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return false;
+ return FALSE;
}
CFX_WideString wsFilePath = m_pDocument->GetPath();
int32_t i = wsFilePath.GetLength() - 1;
@@ -1189,7 +1189,7 @@ bool Document::documentFileName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideSt
}else{
vp << L"";
}
- return true;
+ return TRUE;
}
CFX_WideString Document::ReversalStr(CFX_WideString cbFrom)
@@ -1239,74 +1239,74 @@ CFX_WideString Document::CutString(CFX_WideString cbFrom)
return cbRet;
}
-bool Document::path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::path(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return false;
+ return FALSE;
}
vp << app::SysPathToPDFPath(m_pDocument->GetPath());
- return true;
+ return TRUE;
}
-bool Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::pageWindowRect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::layout(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::addLink(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::closeDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- return true;
+ return TRUE;
}
-bool Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getPageBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getAnnot(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getAnnots(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet.SetNull();
- return true;
+ return TRUE;
}
-bool Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getAnnot3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet.SetNull();
- return true;
+ return TRUE;
}
-bool Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getAnnots3D(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
vRet = VT_undefined;
- return true;
+ return TRUE;
}
-bool Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getOCGs(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getLinks(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect)
@@ -1370,12 +1370,12 @@ IconElement* IconTree::operator [](int iIndex)
return NULL;
}
-bool Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() != 2) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_WideString swIconName = params[0].ToCFXWideString();
@@ -1384,13 +1384,13 @@ bool Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
if (JS_GetObjDefnID(pJSIcon) != JS_GetObjDefnID(*pRuntime, L"Icon")) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR);
- return false;
+ return FALSE;
}
CJS_EmbedObj* pEmbedObj = params[1].ToCJSObject()->GetEmbedObject();
if (!pEmbedObj) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR);
- return false;
+ return FALSE;
}
Icon* pIcon = (Icon*)pEmbedObj;
@@ -1402,21 +1402,21 @@ bool Document::addIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
pNewIcon->NextIcon = NULL;
pNewIcon->IconStream = pIcon;
m_pIconTree->InsertIconElement(pNewIcon);
- return true;
+ return TRUE;
}
-bool Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting()) {
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY);
- return false;
+ return FALSE;
}
if (!m_pIconTree)
{
vp.SetNull();
- return true;
+ return TRUE;
}
CJS_Array Icons(m_isolate);
@@ -1431,13 +1431,13 @@ bool Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
pIconElement = (*m_pIconTree)[i];
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- if (pObj.IsEmpty()) return false;
+ if (pObj.IsEmpty()) return FALSE;
CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
- if (!pJS_Icon) return false;
+ if (!pJS_Icon) return FALSE;
Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
- if (!pIcon)return false;
+ if (!pIcon)return FALSE;
pIcon->SetStream(pIconElement->IconStream->GetStream());
pIcon->SetIconName(pIconElement->IconName);
@@ -1445,19 +1445,19 @@ bool Document::icons(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
}
vp << Icons;
- return true;
+ return TRUE;
}
-bool Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
if (params.size() != 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
if(!m_pIconTree)
- return false;
+ return FALSE;
CFX_WideString swIconName = params[0].ToCFXWideString();
int iIconCounts = m_pIconTree->GetLength();
@@ -1470,82 +1470,82 @@ bool Document::getIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
Icon* pRetIcon = (*m_pIconTree)[i]->IconStream;
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- if (pObj.IsEmpty()) return false;
+ if (pObj.IsEmpty()) return FALSE;
CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
- if (!pJS_Icon) return false;
+ if (!pJS_Icon) return FALSE;
Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
- if (!pIcon)return false;
+ if (!pIcon)return FALSE;
pIcon->SetIconName(swIconName);
pIcon->SetStream(pRetIcon->GetStream());
vRet = pJS_Icon;
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
-bool Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, no supported.
- return true;
+ return TRUE;
}
-bool Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::createDataObject(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not implemented.
- return true;
+ return TRUE;
}
-bool Document::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::calculateNow(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return false;
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
pInterForm->OnCalculate();
- return true;
+ return TRUE;
}
-bool Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::Collab(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false;
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0;
int nWordNo = params.GetSize() > 1 ? params[1].ToInt() : 0;
bool bStrip = params.GetSize() > 2 ? params[2].ToBool() : true;
CPDF_Document* pDocument = m_pDocument->GetDocument();
- if (!pDocument) return false;
+ if (!pDocument) return FALSE;
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR);
- return false;
+ return FALSE;
}
CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo);
- if (!pPageDict) return false;
+ if (!pPageDict) return FALSE;
CPDF_Page page;
page.Load(pDocument, pPageDict);
@@ -1584,23 +1584,23 @@ bool Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params, C
}
vRet = swRet.c_str();
- return true;
+ return TRUE;
}
-bool Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getPageNthWordQuads(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false;
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
- return false;
+ return FALSE;
}
-bool Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return false;
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
int nPageNo = params.GetSize() > 0 ? params[0].ToInt() : 0;
@@ -1611,11 +1611,11 @@ bool Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params,
if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSVALUEERROR);
- return false;
+ return FALSE;
}
CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo);
- if (!pPageDict) return false;
+ if (!pPageDict) return FALSE;
CPDF_Page page;
page.Load(pDocument, pPageDict);
@@ -1640,10 +1640,10 @@ bool Document::getPageNumWords(IFXJS_Context* cc, const CJS_Parameters& params,
vRet = nWords;
- return true;
+ return TRUE;
}
-bool Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
@@ -1652,7 +1652,7 @@ bool Document::getPrintParams(IFXJS_Context* cc, const CJS_Parameters& params, C
// Not implemented yet.
vRet = pRetObj;
- return true;
+ return TRUE;
}
#define ISLATINWORD(u) (u != 0x20 && u <= 0x28FF)
@@ -1666,7 +1666,7 @@ int Document::CountWords(CPDF_TextObject* pTextObj)
CPDF_Font* pFont = pTextObj->GetFont();
if (!pFont) return 0;
- bool bIsLatin = false;
+ FX_BOOL bIsLatin = FALSE;
for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
{
@@ -1701,7 +1701,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex
if (!pFont) return L"";
int nWords = 0;
- bool bIsLatin = false;
+ FX_BOOL bIsLatin = FALSE;
for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
{
@@ -1732,10 +1732,10 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex
return swRet;
}
-bool Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
/**
@@ -1748,39 +1748,39 @@ bool Document::zoom(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
(refW, ReflowWidth)
*/
-bool Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Document::zoomType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::deletePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, no supported.
- return true;
+ return TRUE;
}
-bool Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::extractPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::insertPages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::replacePages(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Document::getURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
void Document::AddDelayData(CJS_DelayData* pData)
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index ca16c90c01..614843426e 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -110,7 +110,7 @@ END_JS_STATIC_METHOD()
IMPLEMENT_JS_CLASS(CJS_Field, Field)
-bool CJS_Field::InitInstance(IFXJS_Context* cc)
+FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -120,15 +120,15 @@ bool CJS_Field::InitInstance(IFXJS_Context* cc)
pField->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
- return true;
+ return TRUE;
};
Field::Field(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject),
m_pJSDoc(NULL),
m_pDocument(NULL),
m_nFormControlIndex(-1),
- m_bCanSet(false),
- m_bDelay(false),
+ m_bCanSet(FALSE),
+ m_bDelay(FALSE),
m_isolate(NULL)
{
}
@@ -168,7 +168,7 @@ void Field::ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &
strFieldName = strFieldNameParsed.substr(0,iStart);
}
-bool Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
+FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
{
ASSERT(pDocument != NULL);
m_pJSDoc = pDocument;
@@ -194,17 +194,17 @@ bool Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
std::wstring strFieldName;
int iControlNo = -1;
ParseFieldName(swFieldNameTemp.c_str(), strFieldName, iControlNo);
- if (iControlNo == -1) return false;
+ if (iControlNo == -1) return FALSE;
m_FieldName = strFieldName.c_str();
m_nFormControlIndex = iControlNo;
- return true;
+ return TRUE;
}
m_FieldName = swFieldNameTemp;
m_nFormControlIndex = -1;
- return true;
+ return TRUE;
}
void Field::GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldArray)
@@ -234,7 +234,7 @@ void Field::GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& Field
}
void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
- bool bChangeMark, bool bResetAP, bool bRefresh)
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
{
ASSERT(pDocument != NULL);
ASSERT(pFormField != NULL);
@@ -255,12 +255,12 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
ASSERT(pWidget != NULL);
- bool bFormated = false;
+ FX_BOOL bFormated = FALSE;
CFX_WideString sValue = pWidget->OnFormat(bFormated);
if (bFormated)
- pWidget->ResetAppearance(sValue.c_str(), false);
+ pWidget->ResetAppearance(sValue.c_str(), FALSE);
else
- pWidget->ResetAppearance(NULL, false);
+ pWidget->ResetAppearance(NULL, FALSE);
}
}
else
@@ -270,7 +270,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
ASSERT(pWidget != NULL);
- pWidget->ResetAppearance(NULL, false);
+ pWidget->ResetAppearance(NULL, FALSE);
}
}
}
@@ -295,7 +295,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi
}
void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
- bool bChangeMark, bool bResetAP, bool bRefresh)
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
{
ASSERT(pDocument != NULL);
ASSERT(pFormControl != NULL);
@@ -312,16 +312,16 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFo
int nFieldType = pWidget->GetFieldType();
if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD)
{
- bool bFormated = false;
+ FX_BOOL bFormated = FALSE;
CFX_WideString sValue = pWidget->OnFormat(bFormated);
if (bFormated)
- pWidget->ResetAppearance(sValue.c_str(), false);
+ pWidget->ResetAppearance(sValue.c_str(), FALSE);
else
- pWidget->ResetAppearance(NULL, false);
+ pWidget->ResetAppearance(NULL, FALSE);
}
else
{
- pWidget->ResetAppearance(NULL, false);
+ pWidget->ResetAppearance(NULL, FALSE);
}
}
@@ -350,17 +350,17 @@ CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl*
return pInterForm->GetWidget(pFormControl);
}
-bool Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel)
+FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel)
{
ASSERT(pFormField != NULL);
for (int i=0,sz = pFormField->CountOptions(); i < sz; i++)
{
if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0)
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField)
@@ -376,13 +376,13 @@ CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField)
/* ---------------------------------------- property ---------------------------------------- */
-bool Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CFX_ByteString alignStr;
vp >> alignStr;
@@ -400,16 +400,16 @@ bool Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
switch (pFormControl->GetControlAlignment())
{
@@ -427,7 +427,7 @@ bool Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
}
}
- return true;
+ return TRUE;
}
void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -436,13 +436,13 @@ void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-bool Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CFX_ByteString strType = "";
vp >> strType;
@@ -460,13 +460,13 @@ bool Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField) return false;
+ if (!pFormField) return FALSE;
CPDFSDK_Widget* pWidget = GetWidget(m_pDocument, GetSmartFieldControl(pFormField));
- if (!pWidget) return false;
+ if (!pWidget) return FALSE;
int nBorderstyle = pWidget->GetBorderStyle();
@@ -493,7 +493,7 @@ bool Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
}
}
- return true;
+ return TRUE;
}
void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -525,7 +525,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw
if (nControlIndex < 0)
{
- bool bSet = false;
+ FX_BOOL bSet = FALSE;
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
if (CPDFSDK_Widget* pWidget = GetWidget(pDocument, pFormField->GetControl(j)))
@@ -533,11 +533,11 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw
if (pWidget->GetBorderStyle() != nBorderStyle)
{
pWidget->SetBorderStyle(nBorderStyle);
- bSet = true;
+ bSet = TRUE;
}
}
}
- if (bSet) UpdateFormField(pDocument, pFormField, true, true, true);
+ if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
}
else
{
@@ -549,7 +549,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw
if (pWidget->GetBorderStyle() != nBorderStyle)
{
pWidget->SetBorderStyle(nBorderStyle);
- UpdateFormControl(pDocument, pFormControl, true, true, true);
+ UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
}
}
}
@@ -557,13 +557,13 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& sw
}
}
-bool Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -581,16 +581,16 @@ bool Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
@@ -600,7 +600,7 @@ bool Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
vp << (int32_t)fLeft;
}
- return true;
+ return TRUE;
}
void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -608,13 +608,13 @@ void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& s
//Not supported.
}
-bool Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -632,16 +632,16 @@ bool Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
@@ -651,7 +651,7 @@ bool Field::buttonAlignY(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
vp << (int32_t)fBottom;
}
- return true;
+ return TRUE;
}
void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -659,13 +659,13 @@ void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& s
//Not supported.
}
-bool Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -683,22 +683,22 @@ bool Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
vp << IconFit.GetFittingBounds();
}
- return true;
+ return TRUE;
}
void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -706,13 +706,13 @@ void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString
//Not supported.
}
-bool Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -730,20 +730,20 @@ bool Field::buttonPosition(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
vp << pFormControl->GetTextPosition();
}
- return true;
+ return TRUE;
}
void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -751,13 +751,13 @@ void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString&
//Not supported.
}
-bool Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -775,16 +775,16 @@ bool Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
if (IconFit.IsProportionalScale())
@@ -793,7 +793,7 @@ bool Field::buttonScaleHow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
vp << (int32_t)1;
}
- return true;
+ return TRUE;
}
void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -801,13 +801,13 @@ void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString&
//Not supported.
}
-bool Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -825,16 +825,16 @@ bool Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*) FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return false;
+ if (!pFormControl) return FALSE;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
int ScaleM = IconFit.GetScaleMethod();
@@ -855,7 +855,7 @@ bool Field::buttonScaleWhen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
}
}
- return true;
+ return TRUE;
}
void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -863,13 +863,13 @@ void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString
//Not supported.
}
-bool Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -887,13 +887,13 @@ bool Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
ASSERT(pRDInterForm != NULL);
@@ -904,7 +904,7 @@ bool Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
vp << (int32_t)pInterForm->FindFieldInCalculationOrder(pFormField);
}
- return true;
+ return TRUE;
}
void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -912,13 +912,13 @@ void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString&
//Not supported.
}
-bool Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -936,17 +936,17 @@ bool Field::charLimit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
vp << (int32_t)pFormField->GetMaxLen();
}
- return true;
+ return TRUE;
}
void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -954,13 +954,13 @@ void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-bool Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -978,13 +978,13 @@ bool Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_COMB)
vp << true;
@@ -992,7 +992,7 @@ bool Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
vp << false;
}
- return true;
+ return TRUE;
}
void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -1000,13 +1000,13 @@ void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
//Not supported.
}
-bool Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -1024,13 +1024,13 @@ bool Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_COMMITONSELCHANGE)
vp << true;
@@ -1038,7 +1038,7 @@ bool Field::commitOnSelChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
vp << false;
}
- return true;
+ return TRUE;
}
void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -1046,13 +1046,13 @@ void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideStri
//Not supported.
}
-bool Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CFX_DWordArray array;
@@ -1089,13 +1089,13 @@ bool Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideSt
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return false;
+ return FALSE;
if (pFormField->CountSelectedItems() == 1)
vp << pFormField->GetSelectedIndex(0);
@@ -1112,7 +1112,7 @@ bool Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideSt
vp << -1;
}
- return true;
+ return TRUE;
}
void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -1132,7 +1132,7 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideSt
if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_LISTBOX)
{
FX_DWORD dwFieldFlags = pFormField->GetFieldFlags();
- pFormField->ClearSelection(true);
+ pFormField->ClearSelection(TRUE);
for (int i=0,sz=array.GetSize(); i<sz; i++)
{
@@ -1143,22 +1143,22 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideSt
int iSelecting = (int32_t)array.GetAt(i);
if (iSelecting < pFormField->CountOptions() && !pFormField->IsItemSelected(iSelecting))
- pFormField->SetItemSelection(iSelecting, true);
+ pFormField->SetItemSelection(iSelecting, TRUE);
}
- UpdateFormField(pDocument, pFormField, true, true, true);
+ UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
}
}
}
-bool Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
// MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT);
- return false;
+ return FALSE;
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
;
}
@@ -1166,7 +1166,7 @@ bool Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
;
}
- return true;
+ return TRUE;
}
void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex)
@@ -1174,13 +1174,13 @@ void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& s
//Not supported.
}
-bool Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CFX_WideString WideStr;
vp >> WideStr;
@@ -1198,18 +1198,18 @@ bool Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON ||
pFormField->GetFieldType() == FIELDTYPE_SIGNATURE)
- return false;
+ return FALSE;
vp << pFormField->GetDefaultValue();
}
- return true;
+ return TRUE;
}
void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -1218,13 +1218,13 @@ void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& s
//Not supported.
}
-bool Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -1242,13 +1242,13 @@ bool Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSCROLL)
vp << true;
@@ -1256,7 +1256,7 @@ bool Field::doNotScroll(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
vp << false;
}
- return true;
+ return TRUE;
}
void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -1264,13 +1264,13 @@ void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& sw
//Not supported.
}
-bool Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -1279,14 +1279,14 @@ bool Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD &&
pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSPELLCHECK)
vp << true;
@@ -1294,10 +1294,10 @@ bool Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
vp << false;
}
- return true;
+ return TRUE;
}
-void Field::SetDelay(bool bDelay)
+void Field::SetDelay(FX_BOOL bDelay)
{
m_bDelay = bDelay;
@@ -1308,11 +1308,11 @@ void Field::SetDelay(bool bDelay)
}
}
-bool Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -1323,16 +1323,16 @@ bool Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp << m_bDelay;
}
- return true;
+ return TRUE;
}
-bool Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -1350,7 +1350,7 @@ bool Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -1359,7 +1359,7 @@ bool Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
ASSERT(pInterForm != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget)return false;
+ if (!pWidget)return FALSE;
FX_DWORD dwFlag = pWidget->GetFlags();
@@ -1387,7 +1387,7 @@ bool Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
}
}
- return true;
+ return TRUE;
}
void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -1407,7 +1407,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
if (nControlIndex < 0)
{
- bool bSet = false;
+ FX_BOOL bSet = FALSE;
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
CPDF_FormControl* pFormControl = pFormField->GetControl(j);
@@ -1445,12 +1445,12 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
if (dwFlag != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlag);
- bSet = true;
+ bSet = TRUE;
}
}
}
- if (bSet) UpdateFormField(pDocument, pFormField, true, false, true);
+ if (bSet) UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
else
{
@@ -1489,7 +1489,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
if (dwFlag != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlag);
- UpdateFormControl(pDocument, pFormControl, true, false, true);
+ UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
}
}
}
@@ -1497,21 +1497,21 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
}
}
-bool Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::doc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (!vp.IsGetting()) {
- return false;
+ return FALSE;
}
vp << m_pJSDoc->GetCJSDoc();
- return true;
+ return TRUE;
}
-bool Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -1520,13 +1520,13 @@ bool Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_EDIT)
vp << true;
@@ -1534,30 +1534,30 @@ bool Field::editable(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
if (FieldArray.GetSize() <= 0)
- return false;
+ return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX &&
pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return false;
+ return FALSE;
if (vp.IsSetting())
{
if (!m_bCanSet)
- return false;
+ return FALSE;
if (!vp.IsArrayObject())
- return false;
+ return FALSE;
}
else
{
@@ -1573,36 +1573,36 @@ bool Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
else
{
if (m_nFormControlIndex >= pFormField->CountControls())
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex);
if (!pFormControl)
- return false;
+ return FALSE;
ExportValusArray.SetElement(0, CJS_Value(m_isolate,pFormControl->GetExportValue().c_str()));
}
vp << ExportValusArray;
}
- return true;
+ return TRUE;
}
-bool Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
if (FieldArray.GetSize() <= 0)
- return false;
+ return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
if (vp.IsSetting())
{
if (!m_bCanSet)
- return false;
+ return FALSE;
bool bVP;
vp >> bVP;
@@ -1614,10 +1614,10 @@ bool Field::fileSelect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
else
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -1626,15 +1626,15 @@ bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
if (FieldArray.GetSize() <= 0)
- return false;
+ return FALSE;
if (vp.IsSetting())
{
if (!m_bCanSet)
- return false;
+ return FALSE;
if (!vp.IsArrayObject())
- return false;
+ return FALSE;
vp >> crArray;
@@ -1656,7 +1656,7 @@ bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
if (!pFormControl)
- return false;
+ return FALSE;
int iColorType;
pFormControl->GetBackgroundColor(iColorType);
@@ -1684,13 +1684,13 @@ bool Field::fillColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
pFormControl->GetOriginalBackgroundColor(3));
}
else
- return false;
+ return FALSE;
color::ConvertPWLColorToArray(color, crArray);
vp << crArray;
}
- return true;
+ return TRUE;
}
void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
@@ -1698,13 +1698,13 @@ void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-bool Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -1722,7 +1722,7 @@ bool Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -1731,7 +1731,7 @@ bool Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pInterForm != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return false;
+ if (!pWidget) return FALSE;
FX_DWORD dwFlags = pWidget->GetFlags();
@@ -1743,7 +1743,7 @@ bool Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
vp << false;
}
- return true;
+ return TRUE;
}
void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -1763,7 +1763,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
if (nControlIndex < 0)
{
- bool bSet = false;
+ FX_BOOL bSet = FALSE;
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
@@ -1787,13 +1787,13 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
if (dwFlags != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlags);
- bSet = true;
+ bSet = TRUE;
}
}
}
if (bSet)
- UpdateFormField(pDocument, pFormField, true, false, true);
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
else
{
@@ -1821,7 +1821,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
if (dwFlags != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlags);
- UpdateFormControl(pDocument, pFormControl, true, false, true);
+ UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
}
}
}
@@ -1829,13 +1829,13 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
}
}
-bool Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CFX_ByteString strMode;
vp >> strMode;
@@ -1853,16 +1853,16 @@ bool Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return false;
+ if (!pFormControl) return FALSE;
int eHM = pFormControl->GetHighlightingMode();
switch (eHM)
@@ -1885,7 +1885,7 @@ bool Field::highlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
}
}
- return true;
+ return TRUE;
}
void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string)
@@ -1893,13 +1893,13 @@ void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-bool Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int iWidth;
vp >> iWidth;
@@ -1917,26 +1917,26 @@ bool Field::lineWidth(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return false;
+ if (!pFormControl) return FALSE;
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
- if(!pFormField->CountControls()) return false;
+ if(!pFormField->CountControls()) return FALSE;
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
- if (!pWidget) return false;
+ if (!pWidget) return FALSE;
vp << (int32_t)pWidget->GetBorderWidth();
}
- return true;
+ return TRUE;
}
void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -1956,7 +1956,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
if (nControlIndex < 0)
{
- bool bSet = false;
+ FX_BOOL bSet = FALSE;
for (int j=0,jsz=pFormField->CountControls(); j<jsz; j++)
{
CPDF_FormControl* pFormControl = pFormField->GetControl(j);
@@ -1967,11 +1967,11 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
if (number != pWidget->GetBorderWidth())
{
pWidget->SetBorderWidth(number);
- bSet = true;
+ bSet = TRUE;
}
}
}
- if (bSet) UpdateFormField(pDocument, pFormField, true, true, true);
+ if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
}
else
{
@@ -1983,7 +1983,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
if (number != pWidget->GetBorderWidth())
{
pWidget->SetBorderWidth(number);
- UpdateFormControl(pDocument, pFormControl, true, true, true);
+ UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
}
}
}
@@ -1991,13 +1991,13 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
}
}
-bool Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -2015,13 +2015,13 @@ bool Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_MULTILINE)
vp << true;
@@ -2029,7 +2029,7 @@ bool Field::multiline(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
vp << false;
}
- return true;
+ return TRUE;
}
void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -2037,13 +2037,13 @@ void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-bool Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -2061,13 +2061,13 @@ bool Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_MULTISELECT)
vp << true;
@@ -2075,7 +2075,7 @@ bool Field::multipleSelection(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
vp << false;
}
- return true;
+ return TRUE;
}
void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -2083,49 +2083,49 @@ void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideStri
//Not supported.
}
-bool Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting()) return false;
+ if (!vp.IsGetting()) return FALSE;
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
vp << m_FieldName;
- return true;
+ return TRUE;
}
-bool Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX &&
pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return false;
+ return FALSE;
- if (!vp.IsGetting()) return false;
+ if (!vp.IsGetting()) return FALSE;
vp << (int32_t)pFormField->CountOptions();
- return true;
+ return TRUE;
}
-bool Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting()) return false;
+ if (!vp.IsGetting()) return FALSE;
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField) return false;
+ if (!pFormField) return FALSE;
ASSERT(m_pDocument != NULL);
@@ -2146,7 +2146,7 @@ bool Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
CPDFSDK_PageView* pPageView = pWidget->GetPageView();
if(!pPageView)
- return false;
+ return FALSE;
PageArray.SetElement(i, CJS_Value(m_isolate,(int32_t)pPageView->GetPageIndex()));
}
@@ -2158,16 +2158,16 @@ bool Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
vp << (int32_t) -1;
}
- return true;
+ return TRUE;
}
-bool Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -2185,13 +2185,13 @@ bool Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_PASSWORD)
vp << true;
@@ -2199,7 +2199,7 @@ bool Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return true;
+ return TRUE;
}
void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -2207,7 +2207,7 @@ void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -2216,11 +2216,11 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -2232,7 +2232,7 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
if (m_nFormControlIndex < 0)
{
- bool bSet = false;
+ FX_BOOL bSet = FALSE;
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
@@ -2246,17 +2246,17 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
if (dwFlags != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlags);
- bSet = true;
+ bSet = TRUE;
}
}
}
if (bSet)
- UpdateFormField(m_pDocument, pFormField, true, false, true);
+ UpdateFormField(m_pDocument, pFormField, TRUE, FALSE, TRUE);
}
else
{
- if(m_nFormControlIndex >= pFormField->CountControls()) return false;
+ if(m_nFormControlIndex >= pFormField->CountControls()) return FALSE;
if (CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex))
{
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
@@ -2270,7 +2270,7 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
if (dwFlags != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlags);
- UpdateFormControl(m_pDocument, pFormField->GetControl(m_nFormControlIndex), true, false, true);
+ UpdateFormControl(m_pDocument, pFormField->GetControl(m_nFormControlIndex), TRUE, FALSE, TRUE);
}
}
}
@@ -2283,7 +2283,7 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pFormField != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return false;
+ if (!pWidget) return FALSE;
if (pWidget->GetFlags() & ANNOTFLAG_PRINT)
vp << true;
@@ -2291,20 +2291,20 @@ bool Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -2316,7 +2316,7 @@ bool Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)
vp << true;
@@ -2324,20 +2324,20 @@ bool Field::radiosInUnison(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -2354,17 +2354,17 @@ bool Field::readonly(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
- if (!vp.IsArrayObject())return false;
+ if (!m_bCanSet) return FALSE;
+ if (!vp.IsArrayObject())return FALSE;
CJS_Array rcArray(m_isolate);
vp >> rcArray;
@@ -2395,7 +2395,7 @@ bool Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -2404,7 +2404,7 @@ bool Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pInterForm != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return false;
+ if (!pWidget) return FALSE;
CFX_FloatRect crRect = pWidget->GetRect();
CJS_Value Upper_Leftx(m_isolate),Upper_Lefty(m_isolate),Lower_Rightx(m_isolate),Lower_Righty(m_isolate);
@@ -2422,7 +2422,7 @@ bool Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
vp << rcArray;
}
- return true;
+ return TRUE;
}
void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPDF_Rect& rect)
@@ -2442,7 +2442,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
if (nControlIndex < 0)
{
- bool bSet = false;
+ FX_BOOL bSet = FALSE;
for (int i=0, sz=pFormField->CountControls(); i<sz; i++)
{
CPDF_FormControl* pFormControl = pFormField->GetControl(i);
@@ -2469,13 +2469,13 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
crRect.bottom != rcOld.bottom)
{
pWidget->SetRect(crRect);
- bSet = true;
+ bSet = TRUE;
}
}
}
}
- if (bSet) UpdateFormField(pDocument, pFormField, true, true, true);
+ if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
}
else
{
@@ -2503,7 +2503,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
crRect.bottom != rcOld.bottom)
{
pWidget->SetRect(crRect);
- UpdateFormControl(pDocument, pFormControl, true, true, true);
+ UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
}
}
}
@@ -2512,17 +2512,17 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
}
}
-bool Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
@@ -2535,7 +2535,7 @@ bool Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED)
vp << true;
@@ -2543,16 +2543,16 @@ bool Field::required(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return true;
+ return TRUE;
}
-bool Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
bool bVP;
vp >> bVP;
@@ -2570,13 +2570,13 @@ bool Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return false;
+ return FALSE;
if (pFormField->GetFieldFlags() & FIELDFLAG_RICHTEXT)
vp << true;
@@ -2584,7 +2584,7 @@ bool Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << false;
}
- return true;
+ return TRUE;
}
void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
@@ -2592,19 +2592,19 @@ void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-bool Field::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
;
}
else
{
;
}
- return true;
+ return TRUE;
}
void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex)
@@ -2612,13 +2612,13 @@ void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-bool Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -2636,18 +2636,18 @@ bool Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
vp << (int32_t)pFormControl->GetRotation();
}
- return true;
+ return TRUE;
}
void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -2655,15 +2655,15 @@ void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-bool Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
- if (!vp.IsArrayObject())return false;
+ if (!vp.IsArrayObject())return FALSE;
CJS_Array crArray(m_isolate);
vp >> crArray;
@@ -2684,13 +2684,13 @@ bool Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
int iColorType;
pFormControl->GetBorderColor(iColorType);
@@ -2719,14 +2719,14 @@ bool Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
pFormControl->GetOriginalBorderColor(3));
}
else
- return false;
+ return FALSE;
CJS_Array crArray(m_isolate);
color::ConvertPWLColorToArray(color, crArray);
vp << crArray;
}
- return true;
+ return TRUE;
}
void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
@@ -2734,13 +2734,13 @@ void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& sw
//Not supported.
}
-bool Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CFX_ByteString csBCaption;
vp >> csBCaption;
@@ -2758,17 +2758,17 @@ bool Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON &&
pFormField->GetFieldType() != FIELDTYPE_CHECKBOX)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return false;
+ if (!pFormControl) return FALSE;
CFX_WideString csWCaption = pFormControl->GetNormalCaption();
CFX_ByteString csBCaption;
@@ -2797,7 +2797,7 @@ bool Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
vp << csBCaption;
}
- return true;
+ return TRUE;
}
void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
@@ -2806,21 +2806,21 @@ void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
//Not supported.
}
-bool Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::submitName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CJS_Array crArray(m_isolate);
- if (!vp.IsArrayObject())return false;
+ if (!vp.IsArrayObject())return FALSE;
vp >> crArray;
CPWL_Color color;
@@ -2839,13 +2839,13 @@ bool Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
int iColorType;
FX_ARGB color;
@@ -2866,7 +2866,7 @@ bool Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
vp << crArray;
}
- return true;
+ return TRUE;
}
void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
@@ -2874,17 +2874,17 @@ void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
//Not supported.
}
-bool Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CFX_ByteString csFontName;
vp >> csFontName;
- if (csFontName.IsEmpty()) return false;
+ if (csFontName.IsEmpty()) return FALSE;
if (m_bDelay)
{
@@ -2899,13 +2899,13 @@ bool Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
int nFieldType = pFormField->GetFieldType();
@@ -2915,15 +2915,15 @@ bool Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
nFieldType == FIELDTYPE_TEXTFIELD)
{
CPDF_Font * pFont = pFormControl->GetDefaultControlFont();
- if (!pFont) return false;
+ if (!pFont) return FALSE;
vp << pFont->GetBaseFont();
}
else
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string)
@@ -2931,13 +2931,13 @@ void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-bool Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int nVP;
vp >> nVP;
@@ -2955,13 +2955,13 @@ bool Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
@@ -2972,7 +2972,7 @@ bool Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << (int)fFontSize;
}
- return true;
+ return TRUE;
}
void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
@@ -2980,15 +2980,15 @@ void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-bool Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!vp.IsGetting()) return false;
+ if (!vp.IsGetting()) return FALSE;
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3024,16 +3024,16 @@ bool Field::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
break;
}
- return true;
+ return TRUE;
}
-bool Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CFX_WideString swName;
vp >> swName;
@@ -3051,7 +3051,7 @@ bool Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3059,7 +3059,7 @@ bool Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << (CFX_WideString)pFormField->GetAlternateName();
}
- return true;
+ return TRUE;
}
void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string)
@@ -3067,13 +3067,13 @@ void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFie
//Not supported.
}
-bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
{
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
CJS_WideStringArray strArray;
@@ -3109,7 +3109,7 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3119,14 +3119,14 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
switch (pFormField->GetFieldType())
{
case FIELDTYPE_PUSHBUTTON:
- return false;
+ return FALSE;
case FIELDTYPE_COMBOBOX:
case FIELDTYPE_TEXTFIELD:
{
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- bool bDot;
+ FX_BOOL bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3160,7 +3160,7 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- bool bDot;
+ FX_BOOL bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3176,14 +3176,14 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
{
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
for (int i = 0 , sz = pFormField->CountControls(); i < sz; i++)
{
if (pFormField->GetControl(i)->IsChecked())
{
CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue();
double dRet;
- bool bDot;
+ FX_BOOL bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
{
if (bDot)
@@ -3194,7 +3194,7 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
else
vp << swValue;
- bFind = true;
+ bFind = TRUE;
break;
}
else
@@ -3210,7 +3210,7 @@ bool Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
}
}
- return true;
+ return TRUE;
}
void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName,
@@ -3238,8 +3238,8 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
if (pFormField->GetValue() != strArray.GetAt(0))
{
CFX_WideString WideString = strArray.GetAt(0);
- pFormField->SetValue(strArray.GetAt(0), true);
- UpdateFormField(pDocument, pFormField, true, false, true);
+ pFormField->SetValue(strArray.GetAt(0), TRUE);
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
break;
case FIELDTYPE_CHECKBOX: //mantis: 0004493
@@ -3247,14 +3247,14 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
{
if (pFormField->GetValue() != strArray.GetAt(0))
{
- pFormField->SetValue(strArray.GetAt(0), true);
- UpdateFormField(pDocument, pFormField, true, false, true);
+ pFormField->SetValue(strArray.GetAt(0), TRUE);
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
}
break;
case FIELDTYPE_LISTBOX:
{
- bool bModified = false;
+ FX_BOOL bModified = FALSE;
for (int i=0,sz=strArray.GetSize(); i<sz; i++)
{
@@ -3262,21 +3262,21 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
if (!pFormField->IsItemSelected(iIndex))
{
- bModified = true;
+ bModified = TRUE;
break;
}
}
if (bModified)
{
- pFormField->ClearSelection(true);
+ pFormField->ClearSelection(TRUE);
for (int i=0,sz=strArray.GetSize(); i<sz; i++)
{
int iIndex = pFormField->FindOption(strArray.GetAt(i));
- pFormField->SetItemSelection(iIndex, true, true);
+ pFormField->SetItemSelection(iIndex, TRUE, TRUE);
}
- UpdateFormField(pDocument, pFormField, true, false, true);
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
}
break;
@@ -3286,25 +3286,25 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
}
}
-bool Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!vp.IsGetting()) return false;
+ if (!vp.IsGetting()) return FALSE;
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
if (pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
{
- if(!pFormField->CountControls()) return false;
+ if(!pFormField->CountControls()) return FALSE;
if (pFormField->GetControl(0)->IsChecked())
vp << L"Yes";
@@ -3331,18 +3331,18 @@ bool Field::valueAsString(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
vp << pFormField->GetValue().c_str();
- return true;
+ return TRUE;
}
/* --------------------------------- methods --------------------------------- */
-bool Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3357,17 +3357,17 @@ bool Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& param
if(!wsFileName.IsEmpty())
{
pFormField->SetValue(wsFileName);
- UpdateFormField(m_pDocument, pFormField, true, true, true);
+ UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
}
}
else
- return false;
+ return FALSE;
- return true;
+ return TRUE;
}
-bool Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3378,16 +3378,16 @@ bool Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJ
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
if (nface == 0)
vRet = pFormControl->GetNormalCaption().c_str();
@@ -3396,14 +3396,14 @@ bool Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJ
else if (nface == 2)
vRet = pFormControl->GetRolloverCaption().c_str();
else
- return false;
+ return FALSE;
- return true;
+ return TRUE;
}
//#pragma warning(disable: 4800)
-bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3414,16 +3414,16 @@ bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return false;
+ return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -3432,7 +3432,7 @@ bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
ASSERT(pRuntime != NULL);
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- ASSERT(pObj.IsEmpty() == false);
+ ASSERT(pObj.IsEmpty() == FALSE);
CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj);
ASSERT(pJS_Icon != NULL);
@@ -3448,27 +3448,27 @@ bool Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
else if (nface == 2)
pIconStream = pFormControl->GetRolloverIcon();
else
- return false;
+ return FALSE;
pIcon->SetStream(pIconStream);
vRet = pJS_Icon;
- return true;
+ return TRUE;
}
//#pragma warning(default: 4800)
-bool Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
#if 0
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField)return false;
+ if (!pFormField)return FALSE;
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
ASSERT(pEnv);
@@ -3477,7 +3477,7 @@ bool Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
if (sIconFileName.IsEmpty())
{
vRet = 1;
- return true;
+ return TRUE;
}
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
@@ -3487,110 +3487,110 @@ bool Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
if (!pStream)
{
vRet = -1;
- return true;
+ return TRUE;
}
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return false;
+ if (!pFormControl)return FALSE;
pFormControl->SetNormalIcon(pStream);
- UpdateFormControl(m_pDocument, pFormControl, true, true, true);
+ UpdateFormControl(m_pDocument, pFormControl, TRUE, TRUE, TRUE);
vRet = 0;
#endif // 0
- return true;
+ return TRUE;
}
-bool Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonSetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::buttonSetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int iSize = params.size();
if (iSize < 1)
- return false;
+ return FALSE;
int nWidget = params[0].ToInt();
- bool bCheckit = true;
+ FX_BOOL bCheckit = TRUE;
if (iSize >= 2)
bCheckit = params[1].ToBool();
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return false;
+ return FALSE;
if(nWidget <0 || nWidget >= pFormField->CountControls())
- return false;
+ return FALSE;
if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)
- pFormField->CheckControl(nWidget, bCheckit, true);
+ pFormField->CheckControl(nWidget, bCheckit, TRUE);
else
- pFormField->CheckControl(nWidget, bCheckit, true);
+ pFormField->CheckControl(nWidget, bCheckit, TRUE);
- UpdateFormField(m_pDocument, pFormField, true, true, true);
- return true;
+ UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
+ return TRUE;
}
-bool Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
- if (!m_bCanSet) return false;
+ if (!m_bCanSet) return FALSE;
int iSize = params.size();
if (iSize < 1)
- return false;
+ return FALSE;
int nWidget = params[0].ToInt();
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if(nWidget <0 || nWidget >= pFormField->CountControls())
{
- vRet = false;
- return false;
+ vRet = FALSE;
+ return FALSE;
}
if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
|| (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
{
- vRet = true;
+ vRet = TRUE;
}
else
- vRet = false;
+ vRet = FALSE;
- return true;
+ return TRUE;
}
-bool Field::deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::deleteItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2)
@@ -3602,13 +3602,13 @@ int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2)
}
-bool Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CGW_ArrayTemplate<CFX_WideString*> swSort;
@@ -3633,7 +3633,7 @@ bool Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
CFX_WideString* pStr = swSort.GetAt(j);
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pObj.IsEmpty() == false);
+ ASSERT(pObj.IsEmpty() == FALSE);
CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj);
ASSERT(pJSField != NULL);
@@ -3652,10 +3652,10 @@ bool Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet = FormFieldArray;
swSort.RemoveAll();
- return true;
+ return TRUE;
}
-bool Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
int iSize = params.size();
@@ -3664,13 +3664,13 @@ bool Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
if (iSize >= 1)
nIdx = params[0].ToInt();
- bool bExport = true;
+ FX_BOOL bExport = TRUE;
if (iSize >= 2)
bExport = params[1].ToBool();
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
@@ -3692,22 +3692,22 @@ bool Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
vRet = pFormField->GetOptionLabel(nIdx).c_str();
}
else
- return false;
+ return FALSE;
- return true;
+ return TRUE;
}
-bool Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::getLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3717,32 +3717,32 @@ bool Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if(nIndex <0 || nIndex >= pFormField->CountControls())
{
- vRet = false;
- return false;
+ vRet = FALSE;
+ return FALSE;
}
if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
|| (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
{
if (pFormField->GetControl(nIndex)->IsChecked() !=0 )
- vRet = true;
+ vRet = TRUE;
else
- vRet = false;
+ vRet = FALSE;
}
else
- vRet = false;
+ vRet = FALSE;
- return true;
+ return TRUE;
}
-bool Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3752,49 +3752,49 @@ bool Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJ
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
if(nIndex <0 || nIndex >= pFormField->CountControls())
{
- vRet = false;
- return false;
+ vRet = FALSE;
+ return FALSE;
}
if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
|| (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
{
if (pFormField->GetControl(nIndex)->IsDefaultChecked() != 0)
- vRet = true;
+ vRet = TRUE;
else
- vRet = false;
+ vRet = FALSE;
}
else
- vRet = false;
+ vRet = FALSE;
- return true;
+ return TRUE;
}
-bool Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::setAction(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return false;
+ if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
int32_t nCount = pFormField->CountControls();
- if (nCount < 1) return false;
+ if (nCount < 1) return FALSE;
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
@@ -3810,7 +3810,7 @@ bool Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
ASSERT(pEnv);
CPDF_Page* pPage = (CPDF_Page*)pEnv->FFI_GetCurrentPage(m_pDocument->GetDocument());
if(!pPage)
- return false;
+ return FALSE;
if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage))
{
for (int32_t i=0; i<nCount; i++)
@@ -3832,57 +3832,57 @@ bool Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
m_pDocument->SetFocusAnnot(pWidget);
}
- return true;
+ return TRUE;
}
-bool Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::setItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::setLock(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureGetModifications(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureGetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureInfo(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureSetSeedValue(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureSign(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Field::signatureValidate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool Field::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Field::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << (CJS_Object*)NULL;
}
- return true;
+ return TRUE;
}
/////////////////////////////////////////// delay /////////////////////////////////////////////
diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp
index 27a9773235..6b3e02e1ec 100644
--- a/fpdfsdk/src/javascript/Icon.cpp
+++ b/fpdfsdk/src/javascript/Icon.cpp
@@ -57,11 +57,11 @@ CFX_WideString Icon::GetIconName()
return m_swIconName;
}
-bool Icon::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL Icon::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if(!vp.IsGetting())return false;
+ if(!vp.IsGetting())return FALSE;
vp << m_swIconName;
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index 0edbf0d0e5..72be34d751 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -16,8 +16,8 @@
CJS_Context::CJS_Context(CJS_Runtime* pRuntime) :
m_pRuntime(pRuntime),
- m_bBusy(false),
- m_bMsgBoxEnable(true)
+ m_bBusy(FALSE),
+ m_bMsgBoxEnable(TRUE)
{
m_pEventHandler = new CJS_EventHandler(this);
}
@@ -41,15 +41,15 @@ CPDFDoc_Environment* CJS_Context::GetReaderApp()
return m_pRuntime->GetReaderApp();
}
-bool CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
+FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
{
if (m_bBusy)
{
info = JSGetStringFromID(this, IDS_STRING_JSBUSY);
- return false;
+ return FALSE;
}
- m_bBusy = true;
+ m_bBusy = TRUE;
ASSERT(m_pRuntime != NULL);
ASSERT(m_pEventHandler != NULL);
@@ -58,7 +58,7 @@ bool CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString&
if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType()))
{
info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
- return false;
+ return FALSE;
}
FXJSErr error ={NULL,NULL, 0};
@@ -95,12 +95,12 @@ bool CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString&
m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType());
m_pEventHandler->Destroy();
- m_bBusy = false;
+ m_bBusy = FALSE;
return nRet >= 0;
}
-bool CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
+FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
{
v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
@@ -110,7 +110,7 @@ bool CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
return DoJob(0, script, info);
}
-bool CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
+FX_BOOL CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
{
v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
@@ -186,58 +186,58 @@ void CJS_Context::OnPage_OutView(CPDFSDK_Document* pTarget)
m_pEventHandler->OnPage_OutView(pTarget);
}
-void CJS_Context::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseDown(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseEnter(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseExit(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField *pTarget)
+void CJS_Context::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_MouseUp(bModifier, bShift, pTarget);
}
-void CJS_Context::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+void CJS_Context::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Focus(bModifier, bShift, pTarget, Value);
}
-void CJS_Context::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+void CJS_Context::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Blur(bModifier, bShift, pTarget, Value);
}
-void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc)
+void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Calculate(pSource, pTarget, Value, bRc);
}
-void CJS_Context::OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, bool bWillCommit)
+void CJS_Context::OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit)
{
m_pEventHandler->OnField_Format(pTarget, Value, bWillCommit);
}
void CJS_Context::OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- bool bKeyDown, bool bModifier, int &nSelEnd,int &nSelStart,
- bool bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
- bool bWillCommit, bool bFieldFull, bool& bRc)
+ FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart,
+ FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
+ FX_BOOL bWillCommit, FX_BOOL bFieldFull, FX_BOOL& bRc)
{
m_pEventHandler->OnField_Keystroke(
strChange, strChangeEx, bKeyDown, bModifier, nSelEnd, nSelStart,
@@ -245,68 +245,68 @@ void CJS_Context::OnField_Keystroke(CFX_WideString& strChange, const CFX_WideStr
}
void CJS_Context::OnField_Validate(CFX_WideString& strChange,const CFX_WideString& strChangeEx,
- bool bKeyDown, bool bModifier, bool bShift, CPDF_FormField* pTarget,
- CFX_WideString& Value, bool& bRc)
+ FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
+ CFX_WideString& Value, FX_BOOL& bRc)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnField_Validate(strChange, strChangeEx, bKeyDown, bModifier, bShift, pTarget, Value, bRc);
}
-void CJS_Context::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Focus(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Blur(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Open(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_Close(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseDown(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseUp(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseEnter(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_MouseExit(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_InView(bModifier, bShift, pScreen);
}
-void CJS_Context::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_Context::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnScreen_OutView(bModifier, bShift, pScreen);
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index 1056c446f4..1769e3053f 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -20,21 +20,21 @@
CJS_EventHandler::CJS_EventHandler(CJS_Context * pContext) :
m_pJSContext(pContext),
m_eEventType(JET_UNKNOWN),
- m_bValid(false),
+ m_bValid(FALSE),
m_pWideStrChange(NULL),
m_nCommitKey(-1),
- m_bKeyDown(false),
- m_bModifier(false),
- m_bShift(false),
+ m_bKeyDown(FALSE),
+ m_bModifier(FALSE),
+ m_bShift(FALSE),
m_pISelEnd(NULL),
m_nSelEndDu(0),
m_pISelStart(NULL),
m_nSelStartDu(0),
- m_bWillCommit(false),
+ m_bWillCommit(FALSE),
m_pValue(NULL),
- m_bFieldFull(false),
+ m_bFieldFull(FALSE),
m_pbRc(NULL),
- m_bRcDu(false),
+ m_bRcDu(FALSE),
m_pSourceDoc(NULL),
m_pTargetBookMark(NULL),
m_pTargetDoc(NULL),
@@ -121,7 +121,7 @@ void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc)
m_pTargetDoc = pDoc;
}
-void CJS_EventHandler::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEENTER);
@@ -132,7 +132,7 @@ void CJS_EventHandler::OnField_MouseEnter(bool bModifier, bool bShift, CPDF_Form
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEEXIT);
@@ -142,7 +142,7 @@ void CJS_EventHandler::OnField_MouseExit(bool bModifier, bool bShift, CPDF_FormF
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEDOWN);
m_eEventType = JET_FIELD_MOUSEDOWN;
@@ -153,7 +153,7 @@ void CJS_EventHandler::OnField_MouseDown(bool bModifier, bool bShift, CPDF_FormF
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormField* pTarget)
+void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEUP);
@@ -163,7 +163,7 @@ void CJS_EventHandler::OnField_MouseUp(bool bModifier, bool bShift, CPDF_FormFie
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_FOCUS);
@@ -175,7 +175,7 @@ void CJS_EventHandler::OnField_Focus(bool bModifier, bool bShift, CPDF_FormField
m_pValue = (CFX_WideString*)&Value;
}
-void CJS_EventHandler::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_BLUR);
@@ -188,11 +188,11 @@ void CJS_EventHandler::OnField_Blur(bool bModifier, bool bShift, CPDF_FormField*
}
void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
- const CFX_WideString& strChangeEx, bool KeyDown,
- bool bModifier, int& nSelEnd, int& nSelStart,
- bool bShift, CPDF_FormField* pTarget,
- CFX_WideString& Value, bool bWillCommit,
- bool bFieldFull, bool& bRc)
+ const CFX_WideString& strChangeEx, FX_BOOL KeyDown,
+ FX_BOOL bModifier, int& nSelEnd, int& nSelStart,
+ FX_BOOL bShift, CPDF_FormField* pTarget,
+ CFX_WideString& Value, FX_BOOL bWillCommit,
+ FX_BOOL bFieldFull, FX_BOOL& bRc)
{
Initial(JET_FIELD_KEYSTROKE);
@@ -213,8 +213,8 @@ void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
}
void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- bool bKeyDown, bool bModifier, bool bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, bool& bRc)
+ FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
{
Initial(JET_FIELD_VALIDATE);
@@ -230,7 +230,7 @@ void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_Wid
}
void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget,
- CFX_WideString& Value, bool& bRc)
+ CFX_WideString& Value, FX_BOOL& bRc)
{
Initial(JET_FIELD_CALCULATE);
@@ -244,7 +244,7 @@ void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField
void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
CFX_WideString& Value,
- bool bWillCommit)
+ FX_BOOL bWillCommit)
{
Initial(JET_FIELD_FORMAT);
@@ -255,7 +255,7 @@ void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
m_bWillCommit = bWillCommit;
}
-void CJS_EventHandler::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_FOCUS);
@@ -264,7 +264,7 @@ void CJS_EventHandler::OnScreen_Focus(bool bModifier, bool bShift, CPDFSDK_Annot
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_BLUR);
@@ -273,7 +273,7 @@ void CJS_EventHandler::OnScreen_Blur(bool bModifier, bool bShift, CPDFSDK_Annot*
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_OPEN);
@@ -282,7 +282,7 @@ void CJS_EventHandler::OnScreen_Open(bool bModifier, bool bShift, CPDFSDK_Annot*
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_CLOSE);
@@ -291,7 +291,7 @@ void CJS_EventHandler::OnScreen_Close(bool bModifier, bool bShift, CPDFSDK_Annot
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEDOWN);
@@ -300,7 +300,7 @@ void CJS_EventHandler::OnScreen_MouseDown(bool bModifier, bool bShift, CPDFSDK_A
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEUP);
@@ -309,7 +309,7 @@ void CJS_EventHandler::OnScreen_MouseUp(bool bModifier, bool bShift, CPDFSDK_Ann
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEENTER);
@@ -318,7 +318,7 @@ void CJS_EventHandler::OnScreen_MouseEnter(bool bModifier, bool bShift, CPDFSDK_
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_MOUSEEXIT);
@@ -327,7 +327,7 @@ void CJS_EventHandler::OnScreen_MouseExit(bool bModifier, bool bShift, CPDFSDK_A
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_INVIEW);
@@ -336,7 +336,7 @@ void CJS_EventHandler::OnScreen_InView(bool bModifier, bool bShift, CPDFSDK_Anno
m_pTargetAnnot = pScreen;
}
-void CJS_EventHandler::OnScreen_OutView(bool bModifier, bool bShift, CPDFSDK_Annot* pScreen)
+void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
{
Initial(JET_SCREEN_OUTVIEW);
@@ -395,33 +395,33 @@ void CJS_EventHandler::Initial(JS_EVENT_T type)
m_WideStrChangeDu = L"";
m_WideStrChangeEx = L"";
m_nCommitKey = -1;
- m_bKeyDown = false;
- m_bModifier = false;
- m_bShift = false;
+ m_bKeyDown = FALSE;
+ m_bModifier = FALSE;
+ m_bShift = FALSE;
m_pISelEnd = NULL;
m_nSelEndDu = 0;
m_pISelStart = NULL;
m_nSelStartDu = 0;
- m_bWillCommit = false;
+ m_bWillCommit = FALSE;
m_pValue = NULL;
- m_bFieldFull = false;
+ m_bFieldFull = FALSE;
m_pbRc = NULL;
- m_bRcDu = false;
+ m_bRcDu = FALSE;
m_pSourceDoc = NULL;
m_pTargetBookMark = NULL;
m_pTargetDoc = NULL;
m_pTargetAnnot = NULL;
- m_bValid = true;
+ m_bValid = TRUE;
}
void CJS_EventHandler::Destroy()
{
- m_bValid = false;
+ m_bValid = FALSE;
}
-bool CJS_EventHandler::IsValid()
+FX_BOOL CJS_EventHandler::IsValid()
{
return m_bValid;
}
@@ -444,17 +444,17 @@ int CJS_EventHandler::CommitKey()
return m_nCommitKey;
}
-bool CJS_EventHandler::FieldFull()
+FX_BOOL CJS_EventHandler::FieldFull()
{
return m_bFieldFull;
}
-bool CJS_EventHandler::KeyDown()
+FX_BOOL CJS_EventHandler::KeyDown()
{
return m_bKeyDown;
}
-bool CJS_EventHandler::Modifier()
+FX_BOOL CJS_EventHandler::Modifier()
{
return m_bModifier;
}
@@ -555,7 +555,7 @@ const FX_WCHAR* CJS_EventHandler::Type()
return L"";
}
-bool& CJS_EventHandler::Rc()
+FX_BOOL& CJS_EventHandler::Rc()
{
if (m_pbRc) {
return *m_pbRc;
@@ -579,7 +579,7 @@ int & CJS_EventHandler::SelStart()
return m_nSelStartDu;
}
-bool CJS_EventHandler::Shift()
+FX_BOOL CJS_EventHandler::Shift()
{
return m_bShift;
}
@@ -591,9 +591,9 @@ Field* CJS_EventHandler::Source()
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
- ASSERT(pDocObj.IsEmpty() == false);
+ ASSERT(pDocObj.IsEmpty() == FALSE);
JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pFieldObj.IsEmpty() == false);
+ ASSERT(pFieldObj.IsEmpty() == FALSE);
CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
ASSERT(pJSDocument != NULL);
@@ -625,9 +625,9 @@ Field* CJS_EventHandler::Target_Field()
CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
- ASSERT(pDocObj.IsEmpty() == false);
+ ASSERT(pDocObj.IsEmpty() == FALSE);
JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pFieldObj.IsEmpty() == false);
+ ASSERT(pFieldObj.IsEmpty() == FALSE);
CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
ASSERT(pJSDocument != NULL);
@@ -653,7 +653,7 @@ CFX_WideString& CJS_EventHandler::Value()
return *m_pValue;
}
-bool CJS_EventHandler::WillCommit()
+FX_BOOL CJS_EventHandler::WillCommit()
{
return m_bWillCommit;
}
diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp
index 71e3a50a60..8c7bd7150e 100644
--- a/fpdfsdk/src/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp
@@ -296,7 +296,7 @@ void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname)
}
}
-bool CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, bool bPersistent)
+FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -304,18 +304,18 @@ bool CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, bool b
sPropName.TrimLeft();
sPropName.TrimRight();
- if (sPropName.GetLength() == 0) return false;
+ if (sPropName.GetLength() == 0) return FALSE;
if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
{
pData->bPersistent = bPersistent;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
+FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
@@ -323,7 +323,7 @@ bool CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
sPropName.TrimLeft();
sPropName.TrimRight();
- if (sPropName.GetLength() == 0) return false;
+ if (sPropName.GetLength() == 0) return FALSE;
int nFind = FindGlobalVariable(sPropName);
@@ -331,10 +331,10 @@ bool CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname)
{
delete m_arrayGlobalData.GetAt(nFind);
m_arrayGlobalData.RemoveAt(nFind);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
int32_t CJS_GlobalData::GetSize() const
@@ -417,7 +417,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables()
break;
}
SetGlobalVariableNumber(sEntry, dData);
- SetGlobalVariablePersistent(sEntry, true);
+ SetGlobalVariablePersistent(sEntry, TRUE);
}
break;
case JS_GLOBALDATA_TYPE_BOOLEAN:
@@ -425,7 +425,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables()
FX_WORD wData = *((FX_WORD*)p);
p += sizeof(FX_WORD);
SetGlobalVariableBoolean(sEntry, (bool)(wData == 1));
- SetGlobalVariablePersistent(sEntry, true);
+ SetGlobalVariablePersistent(sEntry, TRUE);
}
break;
case JS_GLOBALDATA_TYPE_STRING:
@@ -437,14 +437,14 @@ void CJS_GlobalData::LoadGlobalPersistentVariables()
break;
SetGlobalVariableString(sEntry, CFX_ByteString(p, dwLength));
- SetGlobalVariablePersistent(sEntry, true);
+ SetGlobalVariablePersistent(sEntry, TRUE);
p += sizeof(char) * dwLength;
}
break;
case JS_GLOBALDATA_TYPE_NULL:
{
SetGlobalVariableNull(sEntry);
- SetGlobalVariablePersistent(sEntry, true);
+ SetGlobalVariablePersistent(sEntry, TRUE);
}
}
}
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 7333e88cd2..485cd27813 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -40,7 +40,7 @@ IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environ
embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot;
}
JS_Initial(embedderDataSlot);
- m_bInit = true;
+ m_bInit = TRUE;
}
return new CJS_Runtime(pApp);
}
@@ -58,7 +58,7 @@ void CJS_RuntimeFactory::Release()
{
JS_Release();
ReleaseGlobalData();
- m_bInit = false;
+ m_bInit = FALSE;
}
}
}
@@ -108,7 +108,7 @@ void CJS_ArrayBufferAllocator::Free(void* data, size_t length) {
CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) :
m_pApp(pApp),
m_pDocument(NULL),
- m_bBlocking(false),
+ m_bBlocking(FALSE),
m_pFieldEventPath(NULL),
m_isolate(NULL)
{
@@ -150,46 +150,46 @@ CJS_Runtime::~CJS_Runtime()
m_isolate->Dispose();
}
-bool CJS_Runtime::InitJSObjects()
+FX_BOOL CJS_Runtime::InitJSObjects()
{
v8::Isolate::Scope isolate_scope(GetIsolate());
v8::HandleScope handle_scope(GetIsolate());
v8::Local<v8::Context> context = v8::Context::New(GetIsolate());
v8::Context::Scope context_scope(context);
//0 - 8
- if (CJS_Border::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Display::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Font::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Position::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Style::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Border::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Display::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Font::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE;
//9 - 11
- if (CJS_App::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Color::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Console::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_App::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Console::Init(*this, JS_STATIC) < 0) return FALSE;
//12 - 14
- if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return false;
- if (CJS_Event::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return false;
+ if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE;
//15 - 17
- if (CJS_Global::Init(*this, JS_STATIC) < 0) return false;
- if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return false;
- if (CJS_Util::Init(*this, JS_STATIC) < 0) return false;
+ if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Util::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_PublicMethods::Init(*this) < 0) return false;
- if (CJS_GlobalConsts::Init(*this) < 0) return false;
- if (CJS_GlobalArrays::Init(*this) < 0) return false;
+ if (CJS_PublicMethods::Init(*this) < 0) return FALSE;
+ if (CJS_GlobalConsts::Init(*this) < 0) return FALSE;
+ if (CJS_GlobalArrays::Init(*this) < 0) return FALSE;
- if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return false;
- if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return false;
+ if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return FALSE;
- return true;
+ return TRUE;
}
IFXJS_Context* CJS_Runtime::NewContext()
@@ -255,7 +255,7 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc)
}
}
-bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
+FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
if (m_pFieldEventPath == NULL)
{
@@ -264,7 +264,7 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
m_pFieldEventPath->eEventType = eEventType;
m_pFieldEventPath->pNext = NULL;
- return true;
+ return TRUE;
}
//to search
@@ -273,7 +273,7 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
while (p)
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
- return false;
+ return FALSE;
pLast = p;
p = p->pNext;
@@ -287,12 +287,12 @@ bool CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T e
pLast->pNext = pNew;
- return true;
+ return TRUE;
}
void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
{
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
CJS_FieldEvent* p = m_pFieldEventPath;
CJS_FieldEvent* pLast = NULL;
@@ -300,7 +300,7 @@ void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_
{
if (p->eEventType == eEventType && p->sTargetName == sTargetName)
{
- bFind = true;
+ bFind = TRUE;
break;
}
diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp
index 611b1112a0..058f2eaf45 100644
--- a/fpdfsdk/src/javascript/JS_Value.cpp
+++ b/fpdfsdk/src/javascript/JS_Value.cpp
@@ -256,45 +256,45 @@ FXJSVALUETYPE CJS_Value::GetType() const
return VT_unknown;
}
-bool CJS_Value::IsArrayObject() const
+FX_BOOL CJS_Value::IsArrayObject() const
{
- if(m_pValue.IsEmpty()) return false;
+ if(m_pValue.IsEmpty()) return FALSE;
return m_pValue->IsArray();
}
-bool CJS_Value::IsDateObject() const
+FX_BOOL CJS_Value::IsDateObject() const
{
- if(m_pValue.IsEmpty()) return false;
+ if(m_pValue.IsEmpty()) return FALSE;
return m_pValue->IsDate();
}
//CJS_Value::operator CJS_Array()
-bool CJS_Value::ConvertToArray(CJS_Array &array) const
+FX_BOOL CJS_Value::ConvertToArray(CJS_Array &array) const
{
if (IsArrayObject())
{
array.Attach(JS_ToArray(m_isolate, m_pValue));
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool CJS_Value::ConvertToDate(CJS_Date &date) const
+FX_BOOL CJS_Value::ConvertToDate(CJS_Date &date) const
{
// if (GetType() == VT_date)
// {
// date = (double)(*this);
-// return true;
+// return TRUE;
// }
if (IsDateObject())
{
date.Attach(m_pValue);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
/* ---------------------------- CJS_PropValue ---------------------------- */
@@ -314,12 +314,12 @@ CJS_PropValue::~CJS_PropValue()
{
}
-bool CJS_PropValue::IsSetting()
+FX_BOOL CJS_PropValue::IsSetting()
{
return m_bIsSetting;
}
-bool CJS_PropValue::IsGetting()
+FX_BOOL CJS_PropValue::IsGetting()
{
return !m_bIsSetting;
}
@@ -480,9 +480,9 @@ void CJS_Array::Attach(v8::Local<v8::Array> pArray)
m_pArray = pArray;
}
-bool CJS_Array::IsAttached()
+FX_BOOL CJS_Array::IsAttached()
{
- return false;
+ return FALSE;
}
void CJS_Array::GetElement(unsigned index,CJS_Value &value)
@@ -543,9 +543,9 @@ CJS_Date::~CJS_Date()
{
}
-bool CJS_Date::IsValidDate()
+FX_BOOL CJS_Date::IsValidDate()
{
- if(m_pDate.IsEmpty()) return false;
+ if(m_pDate.IsEmpty()) return FALSE;
return !JS_PortIsNan(JS_ToNumber(m_isolate, m_pDate));
}
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 0aa23d16a9..daecdbec89 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -72,76 +72,76 @@ static const FX_WCHAR* fullmonths[] =
L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December"
};
-bool CJS_PublicMethods::IsNumber(const FX_WCHAR* string)
+FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* string)
{
CFX_WideString sTrim = StrTrim(string);
const FX_WCHAR* pTrim = sTrim.c_str();
const FX_WCHAR* p = pTrim;
- bool bDot = false;
- bool bKXJS = false;
+ FX_BOOL bDot = FALSE;
+ FX_BOOL bKXJS = FALSE;
wchar_t c;
while ((c = *p))
{
if (c == '.' || c == ',')
{
- if (bDot) return false;
- bDot = true;
+ if (bDot) return FALSE;
+ bDot = TRUE;
}
else if (c == '-' || c == '+')
{
if (p != pTrim)
- return false;
+ return FALSE;
}
else if (c == 'e' || c == 'E')
{
if (bKXJS)
- return false;
+ return FALSE;
p++;
c = *p;
if (c == '+' || c == '-')
{
- bKXJS = true;
+ bKXJS = TRUE;
}
else
{
- return false;
+ return FALSE;
}
}
else if (!IsDigit(c))
{
- return false;
+ return FALSE;
}
p++;
}
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::IsDigit(wchar_t ch)
+FX_BOOL CJS_PublicMethods::IsDigit(wchar_t ch)
{
return (ch >= L'0' && ch <= L'9');
}
-bool CJS_PublicMethods::IsDigit(char ch)
+FX_BOOL CJS_PublicMethods::IsDigit(char ch)
{
return (ch >= '0' && ch <= '9');
}
-bool CJS_PublicMethods::IsAlphabetic(wchar_t ch)
+FX_BOOL CJS_PublicMethods::IsAlphabetic(wchar_t ch)
{
return ((ch >= L'a' && ch <= L'z') || (ch >= L'A' && ch <= L'Z'));
}
-bool CJS_PublicMethods::IsAlphaNumeric(wchar_t ch)
+FX_BOOL CJS_PublicMethods::IsAlphaNumeric(wchar_t ch)
{
return (IsDigit(ch) || IsAlphabetic(ch));
}
-bool CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
+FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
{
switch (c_Mask)
{
@@ -152,13 +152,13 @@ bool CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
case L'O':
return IsAlphaNumeric(c_Change);
case L'X':
- return true;
+ return TRUE;
default:
return (c_Change == c_Mask);
}
}
-bool CJS_PublicMethods::isReservedMaskChar(wchar_t ch)
+FX_BOOL CJS_PublicMethods::isReservedMaskChar(wchar_t ch)
{
return ch == L'9' || ch == L'A' || ch == L'O' || ch == L'X';
}
@@ -226,13 +226,13 @@ CFX_ByteString CJS_PublicMethods::StrTrim(const FX_CHAR* pStr)
return StrRTrim(StrLTrim(pStr));
}
-double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits, bool& bDot, bool& bSign, bool& bKXJS)
+double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS)
{
- bDot = false;
- bSign = false;
- bKXJS = false;
+ bDot = FALSE;
+ bSign = FALSE;
+ bKXJS = FALSE;
- bool bDigitExist = false;
+ FX_BOOL bDigitExist = FALSE;
const FX_WCHAR* p = swSource;
wchar_t c;
@@ -253,7 +253,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
if (!pStart)
{
- bAllDigits = false;
+ bAllDigits = FALSE;
return 0;
}
@@ -267,7 +267,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
double dRet = 0;
p = pStart;
- bAllDigits = true;
+ bAllDigits = TRUE;
CFX_WideString swDigits;
while (p <= pEnd)
@@ -277,14 +277,14 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
if (IsDigit(c))
{
swDigits += c;
- bDigitExist = true;
+ bDigitExist = TRUE;
}
else
{
switch (c)
{
case L' ':
- bAllDigits = false;
+ bAllDigits = FALSE;
break;
case L'.':
case L',':
@@ -298,10 +298,10 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
{
swDigits += L'0';
swDigits += L'.';
- bDigitExist = true;
+ bDigitExist = TRUE;
}
- bDot = true;
+ bDot = TRUE;
break;
}
case 'e':
@@ -312,7 +312,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
c = *p;
if (c == '+' || c == '-')
{
- bKXJS = true;
+ bKXJS = TRUE;
swDigits += 'e';
swDigits += c;
}
@@ -322,21 +322,21 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
if (!bDigitExist && !bSign)
{
swDigits += c;
- bSign = true;
+ bSign = TRUE;
break;
}
default:
- bAllDigits = false;
+ bAllDigits = FALSE;
if (p != pStart && !bDot && bDigitExist)
{
swDigits += L'.';
- bDot = true;
+ bDot = TRUE;
}
else
{
- bDot = false;
- bDigitExist = false;
+ bDot = FALSE;
+ bDigitExist = FALSE;
swDigits = L"";
}
break;
@@ -374,19 +374,19 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, bool& bAllDigits
double CJS_PublicMethods::ParseStringToNumber(const FX_WCHAR* swSource)
{
- bool bAllDigits = false;
- bool bDot = false;
- bool bSign = false;
- bool bKXJS = false;
+ FX_BOOL bAllDigits = FALSE;
+ FX_BOOL bDot = FALSE;
+ FX_BOOL bSign = FALSE;
+ FX_BOOL bKXJS = FALSE;
return ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
}
-bool CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, bool & bDot)
+FX_BOOL CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot)
{
- bool bAllDigits = false;
- bool bSign = false;
- bool bKXJS = false;
+ FX_BOOL bAllDigits = FALSE;
+ FX_BOOL bSign = FALSE;
+ FX_BOOL bKXJS = FALSE;
dRet = ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
@@ -477,7 +477,7 @@ CFX_WideString CJS_PublicMethods::ParseStringString(const CFX_WideString& string
return swRet;
}
-double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, bool& bWrongFormat)
+double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat)
{
double dt = JS_GetDateTime();
@@ -525,7 +525,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, bool& bW
nMonth = number[1];
}
- bWrongFormat = false;
+ bWrongFormat = FALSE;
}
else if (nIndex == 3)
{
@@ -552,11 +552,11 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, bool& bW
nYear = number[2];
}
- bWrongFormat = false;
+ bWrongFormat = FALSE;
}
else
{
- bWrongFormat = true;
+ bWrongFormat = TRUE;
return dt;
}
@@ -565,7 +565,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, bool& bW
return JS_DateParse(swTemp.c_str());
}
-double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, bool& bWrongFormat)
+double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, FX_BOOL& bWrongFormat)
{
double dt = JS_GetDateTime();
@@ -581,9 +581,9 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
int nYearSub = 99; //nYear - 2000;
- bool bPm = false;
- bool bExit = false;
- bWrongFormat = false;
+ FX_BOOL bPm = FALSE;
+ FX_BOOL bExit = FALSE;
+ bWrongFormat = FALSE;
int i=0;
int j=0;
@@ -715,7 +715,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
case 'm':
{
CFX_WideString sMonth = ParseStringString(value, j, nSkip);
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
for (int m = 0; m < 12; m++)
{
if (sMonth.CompareNoCase(months[m]) == 0)
@@ -723,7 +723,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
nMonth = m + 1;
i+=3;
j+=nSkip;
- bFind = true;
+ bFind = TRUE;
break;
}
}
@@ -757,7 +757,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
break;
case 'm':
{
- bool bFind = false;
+ FX_BOOL bFind = FALSE;
CFX_WideString sMonth = ParseStringString(value, j, nSkip);
sMonth.MakeLower();
@@ -772,7 +772,7 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
nMonth = m + 1;
i += 4;
j += nSkip;
- bFind = true;
+ bFind = TRUE;
break;
}
}
@@ -795,8 +795,8 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
{
if (j >= value.GetLength() || format.GetAt(i) != value.GetAt(j))
{
- bWrongFormat = true;
- bExit = true;
+ bWrongFormat = TRUE;
+ bExit = TRUE;
}
i++;
j++;
@@ -804,8 +804,8 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
if (oldj == j)
{
- bWrongFormat = true;
- bExit = true;
+ bWrongFormat = TRUE;
+ bExit = TRUE;
}
}
@@ -813,12 +813,12 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
default:
if (value.GetLength() <= j)
{
- bExit = true;
+ bExit = TRUE;
}
else if (format.GetAt(i) != value.GetAt(j))
{
- bWrongFormat = true;
- bExit = true;
+ bWrongFormat = TRUE;
+ bExit = TRUE;
}
i++;
@@ -833,19 +833,19 @@ double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CF
nYear += 2000;
if (nMonth < 1 || nMonth > 12)
- bWrongFormat = true;
+ bWrongFormat = TRUE;
if (nDay < 1 || nDay > 31)
- bWrongFormat = true;
+ bWrongFormat = TRUE;
if (nHour < 0 || nHour > 24)
- bWrongFormat = true;
+ bWrongFormat = TRUE;
if (nMin < 0 || nMin > 60)
- bWrongFormat = true;
+ bWrongFormat = TRUE;
if (nSec < 0 || nSec > 60)
- bWrongFormat = true;
+ bWrongFormat = TRUE;
double dRet = 0;
@@ -1021,7 +1021,7 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideStr
/* -------------------------------------------------------------------------- */
//function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
-bool CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
#if _FX_OS_ != _FX_ANDROID_
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1033,21 +1033,21 @@ bool CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters&
if (params.size() != 6)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
CFX_WideString& Value = pEvent->Value();
CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
- if (strValue.IsEmpty()) return true;
+ if (strValue.IsEmpty()) return TRUE;
int iDec = params[0].ToInt();
int iSepStyle = params[1].ToInt();
int iNegStyle = params[2].ToInt();
// params[3] is iCurrStyle, it's not used.
std::wstring wstrCurrency(params[4].ToCFXWideString().c_str());
- bool bCurrencyPrepend = params[5].ToBool();
+ FX_BOOL bCurrencyPrepend = params[5].ToBool();
if (iDec < 0) iDec = -iDec;
@@ -1224,11 +1224,11 @@ bool CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Parameters&
}
Value = strValue2.c_str();
#endif
- return true;
+ return TRUE;
}
//function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
-bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1236,13 +1236,13 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
ASSERT(pEvent != NULL);
if(params.size() < 2)
- return false;
+ return FALSE;
int iSepStyle = params[1].ToInt();
if (iSepStyle < 0 || iSepStyle > 3)
iSepStyle = 0;
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
CFX_WideString & val = pEvent->Value();
CFX_WideString & w_strChange = pEvent->Change();
CFX_WideString w_strValue = val;
@@ -1252,18 +1252,18 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
CFX_WideString wstrChange = w_strChange;
CFX_WideString wstrValue = StrLTrim(w_strValue.c_str());
if (wstrValue.IsEmpty())
- return true;
+ return TRUE;
CFX_WideString swTemp = wstrValue;
swTemp.Replace(L",", L".");
if (!IsNumber(swTemp.c_str()))
{
- pEvent->Rc() = false;
+ pEvent->Rc() = FALSE;
sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE);
Alert(pContext, sError.c_str());
- return true;
+ return TRUE;
}
- return true; // it happens after the last keystroke and before validating,
+ return TRUE; // it happens after the last keystroke and before validating,
}
std::wstring w_strValue2 = w_strValue.c_str();
@@ -1271,15 +1271,15 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
std::wstring w_strSelected;
if(-1 != pEvent->SelStart())
w_strSelected = w_strValue2.substr(pEvent->SelStart(),(pEvent->SelEnd() - pEvent->SelStart()));
- bool bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
+ FX_BOOL bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
if (bHasSign)
{
//can't insert "change" in front to sign postion.
if (pEvent->SelStart() == 0)
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
}
@@ -1297,49 +1297,49 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
break;
}
- bool bHasSep = (w_strValue2.find(cSep) != -1);
+ FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1);
for (std::wstring::iterator it = w_strChange2.begin(); it != w_strChange2.end(); it++)
{
if (*it == cSep)
{
if (bHasSep)
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
- bHasSep = true;
+ bHasSep = TRUE;
continue;
}
if (*it == L'-')
{
if (bHasSign)
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
if (it != w_strChange2.begin()) //sign's position is not correct
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
if (pEvent->SelStart() != 0)
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
- bHasSign = true;
+ bHasSign = TRUE;
continue;
}
if (!IsDigit(*it))
{
- bool &bRc = pEvent->Rc();
- bRc = false;
- return true;
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
}
}
@@ -1351,12 +1351,12 @@ bool CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Paramete
w_strValue2 = w_prefix + w_strChange2 + w_postfix;
w_strValue = w_strValue2.c_str();
val = w_strValue;
- return true;
+ return TRUE;
}
//function AFPercent_Format(nDec, sepStyle)
-bool CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
#if _FX_OS_ != _FX_ANDROID_
CJS_Context* pContext = (CJS_Context *)cc;
@@ -1367,15 +1367,15 @@ bool CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
CFX_WideString& Value = pEvent->Value();
CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
if (strValue.IsEmpty())
- return true;
+ return TRUE;
int iDec = params[0].ToInt();
if (iDec < 0)
@@ -1461,16 +1461,16 @@ bool CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Parameters
strValue += "%";
Value = CFX_WideString::FromLocal(strValue);
#endif
- return true;
+ return TRUE;
}
//AFPercent_Keystroke(nDec, sepStyle)
-bool CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
return AFNumber_Keystroke(cc,params,vRet,sError);
}
//function AFDate_FormatEx(cFormat)
-bool CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1480,18 +1480,18 @@ bool CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters&
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
CFX_WideString& val = pEvent->Value();
CFX_WideString strValue = val;
if (strValue.IsEmpty())
- return true;
+ return TRUE;
CFX_WideString sFormat = params[0].ToCFXWideString();
- bool bWrongFormat = false;
+ FX_BOOL bWrongFormat = FALSE;
double dDate = 0.0f;
if(strValue.Find(L"GMT") != -1)
@@ -1510,11 +1510,11 @@ bool CJS_PublicMethods::AFDate_FormatEx(IFXJS_Context* cc, const CJS_Parameters&
CFX_WideString swMsg;
swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str());
Alert(pContext, swMsg.c_str());
- return false;
+ return FALSE;
}
val = MakeFormatDate(dDate,sFormat);
- return true;
+ return TRUE;
}
double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
@@ -1578,7 +1578,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
}
//AFDate_KeystrokeEx(cFormat)
-bool CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1588,33 +1588,33 @@ bool CJS_PublicMethods::AFDate_KeystrokeEx(IFXJS_Context* cc, const CJS_Paramete
if (params.size() != 1)
{
sError = L"AFDate_KeystrokeEx's parameters' size r not correct";
- return false;
+ return FALSE;
}
if (pEvent->WillCommit())
{
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
CFX_WideString strValue = pEvent->Value();
if (strValue.IsEmpty())
- return true;
+ return TRUE;
CFX_WideString sFormat = params[0].ToCFXWideString();
- bool bWrongFormat = false;
+ FX_BOOL bWrongFormat = FALSE;
double dRet = MakeRegularDate(strValue,sFormat,bWrongFormat);
if (bWrongFormat || JS_PortIsNan(dRet))
{
CFX_WideString swMsg;
swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str());
Alert(pContext, swMsg.c_str());
- pEvent->Rc() = false;
- return true;
+ pEvent->Rc() = FALSE;
+ return TRUE;
}
}
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1624,7 +1624,7 @@ bool CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& p
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
int iIndex = params[0].ToInt();
@@ -1645,7 +1645,7 @@ bool CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters& p
}
//AFDate_KeystrokeEx(cFormat)
-bool CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1655,7 +1655,7 @@ bool CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
int iIndex = params[0].ToInt();
@@ -1676,7 +1676,7 @@ bool CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Parameters
}
//function AFTime_Format(ptf)
-bool CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1685,7 +1685,7 @@ bool CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& p
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
int iIndex = params[0].ToInt();
@@ -1703,7 +1703,7 @@ bool CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters& p
return AFDate_FormatEx(cc,newParams,vRet,sError);
}
-bool CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
if (params.size() != 1)
@@ -1711,7 +1711,7 @@ bool CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
int iIndex = params[0].ToInt();
@@ -1729,18 +1729,18 @@ bool CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Parameters
return AFDate_KeystrokeEx(cc,newParams,vRet,sError);
}
-bool CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFTime_FormatEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
return AFDate_FormatEx(cc,params,vRet,sError);
}
-bool CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
return AFDate_KeystrokeEx(cc,params,vRet,sError);
}
//function AFSpecial_Format(psf)
-bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1748,7 +1748,7 @@ bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
std::string cFormat;
@@ -1758,7 +1758,7 @@ bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters
ASSERT(pEvent != NULL);
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
CFX_WideString& Value = pEvent->Value();
std::string strSrc = CFX_ByteString::FromUnicode(Value).c_str();
@@ -1788,12 +1788,12 @@ bool CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Parameters
std::string strDes;
util::printx(cFormat,strSrc,strDes);
Value = CFX_WideString::FromLocal(strDes.c_str());
- return true;
+ return TRUE;
}
//function AFSpecial_KeystrokeEx(mask)
-bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1804,23 +1804,23 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
if (params.size() < 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
CFX_WideString& valEvent = pEvent->Value();
CFX_WideString wstrMask = params[0].ToCFXWideString();
if (wstrMask.IsEmpty())
- return true;
+ return TRUE;
std::wstring wstrValue = valEvent.c_str();
if (pEvent->WillCommit())
{
if (wstrValue.empty())
- return true;
+ return TRUE;
int iIndexMask = 0;
for (std::wstring::iterator it = wstrValue.begin(); it != wstrValue.end(); it++)
{
@@ -1833,30 +1833,30 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
if (iIndexMask != wstrMask.GetLength() || (iIndexMask != wstrValue.size() && wstrMask.GetLength() != 0))
{
Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE).c_str());
- pEvent->Rc() = false;
+ pEvent->Rc() = FALSE;
}
- return true;
+ return TRUE;
}
CFX_WideString &wideChange = pEvent->Change();
std::wstring wChange = wideChange.c_str();
if (wChange.empty())
- return true;
+ return TRUE;
int iIndexMask = pEvent->SelStart();
if (wstrValue.length() - (pEvent->SelEnd()-pEvent->SelStart()) + wChange.length() > (FX_DWORD)wstrMask.GetLength())
{
Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str());
- pEvent->Rc() = false;
- return true;
+ pEvent->Rc() = FALSE;
+ return TRUE;
}
if (iIndexMask >= wstrMask.GetLength() && (!wChange.empty()))
{
Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str());
- pEvent->Rc() = false;
- return true;
+ pEvent->Rc() = FALSE;
+ return TRUE;
}
for (std::wstring::iterator it = wChange.begin(); it != wChange.end(); it++)
@@ -1864,8 +1864,8 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
if (iIndexMask >= wstrMask.GetLength())
{
Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG).c_str());
- pEvent->Rc() = false;
- return true;
+ pEvent->Rc() = FALSE;
+ return TRUE;
}
wchar_t w_Mask = wstrMask[iIndexMask];
if (!isReservedMaskChar(w_Mask))
@@ -1875,19 +1875,19 @@ bool CJS_PublicMethods::AFSpecial_KeystrokeEx(IFXJS_Context* cc, const CJS_Param
wchar_t w_Change = *it;
if (!maskSatisfied(w_Change,w_Mask))
{
- pEvent->Rc() = false;
- return true;
+ pEvent->Rc() = FALSE;
+ return TRUE;
}
iIndexMask++;
}
wideChange = wChange.c_str();
- return true;
+ return TRUE;
}
//function AFSpecial_Keystroke(psf)
-bool CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -1899,14 +1899,14 @@ bool CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Paramet
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
std::string cFormat;
int iIndex = params[0].ToInt();
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
//CJS_Value val = pEvent->Value();
CFX_WideString& val = pEvent->Value();
std::string strSrc = CFX_ByteString::FromUnicode(val).c_str();
@@ -1946,7 +1946,7 @@ bool CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Paramet
return AFSpecial_KeystrokeEx(cc,params2,vRet,sError);
}
-bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1956,7 +1956,7 @@ bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& p
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_WideString swValue;
@@ -1966,7 +1966,7 @@ bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& p
if (pEventHandler->WillCommit())
{
vRet = swValue.c_str();
- return true;
+ return TRUE;
}
CFX_WideString prefix,postfix;
@@ -1983,10 +1983,10 @@ bool CJS_PublicMethods::AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& p
vRet = (prefix + pEventHandler->Change() + postfix).c_str();
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -1994,13 +1994,13 @@ bool CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& p
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_WideString sValue = params[0].ToCFXWideString();
CFX_WideString sFormat = params[1].ToCFXWideString();
- bool bWrongFormat = false;
+ FX_BOOL bWrongFormat = FALSE;
double dDate = MakeRegularDate(sValue,sFormat,bWrongFormat);
if (JS_PortIsNan(dDate))
@@ -2008,14 +2008,14 @@ bool CJS_PublicMethods::AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& p
CFX_WideString swMsg;
swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE).c_str(), sFormat.c_str());
Alert((CJS_Context *)cc, swMsg.c_str());
- return false;
+ return FALSE;
}
vRet = dDate;
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() != 3)
{
@@ -2023,14 +2023,14 @@ bool CJS_PublicMethods::AFSimple(IFXJS_Context* cc, const CJS_Parameters& params
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
vRet = (double)AF_Simple(params[0].ToCFXWideString().c_str(), params[1].ToDouble(), params[2].ToDouble());
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() != 1)
{
@@ -2038,13 +2038,13 @@ bool CJS_PublicMethods::AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& pa
ASSERT(pContext != NULL);
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
vRet = ParseStringToNumber(params[0].ToCFXWideString().c_str());
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
@@ -2054,7 +2054,7 @@ bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Paramete
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CJS_Value params1 = params[1];
@@ -2062,7 +2062,7 @@ bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Paramete
if (!params1.IsArrayObject() && params1.GetType() != VT_string)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CPDFSDK_Document* pReaderDoc = pContext->GetReaderDocument();
@@ -2162,13 +2162,13 @@ bool CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Paramete
if((CJS_EventHandler*)pContext->GetEventHandler()->m_pValue)
((CJS_EventHandler*)pContext->GetEventHandler())->Value() = jsValue.ToCFXWideString();
- return true;
+ return TRUE;
}
/* This function validates the current event to ensure that its value is
** within the specified range. */
-bool CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context *)cc;
ASSERT(pContext != NULL);
@@ -2178,17 +2178,17 @@ bool CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters
if (params.size() != 4)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
if (pEvent->Value().IsEmpty() )
- return true;
+ return TRUE;
double dEentValue = atof(CFX_ByteString::FromUnicode(pEvent->Value()));
- bool bGreaterThan = params[0].ToBool();
+ FX_BOOL bGreaterThan = params[0].ToBool();
double dGreaterThan = params[1].ToDouble();
- bool bLessThan = params[2].ToBool();
+ FX_BOOL bLessThan = params[2].ToBool();
double dLessThan = params[3].ToDouble();
CFX_WideString swMsg;
@@ -2215,12 +2215,12 @@ bool CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters
if (!swMsg.IsEmpty())
{
Alert(pContext, swMsg.c_str());
- pEvent->Rc() = false;
+ pEvent->Rc() = FALSE;
}
- return true;
+ return TRUE;
}
-bool CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = ::GetIsolate(cc);
CJS_Context* pContext = (CJS_Context*)cc;
@@ -2229,7 +2229,7 @@ bool CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& p
if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CJS_Array nums(isolate);
@@ -2269,5 +2269,5 @@ bool CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& p
else
vRet.SetNull();
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index 0f35297485..af329655fd 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -134,10 +134,10 @@ app::~app(void)
m_aTimer.RemoveAll();
}
-bool app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (!vp.IsGetting())
- return false;
+ return FALSE;
CJS_Context* pContext = (CJS_Context *)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
@@ -166,120 +166,120 @@ bool app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
else
vp.SetNull();
- return true;
+ return TRUE;
}
-bool app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
bool bVP;
vp >> bVP;
- m_bCalculate = (bool)bVP;
+ m_bCalculate = (FX_BOOL)bVP;
CJS_Context* pContext = (CJS_Context*)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CJS_Array aDocs(pRuntime->GetIsolate());
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
- pDoc->GetInterForm()->EnableCalculate((bool)m_bCalculate);
+ pDoc->GetInterForm()->EnableCalculate((FX_BOOL)m_bCalculate);
}
else
{
vp << (bool)m_bCalculate;
}
- return true;
+ return TRUE;
}
-bool app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_NUM_FORMSVERSION;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << L"unknown";
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_STR_VIEWERVARIATION;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_STR_VIEWERVERSION;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool app::platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_STR_PLATFORM;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool app::language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsGetting())
{
vp << JS_STR_LANGUANGE;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
//creates a new fdf object that contains no data
//comment: need reader support
//note:
//CFDF_Document * CPDFDoc_Environment::NewFDF();
-bool app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
//opens a specified pdf document and returns its document object
//comment:need reader support
//note: as defined in js reference, the proto of this function's fourth parmeters, how old an fdf document while do not show it.
//CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv);
-bool app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize < 1)
- return false;
+ return FALSE;
CFX_WideString swMsg = L"";
CFX_WideString swTitle = L"";
@@ -336,7 +336,7 @@ bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet
}
else if (params[0].GetType() == VT_boolean)
{
- bool bGet = params[0].ToBool();
+ FX_BOOL bGet = params[0].ToBool();
if (bGet)
swMsg = L"true";
else
@@ -354,7 +354,7 @@ bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet
{
if (params[0].GetType() == VT_boolean)
{
- bool bGet = params[0].ToBool();
+ FX_BOOL bGet = params[0].ToBool();
if (bGet)
swMsg = L"true";
else
@@ -386,11 +386,11 @@ bool app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet
vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc), swMsg.c_str(), swTitle.c_str(), iType, iIcon);
pRuntime->EndBlock();
- return true;
+ return TRUE;
}
-bool app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() == 1)
{
@@ -398,42 +398,42 @@ bool app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet,
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp();
pEnv->JS_appBeep(params[0].ToInt());
- return true;
+ return TRUE;
}
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
-bool app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() > 2 || params.size() == 0)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_WideString script = params.size() > 0 ? params[0].ToCFXWideString() : L"";
if (script.IsEmpty())
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE);
- return true;
+ return TRUE;
}
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
@@ -463,15 +463,15 @@ bool app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value
vRet = pRetObj;
- return true;
+ return TRUE;
}
-bool app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() > 2 || params.size() == 0)
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CJS_Context* pContext = (CJS_Context*)cc;
@@ -483,7 +483,7 @@ bool app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
if (script.IsEmpty())
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE);
- return true;
+ return TRUE;
}
FX_DWORD dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000;
@@ -512,10 +512,10 @@ bool app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
vRet = pRetObj;
- return true;
+ return TRUE;
}
-bool app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -525,7 +525,7 @@ bool app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
if (params.size() != 1)
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
if (params[0].GetType() == VT_fxobject)
@@ -560,10 +560,10 @@ bool app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Valu
}
}
- return true;
+ return TRUE;
}
-bool app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -573,7 +573,7 @@ bool app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
if (params.size() != 1)
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
if (params[0].GetType() == VT_fxobject)
@@ -608,12 +608,12 @@ bool app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
}
}
- return true;
+ return TRUE;
}
-bool app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
void app::TimerProc(CJS_Timer* pTimer)
@@ -651,24 +651,24 @@ void app::RunJsScript(CJS_Runtime* pRuntime,const CFX_WideString& wsScript)
}
}
-bool app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Not supported.
- return true;
+ return TRUE;
}
-bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
v8::Isolate* isolate = GetIsolate(cc);
- bool bUI = true;
+ FX_BOOL bUI = TRUE;
CFX_WideString cTo = L"";
CFX_WideString cCc = L"";
CFX_WideString cBcc = L"";
@@ -676,7 +676,7 @@ bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
CFX_WideString cMsg = L"";
if (params.size() < 1)
- return false;
+ return FALSE;
if (params[0].GetType() == VT_object)
{
@@ -701,7 +701,7 @@ bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
cMsg = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWideString();
} else {
if (params.size() < 2)
- return false;
+ return FALSE;
bUI = params[0].ToBool();
cTo = params[1].ToCFXWideString();
@@ -726,16 +726,16 @@ bool app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
pApp->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
pRuntime->EndBlock();
- return false;
+ return FALSE;
}
-bool app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
@@ -746,24 +746,24 @@ bool app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
vp<<m_bRuntimeHighLight;
}
- return true;
+ return TRUE;
}
-bool app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath)
@@ -792,17 +792,17 @@ CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath)
return sRet;
}
-bool app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CFX_WideString swQuestion = L"";
CFX_WideString swLabel = L"";
@@ -873,7 +873,7 @@ bool app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
MAX_INPUT_BYTES);
if (nLengthBytes <= 0) {
vRet.SetNull();
- return false;
+ return FALSE;
}
nLengthBytes = std::min(nLengthBytes, MAX_INPUT_BYTES);
@@ -881,15 +881,15 @@ bool app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& v
CFX_WideString::FromUTF16LE((unsigned short*)pBuff.get(),
nLengthBytes / sizeof(unsigned short));
vRet = ret_string.c_str();
- return true;
+ return TRUE;
}
-bool app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return false;
+ return FALSE;
}
-bool app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp
index 7c3c1374b2..a2bbadcd51 100644
--- a/fpdfsdk/src/javascript/color.cpp
+++ b/fpdfsdk/src/javascript/color.cpp
@@ -155,7 +155,7 @@ void color::ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color)
}
#define JS_IMPLEMENT_COLORPROP(prop, var)\
-bool color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)\
+FX_BOOL color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)\
{\
CJS_Context* pContext = (CJS_Context*)cc;\
v8::Isolate* isolate = pContext->GetJSRuntime()->GetIsolate();\
@@ -168,10 +168,10 @@ bool color::prop(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)\
else\
{\
CJS_Array array(isolate);\
- if (!vp.ConvertToArray(array)) return false;\
+ if (!vp.ConvertToArray(array)) return FALSE;\
ConvertArrayToPWLColor(array, var);\
}\
- return true;\
+ return TRUE;\
}
JS_IMPLEMENT_COLORPROP(transparent, m_crTransparent)
@@ -187,13 +187,13 @@ JS_IMPLEMENT_COLORPROP(dkGray, m_crDKGray)
JS_IMPLEMENT_COLORPROP(gray, m_crGray)
JS_IMPLEMENT_COLORPROP(ltGray, m_crLTGray)
-bool color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
- if (iSize < 2) return false;
+ if (iSize < 2) return FALSE;
CJS_Array aSource(isolate);
- if (!params[0].ConvertToArray(aSource)) return false;
+ if (!params[0].ConvertToArray(aSource)) return FALSE;
CPWL_Color crSource;
ConvertArrayToPWLColor(aSource, crSource);
@@ -224,18 +224,18 @@ bool color::convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
ConvertPWLColorToArray(crDest, aDest);
vRet = aDest;
- return true;
+ return TRUE;
}
-bool color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
- if (params.size() < 2) return false;
+ if (params.size() < 2) return FALSE;
CJS_Array array1(isolate), array2(isolate);
- if (!params[0].ConvertToArray(array1)) return false;
- if (!params[1].ConvertToArray(array2)) return false;
+ if (!params[0].ConvertToArray(array1)) return FALSE;
+ if (!params[1].ConvertToArray(array2)) return FALSE;
CPWL_Color color1;
CPWL_Color color2;
@@ -246,6 +246,6 @@ bool color::equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
color1.ConvertColorType(color2.nColorType);
vRet = color1 == color2;
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp
index 4d8067110a..ed9b1fbc56 100644
--- a/fpdfsdk/src/javascript/console.cpp
+++ b/fpdfsdk/src/javascript/console.cpp
@@ -38,28 +38,28 @@ console::~console()
{
}
-bool console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL console::clear(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL console::hide(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
-bool console::println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL console::println(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
if (params.size() < 1)
{
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
-bool console::show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL console::show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp
index ee73e42311..f57b1fb607 100644
--- a/fpdfsdk/src/javascript/event.cpp
+++ b/fpdfsdk/src/javascript/event.cpp
@@ -56,7 +56,7 @@ event::~event(void)
{
}
-bool event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -73,12 +73,12 @@ bool event::change(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp << wChange;
}
- return true;
+ return TRUE;
}
-bool event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -86,12 +86,12 @@ bool event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pEvent != NULL);
vp << pEvent->ChangeEx();
- return true;
+ return TRUE;
}
-bool event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -99,10 +99,10 @@ bool event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
ASSERT(pEvent != NULL);
vp << pEvent->CommitKey();
- return true;
+ return TRUE;
}
-bool event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -110,18 +110,18 @@ bool event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
ASSERT(pEvent != NULL);
if (!vp.IsGetting() && wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
- return false;
+ return FALSE;
if (pEvent->FieldFull())
- vp << true;
+ vp << TRUE;
else
- vp << false;
- return true;
+ vp << FALSE;
+ return TRUE;
}
-bool event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -129,15 +129,15 @@ bool event::keyDown(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
ASSERT(pEvent != NULL);
if (pEvent->KeyDown())
- vp << true;
+ vp << TRUE;
else
- vp << false;
- return true;
+ vp << FALSE;
+ return TRUE;
}
-bool event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -145,15 +145,15 @@ bool event::modifier(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(pEvent != NULL);
if (pEvent->Modifier())
- vp << true;
+ vp << TRUE;
else
- vp << false;
- return true;
+ vp << FALSE;
+ return TRUE;
}
-bool event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -161,17 +161,17 @@ bool event::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
vp << pEvent->Name();
- return true;
+ return TRUE;
}
-bool event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
CJS_EventHandler* pEvent = pContext->GetEventHandler();
ASSERT(pEvent != NULL);
- bool &bRc = pEvent->Rc();
+ FX_BOOL &bRc = pEvent->Rc();
if (vp.IsSetting())
{
vp>>bRc;
@@ -180,12 +180,12 @@ bool event::rc(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp<<bRc;
}
- return true;
+ return TRUE;
}
-bool event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
if (vp.IsSetting())
{
}
@@ -193,12 +193,12 @@ bool event::richChange(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
{
;
}
- return true;
+ return TRUE;
}
-bool event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
if (vp.IsSetting())
{
}
@@ -206,13 +206,13 @@ bool event::richChangeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
{
;
}
- return true;
+ return TRUE;
}
-bool event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- return true;
+ return TRUE;
if (vp.IsSetting())
{
}
@@ -220,10 +220,10 @@ bool event::richValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
{
;
}
- return true;
+ return TRUE;
}
-bool event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -232,7 +232,7 @@ bool event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
{
- return true;
+ return TRUE;
}
int &iSelEnd = pEvent->SelEnd();
@@ -244,10 +244,10 @@ bool event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp << iSelEnd;
}
- return true;
+ return TRUE;
}
-bool event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -256,7 +256,7 @@ bool event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
{
- return true;
+ return TRUE;
}
int &iSelStart = pEvent->SelStart();
if (vp.IsSetting())
@@ -267,12 +267,12 @@ bool event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
vp << iSelStart;
}
- return true;
+ return TRUE;
}
-bool event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -280,15 +280,15 @@ bool event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
if (pEvent->Shift())
- vp << true;
+ vp << TRUE;
else
- vp << false;
- return true;
+ vp << FALSE;
+ return TRUE;
}
-bool event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -296,12 +296,12 @@ bool event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
vp << pEvent->Source()->GetJSObject();
- return true;
+ return TRUE;
}
-bool event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -309,12 +309,12 @@ bool event::target(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
vp<<pEvent->Target_Field()->GetJSObject();
- return true;
+ return TRUE;
}
-bool event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -322,12 +322,12 @@ bool event::targetName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ASSERT(pEvent != NULL);
vp << pEvent->TargetName();
- return true;
+ return TRUE;
}
-bool event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -335,10 +335,10 @@ bool event::type(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
vp << pEvent->Type();
- return true;
+ return TRUE;
}
-bool event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -346,9 +346,9 @@ bool event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
ASSERT(pEvent != NULL);
if (wcscmp((const wchar_t*)pEvent->Type(),L"Field") != 0)
- return false;
+ return FALSE;
if(!pEvent->m_pValue)
- return false;
+ return FALSE;
CFX_WideString & val = pEvent->Value();
if (vp.IsSetting())
{
@@ -358,12 +358,12 @@ bool event::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
vp << val;
}
- return true;
+ return TRUE;
}
-bool event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return false;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -371,9 +371,9 @@ bool event::willCommit(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
ASSERT(pEvent != NULL);
if (pEvent->WillCommit())
- vp << true;
+ vp << TRUE;
else
- vp << false;
- return true;
+ vp << FALSE;
+ return TRUE;
}
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index 98a3cd6cb5..6965c8c884 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -96,7 +96,7 @@ END_JS_STATIC_METHOD()
IMPLEMENT_SPECIAL_JS_CLASS(CJS_Global, global_alternate, global);
-bool CJS_Global::InitInstance(IFXJS_Context* cc)
+FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc)
{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
@@ -106,7 +106,7 @@ bool CJS_Global::InitInstance(IFXJS_Context* cc)
pGlobal->Initial(pContext->GetReaderApp());
- return true;
+ return TRUE;
};
global_alternate::global_alternate(CJS_Object* pJSObject)
@@ -128,26 +128,26 @@ void global_alternate::Initial(CPDFDoc_Environment* pApp)
UpdateGlobalPersistentVariables();
}
-bool global_alternate::QueryProperty(const FX_WCHAR* propname)
+FX_BOOL global_alternate::QueryProperty(const FX_WCHAR* propname)
{
return CFX_WideString(propname) != L"setPersistent";
}
-bool global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError)
+FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError)
{
js_global_data* pData = NULL;
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
if (m_mapGlobal.Lookup(sPropName, (void*&)pData))
{
- pData->bDeleted = true;
- return true;
+ pData->bDeleted = TRUE;
+ return TRUE;
}
- return false;
+ return FALSE;
}
-bool global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError)
+FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
@@ -158,34 +158,34 @@ bool global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, C
{
double dData;
vp >> dData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), false);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), FALSE);
}
case VT_boolean:
{
bool bData;
vp >> bData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), false);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), FALSE);
}
case VT_string:
{
CFX_ByteString sData;
vp >> sData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), false);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), FALSE);
}
case VT_object:
{
JSObject pData;
vp >> pData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, false);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
}
case VT_null:
{
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), false);
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), FALSE);
}
case VT_undefined:
{
DelProperty(cc, propname, sError);
- return true;
+ return TRUE;
}
default:
break;
@@ -197,51 +197,51 @@ bool global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, C
if (!m_mapGlobal.Lookup(CFX_ByteString::FromUnicode(propname), pVoid))
{
vp.SetNull();
- return true;
+ return TRUE;
}
if (!pVoid)
{
vp.SetNull();
- return true;
+ return TRUE;
}
js_global_data* pData = (js_global_data*)pVoid;
if (pData->bDeleted)
- return true;
+ return TRUE;
switch (pData->nType)
{
case JS_GLOBALDATA_TYPE_NUMBER:
vp << pData->dData;
- return true;
+ return TRUE;
case JS_GLOBALDATA_TYPE_BOOLEAN:
vp << pData->bData;
- return true;
+ return TRUE;
case JS_GLOBALDATA_TYPE_STRING:
vp << pData->sData;
- return true;
+ return TRUE;
case JS_GLOBALDATA_TYPE_OBJECT:
{
v8::Local<v8::Object> obj = v8::Local<v8::Object>::New(vp.GetIsolate(),pData->pData);
vp << obj;
- return true;
+ return TRUE;
}
case JS_GLOBALDATA_TYPE_NULL:
vp.SetNull();
- return true;
+ return TRUE;
default:
break;
}
}
- return false;
+ return FALSE;
}
-bool global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
CJS_Context* pContext = static_cast<CJS_Context*>(cc);
if (params.size() != 2)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return false;
+ return FALSE;
}
CFX_ByteString sName = params[0].ToCFXByteString();
@@ -252,12 +252,12 @@ bool global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& pa
if (pData && !pData->bDeleted)
{
pData->bPersistent = params[1].ToBool();
- return true;
+ return TRUE;
}
}
sError = JSGetStringFromID(pContext, IDS_STRING_JSNOGLOBAL);
- return false;
+ return FALSE;
}
void global_alternate::UpdateGlobalPersistentVariables()
@@ -480,10 +480,10 @@ void global_alternate::DestroyGlobalPersisitentVariables()
}
-bool global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
+FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent)
{
- if (propname == NULL) return false;
+ if (propname == NULL) return FALSE;
js_global_data* pTemp = NULL;
m_mapGlobal.Lookup(propname, (void*&)pTemp);
@@ -498,7 +498,7 @@ bool global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
pTemp->nType = nType;
}
- pTemp->bDeleted = false;
+ pTemp->bDeleted = FALSE;
switch (nType)
{
@@ -525,10 +525,10 @@ bool global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
case JS_GLOBALDATA_TYPE_NULL:
break;
default:
- return false;
+ return FALSE;
}
- return true;
+ return TRUE;
}
js_global_data* pNewData = NULL;
@@ -575,12 +575,12 @@ bool global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
}
break;
default:
- return false;
+ return FALSE;
}
m_mapGlobal.SetAt(propname, (void*)pNewData);
- return true;
+ return TRUE;
}
FXJSVALUETYPE GET_VALUE_TYPE(v8::Local<v8::Value> p)
diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp
index 820e7301d3..1478feb1fa 100644
--- a/fpdfsdk/src/javascript/report.cpp
+++ b/fpdfsdk/src/javascript/report.cpp
@@ -36,14 +36,14 @@ Report::~Report()
}
-bool Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Report::writeText(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
-bool Report::save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL Report::save(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
// Unsafe, not supported.
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index 21a7cb83ff..4083ed58da 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -98,7 +98,7 @@ const stru_TbConvert fcTable[] = {
int util::ParstDataType(std::wstring* sFormat)
{
- bool bPercent = false;
+ bool bPercent = FALSE;
for (size_t i = 0; i < sFormat->length(); ++i)
{
wchar_t c = (*sFormat)[i];
@@ -136,11 +136,11 @@ int util::ParstDataType(std::wstring* sFormat)
return -1;
}
-bool util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize < 1)
- return false;
+ return FALSE;
std::wstring c_ConvChar(params[0].ToCFXWideString().c_str());
std::vector<std::wstring> c_strConvers;
int iOffset = 0;
@@ -198,16 +198,16 @@ bool util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
c_strResult.erase(c_strResult.begin());
vRet = c_strResult.c_str();
- return true;
+ return TRUE;
}
-bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
if (iSize < 2)
- return false;
+ return FALSE;
CJS_Value p1(isolate);
p1 = params[0];
@@ -217,13 +217,13 @@ bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
if (!p2.ConvertToDate(jsDate))
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT1);
- return false;
+ return FALSE;
}
if (!jsDate.IsValidDate())
{
sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT2);
- return false;
+ return FALSE;
}
if (p1.GetType() == VT_number)
@@ -261,11 +261,11 @@ bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
jsDate.GetSeconds());
break;
default:
- return false;
+ return FALSE;
}
vRet = swResult.c_str();
- return true;
+ return TRUE;
}
if (p1.GetType() == VT_string)
{
@@ -279,7 +279,7 @@ bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
if (bXFAPicture)
{
- return false; //currently, it doesn't support XFAPicture.
+ return FALSE; //currently, it doesn't support XFAPicture.
}
int iIndex;
@@ -355,9 +355,9 @@ bool util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
cFormat = buf;
vRet = cFormat.c_str();
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPicture, std::wstring &cPurpose)
@@ -450,11 +450,11 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur
cPurpose = cFormat;
}
-bool util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize<2)
- return false;
+ return FALSE;
CFX_WideString sFormat = params[0].ToCFXWideString();
CFX_WideString sSource = params[1].ToCFXWideString();
std::string cFormat = CFX_ByteString::FromUnicode(sFormat).c_str();
@@ -462,7 +462,7 @@ bool util::printx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vR
std::string cDest;
printx(cFormat,cSource,cDest);
vRet = cDest.c_str();
- return true;
+ return TRUE;
}
void util::printx(const std::string &cFormat,const std::string &cSource2,std::string &cPurpose)
@@ -564,19 +564,19 @@ void util::printx(const std::string &cFormat,const std::string &cSource2,std::st
}
}
-bool util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
v8::Isolate* isolate = GetIsolate(cc);
int iSize = params.size();
if (iSize < 2)
- return false;
+ return FALSE;
CFX_WideString sFormat = params[0].ToCFXWideString();
CFX_WideString sDate = params[1].ToCFXWideString();
double dDate = JS_GetDateTime();
if (sDate.GetLength() > 0)
{
- bool bWrongFormat = false;
+ FX_BOOL bWrongFormat = FALSE;
dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat);
}
@@ -590,7 +590,7 @@ bool util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRe
vRet.SetNull();
}
- return true;
+ return TRUE;
}
int64_t FX_atoi64(const char *nptr)
@@ -618,15 +618,15 @@ int64_t FX_atoi64(const char *nptr)
return sign == '-' ? -total : total;
}
-bool util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
+FX_BOOL util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
int iSize = params.size();
if (iSize == 0)
- return false;
+ return FALSE;
int nByte = params[0].ToInt();
unsigned char cByte = (unsigned char)nByte;
CFX_WideString csValue;
csValue.Format(L"%c", cByte);
vRet = csValue.c_str();
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index e1232803e8..c4811bf096 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -42,7 +42,7 @@ class CJS_ObjDefintion
{
public:
CJS_ObjDefintion(v8::Isolate* isolate, const wchar_t* sObjName, FXJSOBJTYPE eObjType, LP_CONSTRUCTOR pConstructor, LP_DESTRUCTOR pDestructor):
- objName(sObjName), objType(eObjType), m_pConstructor(pConstructor), m_pDestructor(pDestructor),m_bSetAsGlobalObject(false)
+ objName(sObjName), objType(eObjType), m_pConstructor(pConstructor), m_pDestructor(pDestructor),m_bSetAsGlobalObject(FALSE)
{
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
@@ -54,7 +54,7 @@ public:
//Document as the global object.
if(FXSYS_wcscmp(sObjName, L"Document") == 0)
{
- m_bSetAsGlobalObject = true;
+ m_bSetAsGlobalObject = TRUE;
}
}
@@ -68,7 +68,7 @@ public:
FXJSOBJTYPE objType;
LP_CONSTRUCTOR m_pConstructor;
LP_DESTRUCTOR m_pDestructor;
- bool m_bSetAsGlobalObject;
+ FX_BOOL m_bSetAsGlobalObject;
v8::Global<v8::ObjectTemplate> m_objTemplate;
v8::Global<v8::Object> m_StaticObj;
diff --git a/fpdfsdk/src/pdfwindow/PWL_Button.cpp b/fpdfsdk/src/pdfwindow/PWL_Button.cpp
index 1712bd24fc..84962285c4 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Button.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Button.cpp
@@ -12,7 +12,7 @@
/* ------------------------------- CPWL_Button ---------------------------------- */
CPWL_Button::CPWL_Button() :
- m_bMouseDown(false)
+ m_bMouseDown(FALSE)
{
}
@@ -31,23 +31,23 @@ void CPWL_Button::OnCreate(PWL_CREATEPARAM & cp)
cp.eCursorType = FXCT_HAND;
}
-bool CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point, nFlag);
- m_bMouseDown = true;
+ m_bMouseDown = TRUE;
SetCapture();
- return true;
+ return TRUE;
}
-bool CPWL_Button::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Button::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point, nFlag);
ReleaseCapture();
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
- return true;
+ return TRUE;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
index deccf06449..84a8b3d186 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
@@ -16,7 +16,7 @@
//////////////////////////////////////////////////////////////////////
CPWL_Caret::CPWL_Caret() :
- m_bFlash(false),
+ m_bFlash(FALSE),
m_ptHead(0,0),
m_ptFoot(0,0),
m_fWidth(0.4f),
@@ -135,7 +135,7 @@ CPDF_Rect CPWL_Caret::GetCaretRect() const
m_ptHead.y);
}
-void CPWL_Caret::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
+void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
{
if (bVisible)
{
@@ -147,9 +147,9 @@ void CPWL_Caret::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_P
m_ptHead = ptHead;
m_ptFoot = ptFoot;
- m_bFlash = true;
- //Move(GetCaretRect(),false,true);
- Move(m_rcInvalid, false, true);
+ m_bFlash = TRUE;
+ //Move(GetCaretRect(),FALSE,TRUE);
+ Move(m_rcInvalid, FALSE, TRUE);
}
}
else
@@ -160,11 +160,11 @@ void CPWL_Caret::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_P
EndTimer();
BeginTimer(PWL_CARET_FLASHINTERVAL);
- CPWL_Wnd::SetVisible(true);
- m_bFlash = true;
+ CPWL_Wnd::SetVisible(TRUE);
+ m_bFlash = TRUE;
- //Move(GetCaretRect(),false,true);
- Move(m_rcInvalid, false, true);
+ //Move(GetCaretRect(),FALSE,TRUE);
+ Move(m_rcInvalid, FALSE, TRUE);
}
}
else
@@ -172,11 +172,11 @@ void CPWL_Caret::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_P
m_ptHead = CPDF_Point(0, 0);
m_ptFoot = CPDF_Point(0, 0);
- m_bFlash = false;
+ m_bFlash = FALSE;
if (IsVisible())
{
EndTimer();
- CPWL_Wnd::SetVisible(false);
+ CPWL_Wnd::SetVisible(FALSE);
}
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
index 6c5dd5516e..f5c8a815d4 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
@@ -22,14 +22,14 @@
/* ---------------------------- CPWL_CBListBox ---------------------------- */
-bool CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
if (ClientHitTest(point))
{
@@ -38,23 +38,23 @@ bool CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pParent->OnNotify(this,PNM_LBUTTONUP,0,PWL_MAKEDWORD(point.x,point.y));
}
- bool bExit = false;
- OnNotifySelChanged(false,bExit, nFlag);
- if (bExit) return false;
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(FALSE,bExit, nFlag);
+ if (bExit) return FALSE;
}
}
- return true;
+ return TRUE;
}
-bool CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFlag)
+FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
{
- if (!m_pList) return false;
+ if (!m_pList) return FALSE;
switch (nChar)
{
default:
- return false;
+ return FALSE;
case FWL_VKEY_Up:
case FWL_VKEY_Down:
case FWL_VKEY_Home:
@@ -88,25 +88,25 @@ bool CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFl
break;
}
- OnNotifySelChanged(true,bExit, nFlag);
+ OnNotifySelChanged(TRUE,bExit, nFlag);
- return true;
+ return TRUE;
}
-bool CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, bool & bExit, FX_DWORD nFlag)
+FX_BOOL CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
{
- if (!m_pList) return false;
+ if (!m_pList) return FALSE;
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return false;
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow())
{
pComboBox->SetSelectText();
}
- OnNotifySelChanged(true,bExit,nFlag);
+ OnNotifySelChanged(TRUE,bExit,nFlag);
- return true;
+ return TRUE;
}
/* ---------------------------- CPWL_CBButton ---------------------------- */
@@ -177,7 +177,7 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
}
}
-bool CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -188,16 +188,16 @@ bool CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
pParent->OnNotify(this,PNM_LBUTTONDOWN,0,PWL_MAKEDWORD(point.x,point.y));
}
- return true;
+ return TRUE;
}
-bool CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point, nFlag);
ReleaseCapture();
- return true;
+ return TRUE;
}
/* ---------------------------- CPWL_ComboBox ---------------------------- */
@@ -205,7 +205,7 @@ bool CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CPWL_ComboBox::CPWL_ComboBox() : m_pEdit(NULL),
m_pButton(NULL),
m_pList(NULL),
- m_bPopup(false),
+ m_bPopup(FALSE),
m_nPopupWhere(0),
m_nSelectItem(-1),
m_pFillerNotify(NULL)
@@ -231,7 +231,7 @@ void CPWL_ComboBox::SetFocus()
void CPWL_ComboBox::KillFocus()
{
- SetPopup(false);
+ SetPopup(FALSE);
CPWL_Wnd::KillFocus();
}
@@ -439,15 +439,15 @@ void CPWL_ComboBox::RePosChildWnd()
}
if (m_pButton)
- m_pButton->Move(rcButton,true,false);
+ m_pButton->Move(rcButton,TRUE,FALSE);
if (m_pEdit)
- m_pEdit->Move(rcEdit,true,false);
+ m_pEdit->Move(rcEdit,TRUE,FALSE);
if (m_pList)
{
- m_pList->SetVisible(true);
- m_pList->Move(rcList,true,false);
+ m_pList->SetVisible(TRUE);
+ m_pList->Move(rcList,TRUE,FALSE);
m_pList->ScrollToListItem(m_nSelectItem);
}
}
@@ -461,7 +461,7 @@ void CPWL_ComboBox::RePosChildWnd()
rcButton.left = rcClient.left;
if (m_pButton)
- m_pButton->Move(rcButton,true,false);
+ m_pButton->Move(rcButton,TRUE,FALSE);
CPDF_Rect rcEdit = rcClient;
rcEdit.right = rcButton.left - 1.0f;
@@ -473,10 +473,10 @@ void CPWL_ComboBox::RePosChildWnd()
rcEdit.right = rcEdit.left;
if (m_pEdit)
- m_pEdit->Move(rcEdit,true,false);
+ m_pEdit->Move(rcEdit,TRUE,FALSE);
if (m_pList)
- m_pList->SetVisible(false);
+ m_pList->SetVisible(FALSE);
}
}
@@ -491,7 +491,7 @@ CPDF_Rect CPWL_ComboBox::GetFocusRect() const
return CPDF_Rect();
}
-void CPWL_ComboBox::SetPopup(bool bPopup)
+void CPWL_ComboBox::SetPopup(FX_BOOL bPopup)
{
if (!m_pList) return;
if (bPopup == m_bPopup) return;
@@ -528,21 +528,21 @@ void CPWL_ComboBox::SetPopup(bool bPopup)
}
m_nPopupWhere = nWhere;
- Move(rcWindow, true, true);
+ Move(rcWindow, TRUE, TRUE);
}
}
}
else
{
m_bPopup = bPopup;
- Move(m_rcOldWindow, true, true);
+ Move(m_rcOldWindow, TRUE, TRUE);
}
}
-bool CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (!m_pList) return false;
- if (!m_pEdit) return false;
+ if (!m_pList) return FALSE;
+ if (!m_pEdit) return FALSE;
m_nSelectItem = -1;
@@ -551,47 +551,47 @@ bool CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
case FWL_VKEY_Up:
if (m_pList->GetCurSel() > 0)
{
- bool bExit = false;
+ FX_BOOL bExit = FALSE;
if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag))
{
- if (bExit) return false;
+ if (bExit) return FALSE;
SetSelectText();
}
}
- return true;
+ return TRUE;
case FWL_VKEY_Down:
if (m_pList->GetCurSel() < m_pList->GetCount() - 1)
{
- bool bExit = false;
+ FX_BOOL bExit = FALSE;
if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag))
{
- if (bExit) return false;
+ if (bExit) return FALSE;
SetSelectText();
}
}
- return true;
+ return TRUE;
}
if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
return m_pEdit->OnKeyDown(nChar,nFlag);
- return false;
+ return FALSE;
}
-bool CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
if (!m_pList)
- return false;
+ return FALSE;
if (!m_pEdit)
- return false;
+ return FALSE;
m_nSelectItem = -1;
if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
return m_pEdit->OnChar(nChar,nFlag);
- bool bExit = false;
- return m_pList->OnCharWithExit(nChar,bExit,nFlag) ? bExit : false;
+ FX_BOOL bExit = FALSE;
+ return m_pList->OnCharWithExit(nChar,bExit,nFlag) ? bExit : FALSE;
}
void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -613,7 +613,7 @@ void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
SetSelectText();
SelectAll();
m_pEdit->SetFocus();
- SetPopup(false);
+ SetPopup(FALSE);
return;
}
}
@@ -622,7 +622,7 @@ void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
}
-bool CPWL_ComboBox::IsPopup() const
+FX_BOOL CPWL_ComboBox::IsPopup() const
{
return m_bPopup;
}
@@ -637,7 +637,7 @@ void CPWL_ComboBox::SetSelectText()
m_nSelectItem = m_pList->GetCurSel();
}
-bool CPWL_ComboBox::IsModified() const
+FX_BOOL CPWL_ComboBox::IsModified() const
{
return m_pEdit->IsModified();
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index 303ae963f4..58d8a79da1 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
@@ -19,14 +19,14 @@
CPWL_Edit::CPWL_Edit() : m_pFillerNotify(NULL),
m_pSpellCheck(NULL),
- m_bFocus(false)
+ m_bFocus(FALSE)
{
m_pFormFiller = NULL;
}
CPWL_Edit::~CPWL_Edit()
{
- ASSERT(m_bFocus == false);
+ ASSERT(m_bFocus == FALSE);
}
CFX_ByteString CPWL_Edit::GetClassName() const
@@ -49,7 +49,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText)
if (CXML_Element * pXML = CXML_Element::Parse(sValue.c_str(), sValue.GetLength()))
{
int32_t nCount = pXML->CountChildren();
- bool bFirst = true;
+ FX_BOOL bFirst = TRUE;
swText.Empty();
@@ -67,7 +67,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText)
swSection += pSubElement->GetContent(j);
}
- if (bFirst)bFirst = false;
+ if (bFirst)bFirst = FALSE;
else
swText += FWL_VKEY_Return;
swText += swSection;
@@ -90,7 +90,7 @@ void CPWL_Edit::RePosChildWnd()
rcWindow.bottom,
rcWindow.right + PWL_SCROLLBAR_WIDTH,
rcWindow.top);
- pVSB->Move(rcVScroll, true, false);
+ pVSB->Move(rcVScroll, TRUE, FALSE);
}
if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW))
@@ -114,39 +114,39 @@ CPDF_Rect CPWL_Edit::GetClientRect() const
return rcClient;
}
-void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, bool bPaint/* = true*/)
+void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, FX_BOOL bPaint/* = TRUE*/)
{
m_pEdit->SetAlignmentH((int32_t)nFormat, bPaint);
}
-void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, bool bPaint/* = true*/)
+void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, FX_BOOL bPaint/* = TRUE*/)
{
m_pEdit->SetAlignmentV((int32_t)nFormat, bPaint);
}
-bool CPWL_Edit::CanSelectAll() const
+FX_BOOL CPWL_Edit::CanSelectAll() const
{
return GetSelectWordRange() != m_pEdit->GetWholeWordRange();
}
-bool CPWL_Edit::CanClear() const
+FX_BOOL CPWL_Edit::CanClear() const
{
return !IsReadOnly() && m_pEdit->IsSelected();
}
-bool CPWL_Edit::CanCopy() const
+FX_BOOL CPWL_Edit::CanCopy() const
{
return !HasFlag(PES_PASSWORD) && !HasFlag(PES_NOREAD) && m_pEdit->IsSelected();
}
-bool CPWL_Edit::CanCut() const
+FX_BOOL CPWL_Edit::CanCut() const
{
return CanCopy() && !IsReadOnly();
}
-bool CPWL_Edit::CanPaste() const
+FX_BOOL CPWL_Edit::CanPaste() const
{
- if (IsReadOnly()) return false;
+ if (IsReadOnly()) return FALSE;
CFX_WideString swClipboard;
if (IFX_SystemHandler* pSH = GetSystemHandler())
@@ -175,13 +175,13 @@ void CPWL_Edit::PasteText()
if (m_pFillerNotify)
{
- bool bRC = true;
- bool bExit = false;
+ FX_BOOL bRC = TRUE;
+ FX_BOOL bExit = FALSE;
CFX_WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = 0;
GetSel(nSelStart, nSelEnd);
- m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), 0 , swClipboard, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, 0);
+ m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), 0 , swClipboard, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, 0);
if (!bRC) return;
if (bExit) return;
}
@@ -194,8 +194,8 @@ void CPWL_Edit::PasteText()
if (m_pFillerNotify)
{
- bool bExit = false;
- m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,0);
+ FX_BOOL bExit = FALSE;
+ m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,0);
if (bExit) return;
}
}
@@ -227,52 +227,52 @@ void CPWL_Edit::OnCreated()
m_rcOldWindow = GetWindowRect();
m_pEdit->SetOprNotify(this);
- m_pEdit->EnableOprNotify(true);
+ m_pEdit->EnableOprNotify(TRUE);
}
void CPWL_Edit::SetParamByFlag()
{
if (HasFlag(PES_RIGHT))
{
- m_pEdit->SetAlignmentH(2, false);
+ m_pEdit->SetAlignmentH(2, FALSE);
}
else if (HasFlag(PES_MIDDLE))
{
- m_pEdit->SetAlignmentH(1, false);
+ m_pEdit->SetAlignmentH(1, FALSE);
}
else
{
- m_pEdit->SetAlignmentH(0, false);
+ m_pEdit->SetAlignmentH(0, FALSE);
}
if (HasFlag(PES_BOTTOM))
{
- m_pEdit->SetAlignmentV(2, false);
+ m_pEdit->SetAlignmentV(2, FALSE);
}
else if (HasFlag(PES_CENTER))
{
- m_pEdit->SetAlignmentV(1, false);
+ m_pEdit->SetAlignmentV(1, FALSE);
}
else
{
- m_pEdit->SetAlignmentV(0, false);
+ m_pEdit->SetAlignmentV(0, FALSE);
}
if (HasFlag(PES_PASSWORD))
{
- m_pEdit->SetPasswordChar('*', false);
+ m_pEdit->SetPasswordChar('*', FALSE);
}
- m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), false);
- m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), false);
- m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), false);
- m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), false);
+ m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), FALSE);
+ m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), FALSE);
+ m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), FALSE);
+ m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), FALSE);
m_pEdit->EnableUndo(HasFlag(PES_UNDO));
if (HasFlag(PES_TEXTOVERFLOW))
{
SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
- m_pEdit->SetTextOverflow(true, false);
+ m_pEdit->SetTextOverflow(TRUE, FALSE);
}
else
{
@@ -304,7 +304,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
case PBS_SOLID:
{
sLine << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderColor(),false) << " 2 J 0 j\n";
+ << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n";
for (int32_t i=1;i<nCharArray;i++)
{
@@ -320,7 +320,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
case PBS_DASH:
{
sLine << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderColor(),false) << " 2 J 0 j\n"
+ << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n"
<< "[" << GetBorderDash().nDash << " "
<< GetBorderDash().nGap << "] "
<< GetBorderDash().nPhase << " d\n";
@@ -383,7 +383,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
{
CFX_ByteString sSpellCheck = CPWL_Utils::GetSpellCheckAppStream(m_pEdit, m_pSpellCheck, ptOffset, &wrVisible);
if (sSpellCheck.GetLength() > 0)
- sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,1,0,0),false) << sSpellCheck;
+ sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,1,0,0),FALSE) << sSpellCheck;
}
if (sText.GetLength() > 0)
@@ -487,7 +487,7 @@ IFX_SystemHandler* pSysHandler = GetSystemHandler();
}
}
-bool CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -496,16 +496,16 @@ bool CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown)
InvalidateRect();
- m_bMouseDown = true;
+ m_bMouseDown = TRUE;
SetCapture();
m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return true;
+ return TRUE;
}
-bool CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDblClk(point, nFlag);
@@ -514,7 +514,7 @@ bool CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
m_pEdit->SelectAll();
}
- return true;
+ return TRUE;
}
#define WM_PWLEDIT_UNDO 0x01
@@ -526,16 +526,16 @@ bool CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
#define WM_PWLEDIT_SELECTALL 0x07
#define WM_PWLEDIT_SUGGEST 0x08
-bool CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (m_bMouseDown) return false;
+ if (m_bMouseDown) return FALSE;
CPWL_Wnd::OnRButtonUp(point, nFlag);
- if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return true;
+ if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return TRUE;
IFX_SystemHandler* pSH = GetSystemHandler();
- if (!pSH) return false;
+ if (!pSH) return FALSE;
SetFocus();
@@ -543,7 +543,7 @@ bool CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CFX_WideString swLatin = m_pEdit->GetRangeText(wrLatin);
FX_HMENU hPopup = pSH->CreatePopupMenu();
- if (!hPopup) return false;
+ if (!hPopup) return FALSE;
CFX_ByteStringArray sSuggestWords;
CPDF_Point ptPopup = point;
@@ -587,9 +587,9 @@ bool CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pSH->AppendMenuItem(hPopup, 0, L"");
if (!m_pEdit->CanUndo())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_UNDO, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_UNDO, FALSE);
if (!m_pEdit->CanRedo())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, FALSE);
}
pSH->AppendMenuItem(hPopup, WM_PWLEDIT_CUT,
@@ -603,32 +603,32 @@ bool CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
CFX_WideString swText = pSH->GetClipboardText(GetAttachedHWnd());
if (swText.IsEmpty())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
if (!m_pEdit->IsSelected())
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
}
if (IsReadOnly())
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, false);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
}
if (HasFlag(PES_PASSWORD))
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
}
if (HasFlag(PES_NOREAD))
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, false);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
}
pSH->AppendMenuItem(hPopup, 0, L"");
@@ -637,7 +637,7 @@ bool CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
if (m_pEdit->GetTotalWords() == 0)
{
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, false);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, FALSE);
}
int32_t x, y;
@@ -699,12 +699,12 @@ bool CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
pSH->DestroyMenu(hPopup);
- return true;
+ return TRUE;
}
void CPWL_Edit::OnSetFocus()
{
- SetEditCaret(true);
+ SetEditCaret(TRUE);
if (!IsReadOnly())
{
@@ -712,15 +712,15 @@ void CPWL_Edit::OnSetFocus()
pFocusHandler->OnSetFocus(this);
}
- m_bFocus = true;
+ m_bFocus = TRUE;
}
void CPWL_Edit::OnKillFocus()
{
- ShowVScrollBar(false);
+ ShowVScrollBar(FALSE);
m_pEdit->SelectNone();
- SetCaret(false, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f));
+ SetCaret(FALSE, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f));
SetCharSet(0);
@@ -730,20 +730,20 @@ void CPWL_Edit::OnKillFocus()
pFocusHandler->OnKillFocus(this);
}
- m_bFocus = false;
+ m_bFocus = FALSE;
}
-void CPWL_Edit::SetHorzScale(int32_t nHorzScale, bool bPaint/* = true*/)
+void CPWL_Edit::SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint/* = TRUE*/)
{
m_pEdit->SetHorzScale(nHorzScale, bPaint);
}
-void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, bool bPaint/* = true*/)
+void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint/* = TRUE*/)
{
m_pEdit->SetCharSpace(fCharSpace, bPaint);
}
-void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, bool bPaint/* = true*/)
+void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint/* = TRUE*/)
{
m_pEdit->SetLineLeading(fLineLeading, bPaint);
}
@@ -813,7 +813,7 @@ CPDF_Point CPWL_Edit::GetWordRightBottomPoint(const CPVT_WordPlace& wpWord)
return pt;
}
-bool CPWL_Edit::IsTextFull() const
+FX_BOOL CPWL_Edit::IsTextFull() const
{
return m_pEdit->IsTextFull();
}
@@ -840,7 +840,7 @@ void CPWL_Edit::SetCharArray(int32_t nCharArray)
if (HasFlag(PES_CHARARRAY) && nCharArray > 0)
{
m_pEdit->SetCharArray(nCharArray);
- m_pEdit->SetTextOverflow(true);
+ m_pEdit->SetTextOverflow(TRUE);
if (HasFlag(PWS_AUTOFONTSIZE))
{
@@ -849,7 +849,7 @@ void CPWL_Edit::SetCharArray(int32_t nCharArray)
FX_FLOAT fFontSize = GetCharArrayAutoFontSize(pFontMap->GetPDFFont(0), GetClientRect(), nCharArray);
if (fFontSize > 0.0f)
{
- m_pEdit->SetAutoFontSize(false);
+ m_pEdit->SetAutoFontSize(FALSE);
m_pEdit->SetFontSize(fFontSize);
}
}
@@ -873,7 +873,7 @@ CPDF_Rect CPWL_Edit::GetFocusRect() const
return CPDF_Rect();
}
-void CPWL_Edit::ShowVScrollBar(bool bShow)
+void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow)
{
if (CPWL_ScrollBar * pScroll = GetVScrollBar())
{
@@ -881,35 +881,35 @@ void CPWL_Edit::ShowVScrollBar(bool bShow)
{
if (!pScroll->IsVisible())
{
- pScroll->SetVisible(true);
+ pScroll->SetVisible(TRUE);
CPDF_Rect rcWindow = GetWindowRect();
m_rcOldWindow = rcWindow;
rcWindow.right += PWL_SCROLLBAR_WIDTH;
- Move(rcWindow, true, true);
+ Move(rcWindow, TRUE, TRUE);
}
}
else
{
if (pScroll->IsVisible())
{
- pScroll->SetVisible(false);
- Move(m_rcOldWindow, true, true);
+ pScroll->SetVisible(FALSE);
+ Move(m_rcOldWindow, TRUE, TRUE);
}
}
}
}
-bool CPWL_Edit::IsVScrollBarVisible() const
+FX_BOOL CPWL_Edit::IsVScrollBarVisible() const
{
if (CPWL_ScrollBar * pScroll = GetVScrollBar())
{
return pScroll->IsVisible();
}
- return false;
+ return FALSE;
}
-void CPWL_Edit::EnableSpellCheck(bool bEnabled)
+void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled)
{
if (bEnabled)
AddFlag(PES_SPELLCHECK);
@@ -917,16 +917,16 @@ void CPWL_Edit::EnableSpellCheck(bool bEnabled)
RemoveFlag(PES_SPELLCHECK);
}
-bool CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return true;
+ if (m_bMouseDown) return TRUE;
if (nChar == FWL_VKEY_Delete)
{
if (m_pFillerNotify)
{
- bool bRC = true;
- bool bExit = false;
+ FX_BOOL bRC = TRUE;
+ FX_BOOL bExit = FALSE;
CFX_WideString strChange;
CFX_WideString strChangeEx;
@@ -936,27 +936,27 @@ bool CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
if (nSelStart == nSelEnd)
nSelEnd = nSelStart + 1;
- m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, nFlag);
- if (!bRC) return false;
- if (bExit) return false;
+ m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
+ if (!bRC) return FALSE;
+ if (bExit) return FALSE;
}
}
- bool bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag);
+ FX_BOOL bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag);
if (nChar == FWL_VKEY_Delete)
{
if (m_pFillerNotify)
{
- bool bExit = false;
- m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,nFlag);
- if (bExit) return false;
+ FX_BOOL bExit = FALSE;
+ m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
+ if (bExit) return FALSE;
}
}
//In case of implementation swallow the OnKeyDown event.
if(IsProceedtoOnChar(nChar, nFlag))
- return true;
+ return TRUE;
return bRet;
}
@@ -965,11 +965,11 @@ bool CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
*In case of implementation swallow the OnKeyDown event.
*If the event is swallowed, implementation may do other unexpected things, which is not the control means to do.
*/
-bool CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
+FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
{
- bool bCtrl = IsCTRLpressed(nFlag);
- bool bAlt = IsALTpressed(nFlag);
+ FX_BOOL bCtrl = IsCTRLpressed(nFlag);
+ FX_BOOL bAlt = IsALTpressed(nFlag);
if(bCtrl && !bAlt)
{
//hot keys for edit control.
@@ -980,7 +980,7 @@ bool CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
case 'X':
case 'A':
case 'Z':
- return true;
+ return TRUE;
default:
break;
}
@@ -992,22 +992,22 @@ bool CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
case FWL_VKEY_Back:
case FWL_VKEY_Return:
case FWL_VKEY_Space:
- return true;
+ return TRUE;
default:
break;
}
- return false;
+ return FALSE;
}
-bool CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return true;
+ if (m_bMouseDown) return TRUE;
- bool bRC = true;
- bool bExit = false;
+ FX_BOOL bRC = TRUE;
+ FX_BOOL bExit = FALSE;
- bool bCtrl = IsCTRLpressed(nFlag);
+ FX_BOOL bCtrl = IsCTRLpressed(nFlag);
if (!bCtrl)
{
if (m_pFillerNotify)
@@ -1036,12 +1036,12 @@ bool CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
}
CFX_WideString strChangeEx;
- m_pFillerNotify->OnBeforeKeyStroke(true, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, true, bRC, bExit, nFlag);
+ m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
}
}
- if (!bRC) return true;
- if (bExit) return false;
+ if (!bRC) return TRUE;
+ if (bExit) return FALSE;
if (IFX_Edit_FontMap * pFontMap = GetFontMap())
{
@@ -1052,21 +1052,21 @@ bool CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
SetCharSet(nNewCharSet);
}
}
- bool bRet = CPWL_EditCtrl::OnChar(nChar,nFlag);
+ FX_BOOL bRet = CPWL_EditCtrl::OnChar(nChar,nFlag);
if (!bCtrl)
{
if (m_pFillerNotify)
{
- m_pFillerNotify->OnAfterKeyStroke(true, GetAttachedData(), bExit,nFlag);
- if (bExit) return false;
+ m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
+ if (bExit) return FALSE;
}
}
return bRet;
}
-bool CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
if (HasFlag(PES_MULTILINE))
{
@@ -1082,10 +1082,10 @@ bool CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nF
}
SetScrollPos(ptScroll);
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void CPWL_Edit::OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
@@ -1205,22 +1205,22 @@ CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1, const CPVT
CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPDF_Point& point) const
{
- return GetSameWordsRange(m_pEdit->SearchWordPlace(point), true, false);
+ return GetSameWordsRange(m_pEdit->SearchWordPlace(point), TRUE, FALSE);
}
CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPVT_WordPlace & place) const
{
- return GetSameWordsRange(place, true, false);
+ return GetSameWordsRange(place, TRUE, FALSE);
}
CPVT_WordRange CPWL_Edit::GetArabicWordsRange(const CPVT_WordPlace & place) const
{
- return GetSameWordsRange(place, false, true);
+ return GetSameWordsRange(place, FALSE, TRUE);
}
#define PWL_ISARABICWORD(word) ((word >= 0x0600 && word <= 0x06FF) || (word >= 0xFB50 && word <= 0xFEFC))
-CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, bool bLatin, bool bArabic) const
+CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const
{
CPVT_WordRange range;
diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
index 11e1fe7d37..0d14587f66 100644
--- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
@@ -22,7 +22,7 @@
CPWL_EditCtrl::CPWL_EditCtrl() :
m_pEdit(NULL),
m_pEditCaret(NULL),
- m_bMouseDown(false),
+ m_bMouseDown(FALSE),
m_pEditNotify(NULL),
m_nCharSet(DEFAULT_CHARSET),
m_nCodePage(0)
@@ -50,7 +50,7 @@ void CPWL_EditCtrl::OnCreated()
m_pEdit->Initialize();
}
-bool CPWL_EditCtrl::IsWndHorV()
+FX_BOOL CPWL_EditCtrl::IsWndHorV()
{
CPDF_Matrix mt = GetWindowMatrix();
CPDF_Point point1(0,1);
@@ -167,17 +167,17 @@ FX_FLOAT CPWL_EditCtrl::GetFontSize() const
return m_pEdit->GetFontSize();
}
-bool CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return true;
+ if (m_bMouseDown) return TRUE;
- bool bRet = CPWL_Wnd::OnKeyDown(nChar,nFlag);
+ FX_BOOL bRet = CPWL_Wnd::OnKeyDown(nChar,nFlag);
//FILTER
switch (nChar)
{
default:
- return false;
+ return FALSE;
case FWL_VKEY_Delete:
case FWL_VKEY_Up:
case FWL_VKEY_Down:
@@ -209,35 +209,35 @@ bool CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
case FWL_VKEY_Delete:
Delete();
- return true;
+ return TRUE;
case FWL_VKEY_Insert:
if (IsSHIFTpressed(nFlag))
PasteText();
- return true;
+ return TRUE;
case FWL_VKEY_Up:
- m_pEdit->OnVK_UP(IsSHIFTpressed(nFlag),false);
- return true;
+ m_pEdit->OnVK_UP(IsSHIFTpressed(nFlag),FALSE);
+ return TRUE;
case FWL_VKEY_Down:
- m_pEdit->OnVK_DOWN(IsSHIFTpressed(nFlag),false);
- return true;
+ m_pEdit->OnVK_DOWN(IsSHIFTpressed(nFlag),FALSE);
+ return TRUE;
case FWL_VKEY_Left:
- m_pEdit->OnVK_LEFT(IsSHIFTpressed(nFlag),false);
- return true;
+ m_pEdit->OnVK_LEFT(IsSHIFTpressed(nFlag),FALSE);
+ return TRUE;
case FWL_VKEY_Right:
- m_pEdit->OnVK_RIGHT(IsSHIFTpressed(nFlag),false);
- return true;
+ m_pEdit->OnVK_RIGHT(IsSHIFTpressed(nFlag),FALSE);
+ return TRUE;
case FWL_VKEY_Home:
m_pEdit->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- return true;
+ return TRUE;
case FWL_VKEY_End:
m_pEdit->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- return true;
+ return TRUE;
case FWL_VKEY_Unknown:
if (!IsSHIFTpressed(nFlag))
Clear();
else
CutText();
- return true;
+ return TRUE;
default:
break;
}
@@ -245,9 +245,9 @@ bool CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
return bRet;
}
-bool CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- if (m_bMouseDown) return true;
+ if (m_bMouseDown) return TRUE;
CPWL_Wnd::OnChar(nChar,nFlag);
@@ -256,14 +256,14 @@ bool CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
case 0x0A:
case 0x1B:
- return false;
+ return FALSE;
default:
break;
}
- bool bCtrl = IsCTRLpressed(nFlag);
- bool bAlt = IsALTpressed(nFlag);
- bool bShift = IsSHIFTpressed(nFlag);
+ FX_BOOL bCtrl = IsCTRLpressed(nFlag);
+ FX_BOOL bAlt = IsALTpressed(nFlag);
+ FX_BOOL bShift = IsSHIFTpressed(nFlag);
FX_WORD word = nChar;
@@ -273,29 +273,29 @@ bool CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
case 'C' - 'A' + 1:
CopyText();
- return true;
+ return TRUE;
case 'V' - 'A' + 1:
PasteText();
- return true;
+ return TRUE;
case 'X' - 'A' + 1:
CutText();
- return true;
+ return TRUE;
case 'A' - 'A' + 1:
SelectAll();
- return true;
+ return TRUE;
case 'Z' - 'A' + 1:
if (bShift)
Redo();
else
Undo();
- return true;
+ return TRUE;
default:
if (nChar < 32)
- return false;
+ return FALSE;
}
}
- if (IsReadOnly()) return true;
+ if (IsReadOnly()) return TRUE;
if (m_pEdit->IsSelected() && word == FWL_VKEY_Back)
word = FWL_VKEY_Unknown;
@@ -319,10 +319,10 @@ bool CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
break;
}
- return true;
+ return TRUE;
}
-bool CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -331,16 +331,16 @@ bool CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown)
InvalidateRect();
- m_bMouseDown = true;
+ m_bMouseDown = TRUE;
SetCapture();
m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return true;
+ return TRUE;
}
-bool CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
@@ -351,20 +351,20 @@ bool CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
SetFocus();
ReleaseCapture();
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
}
- return true;
+ return TRUE;
}
-bool CPWL_EditCtrl::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_EditCtrl::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point,nFlag);
if (m_bMouseDown)
- m_pEdit->OnMouseMove(point,false,false);
+ m_pEdit->OnMouseMove(point,FALSE,FALSE);
- return true;
+ return TRUE;
}
CPDF_Rect CPWL_EditCtrl::GetContentRect() const
@@ -372,7 +372,7 @@ CPDF_Rect CPWL_EditCtrl::GetContentRect() const
return m_pEdit->GetContentRect();
}
-void CPWL_EditCtrl::SetEditCaret(bool bVisible)
+void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible)
{
CPDF_Point ptHead(0,0),ptFoot(0,0);
@@ -418,18 +418,18 @@ void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const
PWLtoWnd(ptHead, x, y);
}
-void CPWL_EditCtrl::SetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
+void CPWL_EditCtrl::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
{
if (m_pEditCaret)
{
if (!IsFocused() || m_pEdit->IsSelected())
- bVisible = false;
+ bVisible = FALSE;
m_pEditCaret->SetCaret(bVisible, ptHead, ptFoot);
}
}
-bool CPWL_EditCtrl::IsModified() const
+FX_BOOL CPWL_EditCtrl::IsModified() const
{
return m_pEdit->IsModified();
}
@@ -466,7 +466,7 @@ void CPWL_EditCtrl::Paint()
m_pEdit->Paint();
}
-void CPWL_EditCtrl::EnableRefresh(bool bRefresh)
+void CPWL_EditCtrl::EnableRefresh(FX_BOOL bRefresh)
{
if (m_pEdit)
m_pEdit->EnableRefresh(bRefresh);
@@ -578,7 +578,7 @@ void CPWL_EditCtrl::CutText()
{
}
-void CPWL_EditCtrl::ShowVScrollBar(bool bShow)
+void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow)
{
}
@@ -612,12 +612,12 @@ void CPWL_EditCtrl::Backspace()
m_pEdit->Backspace();
}
-bool CPWL_EditCtrl::CanUndo() const
+FX_BOOL CPWL_EditCtrl::CanUndo() const
{
return !IsReadOnly() && m_pEdit->CanUndo();
}
-bool CPWL_EditCtrl::CanRedo() const
+FX_BOOL CPWL_EditCtrl::CanRedo() const
{
return !IsReadOnly() && m_pEdit->CanRedo();
}
@@ -651,11 +651,11 @@ void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
if (IsFloatBigger(Info.fPlateWidth,Info.fContentMax-Info.fContentMin)
|| IsFloatEqual(Info.fPlateWidth,Info.fContentMax-Info.fContentMin))
{
- ShowVScrollBar(false);
+ ShowVScrollBar(FALSE);
}
else
{
- ShowVScrollBar(true);
+ ShowVScrollBar(TRUE);
}
}
@@ -664,7 +664,7 @@ void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy)
OnNotify(this, PNM_SETSCROLLPOS,SBT_VSCROLL, (intptr_t)&fy);
}
-void CPWL_EditCtrl::IOnSetCaret(bool bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place)
+void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place)
{
PWL_CARET_INFO cInfo;
cInfo.bVisible = bVisible;
@@ -717,6 +717,6 @@ void CPWL_EditCtrl::SetReadyToInput()
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
index 2f02973f82..50b321dfac 100644
--- a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
@@ -72,7 +72,7 @@ CFX_ByteString CPWL_FontMap::GetPDFFontAlias(int32_t nFontIndex)
return "";
}
-bool CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
+FX_BOOL CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
{
if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
{
@@ -82,7 +82,7 @@ bool CPWL_FontMap::KnowWord(int32_t nFontIndex, FX_WORD word)
}
}
- return false;
+ return FALSE;
}
int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word, int32_t nCharset, int32_t nFontIndex)
@@ -106,13 +106,13 @@ int32_t CPWL_FontMap::GetWordFontIndex(FX_WORD word, int32_t nCharset, int32_t n
}
}
- int32_t nNewFontIndex = GetFontIndex(GetNativeFontName(nCharset), nCharset, true);
+ int32_t nNewFontIndex = GetFontIndex(GetNativeFontName(nCharset), nCharset, TRUE);
if (nNewFontIndex >= 0)
{
if (KnowWord(nNewFontIndex, word))
return nNewFontIndex;
}
- nNewFontIndex = GetFontIndex("Arial Unicode MS", DEFAULT_CHARSET, false);
+ nNewFontIndex = GetFontIndex("Arial Unicode MS", DEFAULT_CHARSET, FALSE);
if (nNewFontIndex >= 0)
{
if (KnowWord(nNewFontIndex, word))
@@ -189,7 +189,7 @@ void CPWL_FontMap::Initial(const FX_CHAR* fontname)
if (sFontName.IsEmpty())
sFontName = DEFAULT_FONT_NAME;
- GetFontIndex(sFontName, ANSI_CHARSET, false);
+ GetFontIndex(sFontName, ANSI_CHARSET, FALSE);
}
@@ -206,15 +206,15 @@ const char* g_sDEStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldO
"Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic",
"Symbol", "ZapfDingbats"};
-bool CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName)
+FX_BOOL CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName)
{
for (int32_t i=0; i<14; i++)
{
if (sFontName == g_sDEStandardFontName[i])
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, int32_t nCharset)
@@ -234,7 +234,7 @@ int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, int32_t nCharset
return -1;
}
-int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, bool bFind)
+int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, int32_t nCharset, FX_BOOL bFind)
{
int32_t nFontIndex = FindFont(EncodeFontAlias(sFontName, nCharset), nCharset);
if (nFontIndex >= 0)
diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
index 85c4bc06c9..71174dfb0a 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
@@ -145,12 +145,12 @@ int32_t CPWL_Icon::GetScaleMethod()
return 0;
}
-bool CPWL_Icon::IsProportionalScale()
+FX_BOOL CPWL_Icon::IsProportionalScale()
{
if (m_pIconFit)
return m_pIconFit->IsProportionalScale();
- return false;
+ return FALSE;
}
void CPWL_Icon::GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom)
@@ -175,12 +175,12 @@ void CPWL_Icon::GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom)
}
}
-bool CPWL_Icon::GetFittingBounds()
+FX_BOOL CPWL_Icon::GetFittingBounds()
{
if (m_pIconFit)
return m_pIconFit->GetFittingBounds();
- return false;
+ return FALSE;
}
void CPWL_Icon::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
diff --git a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
index ecbb0fd3c0..157eba633d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
@@ -22,7 +22,7 @@
CPWL_IconList_Item::CPWL_IconList_Item() :
m_nIconIndex(-1),
m_pData(NULL),
- m_bSelected(false),
+ m_bSelected(FALSE),
m_pText(NULL)
{
}
@@ -67,7 +67,7 @@ void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matr
m_crIcon, m_pText->GetTextColor(), GetTransparency());
}
-void CPWL_IconList_Item::SetSelect(bool bSelected)
+void CPWL_IconList_Item::SetSelect(FX_BOOL bSelected)
{
m_bSelected = bSelected;
@@ -78,7 +78,7 @@ void CPWL_IconList_Item::SetSelect(bool bSelected)
}
-bool CPWL_IconList_Item::IsSelected() const
+FX_BOOL CPWL_IconList_Item::IsSelected() const
{
return m_bSelected;
}
@@ -121,7 +121,7 @@ void CPWL_IconList_Item::RePosChildWnd()
rcClient.left += (PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_WIDTH + PWL_IconList_ITEM_ICON_LEFTMARGIN);
- m_pText->Move(rcClient, true, false);
+ m_pText->Move(rcClient, TRUE, FALSE);
}
void CPWL_IconList_Item::SetIconFillColor(const CPWL_Color& color)
@@ -151,8 +151,8 @@ void CPWL_IconList_Item::OnDisabled()
CPWL_IconList_Content::CPWL_IconList_Content(int32_t nListCount) :
m_nSelectIndex(-1),
m_pNotify(NULL),
- m_bEnableNotify(true),
- m_bMouseDown(false),
+ m_bEnableNotify(TRUE),
+ m_bMouseDown(FALSE),
m_nListCount(nListCount)
{
}
@@ -192,29 +192,29 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp)
}
}
-bool CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
SetFocus();
SetCapture();
- m_bMouseDown = true;
+ m_bMouseDown = TRUE;
int32_t nItemIndex = FindItemIndex(point);
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
- return true;
+ return TRUE;
}
-bool CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
ReleaseCapture();
- return true;
+ return TRUE;
}
-bool CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
if (m_bMouseDown)
{
@@ -223,10 +223,10 @@ bool CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag
ScrollToItem(nItemIndex);
}
- return true;
+ return TRUE;
}
-bool CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
switch (nChar)
{
@@ -237,7 +237,7 @@ bool CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
}
- return true;
+ return TRUE;
case FWL_VKEY_Down:
if (m_nSelectIndex < m_nListCount-1)
{
@@ -245,10 +245,10 @@ bool CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
SetSelect(nItemIndex);
ScrollToItem(nItemIndex);
}
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point)
@@ -307,8 +307,8 @@ void CPWL_IconList_Content::SetSelect(int32_t nIndex)
{
if (m_nSelectIndex != nIndex)
{
- SelectItem(m_nSelectIndex, false);
- SelectItem(nIndex, true);
+ SelectItem(m_nSelectIndex, FALSE);
+ SelectItem(nIndex, TRUE);
m_nSelectIndex = nIndex;
if (IPWL_IconList_Notify* pNotify = GetNotify())
@@ -333,12 +333,12 @@ void CPWL_IconList_Content::SetNotify(IPWL_IconList_Notify* pNotify)
m_pNotify = pNotify;
}
-void CPWL_IconList_Content::EnableNotify(bool bNotify)
+void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify)
{
m_bEnableNotify = bNotify;
}
-void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, bool bSelect)
+void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, FX_BOOL bSelect)
{
if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
{
@@ -423,7 +423,7 @@ void CPWL_IconList::RePosChildWnd()
CPWL_Wnd::RePosChildWnd();
if (m_pListContent)
- m_pListContent->Move(GetClientRect(), true, false);
+ m_pListContent->Move(GetClientRect(), TRUE, FALSE);
}
void CPWL_IconList::CreateChildWnd(const PWL_CREATEPARAM & cp)
@@ -442,7 +442,7 @@ void CPWL_IconList::OnCreated()
{
pScrollBar->RemoveFlag(PWS_AUTOTRANSPARENT);
pScrollBar->SetTransparency(255);
- pScrollBar->SetNotifyForever(true);
+ pScrollBar->SetNotifyForever(TRUE);
}
}
@@ -463,7 +463,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
{
if (!pScrollBar->IsVisible())
{
- pScrollBar->SetVisible(true);
+ pScrollBar->SetVisible(TRUE);
RePosChildWnd();
}
else
@@ -474,7 +474,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
{
if (pScrollBar->IsVisible())
{
- pScrollBar->SetVisible(false);
+ pScrollBar->SetVisible(FALSE);
RePosChildWnd();
}
@@ -522,7 +522,7 @@ void CPWL_IconList::SetNotify(IPWL_IconList_Notify* pNotify)
m_pListContent->SetNotify(pNotify);
}
-void CPWL_IconList::EnableNotify(bool bNotify)
+void CPWL_IconList::EnableNotify(FX_BOOL bNotify)
{
m_pListContent->EnableNotify(bNotify);
}
@@ -552,7 +552,7 @@ void CPWL_IconList::SetIconFillColor(const CPWL_Color& color)
m_pListContent->SetIconFillColor(color);
}
-bool CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
CPDF_Point ptScroll = m_pListContent->GetScrollPos();
CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
@@ -583,10 +583,10 @@ bool CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWOR
if (CPWL_ScrollBar* pScrollBar = GetVScrollBar())
pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
index 3e231d5244..e1780c69a8 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
@@ -39,7 +39,7 @@ void CPWL_Label::OnCreated()
if (HasFlag(PES_TEXTOVERFLOW))
{
SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
- m_pEdit->SetTextOverflow(true);
+ m_pEdit->SetTextOverflow(TRUE);
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index d0e9cc6dfd..48fb409b7b 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -49,7 +49,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
{
if (pScroll->IsVisible())
{
- pScroll->SetVisible(false);
+ pScroll->SetVisible(FALSE);
m_pList->RePosChildWnd();
}
}
@@ -57,7 +57,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
{
if (!pScroll->IsVisible())
{
- pScroll->SetVisible(true);
+ pScroll->SetVisible(TRUE);
m_pList->RePosChildWnd();
}
}
@@ -79,8 +79,8 @@ void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect * pRect)
CPWL_ListBox::CPWL_ListBox() :
m_pList(NULL),
m_pListNotify(NULL),
- m_bMouseDown(false),
- m_bHoverSel(false),
+ m_bMouseDown(FALSE),
+ m_bHoverSel(FALSE),
m_pFillerNotify(NULL)
{
m_pList = IFX_List::NewList();
@@ -229,16 +229,16 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pU
}
}
-bool CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
CPWL_Wnd::OnKeyDown(nChar, nFlag);
- if (!m_pList) return false;
+ if (!m_pList) return FALSE;
switch (nChar)
{
default:
- return false;
+ return FALSE;
case FWL_VKEY_Up:
case FWL_VKEY_Down:
case FWL_VKEY_Home:
@@ -272,33 +272,33 @@ bool CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
break;
}
- bool bExit = false;
- OnNotifySelChanged(true,bExit,nFlag);
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(TRUE,bExit,nFlag);
- return true;
+ return TRUE;
}
-bool CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
CPWL_Wnd::OnChar(nChar,nFlag);
- if (!m_pList) return false;
+ if (!m_pList) return FALSE;
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return false;
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
- bool bExit = false;
- OnNotifySelChanged(true,bExit, nFlag);
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(TRUE,bExit, nFlag);
- return true;
+ return TRUE;
}
-bool CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
if (ClientHitTest(point))
{
- m_bMouseDown = true;
+ m_bMouseDown = TRUE;
SetFocus();
SetCapture();
@@ -306,31 +306,31 @@ bool CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
m_pList->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return true;
+ return TRUE;
}
-bool CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
}
- bool bExit = false;
- OnNotifySelChanged(false,bExit,nFlag);
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(FALSE,bExit,nFlag);
- return true;
+ return TRUE;
}
-void CPWL_ListBox::SetHoverSel(bool bHoverSel)
+void CPWL_ListBox::SetHoverSel(FX_BOOL bHoverSel)
{
m_bHoverSel = bHoverSel;
}
-bool CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point, nFlag);
@@ -346,7 +346,7 @@ bool CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
m_pList->OnMouseMove(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return true;
+ return TRUE;
}
void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -405,19 +405,19 @@ void CPWL_ListBox::RePosChildWnd()
m_pList->SetPlateRect(GetListRect());
}
-void CPWL_ListBox::OnNotifySelChanged(bool bKeyDown, bool & bExit, FX_DWORD nFlag)
+void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit, FX_DWORD nFlag)
{
if (m_pFillerNotify)
{
- bool bRC = true;
+ FX_BOOL bRC = TRUE;
CFX_WideString swChange = GetText();
CFX_WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = swChange.GetLength();
- m_pFillerNotify->OnBeforeKeyStroke(false, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
+ m_pFillerNotify->OnBeforeKeyStroke(FALSE, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
if (bExit) return;
- m_pFillerNotify->OnAfterKeyStroke(false, GetAttachedData(), bExit,nFlag);
+ m_pFillerNotify->OnAfterKeyStroke(FALSE, GetAttachedData(), bExit,nFlag);
}
}
@@ -498,12 +498,12 @@ void CPWL_ListBox::Reset()
m_pList->Cancel();
}
-bool CPWL_ListBox::IsMultipleSel() const
+FX_BOOL CPWL_ListBox::IsMultipleSel() const
{
if (m_pList)
return m_pList->IsMultipleSel();
- return false;
+ return FALSE;
}
int32_t CPWL_ListBox::GetCaretIndex() const
@@ -522,12 +522,12 @@ int32_t CPWL_ListBox::GetCurSel() const
return -1;
}
-bool CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const
+FX_BOOL CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const
{
if (m_pList)
return m_pList->IsItemSelected(nItemIndex);
- return false;
+ return FALSE;
}
int32_t CPWL_ListBox::GetTopVisibleIndex() const
@@ -578,9 +578,9 @@ CPDF_Rect CPWL_ListBox::GetListRect() const
return CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
}
-bool CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
- if (!m_pList) return false;
+ if (!m_pList) return FALSE;
if (zDelta < 0)
{
@@ -591,8 +591,8 @@ bool CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD
m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- bool bExit = false;
- OnNotifySelChanged(false,bExit, nFlag);
- return true;
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(FALSE,bExit, nFlag);
+ return TRUE;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
index d2deacb4d2..3077e6293f 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
@@ -52,7 +52,7 @@ CPDF_Rect CPWL_ListCtrl::GetScrollArea() const
void CPWL_ListCtrl::ResetFace()
{
- ResetAll(false, 0);
+ ResetAll(FALSE, 0);
}
void CPWL_ListCtrl::ResetContent(int32_t nStart)
@@ -60,7 +60,7 @@ void CPWL_ListCtrl::ResetContent(int32_t nStart)
if (nStart < 0)
nStart = 0;
if (nStart >= 0 && nStart < m_aChildren.GetSize())
- ResetAll(true, nStart);
+ ResetAll(TRUE, nStart);
}
FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth)
@@ -91,7 +91,7 @@ FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth)
return fRet;
}
-void CPWL_ListCtrl::ResetAll(bool bMove, int32_t nStart)
+void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart)
{
CPDF_Rect rcClient = GetClientRect();
@@ -119,7 +119,7 @@ void CPWL_ListCtrl::ResetAll(bool bMove, int32_t nStart)
if (bMove)
{
FX_FLOAT fItemHeight = pChild->GetItemHeight(fWidth - fLeft - fRight);
- pChild->Move(CPDF_Rect(fLeft, fy-fItemHeight, fWidth - fRight, fy), true, false);
+ pChild->Move(CPDF_Rect(fLeft, fy-fItemHeight, fWidth - fRight, fy), TRUE, FALSE);
fy -= fItemHeight;
fy -= m_fItemSpace;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
index f3c5816c8d..7ed1115a82 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
@@ -60,13 +60,13 @@ void CPWL_Note_Options::RePosChildWnd()
if (rcClient.Width() > 15.0f)
{
rcClient.right -= 15.0f;
- m_pText->Move(rcClient, true, false);
- m_pText->SetVisible(true);
+ m_pText->Move(rcClient, TRUE, FALSE);
+ m_pText->SetVisible(TRUE);
}
else
{
- m_pText->Move(CPDF_Rect(0,0,0,0), true, false);
- m_pText->SetVisible(false);
+ m_pText->Move(CPDF_Rect(0,0,0,0), TRUE, FALSE);
+ m_pText->SetVisible(FALSE);
}
}
}
@@ -122,9 +122,9 @@ CPDF_Rect CPWL_Note_Options::GetContentRect() const
/* ------------------------------- CPWL_Note_Edit ------------------------------ */
-CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(true),
+CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(TRUE),
m_fOldItemHeight(0.0f),
- m_bSizeChanged(false),
+ m_bSizeChanged(FALSE),
m_fOldMin(0.0f),
m_fOldMax(0.0f)
{
@@ -136,33 +136,33 @@ CPWL_Note_Edit::~CPWL_Note_Edit()
void CPWL_Note_Edit::RePosChildWnd()
{
- m_bEnableNotify = false;
+ m_bEnableNotify = FALSE;
CPWL_Edit::RePosChildWnd();
- m_bEnableNotify = true;
+ m_bEnableNotify = TRUE;
m_fOldItemHeight = GetContentRect().Height();
}
void CPWL_Note_Edit::SetText(const FX_WCHAR* csText)
{
- m_bEnableNotify = false;
+ m_bEnableNotify = FALSE;
CPWL_Edit::SetText(csText);
- m_bEnableNotify = true;
+ m_bEnableNotify = TRUE;
m_fOldItemHeight = GetContentRect().Height();
}
void CPWL_Note_Edit::OnSetFocus()
{
- m_bEnableNotify = false;
+ m_bEnableNotify = FALSE;
CPWL_Edit::OnSetFocus();
- m_bEnableNotify = true;
+ m_bEnableNotify = TRUE;
- EnableSpellCheck(true);
+ EnableSpellCheck(TRUE);
}
void CPWL_Note_Edit::OnKillFocus()
{
- EnableSpellCheck(false);
+ EnableSpellCheck(FALSE);
if (CPWL_Wnd* pParent = GetParentWindow())
{
@@ -193,7 +193,7 @@ void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, int
if (!IsFloatEqual(pInfo->fContentMax, m_fOldMax) ||
!IsFloatEqual(pInfo->fContentMin, m_fOldMin))
{
- m_bSizeChanged = true;
+ m_bSizeChanged = TRUE;
if (CPWL_Wnd * pParent = GetParentWindow())
{
pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
@@ -218,7 +218,7 @@ void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, int
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = true;
+ newInfo.bVisible = TRUE;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -239,18 +239,18 @@ FX_FLOAT CPWL_Note_Edit::GetItemHeight(FX_FLOAT fLimitWidth)
if (!m_bSizeChanged)
return m_fOldItemHeight;
- m_bSizeChanged = false;
+ m_bSizeChanged = FALSE;
- EnableNotify(false);
- EnableRefresh(false);
- m_pEdit->EnableNotify(false);
+ EnableNotify(FALSE);
+ EnableRefresh(FALSE);
+ m_pEdit->EnableNotify(FALSE);
- Move(CPDF_Rect(0,0,fLimitWidth,0), true, false);
+ Move(CPDF_Rect(0,0,fLimitWidth,0), TRUE, FALSE);
FX_FLOAT fRet = GetContentRect().Height();
- m_pEdit->EnableNotify(true);
- EnableNotify(true);
- EnableRefresh(true);
+ m_pEdit->EnableNotify(TRUE);
+ EnableNotify(TRUE);
+ EnableRefresh(TRUE);
return fRet;
}
@@ -349,7 +349,7 @@ void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix*
/* --------------------------------- CPWL_Note_CloseBox ---------------------------------- */
-CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(false)
+CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE)
{
}
@@ -387,19 +387,19 @@ void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matr
0, CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), FXFILL_ALTERNATE);
}
-bool CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
SetBorderStyle(PBS_INSET);
InvalidateRect(NULL);
- m_bMouseDown = true;
+ m_bMouseDown = TRUE;
return CPWL_Button::OnLButtonDown(point,nFlag);
}
-bool CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
SetBorderStyle(PBS_BEVELED);
InvalidateRect(NULL);
@@ -429,18 +429,18 @@ void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM & cp)
ecp.pParentWnd = this;
ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_MULTILINE | PES_AUTORETURN | PES_TEXTOVERFLOW | PES_UNDO | PES_SPELLCHECK;
- m_pEdit->EnableNotify(false);
+ m_pEdit->EnableNotify(FALSE);
m_pEdit->Create(ecp);
- m_pEdit->EnableNotify(true);
+ m_pEdit->EnableNotify(TRUE);
}
void CPWL_Note_Contents::SetText(const CFX_WideString& sText)
{
if (m_pEdit)
{
- m_pEdit->EnableNotify(false);
+ m_pEdit->EnableNotify(FALSE);
m_pEdit->SetText(sText.c_str());
- m_pEdit->EnableNotify(true);
+ m_pEdit->EnableNotify(TRUE);
OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0);
}
}
@@ -551,9 +551,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
int32_t nIndex = GetItemIndex(pWnd);
if (nIndex < 0) nIndex = 0;
- m_pEdit->EnableNotify(false);
+ m_pEdit->EnableNotify(FALSE);
ResetContent(nIndex);
- m_pEdit->EnableNotify(true);
+ m_pEdit->EnableNotify(TRUE);
for (int32_t i=nIndex+1, sz=m_aChildren.GetSize(); i<sz; i++)
{
@@ -576,7 +576,7 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = true;
+ newInfo.bVisible = TRUE;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -588,9 +588,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
return;
case PNM_NOTERESET:
{
- m_pEdit->EnableNotify(false);
+ m_pEdit->EnableNotify(FALSE);
ResetContent(0);
- m_pEdit->EnableNotify(true);
+ m_pEdit->EnableNotify(TRUE);
for (int32_t i=1, sz=m_aChildren.GetSize(); i<sz; i++)
{
@@ -598,9 +598,9 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
pChild->OnNotify(this, PNM_NOTERESET, 0, 0);
}
- m_pEdit->EnableNotify(false);
+ m_pEdit->EnableNotify(FALSE);
ResetContent(0);
- m_pEdit->EnableNotify(true);
+ m_pEdit->EnableNotify(TRUE);
}
return;
}
@@ -608,19 +608,19 @@ void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
}
-bool CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return true;
+ if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return TRUE;
if (!m_pEdit->IsFocused())
{
m_pEdit->SetFocus();
}
- return true;
+ return TRUE;
}
-void CPWL_Note_Contents::SetEditFocus(bool bLast)
+void CPWL_Note_Contents::SetEditFocus(FX_BOOL bLast)
{
if (!m_pEdit->IsFocused())
{
@@ -634,7 +634,7 @@ CPWL_Edit* CPWL_Note_Contents::GetEdit() const
return m_pEdit;
}
-void CPWL_Note_Contents::EnableModify(bool bEnabled)
+void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled)
{
if (!bEnabled)
m_pEdit->AddFlag(PWS_READONLY);
@@ -654,7 +654,7 @@ void CPWL_Note_Contents::EnableModify(bool bEnabled)
}
}
-void CPWL_Note_Contents::EnableRead(bool bEnabled)
+void CPWL_Note_Contents::EnableRead(FX_BOOL bEnabled)
{
if (!bEnabled)
m_pEdit->AddFlag(PES_NOREAD);
@@ -683,8 +683,8 @@ CPWL_NoteItem::CPWL_NoteItem() :
m_pPrivateData(NULL),
m_sAuthor(L""),
m_fOldItemHeight(0.0f),
- m_bSizeChanged(false),
- m_bAllowModify(true)
+ m_bSizeChanged(FALSE),
+ m_bAllowModify(TRUE)
{
}
@@ -748,7 +748,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcClient.right);
rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
rcSubject.Normalize();
- m_pSubject->Move(rcSubject, true, false);
+ m_pSubject->Move(rcSubject, TRUE, FALSE);
m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
CPDF_Rect rcDate = rcClient;
@@ -756,7 +756,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, rcSubject.right);
rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
rcDate.Normalize();
- m_pDateTime->Move(rcDate, true, false);
+ m_pDateTime->Move(rcDate, TRUE, FALSE);
m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
CPDF_Rect rcContents = rcClient;
@@ -765,7 +765,7 @@ void CPWL_NoteItem::RePosChildWnd()
rcContents.top = rcDate.bottom - POPUP_ITEM_HEAD_BOTTOM;
rcContents.bottom += POPUP_ITEM_BOTTOMWIDTH;
rcContents.Normalize();
- m_pContents->Move(rcContents, true, false);
+ m_pContents->Move(rcContents, TRUE, FALSE);
m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
}
@@ -1038,7 +1038,7 @@ FX_FLOAT CPWL_NoteItem::GetItemHeight(FX_FLOAT fLimitWidth)
if (!m_bSizeChanged)
return m_fOldItemHeight;
- m_bSizeChanged = false;
+ m_bSizeChanged = FALSE;
ASSERT(m_pSubject != NULL);
ASSERT(m_pDateTime != NULL);
@@ -1066,26 +1066,26 @@ FX_FLOAT CPWL_NoteItem::GetItemRightMargin()
return POPUP_ITEM_SIDEMARGIN;
}
-bool CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
+FX_BOOL CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
{
if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
{
- SetNoteFocus(false);
+ SetNoteFocus(FALSE);
}
CPWL_Wnd::OnLButtonDown(point,nFlag);
- return true;
+ return TRUE;
}
-bool CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
{
- SetNoteFocus(false);
+ SetNoteFocus(FALSE);
PopupNoteItemMenu(point);
- return true;
+ return TRUE;
}
return CPWL_Wnd::OnRButtonUp(point,nFlag);
@@ -1096,7 +1096,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
switch (msg)
{
case PNM_NOTEEDITCHANGED:
- m_bSizeChanged = true;
+ m_bSizeChanged = TRUE;
if (CPWL_Wnd* pParent = GetParentWindow())
{
@@ -1107,7 +1107,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
{
PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = true;
+ newInfo.bVisible = TRUE;
newInfo.ptHead = ChildToParent(pInfo->ptHead);
newInfo.ptFoot = ChildToParent(pInfo->ptFoot);
@@ -1118,7 +1118,7 @@ void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
}
return;
case PNM_NOTERESET:
- m_bSizeChanged = true;
+ m_bSizeChanged = TRUE;
m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
return;
@@ -1178,18 +1178,18 @@ void CPWL_NoteItem::OnContentsValidate()
}
}
-void CPWL_NoteItem::SetNoteFocus(bool bLast)
+void CPWL_NoteItem::SetNoteFocus(FX_BOOL bLast)
{
m_pContents->SetEditFocus(bLast);
}
-void CPWL_NoteItem::EnableModify(bool bEnabled)
+void CPWL_NoteItem::EnableModify(FX_BOOL bEnabled)
{
m_pContents->EnableModify(bEnabled);
m_bAllowModify = bEnabled;
}
-void CPWL_NoteItem::EnableRead(bool bEnabled)
+void CPWL_NoteItem::EnableRead(FX_BOOL bEnabled)
{
m_pContents->EnableRead(bEnabled);
}
@@ -1205,9 +1205,9 @@ CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL
m_pContentsBar(NULL),
m_pOptions(NULL),
m_pNoteNotify(pNoteNotify),
- m_bResizing(false),
+ m_bResizing(FALSE),
m_rcCaption(0,0,0,0),
- m_bEnalbleNotify(true),
+ m_bEnalbleNotify(TRUE),
m_pPopupNote(pPopupNote)
{
}
@@ -1221,7 +1221,7 @@ IPWL_NoteItem* CPWL_Note::Reply()
return CreateNoteItem();
}
-void CPWL_Note::EnableNotify(bool bEnabled)
+void CPWL_Note::EnableNotify(FX_BOOL bEnabled)
{
m_bEnalbleNotify = bEnabled;
}
@@ -1243,19 +1243,19 @@ void CPWL_Note::RePosChildWnd()
}
}
-bool CPWL_Note::ResetScrollBar()
+FX_BOOL CPWL_Note::ResetScrollBar()
{
- bool bScrollChanged = false;
+ FX_BOOL bScrollChanged = FALSE;
if (ScrollBarShouldVisible())
{
if (!m_pContentsBar->IsVisible())
{
- m_pContentsBar->SetVisible(true);
+ m_pContentsBar->SetVisible(TRUE);
if (m_pContentsBar->IsVisible())
{
m_pContentsBar->InvalidateRect(NULL);
- bScrollChanged = true;
+ bScrollChanged = TRUE;
}
}
}
@@ -1263,10 +1263,10 @@ bool CPWL_Note::ResetScrollBar()
{
if (m_pContentsBar->IsVisible())
{
- m_pContentsBar->SetVisible(false);
+ m_pContentsBar->SetVisible(FALSE);
m_pContentsBar->InvalidateRect(NULL);
- bScrollChanged = true;
+ bScrollChanged = TRUE;
}
}
@@ -1277,7 +1277,7 @@ bool CPWL_Note::ResetScrollBar()
rcContents.right = rcNote.right - 3.0f;
if (m_pContentsBar->IsVisible())
rcContents.right -= PWL_SCROLLBAR_WIDTH;
- m_pContents->Move(rcContents, true, true);
+ m_pContents->Move(rcContents, TRUE, TRUE);
m_pContents->SetScrollPos(CPDF_Point(0.0f,0.0f));
m_pContents->InvalidateRect(NULL);
}
@@ -1285,7 +1285,7 @@ bool CPWL_Note::ResetScrollBar()
return bScrollChanged;
}
-bool CPWL_Note::ScrollBarShouldVisible()
+FX_BOOL CPWL_Note::ScrollBarShouldVisible()
{
CPDF_Rect rcContentsFact = m_pContents->GetScrollArea();
CPDF_Rect rcContentsClient = m_pContents->GetClientRect();
@@ -1305,7 +1305,7 @@ void CPWL_Note::RePosNoteChildren()
{
if (m_bResizing) return;
- m_bResizing = true;
+ m_bResizing = TRUE;
if (IsValid())
{
@@ -1327,7 +1327,7 @@ void CPWL_Note::RePosNoteChildren()
rcIcon.right = rcIcon.left + 14.0f;
rcIcon.bottom = rcIcon.top - 14.0f;
rcIcon.Normalize();
- m_pIcon->Move(rcIcon, true, false);
+ m_pIcon->Move(rcIcon, TRUE, FALSE);
m_pIcon->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcIcon));
CPDF_Rect rcCloseBox = rcClient;
@@ -1336,7 +1336,7 @@ void CPWL_Note::RePosNoteChildren()
rcCloseBox.left = rcCloseBox.right - 14.0f;
rcCloseBox.bottom = rcCloseBox.top - 14.0f;
rcCloseBox.Normalize();
- m_pCloseBox->Move(rcCloseBox, true, false);
+ m_pCloseBox->Move(rcCloseBox, TRUE, FALSE);
m_pCloseBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCloseBox));
CPDF_Rect rcDate = rcClient;
@@ -1345,7 +1345,7 @@ void CPWL_Note::RePosNoteChildren()
rcDate.top = rcClient.top - 2.0f;
rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
rcDate.Normalize();
- m_pDateTime->Move(rcDate, true, false);
+ m_pDateTime->Move(rcDate, TRUE, FALSE);
m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
CPDF_Rect rcSubject = rcClient;
@@ -1354,7 +1354,7 @@ void CPWL_Note::RePosNoteChildren()
rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcDate.left - 1.0f);
rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
rcSubject.Normalize();
- m_pSubject->Move(rcSubject, true, false);
+ m_pSubject->Move(rcSubject, TRUE, FALSE);
m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
CPDF_Rect rcOptions = rcClient;
@@ -1362,7 +1362,7 @@ void CPWL_Note::RePosNoteChildren()
rcOptions.top = rcSubject.bottom - 4.0f;
rcOptions.bottom = rcOptions.top - m_pOptions->GetContentRect().Height();
rcOptions.Normalize();
- m_pOptions->Move(rcOptions, true, false);
+ m_pOptions->Move(rcOptions, TRUE, FALSE);
m_pOptions->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcOptions));
CPDF_Rect rcAuthor = rcClient;
@@ -1371,21 +1371,21 @@ void CPWL_Note::RePosNoteChildren()
rcAuthor.right = PWL_MIN(rcSubject.left + m_pAuthor->GetContentRect().Width() + 1.0f, rcOptions.left - 1.0f);
rcAuthor.bottom = rcAuthor.top - m_pAuthor->GetContentRect().Height();
rcAuthor.Normalize();
- m_pAuthor->Move(rcAuthor, true, false);
+ m_pAuthor->Move(rcAuthor, TRUE, FALSE);
m_pAuthor->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcAuthor));
CPDF_Rect rcLBBox = rcClient;
rcLBBox.top = rcLBBox.bottom + 7.0f;
rcLBBox.right = rcLBBox.left + 7.0f;
rcLBBox.Normalize();
- m_pLBBox->Move(rcLBBox, true, false);
+ m_pLBBox->Move(rcLBBox, TRUE, FALSE);
m_pLBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcLBBox));
CPDF_Rect rcRBBox = rcClient;
rcRBBox.top = rcRBBox.bottom + 7.0f;
rcRBBox.left = rcRBBox.right - 7.0f;
rcRBBox.Normalize();
- m_pRBBox->Move(rcRBBox, true, false);
+ m_pRBBox->Move(rcRBBox, TRUE, FALSE);
m_pRBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcRBBox));
CPDF_Rect rcContents = rcClient;
@@ -1396,20 +1396,20 @@ void CPWL_Note::RePosNoteChildren()
rcContents.right -= PWL_SCROLLBAR_WIDTH;
rcContents.bottom += 14.0f;
rcContents.Normalize();
- m_pContents->Move(rcContents, false, false);
+ m_pContents->Move(rcContents, FALSE, FALSE);
m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
CPDF_Rect rcContentsBar = rcContents;
rcContentsBar.right = rcClient.right - 3.0f;
rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH;
rcContentsBar.Normalize();
- m_pContentsBar->Move(rcContentsBar, true, false);
+ m_pContentsBar->Move(rcContentsBar, TRUE, FALSE);
m_rcCaption = rcClient;
m_rcCaption.bottom = rcContents.top;
}
- m_bResizing = false;
+ m_bResizing = FALSE;
}
//0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options
@@ -1507,7 +1507,7 @@ void CPWL_Note::CreateChildWnd(const PWL_CREATEPARAM & cp)
scp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f, 240/255.0f);
scp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND;
m_pContentsBar->Create(scp);
- m_pContentsBar->SetNotifyForever(true);
+ m_pContentsBar->SetNotifyForever(TRUE);
}
void CPWL_Note::SetSubjectName(const CFX_WideString& sName)
@@ -1538,7 +1538,7 @@ CFX_WideString CPWL_Note::GetAuthorName() const
return L"";
}
-bool CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
CPDF_Point ptScroll = m_pContents->GetScrollPos();
CPDF_Rect rcScroll = m_pContents->GetScrollArea();
@@ -1566,11 +1566,11 @@ bool CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nF
m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (intptr_t)&ptNew.y);
m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&ptNew.y);
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -1591,7 +1591,7 @@ void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t
if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SCROLL_INFO)) != 0)
{
- bool bScrollChanged = false;
+ FX_BOOL bScrollChanged = FALSE;
if (lParam < 3) //·ÀÖ¹ËÀÑ­»· mantis:15759
{
@@ -1704,7 +1704,7 @@ void CPWL_Note::SetBkColor(const CPWL_Color& color)
m_pRBBox->SetTextColor(sTextColor);
}
-bool CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
+FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
{
if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point)))
{
@@ -1717,14 +1717,14 @@ bool CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
KillFocus();
pNotify->OnPopupMenu(x, y);
- return true;
+ return TRUE;
}
}
return CPWL_Wnd::OnLButtonDown(point,nFlag);
}
-bool CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
return CPWL_Wnd::OnRButtonUp(point,nFlag);
}
@@ -1748,12 +1748,12 @@ void CPWL_Note::SetIconType(int32_t nType)
m_pIcon->SetIconType(nType);
}
-void CPWL_Note::EnableModify(bool bEnabled)
+void CPWL_Note::EnableModify(FX_BOOL bEnabled)
{
m_pContents->EnableModify(bEnabled);
}
-void CPWL_Note::EnableRead(bool bEnabled)
+void CPWL_Note::EnableRead(FX_BOOL bEnabled)
{
m_pContents->EnableRead(bEnabled);
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
index 4287bc2753..6d61705222 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
@@ -47,7 +47,7 @@ void PWL_FLOATRANGE::Set(FX_FLOAT min,FX_FLOAT max)
}
}
-bool PWL_FLOATRANGE::In(FX_FLOAT x) const
+FX_BOOL PWL_FLOATRANGE::In(FX_FLOAT x) const
{
return (IsFloatBigger(x,fMin) || IsFloatEqual(x, fMin)) &&
(IsFloatSmaller(x, fMax) || IsFloatEqual(x, fMax));
@@ -99,14 +99,14 @@ void PWL_SCROLL_PRIVATEDATA::SetBigStep(FX_FLOAT step)
fBigStep = step;
}
-bool PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos)
+FX_BOOL PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos)
{
if (ScrollRange.In(pos))
{
fScrollPos = pos;
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
void PWL_SCROLL_PRIVATEDATA::AddSmall()
@@ -140,7 +140,7 @@ CPWL_SBButton::CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,PWL_SBBUTTON_TYPE
m_eScrollBarType = eScrollBarType;
m_eSBButtonType = eButtonType;
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
}
CPWL_SBButton::~CPWL_SBButton()
@@ -359,7 +359,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
if (IsEnabled())
- CPWL_Utils::DrawShadow(pDevice, pUser2Device, true, false, rcDraw, nTransparancy, 80, 220);
+ CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
else
CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
@@ -402,7 +402,7 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
//draw background
rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
if (IsEnabled())
- CPWL_Utils::DrawShadow(pDevice, pUser2Device, true, false, rcDraw, nTransparancy, 80, 220);
+ CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
else
CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
@@ -565,33 +565,33 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p
}
}
-bool CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
if (CPWL_Wnd * pParent = GetParentWindow())
pParent->OnNotify(this,PNM_LBUTTONDOWN,0,(intptr_t)&point);
- m_bMouseDown = true;
+ m_bMouseDown = TRUE;
SetCapture();
- return true;
+ return TRUE;
}
-bool CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (CPWL_Wnd * pParent = GetParentWindow())
pParent->OnNotify(this,PNM_LBUTTONUP,0,(intptr_t)&point);
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
ReleaseCapture();
- return true;
+ return TRUE;
}
-bool CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point,nFlag);
@@ -603,12 +603,12 @@ bool CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
if (m_bMouseDown && (m_eSBButtonType == PSBT_MIN || m_eSBButtonType == PSBT_MAX))
{
if (!pParent->OnNotify(this,PNM_LBUTTONDOWN,nFlags,(intptr_t)&point))
- return false;
+ return FALSE;
}
*/
}
- return true;
+ return TRUE;
}
/* ------------------------------- CPWL_ScrollBar ---------------------------------- */
@@ -618,9 +618,9 @@ CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType):
m_pMinButton(NULL),
m_pMaxButton(NULL),
m_pPosButton(NULL),
- m_bMouseDown(false),
- m_bMinOrMax(false),
- m_bNotifyForever(true)
+ m_bMouseDown(FALSE),
+ m_bMinOrMax(FALSE),
+ m_bNotifyForever(TRUE)
{
}
@@ -665,7 +665,7 @@ void CPWL_ScrollBar::RePosChildWnd()
rcMaxButton = CPDF_Rect(rcClient.right - fBWidth,rcClient.bottom,
rcClient.right,rcClient.top);
}
- else SetVisible(false);
+ else SetVisible(FALSE);
}
break;
case SBT_VSCROLL:
@@ -687,16 +687,16 @@ void CPWL_ScrollBar::RePosChildWnd()
rcMaxButton = CPDF_Rect(rcClient.left,rcClient.bottom,
rcClient.right,rcClient.bottom + fBWidth);
}
- else SetVisible(false);
+ else SetVisible(FALSE);
}
break;
}
if (m_pMinButton)
- m_pMinButton->Move(rcMinButton, true, false);
+ m_pMinButton->Move(rcMinButton, TRUE, FALSE);
if (m_pMaxButton)
- m_pMaxButton->Move(rcMaxButton, true, false);
- MovePosButton(false);
+ m_pMaxButton->Move(rcMaxButton, TRUE, FALSE);
+ MovePosButton(FALSE);
}
void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
@@ -708,7 +708,7 @@ void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
CFX_ByteTextBuf sButton;
sButton << "q\n";
- sButton << "0 w\n" << CPWL_Utils::GetColorAppStream(GetBackgroundColor(),true);
+ sButton << "0 w\n" << CPWL_Utils::GetColorAppStream(GetBackgroundColor(),TRUE);
sButton << rectWnd.left << " " << rectWnd.bottom << " "
<< rectWnd.right - rectWnd.left << " " << rectWnd.top - rectWnd.bottom << " re b Q\n";
@@ -734,7 +734,7 @@ void CPWL_ScrollBar::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix*
}
}
-bool CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
@@ -777,22 +777,22 @@ bool CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
if (rcMinArea.Contains(point.x,point.y))
{
m_sData.SubBig();
- MovePosButton(true);
+ MovePosButton(TRUE);
NotifyScrollWindow();
}
if (rcMaxArea.Contains(point.x,point.y))
{
m_sData.AddBig();
- MovePosButton(true);
+ MovePosButton(TRUE);
NotifyScrollWindow();
}
}
- return true;
+ return TRUE;
}
-bool CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
@@ -806,9 +806,9 @@ bool CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
}
EndTimer();
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
- return true;
+ return TRUE;
}
void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -922,7 +922,7 @@ void CPWL_ScrollBar::CreateButtons(const PWL_CREATEPARAM & cp)
if (!m_pPosButton)
{
m_pPosButton = new CPWL_SBButton(m_sbType,PSBT_POS);
- m_pPosButton->SetVisible(false);
+ m_pPosButton->SetVisible(FALSE);
m_pPosButton->Create(scp);
}
}
@@ -943,12 +943,12 @@ void CPWL_ScrollBar::SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClient
if (IsFloatSmaller(m_sData.ScrollRange.GetWidth(), 0.0f))
{
- m_pPosButton->SetVisible(false);
+ m_pPosButton->SetVisible(FALSE);
}
else
{
- m_pPosButton->SetVisible(true);
- MovePosButton(true);
+ m_pPosButton->SetVisible(TRUE);
+ MovePosButton(TRUE);
}
}
}
@@ -960,7 +960,7 @@ void CPWL_ScrollBar::SetScrollPos(FX_FLOAT fPos)
m_sData.SetPos(fPos);
if (!IsFloatEqual(m_sData.fScrollPos, fOldPos))
- MovePosButton(true);
+ MovePosButton(TRUE);
}
void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep)
@@ -969,7 +969,7 @@ void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep)
m_sData.SetSmallStep(fSmallStep);
}
-void CPWL_ScrollBar::MovePosButton(bool bRefresh)
+void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh)
{
ASSERT (m_pPosButton != NULL);
ASSERT (m_pMinButton != NULL);
@@ -1031,17 +1031,17 @@ void CPWL_ScrollBar::MovePosButton(bool bRefresh)
break;
}
- m_pPosButton->Move(rcPosButton,true,bRefresh);
+ m_pPosButton->Move(rcPosButton,TRUE,bRefresh);
}
}
void CPWL_ScrollBar::OnMinButtonLBDown(const CPDF_Point & point)
{
m_sData.SubSmall();
- MovePosButton(true);
+ MovePosButton(TRUE);
NotifyScrollWindow();
- m_bMinOrMax = true;
+ m_bMinOrMax = TRUE;
EndTimer();
BeginTimer(100);
@@ -1058,10 +1058,10 @@ void CPWL_ScrollBar::OnMinButtonMouseMove(const CPDF_Point & point)
void CPWL_ScrollBar::OnMaxButtonLBDown(const CPDF_Point & point)
{
m_sData.AddSmall();
- MovePosButton(true);
+ MovePosButton(TRUE);
NotifyScrollWindow();
- m_bMinOrMax = false;
+ m_bMinOrMax = FALSE;
EndTimer();
BeginTimer(100);
@@ -1077,7 +1077,7 @@ void CPWL_ScrollBar::OnMaxButtonMouseMove(const CPDF_Point & point)
void CPWL_ScrollBar::OnPosButtonLBDown(const CPDF_Point & point)
{
- m_bMouseDown = true;
+ m_bMouseDown = TRUE;
if (m_pPosButton)
{
@@ -1104,7 +1104,7 @@ void CPWL_ScrollBar::OnPosButtonLBUp(const CPDF_Point & point)
if (!m_bNotifyForever)
NotifyScrollWindow();
}
- m_bMouseDown = false;
+ m_bMouseDown = FALSE;
}
void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point & point)
@@ -1163,7 +1163,7 @@ void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point & point)
if (!IsFloatEqual(fOldScrollPos, m_sData.fScrollPos))
{
- MovePosButton(true);
+ MovePosButton(TRUE);
if (m_bNotifyForever)
NotifyScrollWindow();
@@ -1297,7 +1297,7 @@ void CPWL_ScrollBar::TimerProc()
if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0)
{
- MovePosButton(true);
+ MovePosButton(TRUE);
NotifyScrollWindow();
}
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
index 23be71a29d..76b2bd333a 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
@@ -70,9 +70,9 @@ CPWL_Signature::CPWL_Signature() :
m_pText(NULL),
m_pDescription(NULL),
m_pImage(NULL),
- m_bTextExist(true),
- m_bImageExist(false),
- m_bFlagExist(true)
+ m_bTextExist(TRUE),
+ m_bImageExist(FALSE),
+ m_bFlagExist(TRUE)
{
}
@@ -80,21 +80,21 @@ CPWL_Signature::~CPWL_Signature()
{
}
-void CPWL_Signature::SetTextFlag(bool bTextExist)
+void CPWL_Signature::SetTextFlag(FX_BOOL bTextExist)
{
m_bTextExist = bTextExist;
RePosChildWnd();
}
-void CPWL_Signature::SetImageFlag(bool bImageExist)
+void CPWL_Signature::SetImageFlag(FX_BOOL bImageExist)
{
m_bImageExist = bImageExist;
RePosChildWnd();
}
-void CPWL_Signature::SetFoxitFlag(bool bFlagExist)
+void CPWL_Signature::SetFoxitFlag(FX_BOOL bFlagExist)
{
m_bFlagExist = bFlagExist;
}
@@ -135,7 +135,7 @@ void CPWL_Signature::RePosChildWnd()
CPDF_Rect rcText = rcClient;
CPDF_Rect rcDescription = rcClient;
- bool bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0;
+ FX_BOOL bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0;
if ((bTextVisible || m_bImageExist) &&
m_pDescription->GetText().GetLength() > 0)
@@ -155,9 +155,9 @@ void CPWL_Signature::RePosChildWnd()
m_pText->SetVisible(bTextVisible);
m_pImage->SetVisible(m_bImageExist);
- m_pText->Move(rcText, true, false);
- m_pImage->Move(rcText, true, false);
- m_pDescription->Move(rcDescription, true, false);
+ m_pText->Move(rcText, TRUE, FALSE);
+ m_pImage->Move(rcText, TRUE, FALSE);
+ m_pDescription->Move(rcDescription, TRUE, FALSE);
}
void CPWL_Signature::CreateChildWnd(const PWL_CREATEPARAM & cp)
diff --git a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
index 7bb38c4bfe..90fa8f880d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
@@ -32,7 +32,7 @@ CPDF_Rect CPWL_PushButton::GetFocusRect() const
/* --------------------------- CPWL_CheckBox ---------------------------- */
-CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false)
+CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(FALSE)
{
}
@@ -45,33 +45,33 @@ CFX_ByteString CPWL_CheckBox::GetClassName() const
return "CPWL_CheckBox";
}
-void CPWL_CheckBox::SetCheck(bool bCheck)
+void CPWL_CheckBox::SetCheck(FX_BOOL bCheck)
{
m_bChecked = bCheck;
}
-bool CPWL_CheckBox::IsChecked() const
+FX_BOOL CPWL_CheckBox::IsChecked() const
{
return m_bChecked;
}
-bool CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (IsReadOnly()) return false;
+ if (IsReadOnly()) return FALSE;
SetCheck(!IsChecked());
- return true;
+ return TRUE;
}
-bool CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
SetCheck(!IsChecked());
- return true;
+ return TRUE;
}
/* --------------------------- CPWL_RadioButton ---------------------------- */
-CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false)
+CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(FALSE)
{
}
@@ -84,27 +84,27 @@ CFX_ByteString CPWL_RadioButton::GetClassName() const
return "CPWL_RadioButton";
}
-bool CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
- if (IsReadOnly()) return false;
+ if (IsReadOnly()) return FALSE;
- SetCheck(true);
- return true;
+ SetCheck(TRUE);
+ return TRUE;
}
-void CPWL_RadioButton::SetCheck(bool bCheck)
+void CPWL_RadioButton::SetCheck(FX_BOOL bCheck)
{
m_bChecked = bCheck;
}
-bool CPWL_RadioButton::IsChecked() const
+FX_BOOL CPWL_RadioButton::IsChecked() const
{
return m_bChecked;
}
-bool CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
- SetCheck(true);
- return true;
+ SetCheck(TRUE);
+ return TRUE;
}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index 4e4ac94238..b9ba7661af 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -87,13 +87,13 @@ CPDF_Rect CPWL_Utils::OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y)
rect.right + x,rect.top + y);
}
-bool CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild)
+FX_BOOL CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild)
{
return rcChild.left >= rcParent.left && rcChild.bottom >= rcParent.bottom &&
rcChild.right <= rcParent.right && rcChild.top <= rcParent.top;
}
-bool CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2)
+FX_BOOL CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2)
{
FX_FLOAT left = rect1.left > rect2.left ? rect1.left : rect2.left;
FX_FLOAT right = rect1.right < rect2.right ? rect1.right : rect2.right;
@@ -420,7 +420,7 @@ CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect & rect,const CPW
{
CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor = GetColorAppStream(color,true);
+ CFX_ByteString sColor = GetColorAppStream(color,TRUE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << sColor;
@@ -435,7 +435,7 @@ CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect & rect,const C
{
CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor = GetColorAppStream(color,true);
+ CFX_ByteString sColor = GetColorAppStream(color,TRUE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n";
@@ -458,7 +458,7 @@ CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect & rect)
}
CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange,
- bool bContinuous, FX_WORD SubWord)
+ FX_BOOL bContinuous, FX_WORD SubWord)
{
return IFX_Edit::GetEditAppearanceStream(pEdit,ptOffset,pRange,bContinuous,SubWord);
}
@@ -498,7 +498,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter
FX_FLOAT fY = 0.0f;
FX_FLOAT fStep = 0.0f;
- bool bBreak = false;
+ FX_BOOL bBreak = FALSE;
if (pIterator)
{
@@ -538,7 +538,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter
fEndX = word.ptWord.x + word.fWidth;
}
- bBreak = true;
+ bBreak = TRUE;
}
else
{
@@ -569,7 +569,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
{
pIterator->SetAt(pRange->BeginPos);
- bool bLatinWord = false;
+ FX_BOOL bLatinWord = FALSE;
CPVT_WordPlace wpWordStart;
CFX_ByteString sWord;
@@ -587,7 +587,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
if (!bLatinWord)
{
wpWordStart = place;
- bLatinWord = true;
+ bLatinWord = TRUE;
}
sWord += (char)word.Word;
@@ -602,7 +602,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
pIterator->SetAt(place);
}
- bLatinWord = false;
+ bLatinWord = FALSE;
}
sWord.Empty();
@@ -614,7 +614,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
{
if (!pSpellCheck->CheckWord(sWord))
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
- bLatinWord = false;
+ bLatinWord = FALSE;
sWord.Empty();
}
}
@@ -625,7 +625,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
if (!pSpellCheck->CheckWord(sWord))
sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
- bLatinWord = false;
+ bLatinWord = FALSE;
sWord.Empty();
}
}
@@ -636,7 +636,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap,
const CFX_WideString & sText, int32_t nAlignmentH, int32_t nAlignmentV,
- FX_FLOAT fFontSize, bool bMultiLine, bool bAutoReturn, const CPWL_Color & crText)
+ FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText)
{
CFX_ByteTextBuf sRet;
@@ -649,7 +649,7 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_Fo
pEdit->SetMultiLine(bMultiLine);
pEdit->SetAutoReturn(bAutoReturn);
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(true);
+ pEdit->SetAutoFontSize(TRUE);
else
pEdit->SetFontSize(fFontSize);
@@ -683,10 +683,10 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
pEdit->SetFontMap(pFontMap);
pEdit->SetAlignmentH(1);
pEdit->SetAlignmentV(1);
- pEdit->SetMultiLine(false);
- pEdit->SetAutoReturn(false);
+ pEdit->SetMultiLine(FALSE);
+ pEdit->SetAutoReturn(FALSE);
if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(true);
+ pEdit->SetAutoFontSize(TRUE);
else
pEdit->SetFontSize(fFontSize);
@@ -892,7 +892,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
if (!rcIcon.IsEmpty())
{
- Icon.Move(rcIcon, false, false);
+ Icon.Move(rcIcon, FALSE, FALSE);
sTemp << Icon.GetImageAppStream();
}
@@ -923,7 +923,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
return "";
}
-CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const bool & bFillOrStroke)
+CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke)
{
CFX_ByteTextBuf sColorStream;
@@ -967,7 +967,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
{
default:
case PBS_SOLID:
- sColor = CPWL_Utils::GetColorAppStream(color,true);
+ sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -978,7 +978,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
}
break;
case PBS_DASH:
- sColor = CPWL_Utils::GetColorAppStream(color,false);
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -992,7 +992,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
break;
case PBS_BEVELED:
case PBS_INSET:
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,true);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,TRUE);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1004,7 +1004,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,true);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,TRUE);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1016,7 +1016,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n";
}
- sColor = CPWL_Utils::GetColorAppStream(color,true);
+ sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1026,7 +1026,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
}
break;
case PBS_UNDERLINED:
- sColor = CPWL_Utils::GetColorAppStream(color,false);
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << sColor;
@@ -1065,7 +1065,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
case PBS_SOLID:
case PBS_UNDERLINED:
{
- sColor = CPWL_Utils::GetColorAppStream(color,false);
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fWidth << " w\n" << sColor
@@ -1076,7 +1076,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
break;
case PBS_DASH:
{
- sColor = CPWL_Utils::GetColorAppStream(color,false);
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fWidth << " w\n"
@@ -1090,7 +1090,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
{
FX_FLOAT fHalfWidth = fWidth / 2.0f;
- sColor = CPWL_Utils::GetColorAppStream(color,false);
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1098,7 +1098,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,false);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1106,7 +1106,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,false);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1119,7 +1119,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
{
FX_FLOAT fHalfWidth = fWidth / 2.0f;
- sColor = CPWL_Utils::GetColorAppStream(color,false);
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1127,7 +1127,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,false);
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1135,7 +1135,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
<< " S\nQ\n";
}
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,false);
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
if (sColor.GetLength() > 0)
{
sAppStream << "q\n" << fHalfWidth << " w\n"
@@ -1208,42 +1208,42 @@ CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevi
CFX_ByteString CPWL_Utils::GetAppStream_Check(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,false) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,FALSE) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n";
+ sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Square(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
{
CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,true) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n";
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n";
return sAP.GetByteString();
}
@@ -1299,7 +1299,7 @@ CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect & rcBBox)
if (!rcBBox.IsEmpty())
{
- sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),true);
+ sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),TRUE);
sAppStream << rcBBox.left << " " << rcBBox.bottom << " "
<< rcBBox.right - rcBBox.left << " " << rcBBox.top - rcBBox.bottom << " re f\n";
sAppStream << "Q\n";
@@ -1474,7 +1474,7 @@ void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devi
}
void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- bool bVertical, bool bHorizontal, CPDF_Rect rect,
+ FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect,
int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray)
{
FX_FLOAT fStepGray = 1.0f;
@@ -1638,7 +1638,7 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV
FX_FLOAT fY = 0.0f;
FX_FLOAT fStep = 0.0f;
- bool bBreak = false;
+ FX_BOOL bBreak = FALSE;
if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
{
@@ -1678,7 +1678,7 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV
fEndX = word.ptWord.x + word.fWidth;
}
- bBreak = true;
+ bBreak = TRUE;
}
else
{
@@ -1700,7 +1700,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
const FX_COLORREF crSpell = ArgbEncode(255,255,0,0);
//for spellcheck
- bool bLatinWord = false;
+ FX_BOOL bLatinWord = FALSE;
CPVT_WordPlace wpWordStart;
CFX_ByteString sLatinWord;
@@ -1744,7 +1744,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
if (!bLatinWord)
{
wpWordStart = place;
- bLatinWord = true;
+ bLatinWord = TRUE;
}
sLatinWord += (char)word.Word;
@@ -1761,7 +1761,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pIterator->SetAt(place);
}
}
- bLatinWord = false;
+ bLatinWord = FALSE;
}
sLatinWord.Empty();
@@ -1781,7 +1781,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pIterator->SetAt(place);
}
}
- bLatinWord = false;
+ bLatinWord = FALSE;
}
sLatinWord.Empty();
@@ -1806,12 +1806,12 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
pDevice->RestoreState();
}
-bool CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
+FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
{
switch (color.nColorType)
{
case COLORTYPE_TRANSPARENT:
- return false;
+ return FALSE;
case COLORTYPE_GRAY:
return color.fColor1 < 0.5f;
case COLORTYPE_RGB:
@@ -1820,7 +1820,7 @@ bool CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
return color.fColor1 + color.fColor2 + color.fColor3 + color.fColor4 > 2.0f;
}
- return true;
+ return TRUE;
}
CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color)
@@ -1851,8 +1851,8 @@ CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color)
CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill,
const CPWL_Color& crStroke)
{
- CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, false);
- sAppStream += CPWL_Utils::GetColorAppStream(crFill, true);
+ CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE);
+ sAppStream += CPWL_Utils::GetColorAppStream(crFill, TRUE);
CFX_ByteString sPath;
CFX_PathData path;
diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
index f214fb30a2..433b3c6846 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
@@ -123,40 +123,40 @@ public:
m_pMainKeyboardWnd = NULL;
}
- bool IsWndCreated(const CPWL_Wnd * pWnd) const
+ FX_BOOL IsWndCreated(const CPWL_Wnd * pWnd) const
{
return m_pCreatedWnd == pWnd;
}
- bool IsMainCaptureMouse(const CPWL_Wnd * pWnd) const
+ FX_BOOL IsMainCaptureMouse(const CPWL_Wnd * pWnd) const
{
return pWnd == m_pMainMouseWnd;
}
- bool IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
+ FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
{
if (pWnd)
for( int32_t i=0,sz=m_aMousePath.GetSize(); i<sz; i++)
if (m_aMousePath.GetAt(i) == pWnd)
- return true;
+ return TRUE;
- return false;
+ return FALSE;
}
- bool IsMainCaptureKeyboard(const CPWL_Wnd * pWnd) const
+ FX_BOOL IsMainCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
return pWnd == m_pMainKeyboardWnd;
}
- bool IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
+ FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
if (pWnd)
for( int32_t i=0,sz=m_aKeyboardPath.GetSize(); i<sz; i++)
if (m_aKeyboardPath.GetAt(i) == pWnd)
- return true;
+ return TRUE;
- return false;
+ return FALSE;
}
void SetFocus(CPWL_Wnd * pWnd)
@@ -225,16 +225,16 @@ CPWL_Wnd::CPWL_Wnd() :
m_pVScrollBar(NULL),
m_rcWindow(),
m_rcClip(),
- m_bCreated(false),
- m_bVisible(false),
- m_bNotifying(false),
- m_bEnabled(true)
+ m_bCreated(FALSE),
+ m_bVisible(FALSE),
+ m_bNotifying(FALSE),
+ m_bEnabled(TRUE)
{
}
CPWL_Wnd::~CPWL_Wnd()
{
- ASSERT(m_bCreated == false);
+ ASSERT(m_bCreated == FALSE);
}
CFX_ByteString CPWL_Wnd::GetClassName() const
@@ -272,7 +272,7 @@ void CPWL_Wnd::Create(const PWL_CREATEPARAM & cp)
OnCreated();
RePosChildWnd();
- m_bCreated = true;
+ m_bCreated = TRUE;
}
}
@@ -308,7 +308,7 @@ void CPWL_Wnd::Destroy()
if (m_sPrivateParam.pParentWnd)
m_sPrivateParam.pParentWnd->OnNotify(this, PNM_REMOVECHILD);
- m_bCreated = false;
+ m_bCreated = FALSE;
}
DestroyMsgControl();
@@ -318,7 +318,7 @@ void CPWL_Wnd::Destroy()
m_pVScrollBar = NULL;
}
-void CPWL_Wnd::Move(const CPDF_Rect & rcNew, bool bReset,bool bRefresh)
+void CPWL_Wnd::Move(const CPDF_Rect & rcNew, FX_BOOL bReset,FX_BOOL bRefresh)
{
if (IsValid())
{
@@ -494,7 +494,7 @@ void CPWL_Wnd::InvalidateRect(CPDF_Rect* pRect)
}
#define PWL_IMPLEMENT_KEY_METHOD(key_method_name)\
-bool CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
+FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
{\
if (IsValid() && IsVisible() && IsEnabled())\
{\
@@ -512,11 +512,11 @@ bool CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
}\
}\
}\
- return false;\
+ return FALSE;\
}
#define PWL_IMPLEMENT_MOUSE_METHOD(mouse_method_name)\
-bool CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
+FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
{\
if (IsValid() && IsVisible() && IsEnabled())\
{\
@@ -550,7 +550,7 @@ bool CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
SetCursor();\
}\
}\
- return false;\
+ return FALSE;\
}
PWL_IMPLEMENT_KEY_METHOD(OnKeyDown)
@@ -567,7 +567,7 @@ PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDown)
PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp)
PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)
-bool CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
if (IsValid() && IsVisible() && IsEnabled())
{
@@ -586,7 +586,7 @@ bool CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFl
}
}
}
- return false;
+ return FALSE;
}
void CPWL_Wnd::AddChild(CPWL_Wnd * pWnd)
@@ -624,7 +624,7 @@ void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t
}
}
-bool CPWL_Wnd::IsValid() const
+FX_BOOL CPWL_Wnd::IsValid() const
{
return m_bCreated;
}
@@ -677,7 +677,7 @@ CPDF_Rect CPWL_Wnd::GetWindowCenterSquare() const
return CPWL_Utils::GetCenterSquare(CPWL_Utils::DeflateRect(GetWindowRect(),0.1f));
}
-bool CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const
+FX_BOOL CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const
{
return (m_sPrivateParam.dwFlags & dwFlags) != 0;
}
@@ -865,12 +865,12 @@ void CPWL_Wnd::OnKillFocus()
{
}
-bool CPWL_Wnd::WndHitTest(const CPDF_Point & point) const
+FX_BOOL CPWL_Wnd::WndHitTest(const CPDF_Point & point) const
{
return IsValid() && IsVisible() && GetWindowRect().Contains(point.x,point.y);
}
-bool CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const
+FX_BOOL CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const
{
return IsValid() && IsVisible() && GetClientRect().Contains(point.x,point.y);
}
@@ -883,7 +883,7 @@ const CPWL_Wnd* CPWL_Wnd::GetRootWnd() const
return this;
}
-void CPWL_Wnd::SetVisible(bool bVisible)
+void CPWL_Wnd::SetVisible(FX_BOOL bVisible)
{
if (IsValid())
{
@@ -915,7 +915,7 @@ CPDF_Rect CPWL_Wnd::GetClipRect() const
return m_rcClip;
}
-bool CPWL_Wnd::IsReadOnly() const
+FX_BOOL CPWL_Wnd::IsReadOnly() const
{
return HasFlag(PWS_READONLY);
}
@@ -931,7 +931,7 @@ void CPWL_Wnd::RePosChildWnd()
rcContent.right-1.0f,
rcContent.top);
- if (pVSB) pVSB->Move(rcVScroll,true,false);
+ if (pVSB) pVSB->Move(rcVScroll,TRUE,FALSE);
}
void CPWL_Wnd::CreateChildWnd(const PWL_CREATEPARAM & cp)
@@ -968,33 +968,33 @@ CPWL_MsgControl* CPWL_Wnd::GetMsgControl() const
return m_sPrivateParam.pMsgControl;
}
-bool CPWL_Wnd::IsCaptureMouse() const
+FX_BOOL CPWL_Wnd::IsCaptureMouse() const
{
return IsWndCaptureMouse(this);
}
-bool CPWL_Wnd::IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
+FX_BOOL CPWL_Wnd::IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsWndCaptureMouse(pWnd);
- return false;
+ return FALSE;
}
-bool CPWL_Wnd::IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
+FX_BOOL CPWL_Wnd::IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsWndCaptureKeyboard(pWnd);
- return false;
+ return FALSE;
}
-bool CPWL_Wnd::IsFocused() const
+FX_BOOL CPWL_Wnd::IsFocused() const
{
if (CPWL_MsgControl * pCtrl = GetMsgControl())
return pCtrl->IsMainCaptureKeyboard(this);
- return false;
+ return FALSE;
}
CPDF_Rect CPWL_Wnd::GetFocusRect() const
@@ -1217,7 +1217,7 @@ const CPWL_Wnd* CPWL_Wnd::GetFocused() const
return NULL;
}
-void CPWL_Wnd::EnableWindow(bool bEnable)
+void CPWL_Wnd::EnableWindow(FX_BOOL bEnable)
{
if (m_bEnabled != bEnable)
{
@@ -1238,7 +1238,7 @@ void CPWL_Wnd::EnableWindow(bool bEnable)
}
}
-bool CPWL_Wnd::IsEnabled()
+FX_BOOL CPWL_Wnd::IsEnabled()
{
return m_bEnabled;
}
@@ -1251,42 +1251,42 @@ void CPWL_Wnd::OnDisabled()
{
}
-bool CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const
+FX_BOOL CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsCTRLKeyDown(nFlag);
}
- return false;
+ return FALSE;
}
-bool CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const
+FX_BOOL CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsSHIFTKeyDown(nFlag);
}
- return false;
+ return FALSE;
}
-bool CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const
+FX_BOOL CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsALTKeyDown(nFlag);
}
- return false;
+ return FALSE;
}
-bool CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const
+FX_BOOL CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const
{
if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
{
return pSystemHandler->IsINSERTKeyDown(nFlag);
}
- return false;
+ return FALSE;
}