summaryrefslogtreecommitdiff
path: root/xfa/fwl/core
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/core')
-rw-r--r--xfa/fwl/core/fwl_widgetimp.cpp39
-rw-r--r--xfa/fwl/core/fwl_widgetimp.h3
-rw-r--r--xfa/fwl/core/ifwl_widget.h2
3 files changed, 31 insertions, 13 deletions
diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp
index c6070b28e7..38e3a1ff28 100644
--- a/xfa/fwl/core/fwl_widgetimp.cpp
+++ b/xfa/fwl/core/fwl_widgetimp.cpp
@@ -103,6 +103,14 @@ void IFWL_Widget::SetEventKey(uint32_t key) {
GetImpl()->SetEventKey(key);
}
+void* IFWL_Widget::GetLayoutItem() const {
+ return GetImpl()->GetLayoutItem();
+}
+
+void IFWL_Widget::SetLayoutItem(void* pItem) {
+ GetImpl()->SetLayoutItem(pItem);
+}
+
FWL_Error IFWL_Widget::SetPrivateData(void* module_id,
void* pData,
PD_CALLBACK_FREEDATA callback) {
@@ -517,30 +525,35 @@ void CFWL_WidgetImp::SetEventKey(uint32_t key) {
m_nEventKey = key;
}
+void* CFWL_WidgetImp::GetLayoutItem() const {
+ return m_pLayoutItem;
+}
+
+void CFWL_WidgetImp::SetLayoutItem(void* pItem) {
+ m_pLayoutItem = pItem;
+}
+
CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
: m_pProperties(new CFWL_WidgetImpProperties),
- m_pPrivateData(NULL),
- m_pDelegate(NULL),
- m_pCurDelegate(NULL),
+ m_pPrivateData(nullptr),
+ m_pDelegate(nullptr),
+ m_pCurDelegate(nullptr),
m_pOuter(pOuter),
- m_pInterface(NULL),
+ m_pInterface(nullptr),
+ m_pLayoutItem(nullptr),
m_iLock(0),
m_nEventKey(0) {
*m_pProperties = properties;
m_pWidgetMgr = CFWL_WidgetMgr::GetInstance();
- ASSERT(m_pWidgetMgr != NULL);
+ ASSERT(m_pWidgetMgr);
}
+
CFWL_WidgetImp::~CFWL_WidgetImp() {
- if (m_pPrivateData) {
- delete m_pPrivateData;
- m_pPrivateData = NULL;
- }
- if (m_pProperties) {
- delete m_pProperties;
- m_pProperties = NULL;
- }
+ delete m_pPrivateData;
+ delete m_pProperties;
}
+
FX_BOOL CFWL_WidgetImp::IsEnabled() const {
return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0;
}
diff --git a/xfa/fwl/core/fwl_widgetimp.h b/xfa/fwl/core/fwl_widgetimp.h
index 3fdef9786c..8a887126e3 100644
--- a/xfa/fwl/core/fwl_widgetimp.h
+++ b/xfa/fwl/core/fwl_widgetimp.h
@@ -80,6 +80,8 @@ class CFWL_WidgetImp {
CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent);
uint32_t GetEventKey() const;
void SetEventKey(uint32_t key);
+ void* GetLayoutItem() const;
+ void SetLayoutItem(void* pItem);
protected:
friend class CFWL_WidgetImpDelegate;
@@ -162,6 +164,7 @@ class CFWL_WidgetImp {
IFWL_WidgetDelegate* m_pCurDelegate;
IFWL_Widget* m_pOuter;
IFWL_Widget* m_pInterface;
+ void* m_pLayoutItem;
int32_t m_iLock;
uint32_t m_nEventKey;
};
diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h
index 1c469b276c..e9da806291 100644
--- a/xfa/fwl/core/ifwl_widget.h
+++ b/xfa/fwl/core/ifwl_widget.h
@@ -77,6 +77,8 @@ class IFWL_Widget {
void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE);
uint32_t GetEventKey() const;
void SetEventKey(uint32_t key);
+ void* GetLayoutItem() const;
+ void SetLayoutItem(void* pItem);
FWL_Error SetPrivateData(void* module_id,
void* pData,
PD_CALLBACK_FREEDATA callback);