Index: xfa/fwl/core/ifwl_picturebox.cpp |
diff --git a/xfa/fwl/basewidget/fwl_pictureboximp.cpp b/xfa/fwl/core/ifwl_picturebox.cpp |
similarity index 65% |
rename from xfa/fwl/basewidget/fwl_pictureboximp.cpp |
rename to xfa/fwl/core/ifwl_picturebox.cpp |
index a84cc8c5e8ed409851769f072e2d1c92256a58c7..12d8713971667c98c3e5dade995fdbcb23a5a45a 100644 |
--- a/xfa/fwl/basewidget/fwl_pictureboximp.cpp |
+++ b/xfa/fwl/core/ifwl_picturebox.cpp |
@@ -4,29 +4,21 @@ |
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
-#include "xfa/fwl/basewidget/fwl_pictureboximp.h" |
+#include "xfa/fwl/core/ifwl_picturebox.h" |
#include "xfa/fwl/core/fwl_noteimp.h" |
-#include "xfa/fwl/core/fwl_widgetimp.h" |
#include "xfa/fwl/lightwidget/cfwl_picturebox.h" |
// static |
IFWL_PictureBox* IFWL_PictureBox::Create( |
const CFWL_WidgetImpProperties& properties, |
IFWL_Widget* pOuter) { |
- IFWL_PictureBox* pPictureBox = new IFWL_PictureBox; |
- CFWL_PictureBoxImp* pPictureBoxImpl = |
- new CFWL_PictureBoxImp(properties, pOuter); |
- pPictureBox->SetImpl(pPictureBoxImpl); |
- pPictureBoxImpl->SetInterface(pPictureBox); |
- return pPictureBox; |
+ return new IFWL_PictureBox(properties, pOuter); |
} |
-IFWL_PictureBox::IFWL_PictureBox() {} |
-CFWL_PictureBoxImp::CFWL_PictureBoxImp( |
- const CFWL_WidgetImpProperties& properties, |
- IFWL_Widget* pOuter) |
- : CFWL_WidgetImp(properties, pOuter), |
+IFWL_PictureBox::IFWL_PictureBox(const CFWL_WidgetImpProperties& properties, |
+ IFWL_Widget* pOuter) |
+ : IFWL_Widget(properties, pOuter), |
m_bTop(FALSE), |
m_bVCenter(FALSE), |
m_bButton(FALSE) { |
@@ -35,50 +27,51 @@ CFWL_PictureBoxImp::CFWL_PictureBoxImp( |
m_matrix.SetIdentity(); |
} |
-CFWL_PictureBoxImp::~CFWL_PictureBoxImp() {} |
+IFWL_PictureBox::~IFWL_PictureBox() {} |
-FWL_Error CFWL_PictureBoxImp::GetClassName(CFX_WideString& wsClass) const { |
+FWL_Error IFWL_PictureBox::GetClassName(CFX_WideString& wsClass) const { |
wsClass = FWL_CLASS_PictureBox; |
return FWL_Error::Succeeded; |
} |
-FWL_Type CFWL_PictureBoxImp::GetClassID() const { |
+FWL_Type IFWL_PictureBox::GetClassID() const { |
return FWL_Type::PictureBox; |
} |
-FWL_Error CFWL_PictureBoxImp::Initialize() { |
- if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) |
+FWL_Error IFWL_PictureBox::Initialize() { |
+ if (IFWL_Widget::Initialize() != FWL_Error::Succeeded) |
return FWL_Error::Indefinite; |
m_pDelegate = new CFWL_PictureBoxImpDelegate(this); |
return FWL_Error::Succeeded; |
} |
-FWL_Error CFWL_PictureBoxImp::Finalize() { |
+FWL_Error IFWL_PictureBox::Finalize() { |
delete m_pDelegate; |
m_pDelegate = nullptr; |
- return CFWL_WidgetImp::Finalize(); |
+ return IFWL_Widget::Finalize(); |
} |
-FWL_Error CFWL_PictureBoxImp::GetWidgetRect(CFX_RectF& rect, |
- FX_BOOL bAutoSize) { |
+ |
+FWL_Error IFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
if (bAutoSize) { |
rect.Set(0, 0, 0, 0); |
if (!m_pProperties->m_pDataProvider) |
return FWL_Error::Indefinite; |
CFX_DIBitmap* pBitmap = |
static_cast<IFWL_PictureBoxDP*>(m_pProperties->m_pDataProvider) |
- ->GetPicture(m_pInterface); |
+ ->GetPicture(this); |
if (pBitmap) { |
rect.Set(0, 0, (FX_FLOAT)pBitmap->GetWidth(), |
(FX_FLOAT)pBitmap->GetHeight()); |
} |
- CFWL_WidgetImp::GetWidgetRect(rect, TRUE); |
+ IFWL_Widget::GetWidgetRect(rect, TRUE); |
} else { |
rect = m_pProperties->m_rtWidget; |
} |
return FWL_Error::Succeeded; |
} |
-FWL_Error CFWL_PictureBoxImp::Update() { |
+ |
+FWL_Error IFWL_PictureBox::Update() { |
if (IsLocked()) { |
return FWL_Error::Succeeded; |
} |
@@ -88,8 +81,9 @@ FWL_Error CFWL_PictureBoxImp::Update() { |
GetClientRect(m_rtClient); |
return FWL_Error::Succeeded; |
} |
-FWL_Error CFWL_PictureBoxImp::DrawWidget(CFX_Graphics* pGraphics, |
- const CFX_Matrix* pMatrix) { |
+ |
+FWL_Error IFWL_PictureBox::DrawWidget(CFX_Graphics* pGraphics, |
+ const CFX_Matrix* pMatrix) { |
if (!pGraphics) |
return FWL_Error::Indefinite; |
if (!m_pProperties->m_pThemeProvider) |
@@ -104,17 +98,18 @@ FWL_Error CFWL_PictureBoxImp::DrawWidget(CFX_Graphics* pGraphics, |
DrawBkground(pGraphics, pTheme, pMatrix); |
return FWL_Error::Succeeded; |
} |
-void CFWL_PictureBoxImp::DrawBkground(CFX_Graphics* pGraphics, |
- IFWL_ThemeProvider* pTheme, |
- const CFX_Matrix* pMatrix) { |
+ |
+void IFWL_PictureBox::DrawBkground(CFX_Graphics* pGraphics, |
+ IFWL_ThemeProvider* pTheme, |
+ const CFX_Matrix* pMatrix) { |
IFWL_PictureBoxDP* pPictureDP = |
static_cast<IFWL_PictureBoxDP*>(m_pProperties->m_pDataProvider); |
if (!pPictureDP) |
return; |
- CFX_DIBitmap* pPicture = pPictureDP->GetPicture(m_pInterface); |
+ CFX_DIBitmap* pPicture = pPictureDP->GetPicture(this); |
CFX_Matrix matrix; |
- pPictureDP->GetMatrix(m_pInterface, matrix); |
+ pPictureDP->GetMatrix(this, matrix); |
if (!pPicture) |
return; |
@@ -131,7 +126,8 @@ void CFWL_PictureBoxImp::DrawBkground(CFX_Graphics* pGraphics, |
(m_rtClient.height - fy) / 2), |
&matrix); |
} |
-FX_BOOL CFWL_PictureBoxImp::VStyle(FX_BOOL dwStyle) { |
+ |
+FX_BOOL IFWL_PictureBox::VStyle(FX_BOOL dwStyle) { |
switch (dwStyle & FWL_STYLEEXT_PTB_VAlignMask) { |
case FWL_STYLEEXT_PTB_Top: { |
return m_bTop = TRUE; |
@@ -149,8 +145,7 @@ FX_BOOL CFWL_PictureBoxImp::VStyle(FX_BOOL dwStyle) { |
return FALSE; |
} |
-CFWL_PictureBoxImpDelegate::CFWL_PictureBoxImpDelegate( |
- CFWL_PictureBoxImp* pOwner) |
+CFWL_PictureBoxImpDelegate::CFWL_PictureBoxImpDelegate(IFWL_PictureBox* pOwner) |
: m_pOwner(pOwner) {} |
void CFWL_PictureBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |