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

Side by Side Diff: xfa/fwl/core/ifwl_widget.h

Issue 2016743002: Add back-pointer to "Associated widget" to CFWL_WidgetImp. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@opaque_layout_item
Patch Set: 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 unified diff | Download patch
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 #ifndef XFA_FWL_CORE_IFWL_WIDGET_H_ 7 #ifndef XFA_FWL_CORE_IFWL_WIDGET_H_
8 #define XFA_FWL_CORE_IFWL_WIDGET_H_ 8 #define XFA_FWL_CORE_IFWL_WIDGET_H_
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "core/fxcrt/include/fx_basic.h" 12 #include "core/fxcrt/include/fx_basic.h"
13 #include "core/fxcrt/include/fx_coordinates.h" 13 #include "core/fxcrt/include/fx_coordinates.h"
14 #include "core/fxcrt/include/fx_system.h" 14 #include "core/fxcrt/include/fx_system.h"
15 #include "xfa/fwl/core/fwl_error.h" 15 #include "xfa/fwl/core/fwl_error.h"
16 #include "xfa/fwl/core/fwl_widgetimp.h" 16 #include "xfa/fwl/core/fwl_widgetimp.h"
17 17
18 // FWL contains three parallel inheritance hierarchies, which reference each 18 // FWL contains three parallel inheritance hierarchies, which reference each
19 // other via pointers as follows: 19 // other via pointers as follows:
20 // 20 //
21 // m_pIface m_pImpl 21 // m_pAssociate
Tom Sepez 2016/05/26 18:13:52 Let me know if you can think of a better term that
Lei Zhang 2016/05/26 23:06:07 Nope.
22 // <----------------------------------
22 // CFWL_Widget ----------> IFWL_Widget ----------> CFWL_WidgetImp 23 // CFWL_Widget ----------> IFWL_Widget ----------> CFWL_WidgetImp
23 // | | | 24 // | m_pIface | m_pImpl |
24 // A A A 25 // A A A
25 // | | | 26 // | | |
26 // CFWL_... IFWL_... CFWL_...Imp 27 // CFWL_... IFWL_... CFWL_...Imp
27 // 28 //
29 // TODO(tsepez): Collapse these into a single hierarchy.
30 //
28 31
29 enum class FWL_Type { 32 enum class FWL_Type {
30 Unknown = 0, 33 Unknown = 0,
31 34
32 Barcode, 35 Barcode,
33 Caret, 36 Caret,
34 CheckBox, 37 CheckBox,
35 ComboBox, 38 ComboBox,
36 DateTimePicker, 39 DateTimePicker,
37 Edit, 40 Edit,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 FWL_Error ModifyStyles(uint32_t dwStylesAdded, uint32_t dwStylesRemoved); 75 FWL_Error ModifyStyles(uint32_t dwStylesAdded, uint32_t dwStylesRemoved);
73 uint32_t GetStylesEx(); 76 uint32_t GetStylesEx();
74 FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, 77 FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded,
75 uint32_t dwStylesExRemoved); 78 uint32_t dwStylesExRemoved);
76 uint32_t GetStates(); 79 uint32_t GetStates();
77 void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); 80 void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE);
78 uint32_t GetEventKey() const; 81 uint32_t GetEventKey() const;
79 void SetEventKey(uint32_t key); 82 void SetEventKey(uint32_t key);
80 void* GetLayoutItem() const; 83 void* GetLayoutItem() const;
81 void SetLayoutItem(void* pItem); 84 void SetLayoutItem(void* pItem);
82 FWL_Error SetPrivateData(void* module_id, 85 void* GetAssociateWidget() const;
83 void* pData, 86 void SetAssociateWidget(void* pAssociate);
84 PD_CALLBACK_FREEDATA callback);
85 void* GetPrivateData(void* module_id);
86 FWL_Error Update(); 87 FWL_Error Update();
87 FWL_Error LockUpdate(); 88 FWL_Error LockUpdate();
88 FWL_Error UnlockUpdate(); 89 FWL_Error UnlockUpdate();
89 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); 90 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy);
90 FWL_Error TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); 91 FWL_Error TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy);
91 FWL_Error TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); 92 FWL_Error TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt);
92 FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); 93 FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE);
93 FWL_Error SetMatrix(const CFX_Matrix& matrix); 94 FWL_Error SetMatrix(const CFX_Matrix& matrix);
94 FWL_Error DrawWidget(CFX_Graphics* pGraphics, 95 FWL_Error DrawWidget(CFX_Graphics* pGraphics,
95 const CFX_Matrix* pMatrix = NULL); 96 const CFX_Matrix* pMatrix = NULL);
(...skipping 16 matching lines...) Expand all
112 113
113 protected: 114 protected:
114 // Takes ownership of |pImpl|. 115 // Takes ownership of |pImpl|.
115 void SetImpl(CFWL_WidgetImp* pImpl) { m_pImpl.reset(pImpl); } 116 void SetImpl(CFWL_WidgetImp* pImpl) { m_pImpl.reset(pImpl); }
116 117
117 private: 118 private:
118 std::unique_ptr<CFWL_WidgetImp> m_pImpl; 119 std::unique_ptr<CFWL_WidgetImp> m_pImpl;
119 }; 120 };
120 121
121 #endif // XFA_FWL_CORE_IFWL_WIDGET_H_ 122 #endif // XFA_FWL_CORE_IFWL_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698