summaryrefslogtreecommitdiff
path: root/xfa/fwl/core
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/core')
-rw-r--r--xfa/fwl/core/cfwl_themebackground.h4
-rw-r--r--xfa/fwl/core/cfwl_themepart.h75
-rw-r--r--xfa/fwl/core/fwl_formimp.cpp85
-rw-r--r--xfa/fwl/core/fwl_formimp.h2
-rw-r--r--xfa/fwl/core/fwl_widgetimp.cpp20
-rw-r--r--xfa/fwl/core/fwl_widgetimp.h10
-rw-r--r--xfa/fwl/core/ifwl_form.h20
-rw-r--r--xfa/fwl/core/ifwl_themeprovider.h18
8 files changed, 138 insertions, 96 deletions
diff --git a/xfa/fwl/core/cfwl_themebackground.h b/xfa/fwl/core/cfwl_themebackground.h
index 6cecbbf26a..9761183011 100644
--- a/xfa/fwl/core/cfwl_themebackground.h
+++ b/xfa/fwl/core/cfwl_themebackground.h
@@ -16,7 +16,9 @@ class CFX_Path;
class CFWL_ThemeBackground : public CFWL_ThemePart {
public:
- CFWL_ThemeBackground() : m_pGraphics(NULL), m_pImage(NULL), m_pPath(NULL) {}
+ CFWL_ThemeBackground()
+ : m_pGraphics(nullptr), m_pImage(nullptr), m_pPath(nullptr) {}
+
CFX_Graphics* m_pGraphics;
CFX_DIBitmap* m_pImage;
CFX_Path* m_pPath;
diff --git a/xfa/fwl/core/cfwl_themepart.h b/xfa/fwl/core/cfwl_themepart.h
index 884f38101f..5868465c08 100644
--- a/xfa/fwl/core/cfwl_themepart.h
+++ b/xfa/fwl/core/cfwl_themepart.h
@@ -11,10 +11,81 @@
#include "core/fxcrt/include/fx_system.h"
#include "xfa/fwl/core/ifwl_widget.h"
+enum class CFWL_Part {
+ None = 0,
+
+ BackArrow,
+ Background,
+ Border,
+ Caption,
+ Check,
+ CheckBox,
+ CloseBox,
+ CombTextLine,
+ DateInBK,
+ DateInCircle,
+ DatesIn,
+ DatesOut,
+ DownButton,
+ DropDownButton,
+ Edge,
+ ForeArrow,
+ HSeparator,
+ HeadText,
+ Header,
+ Icon,
+ Image,
+ LBtn,
+ ListItem,
+ LowerTrack,
+ MinimizeBox,
+ MaximizeBox,
+ NarrowCaption,
+ RBtn,
+ StretchHandler,
+ Thumb,
+ ThumbBackArrow,
+ ThumbForeArrow,
+ ThumbLowerTrack,
+ ThumbThumb,
+ ThumbUpperTrack,
+ Today,
+ TodayCircle,
+ UpButton,
+ UpperTrack,
+ VSeparator,
+ Week,
+ WeekNum,
+ WeekNumSep
+};
+
+enum CFWL_PartState {
+ CFWL_PartState_Normal = 0,
+
+ CFWL_PartState_Checked = 1 << 1,
+ CFWL_PartState_Default = 1 << 2,
+ CFWL_PartState_Disabled = 1 << 3,
+ CFWL_PartState_Flagged = 1 << 4,
+ CFWL_PartState_Focused = 1 << 5,
+ CFWL_PartState_HightLight = 1 << 6,
+ CFWL_PartState_Hovered = 1 << 7,
+ CFWL_PartState_Inactive = 1 << 8,
+ CFWL_PartState_Neutral = 1 << 9,
+ CFWL_PartState_Pressed = 1 << 10,
+ CFWL_PartState_ReadOnly = 1 << 11,
+ CFWL_PartState_LSelected = 1 << 12,
+ CFWL_PartState_RSelected = 1 << 13,
+ CFWL_PartState_Selected = 1 << 14
+};
+
class CFWL_ThemePart {
public:
CFWL_ThemePart()
- : m_pWidget(NULL), m_iPart(0), m_dwStates(0), m_dwData(0), m_pData(NULL) {
+ : m_pWidget(nullptr),
+ m_iPart(CFWL_Part::None),
+ m_dwStates(CFWL_PartState_Normal),
+ m_dwData(0),
+ m_pData(nullptr) {
m_rtPart.Reset();
m_matrix.SetIdentity();
}
@@ -22,7 +93,7 @@ class CFWL_ThemePart {
CFX_Matrix m_matrix;
CFX_RectF m_rtPart;
IFWL_Widget* m_pWidget;
- int32_t m_iPart;
+ CFWL_Part m_iPart;
uint32_t m_dwStates;
uint32_t m_dwData;
void* m_pData;
diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp
index 5b1fe7aa28..338c55fee1 100644
--- a/xfa/fwl/core/fwl_formimp.cpp
+++ b/xfa/fwl/core/fwl_formimp.cpp
@@ -21,6 +21,7 @@
#include "xfa/fwl/core/ifwl_adapterwidgetmgr.h"
#include "xfa/fwl/core/ifwl_app.h"
#include "xfa/fwl/core/ifwl_themeprovider.h"
+#include "xfa/fwl/theme/cfwl_widgettp.h"
#define FWL_SYSBTNSIZE 21
#define FWL_SYSBTNMARGIN 5
@@ -168,11 +169,11 @@ FWL_ERR CFWL_FormImp::GetClientRect(CFX_RectF& rect) {
CFWL_ThemePart part;
part.m_pWidget = m_pInterface;
x = *static_cast<FX_FLOAT*>(
- pTheme->GetCapacity(&part, FWL_WGTCAPACITY_CXBorder));
+ pTheme->GetCapacity(&part, CFWL_WidgetCapacity::CXBorder));
y = *static_cast<FX_FLOAT*>(
- pTheme->GetCapacity(&part, FWL_WGTCAPACITY_CYBorder));
+ pTheme->GetCapacity(&part, CFWL_WidgetCapacity::CYBorder));
t = *static_cast<FX_FLOAT*>(
- pTheme->GetCapacity(&part, FWL_WGTCAPACITY_FRM_CYCaption));
+ pTheme->GetCapacity(&part, CFWL_WidgetCapacity::CYCaption));
}
rect = m_pProperties->m_rtWidget;
rect.Offset(-rect.left, -rect.top);
@@ -270,8 +271,7 @@ FWL_ERR CFWL_FormImp::DrawWidget(CFX_Graphics* pGraphics,
return FWL_ERR_Indefinite;
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
FX_BOOL bInactive = !IsActive();
- int32_t iState =
- bInactive ? FWL_PARTSTATE_FRM_Inactive : FWL_PARTSTATE_FRM_Normal;
+ int32_t iState = bInactive ? CFWL_PartState_Inactive : CFWL_PartState_Normal;
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_NoDrawClient) == 0) {
DrawBackground(pGraphics, pTheme);
}
@@ -287,33 +287,33 @@ FWL_ERR CFWL_FormImp::DrawWidget(CFX_Graphics* pGraphics,
param.m_matrix.Concat(*pMatrix);
}
if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) {
- param.m_iPart = FWL_PART_FRM_Border;
+ param.m_iPart = CFWL_Part::Border;
pTheme->DrawBackground(&param);
}
if ((m_pProperties->m_dwStyleExes & FWL_WGTSTYLE_EdgeMask) !=
FWL_WGTSTYLE_EdgeNone) {
CFX_RectF rtEdge;
GetEdgeRect(rtEdge);
- param.m_iPart = FWL_PART_FRM_Edge;
+ param.m_iPart = CFWL_Part::Edge;
param.m_rtPart = rtEdge;
param.m_dwStates = iState;
pTheme->DrawBackground(&param);
}
if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Caption) {
- param.m_iPart = FWL_PART_FRM_Caption;
+ param.m_iPart = CFWL_Part::Caption;
param.m_dwStates = iState;
param.m_rtPart = m_rtCaption;
pTheme->DrawBackground(&param);
DrawCaptionText(pGraphics, pTheme, pMatrix);
} else if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_NarrowCaption) {
- param.m_iPart = FWL_PART_FRM_NarrowCaption;
+ param.m_iPart = CFWL_Part::NarrowCaption;
param.m_dwStates = iState;
param.m_rtPart = m_rtCaption;
pTheme->DrawBackground(&param);
DrawCaptionText(pGraphics, pTheme, pMatrix);
}
if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Icon) {
- param.m_iPart = FWL_PART_FRM_Icon;
+ param.m_iPart = CFWL_Part::Icon;
if (HasIcon()) {
DrawIconImage(pGraphics, pTheme, pMatrix);
}
@@ -321,35 +321,35 @@ FWL_ERR CFWL_FormImp::DrawWidget(CFX_Graphics* pGraphics,
#if (_FX_OS_ == _FX_MACOSX_)
{
if (m_pCloseBox) {
- param.m_iPart = FWL_PART_FRM_CloseBox;
+ param.m_iPart = CFWL_Part::CloseBox;
param.m_dwStates = m_pCloseBox->GetPartState();
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) {
- param.m_dwStates = FWL_PARTSTATE_FRM_Disabled;
- } else if (FWL_PARTSTATE_FRM_Normal == param.m_dwStates && m_bMouseIn) {
- param.m_dwStates = FWL_PARTSTATE_FRM_Hover;
+ param.m_dwStates = CFWL_PartState_Disabled;
+ } else if (CFWL_PartState_Normal == param.m_dwStates && m_bMouseIn) {
+ param.m_dwStates = CFWL_PartState_Hovered;
}
param.m_rtPart = m_pCloseBox->m_rtBtn;
pTheme->DrawBackground(&param);
}
if (m_pMaxBox) {
- param.m_iPart = FWL_PART_FRM_MaximizeBox;
+ param.m_iPart = CFWL_Part::MaximizeBox;
param.m_dwStates = m_pMaxBox->GetPartState();
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) {
- param.m_dwStates = FWL_PARTSTATE_FRM_Disabled;
- } else if (FWL_PARTSTATE_FRM_Normal == param.m_dwStates && m_bMouseIn) {
- param.m_dwStates = FWL_PARTSTATE_FRM_Hover;
+ param.m_dwStates = CFWL_PartState_Disabled;
+ } else if (CFWL_PartState_Normal == param.m_dwStates && m_bMouseIn) {
+ param.m_dwStates = CFWL_PartState_Hovered;
}
param.m_rtPart = m_pMaxBox->m_rtBtn;
param.m_dwData = m_bMaximized;
pTheme->DrawBackground(&param);
}
if (m_pMinBox) {
- param.m_iPart = FWL_PART_FRM_MinimizeBox;
+ param.m_iPart = CFWL_Part::MinimizeBox;
param.m_dwStates = m_pMinBox->GetPartState();
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Deactivated) {
- param.m_dwStates = FWL_PARTSTATE_FRM_Disabled;
- } else if (FWL_PARTSTATE_FRM_Normal == param.m_dwStates && m_bMouseIn) {
- param.m_dwStates = FWL_PARTSTATE_FRM_Hover;
+ param.m_dwStates = CFWL_PartState_Disabled;
+ } else if (CFWL_PartState_Normal == param.m_dwStates && m_bMouseIn) {
+ param.m_dwStates = CFWL_PartState_Hovered;
}
param.m_rtPart = m_pMinBox->m_rtBtn;
pTheme->DrawBackground(&param);
@@ -359,20 +359,20 @@ FWL_ERR CFWL_FormImp::DrawWidget(CFX_Graphics* pGraphics,
#else
{
if (m_pCloseBox) {
- param.m_iPart = FWL_PART_FRM_CloseBox;
+ param.m_iPart = CFWL_Part::CloseBox;
param.m_dwStates = m_pCloseBox->GetPartState();
param.m_rtPart = m_pCloseBox->m_rtBtn;
pTheme->DrawBackground(&param);
}
if (m_pMaxBox) {
- param.m_iPart = FWL_PART_FRM_MaximizeBox;
+ param.m_iPart = CFWL_Part::MaximizeBox;
param.m_dwStates = m_pMaxBox->GetPartState();
param.m_rtPart = m_pMaxBox->m_rtBtn;
param.m_dwData = m_bMaximized;
pTheme->DrawBackground(&param);
}
if (m_pMinBox) {
- param.m_iPart = FWL_PART_FRM_MinimizeBox;
+ param.m_iPart = CFWL_Part::MinimizeBox;
param.m_dwStates = m_pMinBox->GetPartState();
param.m_rtPart = m_pMinBox->m_rtBtn;
pTheme->DrawBackground(&param);
@@ -439,7 +439,7 @@ void CFWL_FormImp::DrawBackground(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme) {
CFWL_ThemeBackground param;
param.m_pWidget = m_pInterface;
- param.m_iPart = FWL_PART_FRM_Background;
+ param.m_iPart = CFWL_Part::Background;
param.m_pGraphics = pGraphics;
param.m_rtPart = m_rtRelative;
param.m_rtPart.Deflate(m_fCYBorder, m_rtCaption.height, m_fCYBorder,
@@ -559,13 +559,14 @@ int32_t CFWL_FormImp::GetSysBtnIndex(CFWL_SysBtn* pBtn) {
return arrBtn.Find(pBtn);
}
FX_FLOAT CFWL_FormImp::GetCaptionHeight() {
- uint32_t dwCapacity = 0;
+ CFWL_WidgetCapacity dwCapacity = CFWL_WidgetCapacity::None;
+
if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Caption) {
- dwCapacity = FWL_WGTCAPACITY_FRM_CYCaption;
+ dwCapacity = CFWL_WidgetCapacity::CYCaption;
} else if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_NarrowCaption) {
- dwCapacity = FWL_WGTCAPACITY_FRM_CYNarrowCaption;
+ dwCapacity = CFWL_WidgetCapacity::CYNarrowCaption;
}
- if (dwCapacity > 0) {
+ if (dwCapacity != CFWL_WidgetCapacity::None) {
FX_FLOAT* pfCapHeight =
static_cast<FX_FLOAT*>(GetThemeCapacity(dwCapacity));
return pfCapHeight ? *pfCapHeight : 0;
@@ -583,8 +584,8 @@ void CFWL_FormImp::DrawCaptionText(CFX_Graphics* pGs,
}
CFWL_ThemeText textParam;
textParam.m_pWidget = m_pInterface;
- textParam.m_iPart = FWL_PART_FRM_Caption;
- textParam.m_dwStates = FWL_PARTSTATE_FRM_Normal;
+ textParam.m_iPart = CFWL_Part::Caption;
+ textParam.m_dwStates = CFWL_PartState_Normal;
textParam.m_pGraphics = pGs;
if (pMatrix) {
textParam.m_matrix.Concat(*pMatrix);
@@ -613,7 +614,7 @@ void CFWL_FormImp::DrawIconImage(CFX_Graphics* pGs,
static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider);
CFWL_ThemeBackground param;
param.m_pWidget = m_pInterface;
- param.m_iPart = FWL_PART_FRM_Icon;
+ param.m_iPart = CFWL_Part::Icon;
param.m_pGraphics = pGs;
param.m_pImage = pData->GetIcon(m_pInterface, FALSE);
param.m_rtPart = m_rtIcon;
@@ -648,9 +649,9 @@ void CFWL_FormImp::Layout() {
}
void CFWL_FormImp::ReSetSysBtn() {
m_fCXBorder =
- *static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_CXBorder));
+ *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::CXBorder));
m_fCYBorder =
- *static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_CYBorder));
+ *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::CYBorder));
RemoveSysButtons();
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
m_bCustomizeLayout = pTheme->IsCustomizedLayout(m_pInterface);
@@ -665,7 +666,7 @@ void CFWL_FormImp::ReSetSysBtn() {
if (m_bCustomizeLayout) {
CFWL_ThemeBackground param;
param.m_pWidget = m_pInterface;
- param.m_iPart = FWL_PART_FRM_CloseBox;
+ param.m_iPart = CFWL_Part::CloseBox;
pTheme->GetPartRect(&param, m_pCloseBox->m_rtBtn);
} else {
m_pCloseBox->m_rtBtn.Set(
@@ -679,7 +680,7 @@ void CFWL_FormImp::ReSetSysBtn() {
if (m_bCustomizeLayout) {
CFWL_ThemeBackground param;
param.m_pWidget = m_pInterface;
- param.m_iPart = FWL_PART_FRM_MaximizeBox;
+ param.m_iPart = CFWL_Part::MaximizeBox;
pTheme->GetPartRect(&param, m_pMaxBox->m_rtBtn);
} else {
if (m_pCloseBox) {
@@ -699,7 +700,7 @@ void CFWL_FormImp::ReSetSysBtn() {
if (m_bCustomizeLayout) {
CFWL_ThemeBackground param;
param.m_pWidget = m_pInterface;
- param.m_iPart = FWL_PART_FRM_MinimizeBox;
+ param.m_iPart = CFWL_Part::MinimizeBox;
pTheme->GetPartRect(&param, m_pMinBox->m_rtBtn);
} else {
if (m_pMaxBox) {
@@ -725,7 +726,7 @@ void CFWL_FormImp::ReSetSysBtn() {
if (m_bCustomizeLayout) {
CFWL_ThemeBackground param;
param.m_pWidget = m_pInterface;
- param.m_iPart = FWL_PART_FRM_Icon;
+ param.m_iPart = CFWL_Part::Icon;
CFX_WideString wsText;
m_pProperties->m_pDataProvider->GetCaption(m_pInterface, wsText);
param.m_pData = &wsText;
@@ -738,7 +739,7 @@ void CFWL_FormImp::ReSetSysBtn() {
if (m_bCustomizeLayout) {
CFWL_ThemeText parma;
parma.m_pWidget = m_pInterface;
- parma.m_iPart = FWL_PART_FRM_HeadText;
+ parma.m_iPart = CFWL_Part::HeadText;
m_pProperties->m_pDataProvider->GetCaption(m_pInterface, parma.m_wsText);
pTheme->GetPartRect(&parma, m_rtCaptionText);
}
@@ -768,9 +769,9 @@ FX_BOOL CFWL_FormImp::IsDoModal() {
}
void CFWL_FormImp::SetThemeData() {
m_fSmallIconSz =
- *static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_FRM_SmallIcon));
+ *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::SmallIcon));
m_fBigIconSz =
- *static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_FRM_BigIcon));
+ *static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::BigIcon));
}
FX_BOOL CFWL_FormImp::HasIcon() {
IFWL_FormDP* pData =
diff --git a/xfa/fwl/core/fwl_formimp.h b/xfa/fwl/core/fwl_formimp.h
index 66e96b33b8..dccdf7f2af 100644
--- a/xfa/fwl/core/fwl_formimp.h
+++ b/xfa/fwl/core/fwl_formimp.h
@@ -48,7 +48,7 @@ class CFWL_SysBtn {
: m_dwState &= ~FWL_SYSBUTTONSTATE_Disabled;
}
int32_t GetPartState() {
- return (IsDisabled() ? FWL_PARTSTATE_FRM_Disabled : (m_dwState + 1));
+ return (IsDisabled() ? CFWL_PartState_Disabled : (m_dwState + 1));
}
CFX_RectF m_rtBtn;
diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp
index ad75483fe4..b11530eab5 100644
--- a/xfa/fwl/core/fwl_widgetimp.cpp
+++ b/xfa/fwl/core/fwl_widgetimp.cpp
@@ -575,28 +575,28 @@ void CFWL_WidgetImp::GetEdgeRect(CFX_RectF& rtEdge) {
}
FX_FLOAT CFWL_WidgetImp::GetBorderSize(FX_BOOL bCX) {
FX_FLOAT* pfBorder = static_cast<FX_FLOAT*>(GetThemeCapacity(
- bCX ? FWL_WGTCAPACITY_CXBorder : FWL_WGTCAPACITY_CYBorder));
+ bCX ? CFWL_WidgetCapacity::CXBorder : CFWL_WidgetCapacity::CYBorder));
if (!pfBorder)
return 0;
return *pfBorder;
}
FX_FLOAT CFWL_WidgetImp::GetEdgeWidth() {
- uint32_t dwCapacity = 0;
+ CFWL_WidgetCapacity dwCapacity = CFWL_WidgetCapacity::None;
switch (m_pProperties->m_dwStyles & FWL_WGTSTYLE_EdgeMask) {
case FWL_WGTSTYLE_EdgeFlat: {
- dwCapacity = FWL_WGTCAPACITY_EdgeFlat;
+ dwCapacity = CFWL_WidgetCapacity::EdgeFlat;
break;
}
case FWL_WGTSTYLE_EdgeRaised: {
- dwCapacity = FWL_WGTCAPACITY_EdgeRaised;
+ dwCapacity = CFWL_WidgetCapacity::EdgeRaised;
break;
}
case FWL_WGTSTYLE_EdgeSunken: {
- dwCapacity = FWL_WGTCAPACITY_EdgeSunken;
+ dwCapacity = CFWL_WidgetCapacity::EdgeSunken;
break;
}
}
- if (dwCapacity > 0) {
+ if (dwCapacity != CFWL_WidgetCapacity::None) {
FX_FLOAT* fRet = static_cast<FX_FLOAT*>(GetThemeCapacity(dwCapacity));
return fRet ? *fRet : 0;
}
@@ -606,7 +606,7 @@ void CFWL_WidgetImp::GetRelativeRect(CFX_RectF& rect) {
rect = m_pProperties->m_rtWidget;
rect.left = rect.top = 0;
}
-void* CFWL_WidgetImp::GetThemeCapacity(uint32_t dwCapacity) {
+void* CFWL_WidgetImp::GetThemeCapacity(CFWL_WidgetCapacity dwCapacity) {
IFWL_ThemeProvider* pTheme = GetAvailableTheme();
if (!pTheme)
return NULL;
@@ -866,7 +866,7 @@ void CFWL_WidgetImp::Repaint(const CFX_RectF* pRect) {
m_pWidgetMgr->RepaintWidget(m_pInterface, &rect);
}
void CFWL_WidgetImp::DrawBackground(CFX_Graphics* pGraphics,
- int32_t iPartBk,
+ CFWL_Part iPartBk,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix) {
CFX_RectF rtRelative;
@@ -882,7 +882,7 @@ void CFWL_WidgetImp::DrawBackground(CFX_Graphics* pGraphics,
pTheme->DrawBackground(&param);
}
void CFWL_WidgetImp::DrawBorder(CFX_Graphics* pGraphics,
- int32_t iPartBorder,
+ CFWL_Part iPartBorder,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix) {
CFX_RectF rtRelative;
@@ -898,7 +898,7 @@ void CFWL_WidgetImp::DrawBorder(CFX_Graphics* pGraphics,
pTheme->DrawBackground(&param);
}
void CFWL_WidgetImp::DrawEdge(CFX_Graphics* pGraphics,
- int32_t iPartEdge,
+ CFWL_Part iPartEdge,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix) {
CFX_RectF rtEdge;
diff --git a/xfa/fwl/core/fwl_widgetimp.h b/xfa/fwl/core/fwl_widgetimp.h
index bd9be7edc5..2e5e761512 100644
--- a/xfa/fwl/core/fwl_widgetimp.h
+++ b/xfa/fwl/core/fwl_widgetimp.h
@@ -10,8 +10,10 @@
#include "core/fxcrt/include/fx_coordinates.h"
#include "core/fxcrt/include/fx_system.h"
#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/cfwl_themepart.h"
#include "xfa/fwl/core/fwl_targetimp.h"
#include "xfa/fwl/core/ifwl_widgetdelegate.h"
+#include "xfa/fwl/theme/cfwl_widgettp.h"
class CFWL_MsgKey;
class CFWL_ThreadImp;
@@ -86,7 +88,7 @@ class CFWL_WidgetImp : public CFWL_TargetImp {
FX_FLOAT GetBorderSize(FX_BOOL bCX = TRUE);
FX_FLOAT GetEdgeWidth();
void GetRelativeRect(CFX_RectF& rect);
- void* GetThemeCapacity(uint32_t dwCapacity);
+ void* GetThemeCapacity(CFWL_WidgetCapacity dwCapacity);
IFWL_ThemeProvider* GetAvailableTheme();
CFWL_WidgetImp* GetRootOuter();
CFX_SizeF CalcTextSize(const CFX_WideString& wsText,
@@ -124,15 +126,15 @@ class CFWL_WidgetImp : public CFWL_TargetImp {
void DispatchEvent(CFWL_Event* pEvent);
void Repaint(const CFX_RectF* pRect = NULL);
void DrawBackground(CFX_Graphics* pGraphics,
- int32_t iPartBk,
+ CFWL_Part iPartBk,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix = NULL);
void DrawBorder(CFX_Graphics* pGraphics,
- int32_t iPartBorder,
+ CFWL_Part iPartBorder,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix = NULL);
void DrawEdge(CFX_Graphics* pGraphics,
- int32_t iPartEdge,
+ CFWL_Part iPartEdge,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix = NULL);
void NotifyDriver();
diff --git a/xfa/fwl/core/ifwl_form.h b/xfa/fwl/core/ifwl_form.h
index 95cae64fa2..185e059826 100644
--- a/xfa/fwl/core/ifwl_form.h
+++ b/xfa/fwl/core/ifwl_form.h
@@ -28,26 +28,6 @@
#define FWL_UseMacSystemBorder
#endif
-#define FWL_WGTCAPACITY_FRM_CYCaption (FWL_WGTCAPACITY_MAX + 1)
-#define FWL_WGTCAPACITY_FRM_CYNarrowCaption (FWL_WGTCAPACITY_MAX + 2)
-#define FWL_WGTCAPACITY_FRM_BigIcon (FWL_WGTCAPACITY_MAX + 3)
-#define FWL_WGTCAPACITY_FRM_SmallIcon (FWL_WGTCAPACITY_MAX + 4)
-#define FWL_PART_FRM_Border 1
-#define FWL_PART_FRM_Edge 2
-#define FWL_PART_FRM_Background 3
-#define FWL_PART_FRM_Caption 4
-#define FWL_PART_FRM_NarrowCaption 5
-#define FWL_PART_FRM_CloseBox 6
-#define FWL_PART_FRM_MinimizeBox 7
-#define FWL_PART_FRM_MaximizeBox 8
-#define FWL_PART_FRM_HeadText 9
-#define FWL_PART_FRM_Icon 10
-#define FWL_PARTSTATE_FRM_Normal 1
-#define FWL_PARTSTATE_FRM_Hover 2
-#define FWL_PARTSTATE_FRM_Pressed 3
-#define FWL_PARTSTATE_FRM_Inactive 4
-#define FWL_PARTSTATE_FRM_Disabled 5
-
enum FWL_FORMSIZE {
FWL_FORMSIZE_Manual = 0,
FWL_FORMSIZE_Width,
diff --git a/xfa/fwl/core/ifwl_themeprovider.h b/xfa/fwl/core/ifwl_themeprovider.h
index f0fb1492a8..c790da5f4e 100644
--- a/xfa/fwl/core/ifwl_themeprovider.h
+++ b/xfa/fwl/core/ifwl_themeprovider.h
@@ -10,21 +10,7 @@
#include "core/fxcrt/include/fx_coordinates.h"
#include "core/fxcrt/include/fx_system.h"
#include "xfa/fwl/core/fwl_error.h"
-
-#define FWL_WGTCAPACITY_CXBorder 1
-#define FWL_WGTCAPACITY_CYBorder 2
-#define FWL_WGTCAPACITY_ScrollBarWidth 3
-#define FWL_WGTCAPACITY_EdgeFlat 4
-#define FWL_WGTCAPACITY_EdgeRaised 5
-#define FWL_WGTCAPACITY_EdgeSunken 6
-#define FWL_WGTCAPACITY_Font 7
-#define FWL_WGTCAPACITY_FontSize 8
-#define FWL_WGTCAPACITY_TextColor 9
-#define FWL_WGTCAPACITY_TextSelColor 10
-#define FWL_WGTCAPACITY_LineHeight 11
-#define FWL_WGTCAPACITY_UIMargin 12
-#define FWL_WGTCAPACITY_SpaceAboveBelow 13
-#define FWL_WGTCAPACITY_MAX 65535
+#include "xfa/fwl/theme/cfwl_widgettp.h"
class CFWL_ThemeBackground;
class CFWL_ThemePart;
@@ -45,7 +31,7 @@ class IFWL_ThemeProvider {
virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) = 0;
virtual FX_BOOL DrawText(CFWL_ThemeText* pParams) = 0;
virtual void* GetCapacity(CFWL_ThemePart* pThemePart,
- uint32_t dwCapacity) = 0;
+ CFWL_WidgetCapacity dwCapacity) = 0;
virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) = 0;
virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart,
CFX_RectF& rtPart) = 0;