diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-27 11:55:29 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-27 11:55:29 -0700 |
commit | ff46aaf499edcf153ee2f57c7016587aa96dcfa0 (patch) | |
tree | 0a0d92713af476897899b126d180cc6294433d10 /fpdfsdk/include/fxedit | |
parent | aafeff816e22c1333c17d8a0eb4fe8927c28142d (diff) | |
download | pdfium-ff46aaf499edcf153ee2f57c7016587aa96dcfa0.tar.xz |
FX Bool considered harmful, part 3
Try to reland this patch after fixing underlying issues that
caused it to be reverted.
fx_system.h is the only manual edit.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1258093002 .
Diffstat (limited to 'fpdfsdk/include/fxedit')
-rw-r--r-- | fpdfsdk/include/fxedit/fx_edit.h | 164 | ||||
-rw-r--r-- | fpdfsdk/include/fxedit/fxet_edit.h | 224 | ||||
-rw-r--r-- | fpdfsdk/include/fxedit/fxet_list.h | 64 |
3 files changed, 226 insertions, 226 deletions
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h index bf46e91819..45d2646c19 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(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place) = 0; + virtual void IOnSetCaret(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 FX_BOOL NextWord() = 0; + virtual bool NextWord() = 0; //move the current position to the next line. - virtual FX_BOOL NextLine() = 0; + virtual bool NextLine() = 0; //move the current position to the next section. - virtual FX_BOOL NextSection() = 0; + virtual bool NextSection() = 0; //move the current position to the previous word. - virtual FX_BOOL PrevWord() = 0; + virtual bool PrevWord() = 0; //move the current position to the previous line. - virtual FX_BOOL PrevLine() = 0; + virtual bool PrevLine() = 0; //move the current position to the previous section. - virtual FX_BOOL PrevSection() = 0; + virtual bool PrevSection() = 0; //get the information of the current word. - virtual FX_BOOL GetWord(CPVT_Word & word) const = 0; + virtual bool GetWord(CPVT_Word & word) const = 0; //get the information of the current line. - virtual FX_BOOL GetLine(CPVT_Line & line) const = 0; + virtual bool GetLine(CPVT_Line & line) const = 0; //get the information of the current section. - virtual FX_BOOL GetSection(CPVT_Section & section) const = 0; + virtual 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, FX_BOOL bPaint = TRUE) = 0; + virtual void SetPlateRect(const CPDF_Rect & rect, 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, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAlignmentH(int32_t nFormat = 0, 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, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAlignmentV(int32_t nFormat = 0, bool bPaint = true) = 0; //if the text is shown in secret , set a character for substitute. - virtual void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) = 0; + virtual void SetPasswordChar(FX_WORD wSubWord = '*', bool bPaint = true) = 0; //set the maximal count of words of the text. - virtual void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0; + virtual void SetLimitChar(int32_t nLimitChar = 0, 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, FX_BOOL bPaint = TRUE) = 0; + virtual void SetCharArray(int32_t nCharArray = 0, bool bPaint = true) = 0; //set the space of two characters. - virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) = 0; + virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, bool bPaint = true) = 0; //set the horizontal scale of all characters. - virtual void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0; + virtual void SetHorzScale(int32_t nHorzScale = 100, bool bPaint = true) = 0; //set the leading of all lines - virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0; + virtual void SetLineLeading(FX_FLOAT fLineLeading, bool bPaint = true) = 0; //if set, CRLF is allowed. - virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE) = 0; + virtual void SetMultiLine(bool bMultiLine = true, bool bPaint = true) = 0; //if set, all words auto fit the width of the bounding box. - virtual void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAutoReturn(bool bAuto = true, bool bPaint = true) = 0; //if set, a font size is calculated to full fit the bounding box. - virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAutoFontSize(bool bAuto = true, bool bPaint = true) = 0; //is set, the text is allowed to scroll. - virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; + virtual void SetAutoScroll(bool bAuto = true, bool bPaint = true) = 0; //set the font size of all words. - virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0; + virtual void SetFontSize(FX_FLOAT fFontSize, bool bPaint = true) = 0; //the text is allowed to auto-scroll, allow the text overflow? - virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE) = 0; + virtual void SetTextOverflow(bool bAllowed = false, bool bPaint = true) = 0; //query if the edit is richedit. - virtual FX_BOOL IsRichText() const = 0; + virtual bool IsRichText() const = 0; //set the edit is richedit. - virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0; + virtual void SetRichText(bool bRichText = true, bool bPaint = true) = 0; //set the fontsize of selected text. - virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0; + virtual bool SetRichFontSize(FX_FLOAT fFontSize) = 0; //set the fontindex of selected text, user can change the font of selected text. - virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0; + virtual bool SetRichFontIndex(int32_t nFontIndex) = 0; //set the textcolor of selected text. - virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0; + virtual bool SetRichTextColor(FX_COLORREF dwColor) = 0; //set the text script type of selected text. (0:normal 1:superscript 2:subscript) - virtual FX_BOOL SetRichTextScript(int32_t nScriptType) = 0; + virtual bool SetRichTextScript(int32_t nScriptType) = 0; //set the bold font style of selected text. - virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0; + virtual bool SetRichTextBold(bool bBold = true) = 0; //set the italic font style of selected text. - virtual FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0; + virtual bool SetRichTextItalic(bool bItalic = true) = 0; //set the underline style of selected text. - virtual FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0; + virtual bool SetRichTextUnderline(bool bUnderline = true) = 0; //set the crossout style of selected text. - virtual FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0; + virtual bool SetRichTextCrossout(bool bCrossout = true) = 0; //set the charspace of selected text, in user coordinate. - virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0; + virtual bool SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0; //set the horizontal scale of selected text, default value is 100. - virtual FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) = 0; + virtual bool SetRichTextHorzScale(int32_t nHorzScale = 100) = 0; //set the leading of selected section, in user coordinate. - virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0; + virtual bool SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0; //set the indent of selected section, in user coordinate. - virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0; + virtual bool SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0; //set the alignment of selected section, nAlignment(0:left 1:middle 2:right) - virtual FX_BOOL SetRichTextAlignment(int32_t nAlignment) = 0; + virtual 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 FX_BOOL IsSelected() const = 0; + virtual 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,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; + //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; //send the UP key message to edit. - virtual void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0; + virtual void OnVK_UP(bool bShift,bool bCtrl) = 0; //send the DOWN key message to edit. - virtual void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0; + virtual void OnVK_DOWN(bool bShift,bool bCtrl) = 0; //send the LEFT key message to edit. - virtual void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0; + virtual void OnVK_LEFT(bool bShift,bool bCtrl) = 0; //send the RIGHT key message to edit. - virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0; + virtual void OnVK_RIGHT(bool bShift,bool bCtrl) = 0; //send the HOME key message to edit. - virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0; + virtual void OnVK_HOME(bool bShift,bool bCtrl) = 0; //send the END key message to edit. - virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0; + virtual void OnVK_END(bool bShift,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 FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0; + virtual bool InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0; //insert a return into the edit. - virtual FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; + virtual bool InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //insert text into the edit. - virtual FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET, + virtual 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 FX_BOOL Backspace() = 0; + virtual bool Backspace() = 0; //do delete operation. - virtual FX_BOOL Delete() = 0; + virtual bool Delete() = 0; //delete the selected text. - virtual FX_BOOL Clear() = 0; + virtual bool Clear() = 0; //do Redo operation. - virtual FX_BOOL Redo() = 0; + virtual bool Redo() = 0; //do Undo operation. - virtual FX_BOOL Undo() = 0; + virtual 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(FX_BOOL bRefresh) = 0; + virtual void EnableRefresh(bool bRefresh) = 0; virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0; //allow undo/redo? - virtual void EnableUndo(FX_BOOL bUndo) = 0; + virtual void EnableUndo(bool bUndo) = 0; //allow notify? - virtual void EnableNotify(FX_BOOL bNotify) = 0; + virtual void EnableNotify(bool bNotify) = 0; //allow opr notify? - virtual void EnableOprNotify(FX_BOOL bNotify) = 0; + virtual void EnableOprNotify(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 FX_BOOL IsTextFull() const = 0; - virtual FX_BOOL CanUndo() const = 0; - virtual FX_BOOL CanRedo() const = 0; + virtual bool IsTextFull() const = 0; + virtual bool CanUndo() const = 0; + virtual bool CanRedo() const = 0; //if the content is changed after settext? - virtual FX_BOOL IsModified() const = 0; + virtual 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, - FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0); + 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 FX_BOOL IsItemSelected(int32_t nIndex) const = 0; + virtual bool IsItemSelected(int32_t nIndex) const = 0; virtual FX_FLOAT GetFirstHeight() 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 void SetMultipleSel(bool bMultiple) = 0; + virtual bool IsMultipleSel() const = 0; + virtual 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,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; + 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; protected: ~IFX_List() { } diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h index 7a2742f0ee..f728d8735e 100644 --- a/fpdfsdk/include/fxedit/fxet_edit.h +++ b/fpdfsdk/include/fxedit/fxet_edit.h @@ -68,27 +68,27 @@ struct CFX_Edit_LineRect { } - FX_BOOL operator != (const CFX_Edit_LineRect & linerect) const + bool operator != (const CFX_Edit_LineRect & linerect) const { return FXSYS_memcmp(this, &linerect, sizeof(CFX_Edit_LineRect)) != 0; } - FX_BOOL IsSameHeight(const CFX_Edit_LineRect & linerect) const + 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)); } - FX_BOOL IsSameTop(const CFX_Edit_LineRect & linerect) const + bool IsSameTop(const CFX_Edit_LineRect & linerect) const { return FX_EDIT_IsFloatZero(m_rcLine.top - linerect.m_rcLine.top); } - FX_BOOL IsSameLeft(const CFX_Edit_LineRect & linerect) const + bool IsSameLeft(const CFX_Edit_LineRect & linerect) const { return FX_EDIT_IsFloatZero(m_rcLine.left - linerect.m_rcLine.left); } - FX_BOOL IsSameRight(const CFX_Edit_LineRect & linerect) const + 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; } - FX_BOOL IsExist() const + bool IsExist() const { return BeginPos != EndPos; } - FX_BOOL operator != (const CPVT_WordRange & wr) const + 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); - FX_BOOL CanUndo() const; - FX_BOOL CanRedo() const; - FX_BOOL IsModified() const; - FX_BOOL IsWorking() const; + bool CanUndo() const; + bool CanRedo() const; + bool IsModified() const; + bool IsWorking() const; void Reset(); @@ -316,26 +316,26 @@ private: int32_t m_nCurUndoPos; int32_t m_nBufSize; - FX_BOOL m_bModified; - FX_BOOL m_bVirgin; - FX_BOOL m_bWorking; + bool m_bModified; + bool m_bVirgin; + 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(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;} + void SetFirst(bool bFirst){m_bFirst = bFirst;} + bool IsFirst(){return m_bFirst;} + void SetLast(bool bLast){m_bLast = bLast;} + bool IsLast(){return m_bLast;} private: - FX_BOOL m_bFirst; - FX_BOOL m_bLast; + bool m_bFirst; + 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, FX_BOOL bSecEnd); + const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, bool bSecEnd); virtual ~CFXEU_Delete(); void Redo(); @@ -439,7 +439,7 @@ private: int32_t m_nCharset; CPVT_SecProps m_SecProps; CPVT_WordProps m_WordProps; - FX_BOOL m_bSecEnd; + 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, FX_BOOL bPaint = TRUE); + void SetPlateRect(const CPDF_Rect & rect, bool bPaint = true); void SetScrollPos(const CPDF_Point & point); - 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 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 SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); - 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, + 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, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); - FX_BOOL Redo(); - FX_BOOL Undo(); + bool Redo(); + 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); - FX_BOOL IsSelected() const; + 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(FX_BOOL bNotify); + void EnableNotify(bool bNotify); void SetText(const FX_WCHAR* text,int32_t charset, - 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 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 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); + 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); 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(FX_BOOL bRefresh); + void EnableRefresh(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(FX_BOOL bUndo); - void EnableOprNotify(FX_BOOL bNotify); + void EnableUndo(bool bUndo); + void EnableOprNotify(bool bNotify); - FX_BOOL IsTextFull() const; - FX_BOOL IsTextOverflow() const; - FX_BOOL CanUndo() const; - FX_BOOL CanRedo() const; - FX_BOOL IsModified() const; + bool IsTextFull() const; + bool IsTextOverflow() const; + bool CanUndo() const; + bool CanRedo() const; + bool IsModified() const; void BeginGroupUndo(const CFX_WideString& sTitle); void EndGroupUndo(); @@ -751,19 +751,19 @@ private: CPDF_Point m_ptScrollPos; CPDF_Point m_ptRefreshScrollPos; - FX_BOOL m_bEnableScroll; + 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; - FX_BOOL m_bNotifyFlag; - FX_BOOL m_bEnableOverflow; - FX_BOOL m_bEnableRefresh; + bool m_bNotifyFlag; + bool m_bEnableOverflow; + bool m_bEnableRefresh; CPDF_Rect m_rcOldContent; - FX_BOOL m_bEnableUndo; - FX_BOOL m_bNotify; - FX_BOOL m_bOprNotify; + bool m_bEnableUndo; + bool m_bNotify; + 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(); - FX_BOOL NextWord(); - FX_BOOL NextLine(); - FX_BOOL NextSection(); - FX_BOOL PrevWord(); - FX_BOOL PrevLine(); - FX_BOOL PrevSection(); + bool NextWord(); + bool NextLine(); + bool NextSection(); + bool PrevWord(); + bool PrevLine(); + bool PrevSection(); - FX_BOOL GetWord(CPVT_Word & word) const; - FX_BOOL GetLine(CPVT_Line & line) const; - FX_BOOL GetSection(CPVT_Section & section) const; + bool GetWord(CPVT_Word & word) const; + bool GetLine(CPVT_Line & line) const; + 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(); - FX_BOOL IsLatinWord(FX_WORD word); + 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 fe75b0fc35..07edb46887 100644 --- a/fpdfsdk/include/fxedit/fxet_list.h +++ b/fpdfsdk/include/fxedit/fxet_list.h @@ -31,7 +31,7 @@ public: y = 0.0f; } - FX_BOOL operator != (const CLST_Size & size) const + bool operator != (const CLST_Size & size) const { return FXSYS_memcmp(this, &size, sizeof(CLST_Size)) != 0; } @@ -81,12 +81,12 @@ public: return *this; } - FX_BOOL operator == (const CLST_Rect & rect) const + bool operator == (const CLST_Rect & rect) const { return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) == 0; } - FX_BOOL operator != (const CLST_Rect & rect) const + 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(FX_BOOL bSelected); - void SetCaret(FX_BOOL bCaret); + void SetSelect(bool bSelected); + void SetCaret(bool bCaret); void SetText(const FX_WCHAR* text); void SetFontSize(FX_FLOAT fFontSize); CFX_WideString GetText() const; CLST_Rect GetRect() const; - FX_BOOL IsSelected() const; - FX_BOOL IsCaret() const; + bool IsSelected() const; + bool IsCaret() const; FX_FLOAT GetItemHeight() const; FX_WORD GetFirstChar() const; private: IFX_Edit* m_pEdit; - FX_BOOL m_bSelected; - FX_BOOL m_bCaret; + bool m_bSelected; + bool m_bCaret; CLST_Rect m_rcListItem; }; @@ -209,7 +209,7 @@ private: template<class TYPE> class CLST_ArrayTemplate : public CFX_ArrayTemplate<TYPE> { public: - FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; } + 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 FX_BOOL IsItemSelected(int32_t nIndex) const; + virtual bool IsItemSelected(int32_t nIndex) const; virtual FX_FLOAT GetFirstHeight() const; - virtual void SetMultipleSel(FX_BOOL bMultiple); - virtual FX_BOOL IsMultipleSel() const; - virtual FX_BOOL IsValid(int32_t nItemIndex) const; + virtual void SetMultipleSel(bool bMultiple); + virtual bool IsMultipleSel() const; + virtual 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, FX_BOOL bSelected); - void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret); + void SetItemSelect(int32_t nItemIndex, bool bSelected); + void SetItemCaret(int32_t nItemIndex, 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; - FX_BOOL m_bMultiple; + 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); - FX_BOOL IsExist(int32_t nItemIndex) const; + 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,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); + 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); 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, FX_BOOL bSelected); + void SetMultipleSelect(int32_t nItemIndex, bool bSelected); void SetSingleSelect(int32_t nItemIndex); void InvalidateItem(int32_t nItemIndex); void SelectItems(); - FX_BOOL IsItemVisible(int32_t nItemIndex) const; + 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; - FX_BOOL m_bNotifyFlag; + 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 - FX_BOOL m_bCtrlSel; //for multiple + bool m_bCtrlSel; //for multiple int32_t m_nCaretIndex; //for multiple }; |