diff options
Diffstat (limited to 'xfa/fwl/core')
41 files changed, 116 insertions, 236 deletions
diff --git a/xfa/fwl/core/cfwl_event.h b/xfa/fwl/core/cfwl_event.h index 3ef81ff3ba..2e1ed69145 100644 --- a/xfa/fwl/core/cfwl_event.h +++ b/xfa/fwl/core/cfwl_event.h @@ -69,7 +69,6 @@ class CFWL_Event { CFWL_Event(); virtual ~CFWL_Event(); - virtual FWL_Error GetClassName(CFX_WideString& wsClass) const; virtual CFWL_EventType GetClassID() const; uint32_t Release(); @@ -86,10 +85,6 @@ inline CFWL_Event::CFWL_Event() inline CFWL_Event::~CFWL_Event() {} -inline FWL_Error CFWL_Event::GetClassName(CFX_WideString& wsClass) const { - return FWL_Error::Succeeded; -} - inline CFWL_EventType CFWL_Event::GetClassID() const { return CFWL_EventType::None; } @@ -107,16 +102,11 @@ inline uint32_t CFWL_Event::Release() { public: \ classname(); \ ~classname() override; \ - FWL_Error GetClassName(CFX_WideString& wsClass) const override; \ CFWL_EventType GetClassID() const override; \ __VA_ARGS__ \ }; \ inline classname::classname() {} \ inline classname::~classname() {} \ - inline FWL_Error classname::GetClassName(CFX_WideString& wsClass) const { \ - wsClass = L## #classname; \ - return FWL_Error::Succeeded; \ - } \ inline CFWL_EventType classname::GetClassID() const { return eventType; } FWL_EVENT_DEF(CFWL_EvtMouse, CFWL_EventType::Mouse, FX_FLOAT m_fx; diff --git a/xfa/fwl/core/cfwl_message.h b/xfa/fwl/core/cfwl_message.h index 2bffff0007..0bfafb5a89 100644 --- a/xfa/fwl/core/cfwl_message.h +++ b/xfa/fwl/core/cfwl_message.h @@ -58,7 +58,6 @@ class CFWL_Message { virtual ~CFWL_Message(); virtual CFWL_Message* Clone(); - virtual FWL_Error GetClassName(CFX_WideString& wsClass) const; virtual CFWL_MessageType GetClassID() const; uint32_t Release(); @@ -84,10 +83,6 @@ inline CFWL_Message* CFWL_Message::Clone() { return nullptr; } -inline FWL_Error CFWL_Message::GetClassName(CFX_WideString& wsClass) const { - return FWL_Error::Succeeded; -} - inline CFWL_MessageType CFWL_Message::GetClassID() const { return CFWL_MessageType::None; } @@ -111,7 +106,6 @@ inline CFWL_Message* CFWL_Message::Retain() { classname(); \ ~classname() override; \ CFWL_Message* Clone() override; \ - FWL_Error GetClassName(CFX_WideString& wsClass) const override; \ CFWL_MessageType GetClassID() const override; \ __VA_ARGS__ \ }; @@ -120,10 +114,6 @@ inline CFWL_Message* CFWL_Message::Retain() { inline classname::classname() {} \ inline classname::~classname() {} \ inline CFWL_Message* classname::Clone() { return new classname(*this); } \ - inline FWL_Error classname::GetClassName(CFX_WideString& wsClass) const { \ - wsClass = L## #classname; \ - return FWL_Error::Succeeded; \ - } \ inline CFWL_MessageType classname::GetClassID() const { return msgType; } \ __VA_ARGS__ diff --git a/xfa/fwl/core/ifwl_barcode.cpp b/xfa/fwl/core/ifwl_barcode.cpp index 770a857d78..a4b210f115 100644 --- a/xfa/fwl/core/ifwl_barcode.cpp +++ b/xfa/fwl/core/ifwl_barcode.cpp @@ -17,11 +17,6 @@ IFWL_Barcode::IFWL_Barcode(const CFWL_WidgetImpProperties& properties) IFWL_Barcode::~IFWL_Barcode() {} -FWL_Error IFWL_Barcode::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_Barcode; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_Barcode::GetClassID() const { return FWL_Type::Barcode; } @@ -34,12 +29,14 @@ FWL_Error IFWL_Barcode::Initialize() { return FWL_Error::Indefinite; return FWL_Error::Succeeded; } -FWL_Error IFWL_Barcode::Finalize() { + +void IFWL_Barcode::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; m_pBarcodeEngine.reset(); - return IFWL_Edit::Finalize(); + IFWL_Edit::Finalize(); } + FWL_Error IFWL_Barcode::Update() { if (IsLocked()) { return FWL_Error::Indefinite; @@ -48,6 +45,7 @@ FWL_Error IFWL_Barcode::Update() { GenerateBarcodeImageCache(); return ret; } + FWL_Error IFWL_Barcode::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { if (!pGraphics) diff --git a/xfa/fwl/core/ifwl_barcode.h b/xfa/fwl/core/ifwl_barcode.h index cccc4f1b9c..2313f86d36 100644 --- a/xfa/fwl/core/ifwl_barcode.h +++ b/xfa/fwl/core/ifwl_barcode.h @@ -20,7 +20,6 @@ class IFWL_Widget; #define XFA_BCS_NeedUpdate 0x0001 #define XFA_BCS_EncodeSuccess 0x0002 -#define FWL_CLASS_Barcode L"FWL_BARCODE" enum FWL_BCDAttribute { FWL_BCDATTRIBUTE_NONE = 0, @@ -63,10 +62,9 @@ class IFWL_Barcode : public IFWL_Edit { ~IFWL_Barcode() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error Update() override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; diff --git a/xfa/fwl/core/ifwl_caret.cpp b/xfa/fwl/core/ifwl_caret.cpp index 643875a001..52269049e2 100644 --- a/xfa/fwl/core/ifwl_caret.cpp +++ b/xfa/fwl/core/ifwl_caret.cpp @@ -24,11 +24,6 @@ IFWL_Caret::IFWL_Caret(const CFWL_WidgetImpProperties& properties, IFWL_Caret::~IFWL_Caret() {} -FWL_Error IFWL_Caret::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_Caret; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_Caret::GetClassID() const { return FWL_Type::Caret; } @@ -41,14 +36,14 @@ FWL_Error IFWL_Caret::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_Caret::Finalize() { +void IFWL_Caret::Finalize() { if (m_pTimerInfo) { m_pTimerInfo->StopTimer(); m_pTimerInfo = nullptr; } delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_Caret::DrawWidget(CFX_Graphics* pGraphics, diff --git a/xfa/fwl/core/ifwl_caret.h b/xfa/fwl/core/ifwl_caret.h index 8cc3cf7e02..c5b6997b45 100644 --- a/xfa/fwl/core/ifwl_caret.h +++ b/xfa/fwl/core/ifwl_caret.h @@ -17,7 +17,6 @@ class CFWL_WidgetImpProperties; class IFWL_Widget; class CFWL_CaretImpDelegate; -#define FWL_CLASS_Caret L"FWL_CARET" #define FWL_STATE_CAT_HightLight 1 class IFWL_Caret : public IFWL_Widget { @@ -26,10 +25,9 @@ class IFWL_Caret : public IFWL_Widget { ~IFWL_Caret() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; diff --git a/xfa/fwl/core/ifwl_checkbox.cpp b/xfa/fwl/core/ifwl_checkbox.cpp index 20298c7308..cc06f9cea8 100644 --- a/xfa/fwl/core/ifwl_checkbox.cpp +++ b/xfa/fwl/core/ifwl_checkbox.cpp @@ -36,11 +36,6 @@ IFWL_CheckBox::IFWL_CheckBox(const CFWL_WidgetImpProperties& properties) IFWL_CheckBox::~IFWL_CheckBox() {} -FWL_Error IFWL_CheckBox::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_CheckBox; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_CheckBox::GetClassID() const { return FWL_Type::CheckBox; } @@ -53,10 +48,10 @@ FWL_Error IFWL_CheckBox::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_CheckBox::Finalize() { +void IFWL_CheckBox::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { diff --git a/xfa/fwl/core/ifwl_checkbox.h b/xfa/fwl/core/ifwl_checkbox.h index 56a9139b99..cdf1e91ca3 100644 --- a/xfa/fwl/core/ifwl_checkbox.h +++ b/xfa/fwl/core/ifwl_checkbox.h @@ -12,7 +12,6 @@ #include "xfa/fwl/core/ifwl_dataprovider.h" #include "xfa/fwl/core/ifwl_widget.h" -#define FWL_CLASS_CheckBox L"FWL_CHECKBOX" #define FWL_STYLEEXT_CKB_Left (0L << 0) #define FWL_STYLEEXT_CKB_Center (1L << 0) #define FWL_STYLEEXT_CKB_Right (2L << 0) @@ -62,10 +61,9 @@ class IFWL_CheckBox : public IFWL_Widget { ~IFWL_CheckBox() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error Update() override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, diff --git a/xfa/fwl/core/ifwl_combobox.cpp b/xfa/fwl/core/ifwl_combobox.cpp index 9d3e58cec6..edc430a0f2 100644 --- a/xfa/fwl/core/ifwl_combobox.cpp +++ b/xfa/fwl/core/ifwl_combobox.cpp @@ -35,11 +35,6 @@ IFWL_ComboBox::IFWL_ComboBox(const CFWL_WidgetImpProperties& properties) IFWL_ComboBox::~IFWL_ComboBox() {} -FWL_Error IFWL_ComboBox::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_ComboBox; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_ComboBox::GetClassID() const { return FWL_Type::ComboBox; } @@ -74,14 +69,14 @@ FWL_Error IFWL_ComboBox::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_ComboBox::Finalize() { - if (m_pEdit) { +void IFWL_ComboBox::Finalize() { + if (m_pEdit) m_pEdit->Finalize(); - } + m_pListBox->Finalize(); delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_ComboBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { diff --git a/xfa/fwl/core/ifwl_combobox.h b/xfa/fwl/core/ifwl_combobox.h index a40f6d583a..15db0490ee 100644 --- a/xfa/fwl/core/ifwl_combobox.h +++ b/xfa/fwl/core/ifwl_combobox.h @@ -25,7 +25,6 @@ class IFWL_FormProxy; class IFWL_ListBox; class IFWL_Widget; -#define FWL_CLASS_ComboBox L"FWL_COMBOBOX" #define FWL_STYLEEXT_CMB_DropList (0L << 0) #define FWL_STYLEEXT_CMB_DropDown (1L << 0) #define FWL_STYLEEXT_CMB_Sort (1L << 1) @@ -89,10 +88,9 @@ class IFWL_ComboBox : public IFWL_Widget { ~IFWL_ComboBox() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved) override; diff --git a/xfa/fwl/core/ifwl_combolist.cpp b/xfa/fwl/core/ifwl_combolist.cpp index abe2c092d2..d34a55bcc2 100644 --- a/xfa/fwl/core/ifwl_combolist.cpp +++ b/xfa/fwl/core/ifwl_combolist.cpp @@ -23,10 +23,10 @@ FWL_Error IFWL_ComboList::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_ComboList::Finalize() { +void IFWL_ComboList::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_ListBox::Finalize(); + IFWL_ListBox::Finalize(); } int32_t IFWL_ComboList::MatchItem(const CFX_WideString& wsMatch) { diff --git a/xfa/fwl/core/ifwl_combolist.h b/xfa/fwl/core/ifwl_combolist.h index 5d21b43681..d88a5956c2 100644 --- a/xfa/fwl/core/ifwl_combolist.h +++ b/xfa/fwl/core/ifwl_combolist.h @@ -18,7 +18,7 @@ class IFWL_ComboList : public IFWL_ListBox { // IFWL_Widget FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; int32_t MatchItem(const CFX_WideString& wsMatch); void ChangeSelected(int32_t iSel); diff --git a/xfa/fwl/core/ifwl_datetimecalendar.cpp b/xfa/fwl/core/ifwl_datetimecalendar.cpp index 786d16860e..0e095b9424 100644 --- a/xfa/fwl/core/ifwl_datetimecalendar.cpp +++ b/xfa/fwl/core/ifwl_datetimecalendar.cpp @@ -23,10 +23,10 @@ FWL_Error IFWL_DateTimeCalendar::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_DateTimeCalendar::Finalize() { +void IFWL_DateTimeCalendar::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_MonthCalendar::Finalize(); + IFWL_MonthCalendar::Finalize(); } CFWL_DateTimeCalendarImpDelegate::CFWL_DateTimeCalendarImpDelegate( diff --git a/xfa/fwl/core/ifwl_datetimecalendar.h b/xfa/fwl/core/ifwl_datetimecalendar.h index 864e756c96..c106e7f86d 100644 --- a/xfa/fwl/core/ifwl_datetimecalendar.h +++ b/xfa/fwl/core/ifwl_datetimecalendar.h @@ -16,7 +16,7 @@ class IFWL_DateTimeCalendar : public IFWL_MonthCalendar { // IFWL_MonthCalendar FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; protected: friend class CFWL_DateTimeCalendarImpDelegate; diff --git a/xfa/fwl/core/ifwl_datetimeedit.cpp b/xfa/fwl/core/ifwl_datetimeedit.cpp index a16b729484..0097691c42 100644 --- a/xfa/fwl/core/ifwl_datetimeedit.cpp +++ b/xfa/fwl/core/ifwl_datetimeedit.cpp @@ -20,10 +20,10 @@ FWL_Error IFWL_DateTimeEdit::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_DateTimeEdit::Finalize() { +void IFWL_DateTimeEdit::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Edit::Finalize(); + IFWL_Edit::Finalize(); } CFWL_DateTimeEditImpDelegate::CFWL_DateTimeEditImpDelegate( diff --git a/xfa/fwl/core/ifwl_datetimeedit.h b/xfa/fwl/core/ifwl_datetimeedit.h index 29433e5173..2429e98a4c 100644 --- a/xfa/fwl/core/ifwl_datetimeedit.h +++ b/xfa/fwl/core/ifwl_datetimeedit.h @@ -20,7 +20,7 @@ class IFWL_DateTimeEdit : public IFWL_Edit { // IFWL_Edit FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; protected: friend class CFWL_DateTimeEditImpDelegate; diff --git a/xfa/fwl/core/ifwl_datetimepicker.cpp b/xfa/fwl/core/ifwl_datetimepicker.cpp index 04290b62d1..ef13d71cf1 100644 --- a/xfa/fwl/core/ifwl_datetimepicker.cpp +++ b/xfa/fwl/core/ifwl_datetimepicker.cpp @@ -36,11 +36,6 @@ IFWL_DateTimePicker::IFWL_DateTimePicker( IFWL_DateTimePicker::~IFWL_DateTimePicker() {} -FWL_Error IFWL_DateTimePicker::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_DateTimePicker; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_DateTimePicker::GetClassID() const { return FWL_Type::DateTimePicker; } @@ -75,20 +70,18 @@ FWL_Error IFWL_DateTimePicker::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_DateTimePicker::Finalize() { - if (m_pEdit) { +void IFWL_DateTimePicker::Finalize() { + if (m_pEdit) m_pEdit->Finalize(); - } - if (m_pMonthCal) { + if (m_pMonthCal) m_pMonthCal->Finalize(); - } - if (m_pForm) { + if (m_pForm) m_pForm->Finalize(); - } + UnregisterEventTarget(); delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_DateTimePicker::GetWidgetRect(CFX_RectF& rect, diff --git a/xfa/fwl/core/ifwl_datetimepicker.h b/xfa/fwl/core/ifwl_datetimepicker.h index 28eefe1cde..4113e9b83e 100644 --- a/xfa/fwl/core/ifwl_datetimepicker.h +++ b/xfa/fwl/core/ifwl_datetimepicker.h @@ -13,7 +13,6 @@ #include "xfa/fwl/core/ifwl_monthcalendar.h" #include "xfa/fwl/core/ifwl_widget.h" -#define FWL_CLASS_DateTimePicker L"FWL_DATETIMEPICKER" #define FWL_STYLEEXT_DTP_AllowEdit (1L << 0) #define FWL_STYLEEXT_DTP_LongDateFormat (0L << 1) #define FWL_STYLEEXT_DTP_ShortDateFormat (1L << 1) @@ -67,10 +66,9 @@ class IFWL_DateTimePicker : public IFWL_Widget { ~IFWL_DateTimePicker() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error Update() override; FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; diff --git a/xfa/fwl/core/ifwl_edit.cpp b/xfa/fwl/core/ifwl_edit.cpp index 189df97c89..1d769af6cb 100644 --- a/xfa/fwl/core/ifwl_edit.cpp +++ b/xfa/fwl/core/ifwl_edit.cpp @@ -79,11 +79,6 @@ IFWL_Edit::~IFWL_Edit() { ClearRecord(); } -FWL_Error IFWL_Edit::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_Edit; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_Edit::GetClassID() const { return FWL_Type::Edit; } @@ -101,20 +96,19 @@ FWL_Error IFWL_Edit::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_Edit::Finalize() { - if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) { +void IFWL_Edit::Finalize() { + if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) ShowCaret(FALSE); - } - if (m_pHorzScrollBar) { + if (m_pHorzScrollBar) m_pHorzScrollBar->Finalize(); - } - if (m_pVertScrollBar) { + if (m_pVertScrollBar) m_pVertScrollBar->Finalize(); - } + delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } + FWL_Error IFWL_Edit::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { if (bAutoSize) { rect.Set(0, 0, 0, 0); @@ -796,19 +790,23 @@ FX_BOOL IFWL_Edit::On_Validate(CFDE_TxtEdtEngine* pEdit, DispatchEvent(&event); return event.bValidate; } + FWL_Error IFWL_Edit::SetBackgroundColor(uint32_t color) { m_backColor = color; m_updateBackColor = TRUE; return FWL_Error::Succeeded; } + FWL_Error IFWL_Edit::SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize) { m_wsFont = wsFont; m_fFontSize = fSize; return FWL_Error::Succeeded; } + void IFWL_Edit::SetScrollOffset(FX_FLOAT fScrollOffset) { m_fScrollOffsetY = fScrollOffset; } + void IFWL_Edit::DrawTextBk(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { diff --git a/xfa/fwl/core/ifwl_edit.h b/xfa/fwl/core/ifwl_edit.h index 688c09c349..e327a2509f 100644 --- a/xfa/fwl/core/ifwl_edit.h +++ b/xfa/fwl/core/ifwl_edit.h @@ -19,7 +19,6 @@ #include "xfa/fwl/lightwidget/cfwl_widget.h" #include "xfa/fxgraphics/cfx_path.h" -#define FWL_CLASS_Edit L"FWL_EDIT" #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) @@ -111,10 +110,9 @@ class IFWL_Edit : public IFWL_Widget { ~IFWL_Edit() override; // IFWL_Widget: - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error SetWidgetRect(const CFX_RectF& rect) override; FWL_Error Update() override; diff --git a/xfa/fwl/core/ifwl_form.cpp b/xfa/fwl/core/ifwl_form.cpp index ad78f98cb3..5aaa566ff4 100644 --- a/xfa/fwl/core/ifwl_form.cpp +++ b/xfa/fwl/core/ifwl_form.cpp @@ -52,7 +52,7 @@ IFWL_Form::IFWL_Form(const CFWL_WidgetImpProperties& properties, m_bLButtonDown(FALSE), m_bMaximized(false), m_bSetMaximize(FALSE), - m_bCustomizeLayout(FALSE), + m_bCustomizeLayout(false), m_eFormSize(FWL_FORMSIZE_Manual), m_bDoModalFlag(FALSE), m_pBigIcon(nullptr), @@ -69,11 +69,6 @@ IFWL_Form::~IFWL_Form() { RemoveSysButtons(); } -FWL_Error IFWL_Form::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_Form; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_Form::GetClassID() const { return FWL_Type::Form; } @@ -92,13 +87,15 @@ FWL_Error IFWL_Form::Initialize() { m_pDelegate = new CFWL_FormImpDelegate(this); return FWL_Error::Succeeded; } -FWL_Error IFWL_Form::Finalize() { + +void IFWL_Form::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; UnregisterEventTarget(); UnRegisterForm(); - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } + FWL_Error IFWL_Form::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { if (bAutoSize) { rect.Reset(); diff --git a/xfa/fwl/core/ifwl_form.h b/xfa/fwl/core/ifwl_form.h index 3aa38a00cd..ee1f360629 100644 --- a/xfa/fwl/core/ifwl_form.h +++ b/xfa/fwl/core/ifwl_form.h @@ -89,11 +89,10 @@ class IFWL_Form : public IFWL_Widget { ~IFWL_Form() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error GetClientRect(CFX_RectF& rect) override; @@ -176,7 +175,7 @@ class IFWL_Form : public IFWL_Widget { FX_BOOL m_bLButtonDown; bool m_bMaximized; FX_BOOL m_bSetMaximize; - FX_BOOL m_bCustomizeLayout; + bool m_bCustomizeLayout; FWL_FORMSIZE m_eFormSize; FX_BOOL m_bDoModalFlag; FX_FLOAT m_fSmallIconSz; diff --git a/xfa/fwl/core/ifwl_formproxy.cpp b/xfa/fwl/core/ifwl_formproxy.cpp index d97b5b6185..9a00bf3e8f 100644 --- a/xfa/fwl/core/ifwl_formproxy.cpp +++ b/xfa/fwl/core/ifwl_formproxy.cpp @@ -14,11 +14,6 @@ IFWL_FormProxy::IFWL_FormProxy(const CFWL_WidgetImpProperties& properties, IFWL_FormProxy::~IFWL_FormProxy() {} -FWL_Error IFWL_FormProxy::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_FormProxy; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_FormProxy::GetClassID() const { return FWL_Type::FormProxy; } @@ -37,10 +32,10 @@ FWL_Error IFWL_FormProxy::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_FormProxy::Finalize() { +void IFWL_FormProxy::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_FormProxy::Update() { diff --git a/xfa/fwl/core/ifwl_formproxy.h b/xfa/fwl/core/ifwl_formproxy.h index d5a1bd97de..3bc614c4d4 100644 --- a/xfa/fwl/core/ifwl_formproxy.h +++ b/xfa/fwl/core/ifwl_formproxy.h @@ -19,11 +19,10 @@ class IFWL_FormProxy : public IFWL_Form { ~IFWL_FormProxy() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error Update() override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp index ac2b1338b9..4e94d955d1 100644 --- a/xfa/fwl/core/ifwl_listbox.cpp +++ b/xfa/fwl/core/ifwl_listbox.cpp @@ -36,11 +36,6 @@ IFWL_ListBox::IFWL_ListBox(const CFWL_WidgetImpProperties& properties, IFWL_ListBox::~IFWL_ListBox() {} -FWL_Error IFWL_ListBox::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_ListBox; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_ListBox::GetClassID() const { return FWL_Type::ListBox; } @@ -53,16 +48,15 @@ FWL_Error IFWL_ListBox::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_ListBox::Finalize() { - if (m_pVertScrollBar) { +void IFWL_ListBox::Finalize() { + if (m_pVertScrollBar) m_pVertScrollBar->Finalize(); - } - if (m_pHorzScrollBar) { + if (m_pHorzScrollBar) m_pHorzScrollBar->Finalize(); - } + delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_ListBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { diff --git a/xfa/fwl/core/ifwl_listbox.h b/xfa/fwl/core/ifwl_listbox.h index faab63056b..036aee2d62 100644 --- a/xfa/fwl/core/ifwl_listbox.h +++ b/xfa/fwl/core/ifwl_listbox.h @@ -16,7 +16,6 @@ #include "xfa/fwl/core/ifwl_listbox.h" #include "xfa/fwl/core/ifwl_widget.h" -#define FWL_CLASS_ListBox L"FWL_LISTBOX" #define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) #define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) #define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) @@ -107,10 +106,9 @@ class IFWL_ListBox : public IFWL_Widget { ~IFWL_ListBox() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error Update() override; FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; diff --git a/xfa/fwl/core/ifwl_monthcalendar.cpp b/xfa/fwl/core/ifwl_monthcalendar.cpp index 096e3586d0..69e7588245 100644 --- a/xfa/fwl/core/ifwl_monthcalendar.cpp +++ b/xfa/fwl/core/ifwl_monthcalendar.cpp @@ -151,11 +151,6 @@ IFWL_MonthCalendar::~IFWL_MonthCalendar() { m_arrSelDays.RemoveAll(); } -FWL_Error IFWL_MonthCalendar::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_MonthCalendar; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_MonthCalendar::GetClassID() const { return FWL_Type::MonthCalendar; } @@ -168,10 +163,10 @@ FWL_Error IFWL_MonthCalendar::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_MonthCalendar::Finalize() { +void IFWL_MonthCalendar::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_MonthCalendar::GetWidgetRect(CFX_RectF& rect, diff --git a/xfa/fwl/core/ifwl_monthcalendar.h b/xfa/fwl/core/ifwl_monthcalendar.h index 48b15fef19..b9376b82c3 100644 --- a/xfa/fwl/core/ifwl_monthcalendar.h +++ b/xfa/fwl/core/ifwl_monthcalendar.h @@ -13,7 +13,6 @@ #include "xfa/fwl/core/ifwl_dataprovider.h" #include "xfa/fwl/core/ifwl_widget.h" -#define FWL_CLASS_MonthCalendar L"FWL_MONTHCALENDAR" #define FWL_STYLEEXT_MCD_MultiSelect (1L << 0) #define FWL_STYLEEXT_MCD_NoToday (1L << 1) #define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2) @@ -58,10 +57,9 @@ class IFWL_MonthCalendar : public IFWL_Widget { ~IFWL_MonthCalendar() override; // FWL_WidgetImp - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error Update() override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, diff --git a/xfa/fwl/core/ifwl_picturebox.cpp b/xfa/fwl/core/ifwl_picturebox.cpp index cff711ca99..301c404767 100644 --- a/xfa/fwl/core/ifwl_picturebox.cpp +++ b/xfa/fwl/core/ifwl_picturebox.cpp @@ -21,11 +21,6 @@ IFWL_PictureBox::IFWL_PictureBox(const CFWL_WidgetImpProperties& properties) IFWL_PictureBox::~IFWL_PictureBox() {} -FWL_Error IFWL_PictureBox::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_PictureBox; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_PictureBox::GetClassID() const { return FWL_Type::PictureBox; } @@ -38,10 +33,10 @@ FWL_Error IFWL_PictureBox::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_PictureBox::Finalize() { +void IFWL_PictureBox::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { diff --git a/xfa/fwl/core/ifwl_picturebox.h b/xfa/fwl/core/ifwl_picturebox.h index 98edd2793f..cfc32c0ba5 100644 --- a/xfa/fwl/core/ifwl_picturebox.h +++ b/xfa/fwl/core/ifwl_picturebox.h @@ -12,7 +12,6 @@ #include "xfa/fwl/core/ifwl_dataprovider.h" #include "xfa/fwl/core/ifwl_widget.h" -#define FWL_CLASS_PictureBox L"FWL_PICTUREBOX" #define FWL_STYLEEXT_PTB_Left 0L << 0 #define FWL_STYLEEXT_PTB_Center 1L << 0 #define FWL_STYLEEXT_PTB_Right 2L << 0 @@ -49,10 +48,9 @@ class IFWL_PictureBox : public IFWL_Widget { ~IFWL_PictureBox() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error Update() override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, diff --git a/xfa/fwl/core/ifwl_pushbutton.cpp b/xfa/fwl/core/ifwl_pushbutton.cpp index 7cbc2e116d..6040ae1117 100644 --- a/xfa/fwl/core/ifwl_pushbutton.cpp +++ b/xfa/fwl/core/ifwl_pushbutton.cpp @@ -25,11 +25,6 @@ IFWL_PushButton::IFWL_PushButton(const CFWL_WidgetImpProperties& properties) IFWL_PushButton::~IFWL_PushButton() {} -FWL_Error IFWL_PushButton::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_PushButton; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_PushButton::GetClassID() const { return FWL_Type::PushButton; } @@ -42,10 +37,10 @@ FWL_Error IFWL_PushButton::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_PushButton::Finalize() { +void IFWL_PushButton::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_PushButton::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { @@ -128,9 +123,9 @@ FWL_Error IFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics, } CFX_RectF rtText; rtText.Set(0, 0, 0, 0); - if (!wsCaption.IsEmpty()) { + if (!wsCaption.IsEmpty()) CalcTextRect(wsCaption, pTheme, 0, m_iTTOAlign, rtText); - } + switch (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_PSB_ModeMask) { case FWL_STYLEEXT_PSB_TextOnly: DrawText(pGraphics, m_pProperties->m_pThemeProvider, &matrix); diff --git a/xfa/fwl/core/ifwl_pushbutton.h b/xfa/fwl/core/ifwl_pushbutton.h index d5ada29e41..8906aa898f 100644 --- a/xfa/fwl/core/ifwl_pushbutton.h +++ b/xfa/fwl/core/ifwl_pushbutton.h @@ -11,7 +11,6 @@ #include "xfa/fwl/core/ifwl_dataprovider.h" #include "xfa/fwl/core/ifwl_widget.h" -#define FWL_CLASS_PushButton L"FWL_PUSHBUTTON" #define FWL_STYLEEXT_PSB_Left (0L << 0) #define FWL_STYLEEXT_PSB_Center (1L << 0) #define FWL_STYLEEXT_PSB_Right (2L << 0) @@ -45,10 +44,9 @@ class IFWL_PushButton : public IFWL_Widget { ~IFWL_PushButton() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE) override; FWL_Error Update() override; diff --git a/xfa/fwl/core/ifwl_scrollbar.cpp b/xfa/fwl/core/ifwl_scrollbar.cpp index 8c677f6a0b..e3b9ca64d9 100644 --- a/xfa/fwl/core/ifwl_scrollbar.cpp +++ b/xfa/fwl/core/ifwl_scrollbar.cpp @@ -41,7 +41,7 @@ IFWL_ScrollBar::IFWL_ScrollBar(const CFWL_WidgetImpProperties& properties, m_bRepaintThumb(FALSE), m_fButtonLen(0), m_bMinSize(FALSE), - m_bCustomLayout(FALSE), + m_bCustomLayout(false), m_fMinThumb(FWL_SCROLLBAR_MinThumb) { m_rtClient.Reset(); m_rtThumb.Reset(); @@ -53,11 +53,6 @@ IFWL_ScrollBar::IFWL_ScrollBar(const CFWL_WidgetImpProperties& properties, IFWL_ScrollBar::~IFWL_ScrollBar() {} -FWL_Error IFWL_ScrollBar::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_ScrollBar; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_ScrollBar::GetClassID() const { return FWL_Type::ScrollBar; } @@ -70,10 +65,10 @@ FWL_Error IFWL_ScrollBar::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_ScrollBar::Finalize() { +void IFWL_ScrollBar::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_ScrollBar::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { diff --git a/xfa/fwl/core/ifwl_scrollbar.h b/xfa/fwl/core/ifwl_scrollbar.h index 39d3c04eb2..95fe7739fe 100644 --- a/xfa/fwl/core/ifwl_scrollbar.h +++ b/xfa/fwl/core/ifwl_scrollbar.h @@ -18,7 +18,6 @@ class CFWL_ScrollBarImpDelegate; class CFWL_WidgetImpProperties; class IFWL_Widget; -#define FWL_CLASS_ScrollBar L"FWL_SCROLLBAR" #define FWL_STYLEEXT_SCB_Horz (0L << 0) #define FWL_STYLEEXT_SCB_Vert (1L << 0) @@ -44,10 +43,9 @@ class IFWL_ScrollBar : public IFWL_Widget, public IFWL_Timer { ~IFWL_ScrollBar() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error Update() override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, @@ -124,7 +122,7 @@ class IFWL_ScrollBar : public IFWL_Widget, public IFWL_Timer { CFX_RectF m_rtMaxBtn; CFX_RectF m_rtMinTrack; CFX_RectF m_rtMaxTrack; - FX_BOOL m_bCustomLayout; + bool m_bCustomLayout; FX_FLOAT m_fMinThumb; protected: diff --git a/xfa/fwl/core/ifwl_spinbutton.cpp b/xfa/fwl/core/ifwl_spinbutton.cpp index a4212bcaeb..d94a240e59 100644 --- a/xfa/fwl/core/ifwl_spinbutton.cpp +++ b/xfa/fwl/core/ifwl_spinbutton.cpp @@ -38,11 +38,6 @@ IFWL_SpinButton::IFWL_SpinButton(const CFWL_WidgetImpProperties& properties) IFWL_SpinButton::~IFWL_SpinButton() {} -FWL_Error IFWL_SpinButton::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_SpinButton; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_SpinButton::GetClassID() const { return FWL_Type::SpinButton; } @@ -55,10 +50,10 @@ FWL_Error IFWL_SpinButton::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_SpinButton::Finalize() { +void IFWL_SpinButton::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_SpinButton::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { diff --git a/xfa/fwl/core/ifwl_spinbutton.h b/xfa/fwl/core/ifwl_spinbutton.h index f35732c4ca..e5e6211917 100644 --- a/xfa/fwl/core/ifwl_spinbutton.h +++ b/xfa/fwl/core/ifwl_spinbutton.h @@ -12,7 +12,6 @@ #include "xfa/fwl/core/ifwl_widget.h" #include "xfa/fxfa/cxfa_eventparam.h" -#define FWL_CLASS_SpinButton L"FWL_SPINBUTTON" #define FWL_STYLEEXE_SPB_Vert (1L << 0) class CFWL_MsgMouse; @@ -27,10 +26,9 @@ class IFWL_SpinButton : public IFWL_Widget, public IFWL_Timer { ~IFWL_SpinButton() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error Update() override; FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; diff --git a/xfa/fwl/core/ifwl_themeprovider.h b/xfa/fwl/core/ifwl_themeprovider.h index 275f649574..d64b6f038d 100644 --- a/xfa/fwl/core/ifwl_themeprovider.h +++ b/xfa/fwl/core/ifwl_themeprovider.h @@ -20,12 +20,12 @@ class IFWL_Widget; class IFWL_ThemeProvider { public: virtual ~IFWL_ThemeProvider() {} - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) = 0; - virtual FX_BOOL DrawText(CFWL_ThemeText* pParams) = 0; + virtual void DrawBackground(CFWL_ThemeBackground* pParams) = 0; + virtual void DrawText(CFWL_ThemeText* pParams) = 0; virtual void* GetCapacity(CFWL_ThemePart* pThemePart, CFWL_WidgetCapacity dwCapacity) = 0; - virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) = 0; - virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) = 0; + virtual bool IsCustomizedLayout(IFWL_Widget* pWidget) = 0; + virtual void CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) = 0; }; #endif // XFA_FWL_CORE_IFWL_THEMEPROVIDER_H_ diff --git a/xfa/fwl/core/ifwl_tooltip.cpp b/xfa/fwl/core/ifwl_tooltip.cpp index 6281040546..a9b9085010 100644 --- a/xfa/fwl/core/ifwl_tooltip.cpp +++ b/xfa/fwl/core/ifwl_tooltip.cpp @@ -32,11 +32,6 @@ IFWL_ToolTip::IFWL_ToolTip(const CFWL_WidgetImpProperties& properties, IFWL_ToolTip::~IFWL_ToolTip() {} -FWL_Error IFWL_ToolTip::GetClassName(CFX_WideString& wsClass) const { - wsClass = FWL_CLASS_ToolTip; - return FWL_Error::Succeeded; -} - FWL_Type IFWL_ToolTip::GetClassID() const { return FWL_Type::ToolTip; } @@ -51,10 +46,10 @@ FWL_Error IFWL_ToolTip::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_ToolTip::Finalize() { +void IFWL_ToolTip::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; - return IFWL_Widget::Finalize(); + IFWL_Widget::Finalize(); } FWL_Error IFWL_ToolTip::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { diff --git a/xfa/fwl/core/ifwl_tooltip.h b/xfa/fwl/core/ifwl_tooltip.h index 7554f82bf9..4aed7d8f7f 100644 --- a/xfa/fwl/core/ifwl_tooltip.h +++ b/xfa/fwl/core/ifwl_tooltip.h @@ -14,7 +14,6 @@ class CFWL_WidgetImpProperties; class IFWL_Widget; class CFWL_ToolTipImpDelegate; -#define FWL_CLASS_ToolTip L"FWL_TOOLTIP" #define FWL_STYLEEXT_TTP_Rectangle (0L << 3) #define FWL_STYLEEXT_TTP_RoundCorner (1L << 3) #define FWL_STYLEEXT_TTP_Balloon (1L << 4) @@ -39,10 +38,9 @@ class IFWL_ToolTip : public IFWL_Form { ~IFWL_ToolTip() override; // IFWL_Widget - FWL_Error GetClassName(CFX_WideString& wsClass) const override; FWL_Type GetClassID() const override; FWL_Error Initialize() override; - FWL_Error Finalize() override; + void Finalize() override; FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; FWL_Error Update() override; FWL_Error DrawWidget(CFX_Graphics* pGraphics, diff --git a/xfa/fwl/core/ifwl_widget.cpp b/xfa/fwl/core/ifwl_widget.cpp index 68755bf24a..5ec738f8cc 100644 --- a/xfa/fwl/core/ifwl_widget.cpp +++ b/xfa/fwl/core/ifwl_widget.cpp @@ -24,6 +24,22 @@ #define FWL_STYLEEXT_MNU_Vert (1L << 0) +IFWL_Widget::IFWL_Widget(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter) + : m_pWidgetMgr(CFWL_WidgetMgr::GetInstance()), + m_pProperties(new CFWL_WidgetImpProperties(properties)), + m_pDelegate(nullptr), + m_pCurDelegate(nullptr), + m_pOuter(pOuter), + m_pLayoutItem(nullptr), + m_pAssociate(nullptr), + m_iLock(0), + m_nEventKey(0) { + ASSERT(m_pWidgetMgr); +} + +IFWL_Widget::~IFWL_Widget() {} + FWL_Error IFWL_Widget::Initialize() { IFWL_App* pApp = FWL_GetApp(); if (!pApp) @@ -45,15 +61,9 @@ FWL_Error IFWL_Widget::Initialize() { return FWL_Error::Succeeded; } -FWL_Error IFWL_Widget::Finalize() { +void IFWL_Widget::Finalize() { NotifyDriver(); m_pWidgetMgr->RemoveWidget(this); - return FWL_Error::Succeeded; -} - -FWL_Error IFWL_Widget::GetClassName(CFX_WideString& wsClass) const { - wsClass.clear(); - return FWL_Error::Succeeded; } FX_BOOL IFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const { @@ -389,30 +399,9 @@ void IFWL_Widget::SetLayoutItem(void* pItem) { m_pLayoutItem = pItem; } -CFWL_Widget* IFWL_Widget::GetAssociateWidget() const { - return m_pAssociate; -} - void IFWL_Widget::SetAssociateWidget(CFWL_Widget* pAssociate) { m_pAssociate = pAssociate; } - -IFWL_Widget::IFWL_Widget(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter) - : m_pWidgetMgr(CFWL_WidgetMgr::GetInstance()), - m_pProperties(new CFWL_WidgetImpProperties(properties)), - m_pDelegate(nullptr), - m_pCurDelegate(nullptr), - m_pOuter(pOuter), - m_pLayoutItem(nullptr), - m_pAssociate(nullptr), - m_iLock(0), - m_nEventKey(0) { - ASSERT(m_pWidgetMgr); -} - -IFWL_Widget::~IFWL_Widget() {} - FX_BOOL IFWL_Widget::IsEnabled() const { return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; } diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h index 9db7a0505a..6cb241d363 100644 --- a/xfa/fwl/core/ifwl_widget.h +++ b/xfa/fwl/core/ifwl_widget.h @@ -67,8 +67,7 @@ class IFWL_Widget { virtual ~IFWL_Widget(); virtual FWL_Error Initialize(); - virtual FWL_Error Finalize(); - virtual FWL_Error GetClassName(CFX_WideString& wsClass) const; + virtual void Finalize(); virtual FWL_Type GetClassID() const = 0; virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; @@ -76,31 +75,42 @@ class IFWL_Widget { virtual FWL_Error GetGlobalRect(CFX_RectF& rect); virtual FWL_Error SetWidgetRect(const CFX_RectF& rect); virtual FWL_Error GetClientRect(CFX_RectF& rect); + virtual IFWL_Widget* GetParent(); virtual FWL_Error SetParent(IFWL_Widget* pParent); + virtual IFWL_Widget* GetOwner(); virtual FWL_Error SetOwner(IFWL_Widget* pOwner); + virtual IFWL_Widget* GetOuter(); + virtual uint32_t GetStyles(); virtual FWL_Error ModifyStyles(uint32_t dwStylesAdded, uint32_t dwStylesRemoved); virtual uint32_t GetStylesEx(); virtual FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); + virtual uint32_t GetStates(); virtual void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); + virtual FWL_Error Update(); virtual FWL_Error LockUpdate(); virtual FWL_Error UnlockUpdate(); + virtual FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); + virtual FWL_Error TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); virtual FWL_Error TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); + virtual FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); virtual FWL_Error SetMatrix(const CFX_Matrix& matrix); + virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr); + virtual IFWL_ThemeProvider* GetThemeProvider(); virtual FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); @@ -115,7 +125,6 @@ class IFWL_Widget { void* GetLayoutItem() const; void SetLayoutItem(void* pItem); - CFWL_Widget* GetAssociateWidget() const; void SetAssociateWidget(CFWL_Widget* pAssociate); protected: |