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

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

Issue 2436103002: Remove FWL globals. (Closed)
Patch Set: fix mac Created 4 years, 2 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_CFWL_WIDGET_H_ 7 #ifndef XFA_FWL_CORE_CFWL_WIDGET_H_
8 #define XFA_FWL_CORE_CFWL_WIDGET_H_ 8 #define XFA_FWL_CORE_CFWL_WIDGET_H_
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "xfa/fwl/core/cfwl_event.h" 12 #include "xfa/fwl/core/cfwl_event.h"
13 #include "xfa/fwl/core/cfwl_widgetproperties.h" 13 #include "xfa/fwl/core/cfwl_widgetproperties.h"
14 #include "xfa/fwl/core/ifwl_widget.h" 14 #include "xfa/fwl/core/ifwl_widget.h"
15 15
16 class CFWL_Event; 16 class CFWL_Event;
17 class CFWL_Message; 17 class CFWL_Message;
18 class CFWL_Widget; 18 class CFWL_Widget;
19 class CFWL_WidgetDelegate; 19 class CFWL_WidgetDelegate;
20 class CFWL_WidgetMgr; 20 class CFWL_WidgetMgr;
21 21
22 class CFWL_Widget { 22 class CFWL_Widget {
23 public: 23 public:
24 CFWL_Widget(); 24 CFWL_Widget(const IFWL_App*);
25 virtual ~CFWL_Widget(); 25 virtual ~CFWL_Widget();
26 26
27 virtual IFWL_Widget* GetWidget(); 27 virtual IFWL_Widget* GetWidget();
28 virtual const IFWL_Widget* GetWidget() const; 28 virtual const IFWL_Widget* GetWidget() const;
29 29
30 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); 30 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE);
31 FWL_Error SetWidgetRect(const CFX_RectF& rect); 31 FWL_Error SetWidgetRect(const CFX_RectF& rect);
32 FWL_Error GetGlobalRect(CFX_RectF& rect); 32 FWL_Error GetGlobalRect(CFX_RectF& rect);
33 FWL_Error GetClientRect(CFX_RectF& rtClient); 33 FWL_Error GetClientRect(CFX_RectF& rtClient);
34 34
(...skipping 12 matching lines...) Expand all
47 void UnlockUpdate(); 47 void UnlockUpdate();
48 48
49 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); 49 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy);
50 50
51 FWL_Error DrawWidget(CFX_Graphics* pGraphics, 51 FWL_Error DrawWidget(CFX_Graphics* pGraphics,
52 const CFX_Matrix* pMatrix = nullptr); 52 const CFX_Matrix* pMatrix = nullptr);
53 53
54 IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); 54 IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate);
55 55
56 protected: 56 protected:
57 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); 57 void Initialize(const CFWL_WidgetProperties* pProperties);
58 58
59 const IFWL_App* m_pApp;
59 std::unique_ptr<IFWL_Widget> m_pIface; 60 std::unique_ptr<IFWL_Widget> m_pIface;
60 IFWL_WidgetDelegate* m_pDelegate; 61 IFWL_WidgetDelegate* m_pDelegate;
61 CFWL_WidgetMgr* const m_pWidgetMgr; 62 CFWL_WidgetMgr* const m_pWidgetMgr;
62 std::unique_ptr<CFWL_WidgetProperties> m_pProperties; 63 std::unique_ptr<CFWL_WidgetProperties> m_pProperties;
63 }; 64 };
64 65
65 #endif // XFA_FWL_CORE_CFWL_WIDGET_H_ 66 #endif // XFA_FWL_CORE_CFWL_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698