| Index: xfa/fwl/core/ifwl_edit.cpp
|
| diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/core/ifwl_edit.cpp
|
| similarity index 84%
|
| rename from xfa/fwl/basewidget/fwl_editimp.cpp
|
| rename to xfa/fwl/core/ifwl_edit.cpp
|
| index 0f939f1145378a1cd1a107d887e2ab209dfe41e5..83c00627c3b741ae6a4c63c276440ada8ab69b2c 100644
|
| --- a/xfa/fwl/basewidget/fwl_editimp.cpp
|
| +++ b/xfa/fwl/core/ifwl_edit.cpp
|
| @@ -4,7 +4,7 @@
|
|
|
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
|
|
|
| -#include "xfa/fwl/basewidget/fwl_editimp.h"
|
| +#include "xfa/fwl/core/ifwl_edit.h"
|
|
|
| #include <algorithm>
|
| #include <memory>
|
| @@ -16,16 +16,12 @@
|
| #include "xfa/fde/fde_render.h"
|
| #include "xfa/fde/ifde_txtedtpage.h"
|
| #include "xfa/fgas/font/fgas_gefont.h"
|
| -#include "xfa/fwl/basewidget/fwl_caretimp.h"
|
| -#include "xfa/fwl/basewidget/fwl_comboboximp.h"
|
| -#include "xfa/fwl/basewidget/fwl_scrollbarimp.h"
|
| -#include "xfa/fwl/basewidget/ifwl_caret.h"
|
| #include "xfa/fwl/core/cfwl_message.h"
|
| #include "xfa/fwl/core/cfwl_themebackground.h"
|
| #include "xfa/fwl/core/cfwl_themepart.h"
|
| #include "xfa/fwl/core/cfwl_widgetmgr.h"
|
| -#include "xfa/fwl/core/fwl_widgetimp.h"
|
| #include "xfa/fwl/core/ifwl_app.h"
|
| +#include "xfa/fwl/core/ifwl_caret.h"
|
| #include "xfa/fwl/core/ifwl_themeprovider.h"
|
| #include "xfa/fxfa/xfa_ffdoc.h"
|
| #include "xfa/fxfa/xfa_ffwidget.h"
|
| @@ -58,147 +54,12 @@ void AddSquigglyPath(CFX_Path* pPathData,
|
| // static
|
| IFWL_Edit* IFWL_Edit::Create(const CFWL_WidgetImpProperties& properties,
|
| IFWL_Widget* pOuter) {
|
| - IFWL_Edit* pEdit = new IFWL_Edit;
|
| - CFWL_EditImp* pEditImpl = new CFWL_EditImp(properties, pOuter);
|
| - pEdit->SetImpl(pEditImpl);
|
| - pEditImpl->SetInterface(pEdit);
|
| - return pEdit;
|
| -}
|
| -// static
|
| -IFWL_Edit* IFWL_Edit::CreateComboEdit(
|
| - const CFWL_WidgetImpProperties& properties,
|
| - IFWL_Widget* pOuter) {
|
| - IFWL_Edit* pEdit = new IFWL_Edit;
|
| - CFWL_EditImp* pComboEditImpl = new CFWL_ComboEditImp(properties, pOuter);
|
| - pEdit->SetImpl(pComboEditImpl);
|
| - pComboEditImpl->SetInterface(pEdit);
|
| - return pEdit;
|
| -}
|
| -IFWL_Edit::IFWL_Edit() {}
|
| -FWL_Error IFWL_Edit::SetText(const CFX_WideString& wsText) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetText(wsText);
|
| -}
|
| -int32_t IFWL_Edit::GetTextLength() const {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->GetTextLength();
|
| -}
|
| -FWL_Error IFWL_Edit::GetText(CFX_WideString& wsText,
|
| - int32_t nStart,
|
| - int32_t nCount) const {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->GetText(wsText, nStart, nCount);
|
| -}
|
| -FWL_Error IFWL_Edit::ClearText() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->ClearText();
|
| -}
|
| -int32_t IFWL_Edit::GetCaretPos() const {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->GetCaretPos();
|
| -}
|
| -int32_t IFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetCaretPos(nIndex, bBefore);
|
| -}
|
| -FWL_Error IFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->AddSelRange(nStart, nCount);
|
| -}
|
| -int32_t IFWL_Edit::CountSelRanges() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->CountSelRanges();
|
| -}
|
| -int32_t IFWL_Edit::GetSelRange(int32_t nIndex, int32_t& nStart) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->GetSelRange(nIndex, nStart);
|
| -}
|
| -FWL_Error IFWL_Edit::ClearSelections() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->ClearSelections();
|
| -}
|
| -int32_t IFWL_Edit::GetLimit() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->GetLimit();
|
| -}
|
| -FWL_Error IFWL_Edit::SetLimit(int32_t nLimit) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetLimit(nLimit);
|
| -}
|
| -FWL_Error IFWL_Edit::SetAliasChar(FX_WCHAR wAlias) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetAliasChar(wAlias);
|
| -}
|
| -FWL_Error IFWL_Edit::Insert(int32_t nStart,
|
| - const FX_WCHAR* lpText,
|
| - int32_t nLen) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Insert(nStart, lpText, nLen);
|
| -}
|
| -FWL_Error IFWL_Edit::DeleteSelections() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->DeleteSelections();
|
| -}
|
| -FWL_Error IFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->DeleteRange(nStart, nCount);
|
| -}
|
| -FWL_Error IFWL_Edit::Replace(int32_t nStart,
|
| - int32_t nLen,
|
| - const CFX_WideStringC& wsReplace) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())
|
| - ->Replace(nStart, nLen, wsReplace);
|
| -}
|
| -FWL_Error IFWL_Edit::DoClipboard(int32_t iCmd) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->DoClipboard(iCmd);
|
| -}
|
| -FX_BOOL IFWL_Edit::Copy(CFX_WideString& wsCopy) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Copy(wsCopy);
|
| -}
|
| -FX_BOOL IFWL_Edit::Cut(CFX_WideString& wsCut) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Cut(wsCut);
|
| -}
|
| -FX_BOOL IFWL_Edit::Paste(const CFX_WideString& wsPaste) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Paste(wsPaste);
|
| -}
|
| -FX_BOOL IFWL_Edit::Delete() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Delete();
|
| -}
|
| -FX_BOOL IFWL_Edit::Redo(const IFDE_TxtEdtDoRecord* pRecord) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Redo(pRecord);
|
| -}
|
| -FX_BOOL IFWL_Edit::Undo(const IFDE_TxtEdtDoRecord* pRecord) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Undo(pRecord);
|
| -}
|
| -FX_BOOL IFWL_Edit::Undo() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Undo();
|
| -}
|
| -FX_BOOL IFWL_Edit::Redo() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->Redo();
|
| -}
|
| -FX_BOOL IFWL_Edit::CanUndo() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->CanUndo();
|
| -}
|
| -FX_BOOL IFWL_Edit::CanRedo() {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->CanRedo();
|
| -}
|
| -FWL_Error IFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())
|
| - ->SetTabWidth(fTabWidth, bEquidistant);
|
| -}
|
| -FWL_Error IFWL_Edit::SetOuter(IFWL_Widget* pOuter) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetOuter(pOuter);
|
| -}
|
| -FWL_Error IFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetNumberRange(iMin, iMax);
|
| -}
|
| -FWL_Error IFWL_Edit::SetBackColor(uint32_t dwColor) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetBackgroundColor(dwColor);
|
| -}
|
| -FWL_Error IFWL_Edit::SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetFont(wsFont, fSize);
|
| -}
|
| -void IFWL_Edit::SetScrollOffset(FX_FLOAT fScrollOffset) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())->SetScrollOffset(fScrollOffset);
|
| -}
|
| -FX_BOOL IFWL_Edit::GetSuggestWords(CFX_PointF pointf,
|
| - std::vector<CFX_ByteString>& sSuggest) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())
|
| - ->GetSuggestWords(pointf, sSuggest);
|
| -}
|
| -FX_BOOL IFWL_Edit::ReplaceSpellCheckWord(CFX_PointF pointf,
|
| - const CFX_ByteStringC& bsReplace) {
|
| - return static_cast<CFWL_EditImp*>(GetImpl())
|
| - ->ReplaceSpellCheckWord(pointf, bsReplace);
|
| + return new IFWL_Edit(properties, pOuter);
|
| }
|
|
|
| -CFWL_EditImp::CFWL_EditImp(const CFWL_WidgetImpProperties& properties,
|
| - IFWL_Widget* pOuter)
|
| - : CFWL_WidgetImp(properties, pOuter),
|
| +IFWL_Edit::IFWL_Edit(const CFWL_WidgetImpProperties& properties,
|
| + IFWL_Widget* pOuter)
|
| + : IFWL_Widget(properties, pOuter),
|
| m_fVAlignOffset(0.0f),
|
| m_fScrollOffsetX(0.0f),
|
| m_fScrollOffsetY(0.0f),
|
| @@ -220,21 +81,21 @@ CFWL_EditImp::CFWL_EditImp(const CFWL_WidgetImpProperties& properties,
|
| m_rtStatic.Reset();
|
| }
|
|
|
| -CFWL_EditImp::~CFWL_EditImp() {
|
| +IFWL_Edit::~IFWL_Edit() {
|
| ClearRecord();
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::GetClassName(CFX_WideString& wsClass) const {
|
| +FWL_Error IFWL_Edit::GetClassName(CFX_WideString& wsClass) const {
|
| wsClass = FWL_CLASS_Edit;
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Type CFWL_EditImp::GetClassID() const {
|
| +FWL_Type IFWL_Edit::GetClassID() const {
|
| return FWL_Type::Edit;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::Initialize() {
|
| - if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded)
|
| +FWL_Error IFWL_Edit::Initialize() {
|
| + if (IFWL_Widget::Initialize() != FWL_Error::Succeeded)
|
| return FWL_Error::Indefinite;
|
| if (!m_pDelegate)
|
| m_pDelegate = new CFWL_EditImpDelegate(this);
|
| @@ -246,7 +107,7 @@ FWL_Error CFWL_EditImp::Initialize() {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::Finalize() {
|
| +FWL_Error IFWL_Edit::Finalize() {
|
| if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) {
|
| ShowCaret(FALSE);
|
| }
|
| @@ -258,9 +119,9 @@ FWL_Error CFWL_EditImp::Finalize() {
|
| }
|
| delete m_pDelegate;
|
| m_pDelegate = nullptr;
|
| - return CFWL_WidgetImp::Finalize();
|
| + return IFWL_Widget::Finalize();
|
| }
|
| -FWL_Error CFWL_EditImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
|
| +FWL_Error IFWL_Edit::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
|
| if (bAutoSize) {
|
| rect.Set(0, 0, 0, 0);
|
| if (m_pEdtEngine) {
|
| @@ -274,7 +135,7 @@ FWL_Error CFWL_EditImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
|
| rect.Set(0, 0, sz.x, sz.y);
|
| }
|
| }
|
| - CFWL_WidgetImp::GetWidgetRect(rect, TRUE);
|
| + IFWL_Widget::GetWidgetRect(rect, TRUE);
|
| } else {
|
| rect = m_pProperties->m_rtWidget;
|
| if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_OuterScrollbar) {
|
| @@ -295,18 +156,18 @@ FWL_Error CFWL_EditImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -void CFWL_EditImp::SetStates(uint32_t dwStates, FX_BOOL bSet) {
|
| +void IFWL_Edit::SetStates(uint32_t dwStates, FX_BOOL bSet) {
|
| if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) ||
|
| (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)) {
|
| ShowCaret(FALSE);
|
| }
|
| - CFWL_WidgetImp::SetStates(dwStates, bSet);
|
| + IFWL_Widget::SetStates(dwStates, bSet);
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::SetWidgetRect(const CFX_RectF& rect) {
|
| - return CFWL_WidgetImp::SetWidgetRect(rect);
|
| +FWL_Error IFWL_Edit::SetWidgetRect(const CFX_RectF& rect) {
|
| + return IFWL_Widget::SetWidgetRect(rect);
|
| }
|
| -FWL_Error CFWL_EditImp::Update() {
|
| +FWL_Error IFWL_Edit::Update() {
|
| if (IsLocked()) {
|
| return FWL_Error::Indefinite;
|
| }
|
| @@ -324,7 +185,7 @@ FWL_Error CFWL_EditImp::Update() {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_WidgetHit CFWL_EditImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| +FWL_WidgetHit IFWL_Edit::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_OuterScrollbar) {
|
| if (IsShowScrollBar(TRUE)) {
|
| CFX_RectF rect;
|
| @@ -344,11 +205,11 @@ FWL_WidgetHit CFWL_EditImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| return FWL_WidgetHit::Unknown;
|
| }
|
|
|
| -void CFWL_EditImp::AddSpellCheckObj(CFX_Path& PathData,
|
| - int32_t nStart,
|
| - int32_t nCount,
|
| - FX_FLOAT fOffSetX,
|
| - FX_FLOAT fOffSetY) {
|
| +void IFWL_Edit::AddSpellCheckObj(CFX_Path& PathData,
|
| + int32_t nStart,
|
| + int32_t nCount,
|
| + FX_FLOAT fOffSetX,
|
| + FX_FLOAT fOffSetY) {
|
| FX_FLOAT fStartX = 0.0f;
|
| FX_FLOAT fEndX = 0.0f;
|
| FX_FLOAT fY = 0.0f;
|
| @@ -369,11 +230,11 @@ void CFWL_EditImp::AddSpellCheckObj(CFX_Path& PathData,
|
| AddSquigglyPath(&PathData, fStartX, fEndX, fY, fStep);
|
| }
|
| }
|
| -int32_t CFWL_EditImp::GetWordAtPoint(CFX_PointF pointf, int32_t& nCount) {
|
| +int32_t IFWL_Edit::GetWordAtPoint(CFX_PointF pointf, int32_t& nCount) {
|
| return 0;
|
| }
|
| -FX_BOOL CFWL_EditImp::GetSuggestWords(CFX_PointF pointf,
|
| - std::vector<CFX_ByteString>& sSuggest) {
|
| +FX_BOOL IFWL_Edit::GetSuggestWords(CFX_PointF pointf,
|
| + std::vector<CFX_ByteString>& sSuggest) {
|
| int32_t nWordCount = 0;
|
| int32_t nWordStart = GetWordAtPoint(pointf, nWordCount);
|
| if (nWordCount < 1) {
|
| @@ -392,7 +253,7 @@ FX_BOOL CFWL_EditImp::GetSuggestWords(CFX_PointF pointf,
|
| return FALSE;
|
| }
|
| CFWL_EvtEdtCheckWord checkWordEvent;
|
| - checkWordEvent.m_pSrcTarget = m_pInterface;
|
| + checkWordEvent.m_pSrcTarget = this;
|
| checkWordEvent.bsWord = sLatinWord;
|
| checkWordEvent.bCheckWord = TRUE;
|
| DispatchEvent(&checkWordEvent);
|
| @@ -400,15 +261,15 @@ FX_BOOL CFWL_EditImp::GetSuggestWords(CFX_PointF pointf,
|
| return FALSE;
|
| }
|
| CFWL_EvtEdtGetSuggestWords suggestWordsEvent;
|
| - suggestWordsEvent.m_pSrcTarget = m_pInterface;
|
| + suggestWordsEvent.m_pSrcTarget = this;
|
| suggestWordsEvent.bsWord = sLatinWord;
|
| suggestWordsEvent.bsArraySuggestWords = sSuggest;
|
| suggestWordsEvent.bSuggestWords = FALSE;
|
| DispatchEvent(&checkWordEvent);
|
| return suggestWordsEvent.bSuggestWords;
|
| }
|
| -FX_BOOL CFWL_EditImp::ReplaceSpellCheckWord(CFX_PointF pointf,
|
| - const CFX_ByteStringC& bsReplace) {
|
| +FX_BOOL IFWL_Edit::ReplaceSpellCheckWord(CFX_PointF pointf,
|
| + const CFX_ByteStringC& bsReplace) {
|
| int32_t nWordCount = 0;
|
| int32_t nWordStart = GetWordAtPoint(pointf, nWordCount);
|
| if (nWordCount < 1) {
|
| @@ -432,8 +293,8 @@ FX_BOOL CFWL_EditImp::ReplaceSpellCheckWord(CFX_PointF pointf,
|
| Replace(nWordStart, nWordCount, wsDest.AsStringC());
|
| return TRUE;
|
| }
|
| -void CFWL_EditImp::DrawSpellCheck(CFX_Graphics* pGraphics,
|
| - const CFX_Matrix* pMatrix) {
|
| +void IFWL_Edit::DrawSpellCheck(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix) {
|
| pGraphics->SaveGraphState();
|
| if (pMatrix) {
|
| pGraphics->ConcatMatrix(const_cast<CFX_Matrix*>(pMatrix));
|
| @@ -441,7 +302,7 @@ void CFWL_EditImp::DrawSpellCheck(CFX_Graphics* pGraphics,
|
| FX_ARGB cr = 0xFFFF0000;
|
| CFX_Color crLine(cr);
|
| CFWL_EvtEdtCheckWord checkWordEvent;
|
| - checkWordEvent.m_pSrcTarget = m_pInterface;
|
| + checkWordEvent.m_pSrcTarget = this;
|
| CFX_ByteString sLatinWord;
|
| CFX_Path pathSpell;
|
| pathSpell.Create();
|
| @@ -490,8 +351,8 @@ void CFWL_EditImp::DrawSpellCheck(CFX_Graphics* pGraphics,
|
| }
|
| pGraphics->RestoreGraphState();
|
| }
|
| -FWL_Error CFWL_EditImp::DrawWidget(CFX_Graphics* pGraphics,
|
| - const CFX_Matrix* pMatrix) {
|
| +FWL_Error IFWL_Edit::DrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix) {
|
| if (!pGraphics)
|
| return FWL_Error::Indefinite;
|
| if (!m_pProperties->m_pThemeProvider)
|
| @@ -518,7 +379,7 @@ FWL_Error CFWL_EditImp::DrawWidget(CFX_Graphics* pGraphics,
|
| }
|
| return FWL_Error::Succeeded;
|
| }
|
| -FWL_Error CFWL_EditImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
|
| +FWL_Error IFWL_Edit::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
|
| if (!pThemeProvider)
|
| return FWL_Error::Indefinite;
|
| if (m_pHorzScrollBar) {
|
| @@ -534,20 +395,20 @@ FWL_Error CFWL_EditImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::SetText(const CFX_WideString& wsText) {
|
| +FWL_Error IFWL_Edit::SetText(const CFX_WideString& wsText) {
|
| m_pEdtEngine->SetText(wsText);
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -int32_t CFWL_EditImp::GetTextLength() const {
|
| +int32_t IFWL_Edit::GetTextLength() const {
|
| if (!m_pEdtEngine)
|
| return -1;
|
| return m_pEdtEngine->GetTextLength();
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::GetText(CFX_WideString& wsText,
|
| - int32_t nStart,
|
| - int32_t nCount) const {
|
| +FWL_Error IFWL_Edit::GetText(CFX_WideString& wsText,
|
| + int32_t nStart,
|
| + int32_t nCount) const {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -555,7 +416,7 @@ FWL_Error CFWL_EditImp::GetText(CFX_WideString& wsText,
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::ClearText() {
|
| +FWL_Error IFWL_Edit::ClearText() {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -563,19 +424,19 @@ FWL_Error CFWL_EditImp::ClearText() {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -int32_t CFWL_EditImp::GetCaretPos() const {
|
| +int32_t IFWL_Edit::GetCaretPos() const {
|
| if (!m_pEdtEngine)
|
| return -1;
|
| return m_pEdtEngine->GetCaretPos();
|
| }
|
|
|
| -int32_t CFWL_EditImp::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
|
| +int32_t IFWL_Edit::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) {
|
| if (!m_pEdtEngine)
|
| return -1;
|
| return m_pEdtEngine->SetCaretPos(nIndex, bBefore);
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::AddSelRange(int32_t nStart, int32_t nCount) {
|
| +FWL_Error IFWL_Edit::AddSelRange(int32_t nStart, int32_t nCount) {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -583,19 +444,19 @@ FWL_Error CFWL_EditImp::AddSelRange(int32_t nStart, int32_t nCount) {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -int32_t CFWL_EditImp::CountSelRanges() {
|
| +int32_t IFWL_Edit::CountSelRanges() {
|
| if (!m_pEdtEngine)
|
| return 0;
|
| return m_pEdtEngine->CountSelRanges();
|
| }
|
|
|
| -int32_t CFWL_EditImp::GetSelRange(int32_t nIndex, int32_t& nStart) {
|
| +int32_t IFWL_Edit::GetSelRange(int32_t nIndex, int32_t& nStart) {
|
| if (!m_pEdtEngine)
|
| return -1;
|
| return m_pEdtEngine->GetSelRange(nIndex, nStart);
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::ClearSelections() {
|
| +FWL_Error IFWL_Edit::ClearSelections() {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -603,11 +464,11 @@ FWL_Error CFWL_EditImp::ClearSelections() {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -int32_t CFWL_EditImp::GetLimit() {
|
| +int32_t IFWL_Edit::GetLimit() {
|
| return m_nLimit;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::SetLimit(int32_t nLimit) {
|
| +FWL_Error IFWL_Edit::SetLimit(int32_t nLimit) {
|
| m_nLimit = nLimit;
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
| @@ -616,7 +477,7 @@ FWL_Error CFWL_EditImp::SetLimit(int32_t nLimit) {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::SetAliasChar(FX_WCHAR wAlias) {
|
| +FWL_Error IFWL_Edit::SetAliasChar(FX_WCHAR wAlias) {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -624,9 +485,9 @@ FWL_Error CFWL_EditImp::SetAliasChar(FX_WCHAR wAlias) {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::Insert(int32_t nStart,
|
| - const FX_WCHAR* lpText,
|
| - int32_t nLen) {
|
| +FWL_Error IFWL_Edit::Insert(int32_t nStart,
|
| + const FX_WCHAR* lpText,
|
| + int32_t nLen) {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -638,7 +499,7 @@ FWL_Error CFWL_EditImp::Insert(int32_t nStart,
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::DeleteSelections() {
|
| +FWL_Error IFWL_Edit::DeleteSelections() {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -648,7 +509,7 @@ FWL_Error CFWL_EditImp::DeleteSelections() {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::DeleteRange(int32_t nStart, int32_t nCount) {
|
| +FWL_Error IFWL_Edit::DeleteRange(int32_t nStart, int32_t nCount) {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -656,9 +517,9 @@ FWL_Error CFWL_EditImp::DeleteRange(int32_t nStart, int32_t nCount) {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::Replace(int32_t nStart,
|
| - int32_t nLen,
|
| - const CFX_WideStringC& wsReplace) {
|
| +FWL_Error IFWL_Edit::Replace(int32_t nStart,
|
| + int32_t nLen,
|
| + const CFX_WideStringC& wsReplace) {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -666,7 +527,7 @@ FWL_Error CFWL_EditImp::Replace(int32_t nStart,
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::DoClipboard(int32_t iCmd) {
|
| +FWL_Error IFWL_Edit::DoClipboard(int32_t iCmd) {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -677,7 +538,7 @@ FWL_Error CFWL_EditImp::DoClipboard(int32_t iCmd) {
|
| return FWL_Error::Indefinite;
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::Copy(CFX_WideString& wsCopy) {
|
| +FX_BOOL IFWL_Edit::Copy(CFX_WideString& wsCopy) {
|
| if (!m_pEdtEngine)
|
| return FALSE;
|
|
|
| @@ -697,7 +558,7 @@ FX_BOOL CFWL_EditImp::Copy(CFX_WideString& wsCopy) {
|
| return TRUE;
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::Cut(CFX_WideString& wsCut) {
|
| +FX_BOOL IFWL_Edit::Cut(CFX_WideString& wsCut) {
|
| if (!m_pEdtEngine)
|
| return FALSE;
|
|
|
| @@ -718,7 +579,7 @@ FX_BOOL CFWL_EditImp::Cut(CFX_WideString& wsCut) {
|
| return TRUE;
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::Paste(const CFX_WideString& wsPaste) {
|
| +FX_BOOL IFWL_Edit::Paste(const CFX_WideString& wsPaste) {
|
| if (!m_pEdtEngine)
|
| return FALSE;
|
|
|
| @@ -732,7 +593,7 @@ FX_BOOL CFWL_EditImp::Paste(const CFX_WideString& wsPaste) {
|
| return TRUE;
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::Delete() {
|
| +FX_BOOL IFWL_Edit::Delete() {
|
| if (!m_pEdtEngine)
|
| return FALSE;
|
|
|
| @@ -744,7 +605,7 @@ FX_BOOL CFWL_EditImp::Delete() {
|
| return TRUE;
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::Redo(const IFDE_TxtEdtDoRecord* pRecord) {
|
| +FX_BOOL IFWL_Edit::Redo(const IFDE_TxtEdtDoRecord* pRecord) {
|
| if (!m_pEdtEngine)
|
| return FALSE;
|
| if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoRedoUndo)
|
| @@ -752,7 +613,7 @@ FX_BOOL CFWL_EditImp::Redo(const IFDE_TxtEdtDoRecord* pRecord) {
|
| return m_pEdtEngine->Redo(pRecord);
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::Undo(const IFDE_TxtEdtDoRecord* pRecord) {
|
| +FX_BOOL IFWL_Edit::Undo(const IFDE_TxtEdtDoRecord* pRecord) {
|
| if (!m_pEdtEngine)
|
| return FALSE;
|
| if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoRedoUndo)
|
| @@ -760,27 +621,27 @@ FX_BOOL CFWL_EditImp::Undo(const IFDE_TxtEdtDoRecord* pRecord) {
|
| return m_pEdtEngine->Undo(pRecord);
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::Undo() {
|
| +FX_BOOL IFWL_Edit::Undo() {
|
| if (!CanUndo())
|
| return FALSE;
|
| return Undo(m_DoRecords[m_iCurRecord--].get());
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::Redo() {
|
| +FX_BOOL IFWL_Edit::Redo() {
|
| if (!CanRedo())
|
| return FALSE;
|
| return Redo(m_DoRecords[++m_iCurRecord].get());
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::CanUndo() {
|
| +FX_BOOL IFWL_Edit::CanUndo() {
|
| return m_iCurRecord >= 0;
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::CanRedo() {
|
| +FX_BOOL IFWL_Edit::CanRedo() {
|
| return m_iCurRecord < pdfium::CollectionSize<int32_t>(m_DoRecords) - 1;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
|
| +FWL_Error IFWL_Edit::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
|
| if (!m_pEdtEngine)
|
| return FWL_Error::Indefinite;
|
|
|
| @@ -790,21 +651,21 @@ FWL_Error CFWL_EditImp::SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant) {
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::SetOuter(IFWL_Widget* pOuter) {
|
| +FWL_Error IFWL_Edit::SetOuter(IFWL_Widget* pOuter) {
|
| m_pOuter = pOuter;
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_Error CFWL_EditImp::SetNumberRange(int32_t iMin, int32_t iMax) {
|
| +FWL_Error IFWL_Edit::SetNumberRange(int32_t iMin, int32_t iMax) {
|
| m_iMin = iMin;
|
| m_iMax = iMax;
|
| m_bSetRange = TRUE;
|
| return FWL_Error::Succeeded;
|
| }
|
|
|
| -void CFWL_EditImp::On_CaretChanged(CFDE_TxtEdtEngine* pEdit,
|
| - int32_t nPage,
|
| - FX_BOOL bVisible) {
|
| +void IFWL_Edit::On_CaretChanged(CFDE_TxtEdtEngine* pEdit,
|
| + int32_t nPage,
|
| + FX_BOOL bVisible) {
|
| if (m_rtEngine.IsEmpty())
|
| return;
|
| if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)
|
| @@ -830,8 +691,8 @@ void CFWL_EditImp::On_CaretChanged(CFDE_TxtEdtEngine* pEdit,
|
| }
|
| }
|
|
|
| -void CFWL_EditImp::On_TextChanged(CFDE_TxtEdtEngine* pEdit,
|
| - FDE_TXTEDT_TEXTCHANGE_INFO& ChangeInfo) {
|
| +void IFWL_Edit::On_TextChanged(CFDE_TxtEdtEngine* pEdit,
|
| + FDE_TXTEDT_TEXTCHANGE_INFO& ChangeInfo) {
|
| uint32_t dwStyleEx = m_pProperties->m_dwStyleExes;
|
| if (dwStyleEx & FWL_STYLEEXT_EDT_VAlignMask)
|
| UpdateVAlignment();
|
| @@ -848,7 +709,7 @@ void CFWL_EditImp::On_TextChanged(CFDE_TxtEdtEngine* pEdit,
|
| FX_BOOL bNeedUpdate = FALSE;
|
| if (bHSelfAdaption || bVSelfAdaption) {
|
| CFWL_EvtEdtPreSelfAdaption evt;
|
| - evt.m_pSrcTarget = m_pInterface;
|
| + evt.m_pSrcTarget = this;
|
| evt.bHSelfAdaption = TRUE;
|
| evt.bVSelfAdaption = TRUE;
|
| FX_FLOAT fWidth;
|
| @@ -886,7 +747,7 @@ void CFWL_EditImp::On_TextChanged(CFDE_TxtEdtEngine* pEdit,
|
| m_pProperties->m_rtWidget.height = fContentHeight1;
|
| }
|
| CFWL_EvtEdtTextChanged event;
|
| - event.m_pSrcTarget = m_pInterface;
|
| + event.m_pSrcTarget = this;
|
| event.nChangeType = ChangeInfo.nChangeType;
|
| event.wsInsert = ChangeInfo.wsInsert;
|
| event.wsDelete = ChangeInfo.wsDelete;
|
| @@ -896,15 +757,15 @@ void CFWL_EditImp::On_TextChanged(CFDE_TxtEdtEngine* pEdit,
|
| Repaint(&rtTemp);
|
| }
|
|
|
| -void CFWL_EditImp::On_SelChanged(CFDE_TxtEdtEngine* pEdit) {
|
| +void IFWL_Edit::On_SelChanged(CFDE_TxtEdtEngine* pEdit) {
|
| CFX_RectF rtTemp;
|
| GetClientRect(rtTemp);
|
| Repaint(&rtTemp);
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::On_PageLoad(CFDE_TxtEdtEngine* pEdit,
|
| - int32_t nPageIndex,
|
| - int32_t nPurpose) {
|
| +FX_BOOL IFWL_Edit::On_PageLoad(CFDE_TxtEdtEngine* pEdit,
|
| + int32_t nPageIndex,
|
| + int32_t nPurpose) {
|
| IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(nPageIndex);
|
| if (!pPage)
|
| return FALSE;
|
| @@ -912,9 +773,9 @@ FX_BOOL CFWL_EditImp::On_PageLoad(CFDE_TxtEdtEngine* pEdit,
|
| return TRUE;
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::On_PageUnload(CFDE_TxtEdtEngine* pEdit,
|
| - int32_t nPageIndex,
|
| - int32_t nPurpose) {
|
| +FX_BOOL IFWL_Edit::On_PageUnload(CFDE_TxtEdtEngine* pEdit,
|
| + int32_t nPageIndex,
|
| + int32_t nPurpose) {
|
| IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(nPageIndex);
|
| if (!pPage)
|
| return FALSE;
|
| @@ -922,43 +783,43 @@ FX_BOOL CFWL_EditImp::On_PageUnload(CFDE_TxtEdtEngine* pEdit,
|
| return TRUE;
|
| }
|
|
|
| -void CFWL_EditImp::On_AddDoRecord(CFDE_TxtEdtEngine* pEdit,
|
| - IFDE_TxtEdtDoRecord* pRecord) {
|
| +void IFWL_Edit::On_AddDoRecord(CFDE_TxtEdtEngine* pEdit,
|
| + IFDE_TxtEdtDoRecord* pRecord) {
|
| AddDoRecord(pRecord);
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::On_Validate(CFDE_TxtEdtEngine* pEdit,
|
| - CFX_WideString& wsText) {
|
| +FX_BOOL IFWL_Edit::On_Validate(CFDE_TxtEdtEngine* pEdit,
|
| + CFX_WideString& wsText) {
|
| IFWL_Widget* pDst = GetOuter();
|
| if (!pDst) {
|
| - pDst = m_pInterface;
|
| + pDst = this;
|
| }
|
| CFWL_EvtEdtValidate event;
|
| event.pDstWidget = pDst;
|
| - event.m_pSrcTarget = m_pInterface;
|
| + event.m_pSrcTarget = this;
|
| event.wsInsert = wsText;
|
| event.bValidate = TRUE;
|
| DispatchEvent(&event);
|
| return event.bValidate;
|
| }
|
| -FWL_Error CFWL_EditImp::SetBackgroundColor(uint32_t color) {
|
| +FWL_Error IFWL_Edit::SetBackgroundColor(uint32_t color) {
|
| m_backColor = color;
|
| m_updateBackColor = TRUE;
|
| return FWL_Error::Succeeded;
|
| }
|
| -FWL_Error CFWL_EditImp::SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize) {
|
| +FWL_Error IFWL_Edit::SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize) {
|
| m_wsFont = wsFont;
|
| m_fFontSize = fSize;
|
| return FWL_Error::Succeeded;
|
| }
|
| -void CFWL_EditImp::SetScrollOffset(FX_FLOAT fScrollOffset) {
|
| +void IFWL_Edit::SetScrollOffset(FX_FLOAT fScrollOffset) {
|
| m_fScrollOffsetY = fScrollOffset;
|
| }
|
| -void CFWL_EditImp::DrawTextBk(CFX_Graphics* pGraphics,
|
| - IFWL_ThemeProvider* pTheme,
|
| - const CFX_Matrix* pMatrix) {
|
| +void IFWL_Edit::DrawTextBk(CFX_Graphics* pGraphics,
|
| + IFWL_ThemeProvider* pTheme,
|
| + const CFX_Matrix* pMatrix) {
|
| CFWL_ThemeBackground param;
|
| - param.m_pWidget = m_pInterface;
|
| + param.m_pWidget = this;
|
| param.m_iPart = CFWL_Part::Background;
|
| param.m_bStaticBackground = false;
|
| param.m_dwStates = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ReadOnly
|
| @@ -986,9 +847,9 @@ void CFWL_EditImp::DrawTextBk(CFX_Graphics* pGraphics,
|
| param.m_rtPart = rtStatic;
|
| pTheme->DrawBackground(¶m);
|
| }
|
| -void CFWL_EditImp::DrawContent(CFX_Graphics* pGraphics,
|
| - IFWL_ThemeProvider* pTheme,
|
| - const CFX_Matrix* pMatrix) {
|
| +void IFWL_Edit::DrawContent(CFX_Graphics* pGraphics,
|
| + IFWL_ThemeProvider* pTheme,
|
| + const CFX_Matrix* pMatrix) {
|
| if (!m_pEdtEngine)
|
| return;
|
| IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(0);
|
| @@ -1011,7 +872,7 @@ void CFWL_EditImp::DrawContent(CFX_Graphics* pGraphics,
|
| (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoHideSel) ||
|
| (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused);
|
| if (bShowSel) {
|
| - IFWL_Widget* pForm = m_pWidgetMgr->GetSystemFormWidget(m_pInterface);
|
| + IFWL_Widget* pForm = m_pWidgetMgr->GetSystemFormWidget(this);
|
| if (pForm) {
|
| bShowSel = (pForm->GetStates() & FWL_WGTSTATE_Deactivated) !=
|
| FWL_WGTSTATE_Deactivated;
|
| @@ -1050,7 +911,7 @@ void CFWL_EditImp::DrawContent(CFX_Graphics* pGraphics,
|
| CFWL_ThemeBackground param;
|
| param.m_pGraphics = pGraphics;
|
| param.m_matrix = *pMatrix;
|
| - param.m_pWidget = m_pInterface;
|
| + param.m_pWidget = this;
|
| param.m_iPart = CFWL_Part::Background;
|
| param.m_pPath = &path;
|
| pTheme->DrawBackground(¶m);
|
| @@ -1079,7 +940,7 @@ void CFWL_EditImp::DrawContent(CFX_Graphics* pGraphics,
|
| CFWL_ThemeBackground param;
|
| param.m_pGraphics = pGraphics;
|
| param.m_matrix = *pMatrix;
|
| - param.m_pWidget = m_pInterface;
|
| + param.m_pWidget = this;
|
| param.m_iPart = CFWL_Part::CombTextLine;
|
| param.m_pPath = &path;
|
| pTheme->DrawBackground(¶m);
|
| @@ -1087,14 +948,14 @@ void CFWL_EditImp::DrawContent(CFX_Graphics* pGraphics,
|
| pGraphics->RestoreGraphState();
|
| }
|
|
|
| -void CFWL_EditImp::UpdateEditEngine() {
|
| +void IFWL_Edit::UpdateEditEngine() {
|
| UpdateEditParams();
|
| UpdateEditLayout();
|
| if (m_nLimit > -1) {
|
| m_pEdtEngine->SetLimit(m_nLimit);
|
| }
|
| }
|
| -void CFWL_EditImp::UpdateEditParams() {
|
| +void IFWL_Edit::UpdateEditParams() {
|
| FDE_TXTEDTPARAMS params;
|
| params.nHorzScale = 100;
|
| params.fPlateWidth = m_rtEngine.width;
|
| @@ -1210,7 +1071,7 @@ void CFWL_EditImp::UpdateEditParams() {
|
| m_pEdtEngine->SetEditParams(params);
|
| }
|
|
|
| -void CFWL_EditImp::UpdateEditLayout() {
|
| +void IFWL_Edit::UpdateEditLayout() {
|
| if (m_pEdtEngine->GetTextLength() <= 0)
|
| m_pEdtEngine->SetTextByStream(nullptr);
|
|
|
| @@ -1226,7 +1087,7 @@ void CFWL_EditImp::UpdateEditLayout() {
|
| pPage->LoadPage(nullptr, nullptr);
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::UpdateOffset() {
|
| +FX_BOOL IFWL_Edit::UpdateOffset() {
|
| CFX_RectF rtCaret;
|
| m_pEdtEngine->GetCaretRect(rtCaret);
|
| FX_FLOAT fOffSetX = m_rtEngine.left - m_fScrollOffsetX;
|
| @@ -1270,8 +1131,8 @@ FX_BOOL CFWL_EditImp::UpdateOffset() {
|
| return TRUE;
|
| }
|
|
|
| -FX_BOOL CFWL_EditImp::UpdateOffset(IFWL_ScrollBar* pScrollBar,
|
| - FX_FLOAT fPosChanged) {
|
| +FX_BOOL IFWL_Edit::UpdateOffset(IFWL_ScrollBar* pScrollBar,
|
| + FX_FLOAT fPosChanged) {
|
| if (pScrollBar == m_pHorzScrollBar.get())
|
| m_fScrollOffsetX += fPosChanged;
|
| else
|
| @@ -1279,7 +1140,7 @@ FX_BOOL CFWL_EditImp::UpdateOffset(IFWL_ScrollBar* pScrollBar,
|
| return TRUE;
|
| }
|
|
|
| -void CFWL_EditImp::UpdateVAlignment() {
|
| +void IFWL_Edit::UpdateVAlignment() {
|
| IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(0);
|
| if (!pPage)
|
| return;
|
| @@ -1317,7 +1178,7 @@ void CFWL_EditImp::UpdateVAlignment() {
|
| m_fVAlignOffset = 0;
|
| }
|
| }
|
| -void CFWL_EditImp::UpdateCaret() {
|
| +void IFWL_Edit::UpdateCaret() {
|
| CFX_RectF rtFDE;
|
| m_pEdtEngine->GetCaretRect(rtFDE);
|
| rtFDE.Offset(m_rtEngine.left - m_fScrollOffsetX,
|
| @@ -1354,7 +1215,7 @@ void CFWL_EditImp::UpdateCaret() {
|
| }
|
| ShowCaret(bShow, &rtCaret);
|
| }
|
| -IFWL_ScrollBar* CFWL_EditImp::UpdateScroll() {
|
| +IFWL_ScrollBar* IFWL_Edit::UpdateScroll() {
|
| FX_BOOL bShowHorz =
|
| m_pHorzScrollBar &&
|
| ((m_pHorzScrollBar->GetStates() & FWL_WGTSTATE_Invisible) == 0);
|
| @@ -1437,7 +1298,7 @@ IFWL_ScrollBar* CFWL_EditImp::UpdateScroll() {
|
| }
|
| return pRepaint;
|
| }
|
| -FX_BOOL CFWL_EditImp::IsShowScrollBar(FX_BOOL bVert) {
|
| +FX_BOOL IFWL_Edit::IsShowScrollBar(FX_BOOL bVert) {
|
| FX_BOOL bShow =
|
| (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ShowScrollbarFocus)
|
| ? (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) ==
|
| @@ -1451,7 +1312,7 @@ FX_BOOL CFWL_EditImp::IsShowScrollBar(FX_BOOL bVert) {
|
| return bShow && (m_pProperties->m_dwStyles & FWL_WGTSTYLE_HScroll) &&
|
| (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_MultiLine);
|
| }
|
| -FX_BOOL CFWL_EditImp::IsContentHeightOverflow() {
|
| +FX_BOOL IFWL_Edit::IsContentHeightOverflow() {
|
| if (!m_pEdtEngine)
|
| return FALSE;
|
| IFDE_TxtEdtPage* pPage = m_pEdtEngine->GetPage(0);
|
| @@ -1459,7 +1320,7 @@ FX_BOOL CFWL_EditImp::IsContentHeightOverflow() {
|
| return FALSE;
|
| return pPage->GetContentsBox().height > m_rtEngine.height + 1.0f;
|
| }
|
| -int32_t CFWL_EditImp::AddDoRecord(IFDE_TxtEdtDoRecord* pRecord) {
|
| +int32_t IFWL_Edit::AddDoRecord(IFDE_TxtEdtDoRecord* pRecord) {
|
| int32_t nCount = pdfium::CollectionSize<int32_t>(m_DoRecords);
|
| if (m_iCurRecord == nCount - 1) {
|
| if (nCount == m_iMaxRecord) {
|
| @@ -1475,7 +1336,7 @@ int32_t CFWL_EditImp::AddDoRecord(IFDE_TxtEdtDoRecord* pRecord) {
|
| m_iCurRecord = pdfium::CollectionSize<int32_t>(m_DoRecords) - 1;
|
| return m_iCurRecord;
|
| }
|
| -void CFWL_EditImp::Layout() {
|
| +void IFWL_Edit::Layout() {
|
| GetClientRect(m_rtClient);
|
| m_rtEngine = m_rtClient;
|
| FX_FLOAT* pfWidth = static_cast<FX_FLOAT*>(
|
| @@ -1544,7 +1405,7 @@ void CFWL_EditImp::Layout() {
|
| m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible, TRUE);
|
| }
|
| }
|
| -void CFWL_EditImp::LayoutScrollBar() {
|
| +void IFWL_Edit::LayoutScrollBar() {
|
| if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ShowScrollbarFocus) ==
|
| 0) {
|
| return;
|
| @@ -1607,26 +1468,26 @@ void CFWL_EditImp::LayoutScrollBar() {
|
| }
|
| }
|
|
|
| -void CFWL_EditImp::DeviceToEngine(CFX_PointF& pt) {
|
| +void IFWL_Edit::DeviceToEngine(CFX_PointF& pt) {
|
| pt.x += m_fScrollOffsetX - m_rtEngine.left;
|
| pt.y += m_fScrollOffsetY - m_rtEngine.top - m_fVAlignOffset;
|
| }
|
|
|
| -void CFWL_EditImp::InitScrollBar(FX_BOOL bVert) {
|
| +void IFWL_Edit::InitScrollBar(FX_BOOL bVert) {
|
| if ((bVert && m_pVertScrollBar) || (!bVert && m_pHorzScrollBar)) {
|
| return;
|
| }
|
| CFWL_WidgetImpProperties prop;
|
| prop.m_dwStyleExes = bVert ? FWL_STYLEEXT_SCB_Vert : FWL_STYLEEXT_SCB_Horz;
|
| prop.m_dwStates = FWL_WGTSTATE_Disabled | FWL_WGTSTATE_Invisible;
|
| - prop.m_pParent = m_pInterface;
|
| + prop.m_pParent = this;
|
| prop.m_pThemeProvider = m_pProperties->m_pThemeProvider;
|
| - IFWL_ScrollBar* pScrollBar = IFWL_ScrollBar::Create(prop, m_pInterface);
|
| + IFWL_ScrollBar* pScrollBar = IFWL_ScrollBar::Create(prop, this);
|
| pScrollBar->Initialize();
|
| (bVert ? &m_pVertScrollBar : &m_pHorzScrollBar)->reset(pScrollBar);
|
| }
|
|
|
| -void CFWL_EditImp::InitEngine() {
|
| +void IFWL_Edit::InitEngine() {
|
| if (!m_pEdtEngine)
|
| m_pEdtEngine.reset(new CFDE_TxtEdtEngine);
|
| }
|
| @@ -1656,7 +1517,7 @@ FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget,
|
| return TRUE;
|
| }
|
|
|
| -void CFWL_EditImp::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) {
|
| +void IFWL_Edit::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) {
|
| if (m_pCaret) {
|
| m_pCaret->ShowCaret(bVisible);
|
| if (bVisible && !pRect->IsEmpty()) {
|
| @@ -1664,7 +1525,7 @@ void CFWL_EditImp::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) {
|
| }
|
| Repaint(&m_rtEngine);
|
| } else {
|
| - IFWL_Widget* pOuter = m_pInterface;
|
| + IFWL_Widget* pOuter = this;
|
| if (bVisible) {
|
| pRect->Offset(m_pProperties->m_rtWidget.left,
|
| m_pProperties->m_rtWidget.top);
|
| @@ -1680,7 +1541,7 @@ void CFWL_EditImp::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) {
|
| FWL_ShowCaret(pOuter, bVisible, pRect);
|
| }
|
| }
|
| -FX_BOOL CFWL_EditImp::ValidateNumberChar(FX_WCHAR cNum) {
|
| +FX_BOOL IFWL_Edit::ValidateNumberChar(FX_WCHAR cNum) {
|
| if (!m_pEdtEngine) {
|
| return FALSE;
|
| }
|
| @@ -1715,13 +1576,13 @@ FX_BOOL CFWL_EditImp::ValidateNumberChar(FX_WCHAR cNum) {
|
| }
|
| return FALSE;
|
| }
|
| -void CFWL_EditImp::InitCaret() {
|
| +void IFWL_Edit::InitCaret() {
|
| if (!m_pCaret) {
|
| if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_InnerCaret)) {
|
| CFWL_WidgetImpProperties prop;
|
| - m_pCaret.reset(IFWL_Caret::Create(prop, m_pInterface));
|
| + m_pCaret.reset(IFWL_Caret::Create(prop, this));
|
| m_pCaret->Initialize();
|
| - m_pCaret->SetParent(m_pInterface);
|
| + m_pCaret->SetParent(this);
|
| m_pCaret->SetStates(m_pProperties->m_dwStates);
|
| }
|
| } else if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_InnerCaret) ==
|
| @@ -1730,16 +1591,16 @@ void CFWL_EditImp::InitCaret() {
|
| }
|
| }
|
|
|
| -void CFWL_EditImp::ClearRecord() {
|
| +void IFWL_Edit::ClearRecord() {
|
| m_iCurRecord = -1;
|
| m_DoRecords.clear();
|
| }
|
|
|
| -void CFWL_EditImp::ProcessInsertError(int32_t iError) {
|
| +void IFWL_Edit::ProcessInsertError(int32_t iError) {
|
| switch (iError) {
|
| case -2: {
|
| CFWL_EvtEdtTextFull textFullEvent;
|
| - textFullEvent.m_pSrcTarget = m_pInterface;
|
| + textFullEvent.m_pSrcTarget = this;
|
| DispatchEvent(&textFullEvent);
|
| break;
|
| }
|
| @@ -1747,7 +1608,7 @@ void CFWL_EditImp::ProcessInsertError(int32_t iError) {
|
| }
|
| }
|
|
|
| -CFWL_EditImpDelegate::CFWL_EditImpDelegate(CFWL_EditImp* pOwner)
|
| +CFWL_EditImpDelegate::CFWL_EditImpDelegate(IFWL_Edit* pOwner)
|
| : m_pOwner(pOwner) {}
|
|
|
| void CFWL_EditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
|
| @@ -1805,9 +1666,7 @@ void CFWL_EditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
|
| OnChar(pKey);
|
| break;
|
| }
|
| - default: {
|
| - break;
|
| - }
|
| + default: { break; }
|
| }
|
| CFWL_WidgetImpDelegate::OnProcessMessage(pMessage);
|
| }
|
|
|