diff options
Diffstat (limited to 'xfa/fwl/core')
-rw-r--r-- | xfa/fwl/core/cfwl_event.h | 192 | ||||
-rw-r--r-- | xfa/fwl/core/cfwl_message.h | 231 | ||||
-rw-r--r-- | xfa/fwl/core/cfwl_themepart.h | 22 | ||||
-rw-r--r-- | xfa/fwl/core/cfwl_widgetimpproperties.h | 31 | ||||
-rw-r--r-- | xfa/fwl/core/cfwl_widgetmgr.cpp | 19 | ||||
-rw-r--r-- | xfa/fwl/core/cfwl_widgetmgr.h | 19 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_appimp.cpp | 4 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_formimp.cpp | 42 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_formimp.h | 41 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_noteimp.cpp | 25 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_noteimp.h | 4 | ||||
-rw-r--r-- | xfa/fwl/core/fwl_widgetimp.cpp | 2 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_app.h | 4 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_tooltiptarget.h | 8 |
14 files changed, 363 insertions, 281 deletions
diff --git a/xfa/fwl/core/cfwl_event.h b/xfa/fwl/core/cfwl_event.h index d9decac334..4d208d0d46 100644 --- a/xfa/fwl/core/cfwl_event.h +++ b/xfa/fwl/core/cfwl_event.h @@ -66,22 +66,13 @@ class IFWL_Widget; class CFWL_Event { public: - CFWL_Event() - : m_pSrcTarget(nullptr), m_pDstTarget(nullptr), m_dwRefCount(1) {} - virtual ~CFWL_Event() {} - - virtual FWL_Error GetClassName(CFX_WideString& wsClass) const { - return FWL_Error::Succeeded; - } - virtual CFWL_EventType GetClassID() const { return CFWL_EventType::None; } - - uint32_t Release() { - m_dwRefCount--; - uint32_t dwRefCount = m_dwRefCount; - if (!m_dwRefCount) - delete this; - return dwRefCount; - } + CFWL_Event(); + virtual ~CFWL_Event(); + + virtual FWL_Error GetClassName(CFX_WideString& wsClass) const; + virtual CFWL_EventType GetClassID() const; + + uint32_t Release(); IFWL_Widget* m_pSrcTarget; IFWL_Widget* m_pDstTarget; @@ -90,84 +81,95 @@ class CFWL_Event { uint32_t m_dwRefCount; }; -#define BEGIN_FWL_EVENT_DEF(classname, eventType) \ - class classname : public CFWL_Event { \ - public: \ - classname() : CFWL_Event() {} \ - virtual FWL_Error GetClassName(CFX_WideString& wsClass) const { \ - wsClass = L## #classname; \ - return FWL_Error::Succeeded; \ - } \ - virtual CFWL_EventType GetClassID() const { return eventType; } - -#define END_FWL_EVENT_DEF \ - } \ - ; // NOLINT - -BEGIN_FWL_EVENT_DEF(CFWL_EvtMouse, CFWL_EventType::Mouse) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -uint32_t m_dwFlags; -FWL_MouseCommand m_dwCmd; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtMouseWheel, CFWL_EventType::MouseWheel) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -FX_FLOAT m_fDeltaX; -FX_FLOAT m_fDeltaY; -uint32_t m_dwFlags; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtKey, CFWL_EventType::Key) -uint32_t m_dwKeyCode; -uint32_t m_dwFlags; -FWL_KeyCommand m_dwCmd; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtSetFocus, CFWL_EventType::SetFocus) -IFWL_Widget* m_pSetFocus; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtKillFocus, CFWL_EventType::KillFocus) -IFWL_Widget* m_pKillFocus; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtDraw, CFWL_EventType::Draw) -CFX_Graphics* m_pGraphics; -IFWL_Widget* m_pWidget; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtClick, CFWL_EventType::Click) -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtScroll, CFWL_EventType::Scroll) -uint32_t m_iScrollCode; -FX_FLOAT m_fPos; -FX_BOOL* m_pRet; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtClose, CFWL_EventType::Close) -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtContextMenu, CFWL_EventType::ContextMenu) -FX_FLOAT m_fPosX; -FX_FLOAT m_fPosY; -IFWL_Widget* m_pOwner; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtMenuCommand, CFWL_EventType::MenuCommand) -int32_t m_iCommand; -void* m_pData; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtSizeChanged, CFWL_EventType::SizeChanged) -IFWL_Widget* m_pWidget; -CFX_RectF m_rtOld; -CFX_RectF m_rtNew; -END_FWL_EVENT_DEF - -BEGIN_FWL_EVENT_DEF(CFWL_EvtIdle, CFWL_EventType::Idle) -END_FWL_EVENT_DEF +inline CFWL_Event::CFWL_Event() + : m_pSrcTarget(nullptr), m_pDstTarget(nullptr), m_dwRefCount(1) {} + +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; +} + +inline uint32_t CFWL_Event::Release() { + m_dwRefCount--; + uint32_t dwRefCount = m_dwRefCount; + if (!m_dwRefCount) + delete this; + return dwRefCount; +} + +#define FWL_EVENT_DEF(classname, eventType, ...) \ + class classname : public CFWL_Event { \ + 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; + FX_FLOAT m_fy; + uint32_t m_dwFlags; + FWL_MouseCommand m_dwCmd;) + +FWL_EVENT_DEF(CFWL_EvtMouseWheel, CFWL_EventType::MouseWheel, FX_FLOAT m_fx; + FX_FLOAT m_fy; + FX_FLOAT m_fDeltaX; + FX_FLOAT m_fDeltaY; + uint32_t m_dwFlags;) + +FWL_EVENT_DEF(CFWL_EvtKey, CFWL_EventType::Key, uint32_t m_dwKeyCode; + uint32_t m_dwFlags; + FWL_KeyCommand m_dwCmd;) + +FWL_EVENT_DEF(CFWL_EvtSetFocus, + CFWL_EventType::SetFocus, + IFWL_Widget* m_pSetFocus;) + +FWL_EVENT_DEF(CFWL_EvtKillFocus, + CFWL_EventType::KillFocus, + IFWL_Widget* m_pKillFocus;) + +FWL_EVENT_DEF(CFWL_EvtDraw, CFWL_EventType::Draw, CFX_Graphics* m_pGraphics; + IFWL_Widget * m_pWidget;) + +FWL_EVENT_DEF(CFWL_EvtClick, CFWL_EventType::Click) + +FWL_EVENT_DEF(CFWL_EvtScroll, CFWL_EventType::Scroll, uint32_t m_iScrollCode; + FX_FLOAT m_fPos; + FX_BOOL * m_pRet;) + +FWL_EVENT_DEF(CFWL_EvtClose, CFWL_EventType::Close) + +FWL_EVENT_DEF(CFWL_EvtContextMenu, + CFWL_EventType::ContextMenu, + FX_FLOAT m_fPosX; + FX_FLOAT m_fPosY; + IFWL_Widget * m_pOwner;) + +FWL_EVENT_DEF(CFWL_EvtMenuCommand, + CFWL_EventType::MenuCommand, + int32_t m_iCommand; + void* m_pData;) + +FWL_EVENT_DEF(CFWL_EvtSizeChanged, + CFWL_EventType::SizeChanged, + IFWL_Widget* m_pWidget; + CFX_RectF m_rtOld; + CFX_RectF m_rtNew;) + +FWL_EVENT_DEF(CFWL_EvtIdle, CFWL_EventType::Idle) #endif // XFA_FWL_CORE_CFWL_EVENT_H_ diff --git a/xfa/fwl/core/cfwl_message.h b/xfa/fwl/core/cfwl_message.h index 74401c3e34..db434fc1fb 100644 --- a/xfa/fwl/core/cfwl_message.h +++ b/xfa/fwl/core/cfwl_message.h @@ -53,31 +53,15 @@ class IFWL_Widget; class CFWL_Message { public: - CFWL_Message() - : m_pSrcTarget(nullptr), - m_pDstTarget(nullptr), - m_dwExtend(0), - m_dwRefCount(1) {} - virtual ~CFWL_Message() {} - - virtual CFWL_Message* Clone() { return nullptr; } - virtual FWL_Error GetClassName(CFX_WideString& wsClass) const { - return FWL_Error::Succeeded; - } - virtual CFWL_MessageType GetClassID() const { return CFWL_MessageType::None; } - - uint32_t Release() { - m_dwRefCount--; - uint32_t dwRefCount = m_dwRefCount; - if (!m_dwRefCount) - delete this; - return dwRefCount; - } - - CFWL_Message* Retain() { - m_dwRefCount++; - return this; - } + 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(); + CFWL_Message* Retain(); IFWL_Widget* m_pSrcTarget; IFWL_Widget* m_pDstTarget; @@ -87,91 +71,124 @@ class CFWL_Message { uint32_t m_dwRefCount; }; -#define BEGIN_FWL_MESSAGE_DEF(classname, msgType) \ - class classname : public CFWL_Message { \ - public: \ - classname() : CFWL_Message() {} \ - CFWL_Message* Clone() override { return new classname(*this); } \ - FWL_Error GetClassName(CFX_WideString& wsClass) const override { \ - wsClass = L## #classname; \ - return FWL_Error::Succeeded; \ - } \ - CFWL_MessageType GetClassID() const override { return msgType; } - -#define END_FWL_MESSAGE_DEF \ - } \ - ; // NOLINT - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, CFWL_MessageType::Activate) -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, CFWL_MessageType::Deactivate) -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouse, CFWL_MessageType::Mouse) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -uint32_t m_dwFlags; -FWL_MouseCommand m_dwCmd; -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouseWheel, CFWL_MessageType::MouseWheel) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -FX_FLOAT m_fDeltaX; -FX_FLOAT m_fDeltaY; -uint32_t m_dwFlags; -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSetFocus, CFWL_MessageType::SetFocus) -IFWL_Widget* m_pKillFocus; -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKillFocus, CFWL_MessageType::KillFocus) -IFWL_Widget* m_pSetFocus; -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKey, CFWL_MessageType::Key) -uint32_t m_dwKeyCode; -uint32_t m_dwFlags; -FWL_KeyCommand m_dwCmd; -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgCursor, CFWL_MessageType::Cursor) -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSize, CFWL_MessageType::Size) -int32_t m_iWidth; -int32_t m_iHeight; -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowMove, CFWL_MessageType::WindowMove) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -END_FWL_MESSAGE_DEF - -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDropFiles, CFWL_MessageType::DropFiles) -CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy) { - m_pDstTarget = copy.m_pDstTarget; - m_pSrcTarget = copy.m_pSrcTarget; - m_fx = copy.m_fx; - m_fy = copy.m_fy; - m_files.Append(copy.m_files); +inline CFWL_Message::CFWL_Message() + : m_pSrcTarget(nullptr), + m_pDstTarget(nullptr), + m_dwExtend(0), + m_dwRefCount(1) {} + +inline CFWL_Message::~CFWL_Message() {} + +inline CFWL_Message* CFWL_Message::Clone() { + return nullptr; +} + +inline FWL_Error CFWL_Message::GetClassName(CFX_WideString& wsClass) const { + return FWL_Error::Succeeded; } -FX_FLOAT m_fx; -FX_FLOAT m_fy; -CFX_WideStringArray m_files; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgTaskClicked, CFWL_MessageType::TaskClicked) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -END_FWL_MESSAGE_DEF +inline CFWL_MessageType CFWL_Message::GetClassID() const { + return CFWL_MessageType::None; +} -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgClose, CFWL_MessageType::Close) -END_FWL_MESSAGE_DEF +inline uint32_t CFWL_Message::Release() { + m_dwRefCount--; + uint32_t dwRefCount = m_dwRefCount; + if (!m_dwRefCount) + delete this; + return dwRefCount; +} + +inline CFWL_Message* CFWL_Message::Retain() { + m_dwRefCount++; + return this; +} -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, CFWL_MessageType::WindowWillMove) -END_FWL_MESSAGE_DEF +#define FWL_MESSAGE_CLASS_DEF(classname, msgType, ...) \ + class classname : public CFWL_Message { \ + public: \ + classname(); \ + ~classname() override; \ + CFWL_Message* Clone() override; \ + FWL_Error GetClassName(CFX_WideString& wsClass) const override; \ + CFWL_MessageType GetClassID() const override; \ + __VA_ARGS__ \ + }; + +#define FWL_MESSAGE_FUNCTION_DEF(classname, msgType, ...) \ + 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__ + +#define FWL_MESSAGE_DEF(classname, msgType, ...) \ + FWL_MESSAGE_CLASS_DEF(classname, msgType, __VA_ARGS__) \ + FWL_MESSAGE_FUNCTION_DEF(classname, msgType) + +FWL_MESSAGE_DEF(CFWL_MsgActivate, CFWL_MessageType::Activate) + +FWL_MESSAGE_DEF(CFWL_MsgDeactivate, CFWL_MessageType::Deactivate) + +FWL_MESSAGE_DEF(CFWL_MsgMouse, CFWL_MessageType::Mouse, FX_FLOAT m_fx; + FX_FLOAT m_fy; + uint32_t m_dwFlags; + FWL_MouseCommand m_dwCmd;) + +FWL_MESSAGE_DEF(CFWL_MsgMouseWheel, CFWL_MessageType::MouseWheel, FX_FLOAT m_fx; + FX_FLOAT m_fy; + FX_FLOAT m_fDeltaX; + FX_FLOAT m_fDeltaY; + uint32_t m_dwFlags;) + +FWL_MESSAGE_DEF(CFWL_MsgSetFocus, + CFWL_MessageType::SetFocus, + IFWL_Widget* m_pKillFocus;) + +FWL_MESSAGE_DEF(CFWL_MsgKillFocus, + CFWL_MessageType::KillFocus, + IFWL_Widget* m_pSetFocus;) + +FWL_MESSAGE_DEF(CFWL_MsgKey, CFWL_MessageType::Key, uint32_t m_dwKeyCode; + uint32_t m_dwFlags; + FWL_KeyCommand m_dwCmd;) + +FWL_MESSAGE_DEF(CFWL_MsgCursor, CFWL_MessageType::Cursor) + +FWL_MESSAGE_DEF(CFWL_MsgSize, CFWL_MessageType::Size, int32_t m_iWidth; + int32_t m_iHeight;) + +FWL_MESSAGE_DEF(CFWL_MsgWindowMove, CFWL_MessageType::WindowMove, FX_FLOAT m_fx; + FX_FLOAT m_fy;) + +FWL_MESSAGE_CLASS_DEF(CFWL_MsgDropFiles, + CFWL_MessageType::DropFiles, + CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy); + FX_FLOAT m_fx; + FX_FLOAT m_fy; + CFX_WideStringArray m_files;) +FWL_MESSAGE_FUNCTION_DEF( + CFWL_MsgDropFiles, + CFWL_MessageType::DropFiles, + inline CFWL_MsgDropFiles::CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy) { + m_pDstTarget = copy.m_pDstTarget; + m_pSrcTarget = copy.m_pSrcTarget; + m_fx = copy.m_fx; + m_fy = copy.m_fy; + m_files.Append(copy.m_files); + }) + +FWL_MESSAGE_DEF(CFWL_MsgTaskClicked, + CFWL_MessageType::TaskClicked, + FX_FLOAT m_fx; + FX_FLOAT m_fy;) + +FWL_MESSAGE_DEF(CFWL_MsgClose, CFWL_MessageType::Close) + +FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, CFWL_MessageType::WindowWillMove) #endif // XFA_FWL_CORE_CFWL_MESSAGE_H_ diff --git a/xfa/fwl/core/cfwl_themepart.h b/xfa/fwl/core/cfwl_themepart.h index 5bdf1530a5..c5e6cd7ff5 100644 --- a/xfa/fwl/core/cfwl_themepart.h +++ b/xfa/fwl/core/cfwl_themepart.h @@ -81,16 +81,7 @@ class IFWL_Widget; class CFWL_ThemePart { public: - CFWL_ThemePart() - : m_pWidget(nullptr), - m_iPart(CFWL_Part::None), - m_dwStates(CFWL_PartState_Normal), - m_bMaximize(false), - m_bStaticBackground(false), - m_pData(nullptr) { - m_rtPart.Reset(); - m_matrix.SetIdentity(); - } + CFWL_ThemePart(); CFX_Matrix m_matrix; CFX_RectF m_rtPart; @@ -102,4 +93,15 @@ class CFWL_ThemePart { void* m_pData; }; +inline CFWL_ThemePart::CFWL_ThemePart() + : m_pWidget(nullptr), + m_iPart(CFWL_Part::None), + m_dwStates(CFWL_PartState_Normal), + m_bMaximize(false), + m_bStaticBackground(false), + m_pData(nullptr) { + m_rtPart.Reset(); + m_matrix.SetIdentity(); +} + #endif // XFA_FWL_CORE_CFWL_THEMEPART_H_ diff --git a/xfa/fwl/core/cfwl_widgetimpproperties.h b/xfa/fwl/core/cfwl_widgetimpproperties.h index 8b1cf864d4..71b0368311 100644 --- a/xfa/fwl/core/cfwl_widgetimpproperties.h +++ b/xfa/fwl/core/cfwl_widgetimpproperties.h @@ -17,17 +17,9 @@ class IFWL_Widget; class CFWL_WidgetImpProperties { public: - CFWL_WidgetImpProperties() - : m_dwStyles(FWL_WGTSTYLE_Child), - m_dwStyleExes(0), - m_dwStates(0), - m_pThemeProvider(nullptr), - m_pDataProvider(nullptr), - m_pParent(nullptr), - m_pOwner(nullptr) { - m_ctmOnParent.SetIdentity(); - m_rtWidget.Set(0, 0, 0, 0); - } + CFWL_WidgetImpProperties(); + ~CFWL_WidgetImpProperties(); + CFWL_WidgetImpProperties(const CFWL_WidgetImpProperties& other); CFX_Matrix m_ctmOnParent; CFX_RectF m_rtWidget; @@ -40,4 +32,21 @@ class CFWL_WidgetImpProperties { IFWL_Widget* m_pOwner; }; +inline CFWL_WidgetImpProperties::CFWL_WidgetImpProperties() + : m_dwStyles(FWL_WGTSTYLE_Child), + m_dwStyleExes(0), + m_dwStates(0), + m_pThemeProvider(nullptr), + m_pDataProvider(nullptr), + m_pParent(nullptr), + m_pOwner(nullptr) { + m_ctmOnParent.SetIdentity(); + m_rtWidget.Set(0, 0, 0, 0); +} + +inline CFWL_WidgetImpProperties::~CFWL_WidgetImpProperties() {} + +inline CFWL_WidgetImpProperties::CFWL_WidgetImpProperties( + const CFWL_WidgetImpProperties& other) = default; + #endif // XFA_FWL_CORE_CFWL_WIDGETIMPPROPERTIES_H_ diff --git a/xfa/fwl/core/cfwl_widgetmgr.cpp b/xfa/fwl/core/cfwl_widgetmgr.cpp index 78d8206369..d36ab7792b 100644 --- a/xfa/fwl/core/cfwl_widgetmgr.cpp +++ b/xfa/fwl/core/cfwl_widgetmgr.cpp @@ -859,3 +859,22 @@ FX_BOOL CFWL_WidgetMgrDelegate::bUseOffscreenDirect(IFWL_Widget* pWidget) { return pItem->iRedrawCounter == 0; } + +CFWL_WidgetMgrItem::CFWL_WidgetMgrItem() : CFWL_WidgetMgrItem(nullptr) {} + +CFWL_WidgetMgrItem::CFWL_WidgetMgrItem(IFWL_Widget* widget) + : pParent(nullptr), + pOwner(nullptr), + pChild(nullptr), + pPrevious(nullptr), + pNext(nullptr), + pWidget(widget), + iRedrawCounter(0) +#if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) + , + bOutsideChanged(FALSE) +#endif +{ +} + +CFWL_WidgetMgrItem::~CFWL_WidgetMgrItem() {} diff --git a/xfa/fwl/core/cfwl_widgetmgr.h b/xfa/fwl/core/cfwl_widgetmgr.h index 957f6dc428..1f0df3beb6 100644 --- a/xfa/fwl/core/cfwl_widgetmgr.h +++ b/xfa/fwl/core/cfwl_widgetmgr.h @@ -27,22 +27,9 @@ class IFWL_Widget; class CFWL_WidgetMgrItem { public: - CFWL_WidgetMgrItem() : CFWL_WidgetMgrItem(nullptr) {} - explicit CFWL_WidgetMgrItem(IFWL_Widget* widget) - : pParent(nullptr), - pOwner(nullptr), - pChild(nullptr), - pPrevious(nullptr), - pNext(nullptr), - pWidget(widget), - iRedrawCounter(0) -#if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) - , - bOutsideChanged(FALSE) -#endif - { - } - ~CFWL_WidgetMgrItem() {} + CFWL_WidgetMgrItem(); + explicit CFWL_WidgetMgrItem(IFWL_Widget* widget); + ~CFWL_WidgetMgrItem(); CFWL_WidgetMgrItem* pParent; CFWL_WidgetMgrItem* pOwner; diff --git a/xfa/fwl/core/fwl_appimp.cpp b/xfa/fwl/core/fwl_appimp.cpp index 089a6d3693..2c4258ce74 100644 --- a/xfa/fwl/core/fwl_appimp.cpp +++ b/xfa/fwl/core/fwl_appimp.cpp @@ -18,6 +18,10 @@ IFWL_App* IFWL_App::Create(CXFA_FFApp* pAdapter) { return pApp; } +IFWL_App::IFWL_App() {} + +IFWL_App::~IFWL_App() {} + void IFWL_App::Release() {} FWL_Error IFWL_App::Initialize() { diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp index 1dcb310bd4..8b4ef9fc43 100644 --- a/xfa/fwl/core/fwl_formimp.cpp +++ b/xfa/fwl/core/fwl_formimp.cpp @@ -64,6 +64,10 @@ FWL_Error IFWL_Form::SetBorderRegion(CFX_Path* pPath) { return static_cast<CFWL_FormImp*>(GetImpl())->SetBorderRegion(pPath); } +RestoreResizeInfo::RestoreResizeInfo() {} + +RestoreResizeInfo::~RestoreResizeInfo() {} + CFWL_FormImp::CFWL_FormImp(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter) : CFWL_WidgetImp(properties, pOuter), @@ -1128,3 +1132,41 @@ void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) { eClose.m_pSrcTarget = m_pOwner->m_pInterface; m_pOwner->DispatchEvent(&eClose); } + +CFWL_SysBtn::CFWL_SysBtn() { + m_rtBtn.Set(0, 0, 0, 0); + m_dwState = 0; +} + +bool CFWL_SysBtn::IsDisabled() const { + return !!(m_dwState & FWL_SYSBUTTONSTATE_Disabled); +} + +void CFWL_SysBtn::SetNormal() { + m_dwState &= 0xFFF0; +} + +void CFWL_SysBtn::SetPressed() { + SetNormal(); + m_dwState |= FWL_SYSBUTTONSTATE_Pressed; +} + +void CFWL_SysBtn::SetHover() { + SetNormal(); + m_dwState |= FWL_SYSBUTTONSTATE_Hover; +} + +void CFWL_SysBtn::SetDisabled(FX_BOOL bDisabled) { + bDisabled ? m_dwState |= FWL_SYSBUTTONSTATE_Disabled + : m_dwState &= ~FWL_SYSBUTTONSTATE_Disabled; +} + +uint32_t CFWL_SysBtn::GetPartState() const { + if (IsDisabled()) + return CFWL_PartState_Disabled; + if (m_dwState & FWL_SYSBUTTONSTATE_Pressed) + return CFWL_PartState_Pressed; + if (m_dwState & FWL_SYSBUTTONSTATE_Hover) + return CFWL_PartState_Hovered; + return CFWL_PartState_Normal; +} diff --git a/xfa/fwl/core/fwl_formimp.h b/xfa/fwl/core/fwl_formimp.h index 1f2d6951c0..7278afb681 100644 --- a/xfa/fwl/core/fwl_formimp.h +++ b/xfa/fwl/core/fwl_formimp.h @@ -27,35 +27,15 @@ class CFWL_FormImpDelegate; class CFWL_SysBtn { public: - CFWL_SysBtn() { - m_rtBtn.Set(0, 0, 0, 0); - m_dwState = 0; - } - - bool IsDisabled() { return !!(m_dwState & FWL_SYSBUTTONSTATE_Disabled); } - - void SetNormal() { m_dwState &= 0xFFF0; } - void SetPressed() { - SetNormal(); - m_dwState |= FWL_SYSBUTTONSTATE_Pressed; - } - void SetHover() { - SetNormal(); - m_dwState |= FWL_SYSBUTTONSTATE_Hover; - } - void SetDisabled(FX_BOOL bDisabled) { - bDisabled ? m_dwState |= FWL_SYSBUTTONSTATE_Disabled - : m_dwState &= ~FWL_SYSBUTTONSTATE_Disabled; - } - uint32_t GetPartState() { - if (IsDisabled()) - return CFWL_PartState_Disabled; - if (m_dwState & FWL_SYSBUTTONSTATE_Pressed) - return CFWL_PartState_Pressed; - if (m_dwState & FWL_SYSBUTTONSTATE_Hover) - return CFWL_PartState_Hovered; - return CFWL_PartState_Normal; - } + CFWL_SysBtn(); + + bool IsDisabled() const; + uint32_t GetPartState() const; + + void SetNormal(); + void SetPressed(); + void SetHover(); + void SetDisabled(FX_BOOL bDisabled); CFX_RectF m_rtBtn; uint32_t m_dwState; @@ -67,6 +47,9 @@ enum FORM_RESIZETYPE { }; typedef struct RestoreResizeInfo { + RestoreResizeInfo(); + ~RestoreResizeInfo(); + CFX_PointF m_ptStart; CFX_SizeF m_szStart; } RestoreInfo; diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp index 9518a08f00..b38592b2d3 100644 --- a/xfa/fwl/core/fwl_noteimp.cpp +++ b/xfa/fwl/core/fwl_noteimp.cpp @@ -668,11 +668,14 @@ void CFWL_NoteDriver::ClearInvalidEventTargets(FX_BOOL bRemoveAll) { class CFWL_CoreToolTipDP : public IFWL_ToolTipDP { public: - FWL_Error GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - int32_t GetInitialDelay(IFWL_Widget* pWidget); - int32_t GetAutoPopDelay(IFWL_Widget* pWidget); - CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget); - CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget); + // IFWL_ToolTipDP + FWL_Error GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) override; + int32_t GetInitialDelay(IFWL_Widget* pWidget) override; + int32_t GetAutoPopDelay(IFWL_Widget* pWidget) override; + CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) override; + CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) override; + CFX_RectF GetAnchor(); CFWL_CoreToolTipDP(); @@ -681,34 +684,46 @@ class CFWL_CoreToolTipDP : public IFWL_ToolTipDP { int32_t m_nAutoPopDelayTime; CFX_RectF m_fAnchor; }; + CFWL_CoreToolTipDP::CFWL_CoreToolTipDP() { m_nInitDelayTime = 500; m_nAutoPopDelayTime = 50000; m_fAnchor.Set(0.0, 0.0, 0.0, 0.0); } + FWL_Error CFWL_CoreToolTipDP::GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) { wsCaption = m_wsCaption; return FWL_Error::Succeeded; } + int32_t CFWL_CoreToolTipDP::GetInitialDelay(IFWL_Widget* pWidget) { return m_nInitDelayTime; } + int32_t CFWL_CoreToolTipDP::GetAutoPopDelay(IFWL_Widget* pWidget) { return m_nAutoPopDelayTime; } + CFX_DIBitmap* CFWL_CoreToolTipDP::GetToolTipIcon(IFWL_Widget* pWidget) { return NULL; } + CFX_SizeF CFWL_CoreToolTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) { return CFX_SizeF(); } + CFX_RectF CFWL_CoreToolTipDP::GetAnchor() { return m_fAnchor; } + +CFWL_EventTarget::CFWL_EventTarget(CFWL_NoteDriver* pNoteDriver, + IFWL_Widget* pListener) + : m_pListener(pListener), m_pNoteDriver(pNoteDriver), m_bInvalid(FALSE) {} CFWL_EventTarget::~CFWL_EventTarget() { m_eventSources.RemoveAll(); } + int32_t CFWL_EventTarget::SetEventSource(IFWL_Widget* pSource, uint32_t dwFilter) { if (pSource) { diff --git a/xfa/fwl/core/fwl_noteimp.h b/xfa/fwl/core/fwl_noteimp.h index 9116e31e08..eb922f916c 100644 --- a/xfa/fwl/core/fwl_noteimp.h +++ b/xfa/fwl/core/fwl_noteimp.h @@ -121,9 +121,9 @@ class CFWL_NoteDriver { class CFWL_EventTarget { public: - CFWL_EventTarget(CFWL_NoteDriver* pNoteDriver, IFWL_Widget* pListener) - : m_pListener(pListener), m_pNoteDriver(pNoteDriver), m_bInvalid(FALSE) {} + CFWL_EventTarget(CFWL_NoteDriver* pNoteDriver, IFWL_Widget* pListener); ~CFWL_EventTarget(); + int32_t SetEventSource(IFWL_Widget* pSource, uint32_t dwFilter = FWL_EVENT_ALL_MASK); FX_BOOL ProcessEvent(CFWL_Event* pEvent); diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp index 27f8a44c79..d556499e27 100644 --- a/xfa/fwl/core/fwl_widgetimp.cpp +++ b/xfa/fwl/core/fwl_widgetimp.cpp @@ -10,7 +10,6 @@ #include "xfa/fde/tto/fde_textout.h" #include "xfa/fwl/basewidget/ifwl_combobox.h" -#include "xfa/fwl/basewidget/ifwl_datetimepicker.h" #include "xfa/fwl/core/cfwl_message.h" #include "xfa/fwl/core/cfwl_themebackground.h" #include "xfa/fwl/core/cfwl_themepart.h" @@ -21,6 +20,7 @@ #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_form.h" #include "xfa/fwl/core/ifwl_themeprovider.h" +#include "xfa/fwl/core/ifwl_widget.h" #include "xfa/fxfa/include/xfa_ffapp.h" #define FWL_STYLEEXT_MNU_Vert (1L << 0) diff --git a/xfa/fwl/core/ifwl_app.h b/xfa/fwl/core/ifwl_app.h index 5fbac6644f..27c65c8317 100644 --- a/xfa/fwl/core/ifwl_app.h +++ b/xfa/fwl/core/ifwl_app.h @@ -32,7 +32,7 @@ class IFWL_App { public: static IFWL_App* Create(CXFA_FFApp* pAdapter); - virtual ~IFWL_App() {} + virtual ~IFWL_App(); FWL_Error Initialize(); FWL_Error Finalize(); @@ -53,7 +53,7 @@ class IFWL_App { CFWL_NoteDriver* GetNoteDriver() const; private: - IFWL_App() {} + IFWL_App(); std::unique_ptr<CFWL_AppImp> m_pImpl; }; diff --git a/xfa/fwl/core/ifwl_tooltiptarget.h b/xfa/fwl/core/ifwl_tooltiptarget.h index 7489e73efd..c6a47d0e09 100644 --- a/xfa/fwl/core/ifwl_tooltiptarget.h +++ b/xfa/fwl/core/ifwl_tooltiptarget.h @@ -26,9 +26,11 @@ class IFWL_ToolTipTarget { virtual FX_BOOL UseDefaultTheme() = 0; virtual FWL_Error GetCaption(CFX_WideString& wsCaption) = 0; virtual FWL_Error GetToolTipSize(CFX_SizeF& sz) = 0; - virtual FWL_Error GetToolTipPos(CFX_PointF& pt) { - return FWL_Error::Indefinite; - } + virtual FWL_Error GetToolTipPos(CFX_PointF& pt); }; +inline FWL_Error GetToolTipPos(CFX_PointF& pt) { + return FWL_Error::Indefinite; +} + #endif // XFA_FWL_CORE_IFWL_TOOLTIPTARGET_H_ |