Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Unified Diff: xfa/fwl/core/fwl_widgetimp.cpp

Issue 2010923002: Add opaque "layout item" to widgets for caller's use. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Cast to FFWidget. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/fwl_widgetimp.h ('k') | xfa/fwl/core/ifwl_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/fwl_widgetimp.cpp
diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp
index c6070b28e742ba4c9093948a69d15f231085ff49..38e3a1ff282d860267bbdf713099cea4f7f3c4f8 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;
}
« no previous file with comments | « xfa/fwl/core/fwl_widgetimp.h ('k') | xfa/fwl/core/ifwl_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698