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

Side by Side 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, 6 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/core/fwl_widgetimp.h" 7 #include "xfa/fwl/core/fwl_widgetimp.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 uint32_t IFWL_Widget::GetEventKey() const { 98 uint32_t IFWL_Widget::GetEventKey() const {
99 return GetImpl()->GetEventKey(); 99 return GetImpl()->GetEventKey();
100 } 100 }
101 101
102 void IFWL_Widget::SetEventKey(uint32_t key) { 102 void IFWL_Widget::SetEventKey(uint32_t key) {
103 GetImpl()->SetEventKey(key); 103 GetImpl()->SetEventKey(key);
104 } 104 }
105 105
106 void* IFWL_Widget::GetLayoutItem() const {
107 return GetImpl()->GetLayoutItem();
108 }
109
110 void IFWL_Widget::SetLayoutItem(void* pItem) {
111 GetImpl()->SetLayoutItem(pItem);
112 }
113
106 FWL_Error IFWL_Widget::SetPrivateData(void* module_id, 114 FWL_Error IFWL_Widget::SetPrivateData(void* module_id,
107 void* pData, 115 void* pData,
108 PD_CALLBACK_FREEDATA callback) { 116 PD_CALLBACK_FREEDATA callback) {
109 return GetImpl()->SetPrivateData(module_id, pData, callback); 117 return GetImpl()->SetPrivateData(module_id, pData, callback);
110 } 118 }
111 void* IFWL_Widget::GetPrivateData(void* module_id) { 119 void* IFWL_Widget::GetPrivateData(void* module_id) {
112 return GetImpl()->GetPrivateData(module_id); 120 return GetImpl()->GetPrivateData(module_id);
113 } 121 }
114 FWL_Error IFWL_Widget::Update() { 122 FWL_Error IFWL_Widget::Update() {
115 return GetImpl()->Update(); 123 return GetImpl()->Update();
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } 518 }
511 519
512 uint32_t CFWL_WidgetImp::GetEventKey() const { 520 uint32_t CFWL_WidgetImp::GetEventKey() const {
513 return m_nEventKey; 521 return m_nEventKey;
514 } 522 }
515 523
516 void CFWL_WidgetImp::SetEventKey(uint32_t key) { 524 void CFWL_WidgetImp::SetEventKey(uint32_t key) {
517 m_nEventKey = key; 525 m_nEventKey = key;
518 } 526 }
519 527
528 void* CFWL_WidgetImp::GetLayoutItem() const {
529 return m_pLayoutItem;
530 }
531
532 void CFWL_WidgetImp::SetLayoutItem(void* pItem) {
533 m_pLayoutItem = pItem;
534 }
535
520 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, 536 CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties,
521 IFWL_Widget* pOuter) 537 IFWL_Widget* pOuter)
522 : m_pProperties(new CFWL_WidgetImpProperties), 538 : m_pProperties(new CFWL_WidgetImpProperties),
523 m_pPrivateData(NULL), 539 m_pPrivateData(nullptr),
524 m_pDelegate(NULL), 540 m_pDelegate(nullptr),
525 m_pCurDelegate(NULL), 541 m_pCurDelegate(nullptr),
526 m_pOuter(pOuter), 542 m_pOuter(pOuter),
527 m_pInterface(NULL), 543 m_pInterface(nullptr),
544 m_pLayoutItem(nullptr),
528 m_iLock(0), 545 m_iLock(0),
529 m_nEventKey(0) { 546 m_nEventKey(0) {
530 *m_pProperties = properties; 547 *m_pProperties = properties;
531 m_pWidgetMgr = CFWL_WidgetMgr::GetInstance(); 548 m_pWidgetMgr = CFWL_WidgetMgr::GetInstance();
532 ASSERT(m_pWidgetMgr != NULL); 549 ASSERT(m_pWidgetMgr);
533 } 550 }
551
534 CFWL_WidgetImp::~CFWL_WidgetImp() { 552 CFWL_WidgetImp::~CFWL_WidgetImp() {
535 if (m_pPrivateData) { 553 delete m_pPrivateData;
536 delete m_pPrivateData; 554 delete m_pProperties;
537 m_pPrivateData = NULL;
538 }
539 if (m_pProperties) {
540 delete m_pProperties;
541 m_pProperties = NULL;
542 }
543 } 555 }
556
544 FX_BOOL CFWL_WidgetImp::IsEnabled() const { 557 FX_BOOL CFWL_WidgetImp::IsEnabled() const {
545 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; 558 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0;
546 } 559 }
547 FX_BOOL CFWL_WidgetImp::IsVisible() const { 560 FX_BOOL CFWL_WidgetImp::IsVisible() const {
548 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0; 561 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0;
549 } 562 }
550 FX_BOOL CFWL_WidgetImp::IsActive() const { 563 FX_BOOL CFWL_WidgetImp::IsActive() const {
551 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) == 0; 564 return (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) == 0;
552 } 565 }
553 FX_BOOL CFWL_WidgetImp::IsOverLapper() const { 566 FX_BOOL CFWL_WidgetImp::IsOverLapper() const {
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 } 1048 }
1036 } 1049 }
1037 1050
1038 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} 1051 void CFWL_WidgetImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {}
1039 1052
1040 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, 1053 void CFWL_WidgetImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
1041 const CFX_Matrix* pMatrix) { 1054 const CFX_Matrix* pMatrix) {
1042 CFWL_EvtDraw evt; 1055 CFWL_EvtDraw evt;
1043 evt.m_pGraphics = pGraphics; 1056 evt.m_pGraphics = pGraphics;
1044 } 1057 }
OLDNEW
« 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