diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-12-09 16:16:19 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-12-09 16:16:19 -0800 |
commit | 8ee79f8f2824d5b7058d49ebb10ced6b001c178e (patch) | |
tree | 182737e505b0795a1a9365cc3f591df266d5a6ae /xfa/include/fwl/core | |
parent | b3e2d4ae6c0c9a32c4616acc71cad4751c210ae0 (diff) | |
download | pdfium-8ee79f8f2824d5b7058d49ebb10ced6b001c178e.tar.xz |
FWL refcounts never incremented (part 2).
Re-introduce create methods that actually create the
corresponding impl so we don't have ifaces without impls.
Remove per-subclass Initialize() methods.
Remove unused ctors.
BUG=pdfium:282
R=jun_fang@foxitsoftware.com, thestig@chromium.org
Review URL: https://codereview.chromium.org/1453473002 .
Diffstat (limited to 'xfa/include/fwl/core')
-rw-r--r-- | xfa/include/fwl/core/fwl_form.h | 12 | ||||
-rw-r--r-- | xfa/include/fwl/core/fwl_grid.h | 4 | ||||
-rw-r--r-- | xfa/include/fwl/core/fwl_panel.h | 12 | ||||
-rw-r--r-- | xfa/include/fwl/core/fwl_target.h | 4 | ||||
-rw-r--r-- | xfa/include/fwl/core/fwl_widget.h | 6 |
5 files changed, 24 insertions, 14 deletions
diff --git a/xfa/include/fwl/core/fwl_form.h b/xfa/include/fwl/core/fwl_form.h index 439d1cb554..52a2f5c479 100644 --- a/xfa/include/fwl/core/fwl_form.h +++ b/xfa/include/fwl/core/fwl_form.h @@ -63,17 +63,21 @@ enum FWL_COMMANDID { FWL_COMMANDID_Yes,
FWL_COMMANDID_No,
};
+
class IFWL_Form : public IFWL_Panel {
public:
- IFWL_Form();
- FWL_ERR Initialize(CFWL_WidgetImpProperties& properties,
- CFX_WideString* classname,
- IFWL_Widget* pOuter);
+ static IFWL_Form* CreateFormProxy(CFWL_WidgetImpProperties& properties,
+ CFX_WideString* classname,
+ IFWL_Widget* pOuter);
+
FWL_FORMSIZE GetFormSize();
FWL_ERR SetFormSize(FWL_FORMSIZE eFormSize);
IFWL_Widget* DoModal();
IFWL_Widget* DoModal(FX_DWORD& dwCommandID);
FWL_ERR EndDoModal();
FWL_ERR SetBorderRegion(CFX_Path* pPath);
+
+ protected:
+ IFWL_Form();
};
#endif
diff --git a/xfa/include/fwl/core/fwl_grid.h b/xfa/include/fwl/core/fwl_grid.h index a41ef4ed53..168de913ba 100644 --- a/xfa/include/fwl/core/fwl_grid.h +++ b/xfa/include/fwl/core/fwl_grid.h @@ -8,7 +8,6 @@ #define _FWL_GRID_H
class IFWL_Widget;
class IFWL_Content;
-class IFWL_Grid;
#define FWL_CLASS_Grid L"FWL_GRID"
#define FWL_CLASSHASH_Grid 3150298670
#define FWL_GRIDSTYLEEXT_ShowGridLines (1L << 0)
@@ -39,8 +38,7 @@ enum FWL_GRIDSIZE { typedef struct _FWL_HGRIDCOLROW { void* pData; } * FWL_HGRIDCOLROW;
class IFWL_Grid : public IFWL_Content {
public:
- static IFWL_Grid* Create();
- FWL_ERR Initialize(CFWL_WidgetImpProperties& properties);
+ static IFWL_Grid* Create(const CFWL_WidgetImpProperties& properties);
FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, int32_t nIndex = -1);
int32_t CountColRows(FX_BOOL bColumn);
diff --git a/xfa/include/fwl/core/fwl_panel.h b/xfa/include/fwl/core/fwl_panel.h index bea6675911..351055def7 100644 --- a/xfa/include/fwl/core/fwl_panel.h +++ b/xfa/include/fwl/core/fwl_panel.h @@ -12,20 +12,24 @@ class IFWL_Panel; class IFWL_CustomPanel;
#define FWL_CLASS_Panel L"FWL_Panel"
#define FWL_CLASSHASH_Panel 881567292
+
class IFWL_Panel : public IFWL_Widget {
public:
- static IFWL_Panel* Create();
- FWL_ERR Initialize(CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter);
+ static IFWL_Panel* Create(CFWL_WidgetImpProperties& properties,
+ IFWL_Widget* pOuter);
+
IFWL_Content* GetContent();
FWL_ERR SetContent(IFWL_Content* pContent);
protected:
IFWL_Panel();
};
+
class IFWL_CustomPanel : public IFWL_Widget {
public:
- static IFWL_CustomPanel* Create();
- FWL_ERR Initialize(CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter);
+ static IFWL_CustomPanel* Create(CFWL_WidgetImpProperties& properties,
+ IFWL_Widget* pOuter);
+
IFWL_Content* GetContent();
FWL_ERR SetContent(IFWL_Content* pContent);
FWL_ERR SetProxy(IFWL_Proxy* pProxy);
diff --git a/xfa/include/fwl/core/fwl_target.h b/xfa/include/fwl/core/fwl_target.h index dc10ca5399..d7be7519b5 100644 --- a/xfa/include/fwl/core/fwl_target.h +++ b/xfa/include/fwl/core/fwl_target.h @@ -31,6 +31,8 @@ class IFWL_Target { IFWL_Target() : m_pImpl(nullptr) {}
virtual ~IFWL_Target();
+ // These call into equivalent polymorphic methods of m_pImpl. There
+ // should be no need to override these in subclasses.
FWL_ERR GetClassName(CFX_WideString& wsClass) const;
FX_DWORD GetClassID() const;
FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const;
@@ -38,6 +40,8 @@ class IFWL_Target { FWL_ERR Finalize();
CFWL_TargetImp* GetImpl() const { return m_pImpl; }
+
+ protected:
void SetImpl(CFWL_TargetImp* pImpl) { m_pImpl = pImpl; }
private:
diff --git a/xfa/include/fwl/core/fwl_widget.h b/xfa/include/fwl/core/fwl_widget.h index acada467b4..6338be9ee6 100644 --- a/xfa/include/fwl/core/fwl_widget.h +++ b/xfa/include/fwl/core/fwl_widget.h @@ -92,9 +92,9 @@ class CFWL_WidgetImpProperties { };
class IFWL_Custom : public IFWL_Widget {
public:
- static IFWL_Custom* Create();
- FWL_ERR Initialize(const CFWL_WidgetImpProperties& properties,
- IFWL_Widget* pOuter);
+ static IFWL_Custom* Create(const CFWL_WidgetImpProperties& properties,
+ IFWL_Widget* pOuter);
+
FWL_ERR SetProxy(IFWL_Proxy* pProxy);
protected:
|