diff options
Diffstat (limited to 'xfa/fwl/theme')
-rw-r--r-- | xfa/fwl/theme/cfwl_formtp.cpp | 874 | ||||
-rw-r--r-- | xfa/fwl/theme/cfwl_formtp.h | 113 |
2 files changed, 0 insertions, 987 deletions
diff --git a/xfa/fwl/theme/cfwl_formtp.cpp b/xfa/fwl/theme/cfwl_formtp.cpp deleted file mode 100644 index 033375911b..0000000000 --- a/xfa/fwl/theme/cfwl_formtp.cpp +++ /dev/null @@ -1,874 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "xfa/fwl/theme/cfwl_formtp.h" - -#include "xfa/fde/tto/fde_textout.h" -#include "xfa/fwl/core/cfwl_themebackground.h" -#include "xfa/fwl/core/cfwl_themepart.h" -#include "xfa/fwl/core/cfwl_themetext.h" -#include "xfa/fwl/core/ifwl_form.h" -#include "xfa/fwl/core/ifwl_themeprovider.h" -#include "xfa/fwl/core/ifwl_widget.h" -#include "xfa/fxgraphics/cfx_color.h" -#include "xfa/fxgraphics/cfx_path.h" - -namespace { - -const int kCXFormBorder = 3; -const int kCYFormBorder = 3; -const int kCYCaption = 29; -const int kFormBigIconSize = 32; -const int kFormSmallIconSize = 16; -const uint32_t kFormTextColor = 0xFFFFFFFF; - -const int kButtonSize = 21; -const int kButtonMargin = 5; -const int kButtonSpan = 2; - -} // namespace - -CFWL_FormTP::CFWL_FormTP() : m_pActiveBitmap(NULL), m_pDeactivebitmap(NULL) { - m_pThemeData = new SBThemeData; - SetThemeData(0); - m_rtDisLBorder.Reset(); - m_rtDisRBorder.Reset(); - m_rtDisBBorder.Reset(); - m_rtDisCaption.Reset(); -} - -CFWL_FormTP::~CFWL_FormTP() { - delete m_pThemeData; -} - -FWL_Error CFWL_FormTP::Initialize() { - InitTTO(); - InitCaption(TRUE); - InitCaption(FALSE); - return CFWL_WidgetTP::Initialize(); -} - -FWL_Error CFWL_FormTP::Finalize() { - FinalizeTTO(); - delete m_pActiveBitmap; - m_pActiveBitmap = nullptr; - delete m_pDeactivebitmap; - m_pDeactivebitmap = nullptr; - return CFWL_WidgetTP::Finalize(); -} - -bool CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) { - return pWidget && pWidget->GetClassID() == FWL_Type::Form; -} - -uint32_t CFWL_FormTP::SetThemeID(IFWL_Widget* pWidget, - uint32_t dwThemeID, - FX_BOOL bChildren) { - if (m_pThemeData) { - SetThemeData(FWL_GetThemeColor(dwThemeID)); - } - InitCaption(TRUE); - InitCaption(FALSE); - return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); -} -FX_BOOL CFWL_FormTP::DrawBackground(CFWL_ThemeBackground* pParams) { - if (!pParams) - return FALSE; - int32_t iActive = 0; - if (pParams->m_dwStates & CFWL_PartState_Inactive) - iActive = 1; - - FWLTHEME_STATE eState = FWLTHEME_STATE_Normal; - if (pParams->m_dwStates & CFWL_PartState_Hovered) - eState = FWLTHEME_STATE_Hover; - else if (pParams->m_dwStates & CFWL_PartState_Pressed) - eState = FWLTHEME_STATE_Pressed; - else if (pParams->m_dwStates & CFWL_PartState_Disabled) - eState = FWLTHEME_STATE_Disabale; - - switch (pParams->m_iPart) { - case CFWL_Part::Border: { - DrawFormBorder(pParams->m_pGraphics, &pParams->m_rtPart, eState, - &pParams->m_matrix, iActive); - break; - } - case CFWL_Part::Edge: { - DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), - &pParams->m_rtPart, &pParams->m_matrix); - break; - } - case CFWL_Part::Background: { - FillBackground(pParams->m_pGraphics, &pParams->m_rtPart, - &pParams->m_matrix); - break; - } - case CFWL_Part::Caption: { - DrawCaption(pParams->m_pGraphics, &pParams->m_rtPart, eState, - &pParams->m_matrix, iActive); - break; - } - case CFWL_Part::NarrowCaption: { - DrawNarrowCaption(pParams->m_pGraphics, &pParams->m_rtPart, eState, - &pParams->m_matrix, iActive); - break; - } - case CFWL_Part::CloseBox: { - DrawCloseBox(pParams->m_pGraphics, &pParams->m_rtPart, eState, - &pParams->m_matrix, iActive); - break; - } - case CFWL_Part::MinimizeBox: { - DrawMinimizeBox(pParams->m_pGraphics, &pParams->m_rtPart, eState, - &pParams->m_matrix, iActive); - break; - } - case CFWL_Part::MaximizeBox: { - DrawMaximizeBox(pParams->m_pGraphics, &pParams->m_rtPart, eState, - pParams->m_bMaximize, &pParams->m_matrix, iActive); - break; - } - case CFWL_Part::Icon: { - DrawIconImage(pParams->m_pGraphics, pParams->m_pImage, &pParams->m_rtPart, - eState, &pParams->m_matrix, iActive); - break; - } - default: {} - } - return TRUE; -} -FX_BOOL CFWL_FormTP::DrawText(CFWL_ThemeText* pParams) { - if (!m_pTextOut) - return FALSE; - if (pParams->m_iPart == CFWL_Part::Caption) { - m_pTextOut->SetTextColor(0xFFFFFFFF); - } else { - m_pTextOut->SetTextColor(0xFF000000); - } - return CFWL_WidgetTP::DrawText(pParams); -} -void* CFWL_FormTP::GetCapacity(CFWL_ThemePart* pThemePart, - CFWL_WidgetCapacity dwCapacity) { - FX_BOOL bDefPro = FALSE; - FX_BOOL bDwordVal = FALSE; - switch (dwCapacity) { - case CFWL_WidgetCapacity::CXBorder: { - m_fValue = kCXFormBorder; - break; - } - case CFWL_WidgetCapacity::CYBorder: { - m_fValue = kCYFormBorder; - break; - } - case CFWL_WidgetCapacity::CYCaption: { - m_fValue = kCYCaption; - break; - } - case CFWL_WidgetCapacity::CYNarrowCaption: { - m_fValue = kCYCaption; - break; - } - case CFWL_WidgetCapacity::TextColor: { - bDwordVal = TRUE; - m_dwValue = kFormTextColor; - break; - } - case CFWL_WidgetCapacity::BigIcon: { - m_fValue = kFormBigIconSize; - break; - } - case CFWL_WidgetCapacity::SmallIcon: { - m_fValue = kFormSmallIconSize; - break; - } - default: { bDefPro = TRUE; } - } - if (!bDefPro) { - if (bDwordVal) { - return &m_dwValue; - } - return &m_fValue; - } - return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity); -} -FWL_Error CFWL_FormTP::GetPartRect(CFWL_ThemePart* pThemePart, - CFX_RectF& rtPart) { - switch (pThemePart->m_iPart) { - case CFWL_Part::CloseBox: { - CalCloseBox(pThemePart->m_pWidget, rtPart); - break; - } - case CFWL_Part::MaximizeBox: { - CalMaxBox(pThemePart->m_pWidget, rtPart); - break; - } - case CFWL_Part::MinimizeBox: { - CalMinBox(pThemePart->m_pWidget, rtPart); - break; - } - case CFWL_Part::HeadText: { - CalCaption(pThemePart->m_pWidget, rtPart); - break; - } - case CFWL_Part::Icon: { - CalIcon(pThemePart->m_pWidget, rtPart); - break; - } - default: {} - } - return FWL_Error::Succeeded; -} -void CFWL_FormTP::CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect) { - uint32_t dwStyles = pWidget->GetStyles(); - CFX_RectF rtWidget; - pWidget->GetWidgetRect(rtWidget); - rtWidget.Offset(-rtWidget.left, -rtWidget.top); - if (dwStyles & FWL_WGTSTYLE_CloseBox) { - rect.Set(rtWidget.left + kButtonMargin + kButtonSpan, - rtWidget.top + kButtonMargin, kButtonSize, kButtonSize); - } else { - rect.Set(rtWidget.left + kButtonMargin + kButtonSpan, - rtWidget.top + kButtonMargin, 0, 0); - } -} -void CFWL_FormTP::CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect) { - uint32_t dwStyles = pWidget->GetStyles(); - CFX_RectF rtWidget; - pWidget->GetWidgetRect(rtWidget); - rtWidget.Offset(-rtWidget.left, -rtWidget.top); - if (dwStyles & FWL_WGTSTYLE_MaximizeBox) { - rect.Set(rtWidget.left + kButtonMargin + kButtonSize + kButtonSpan * 2, - rtWidget.top + kButtonMargin, kButtonSize, kButtonSize); - } else { - rect.Set(rtWidget.left + kButtonMargin + kButtonSize + kButtonSpan * 2, - rtWidget.top + kButtonMargin, 0, 0); - } -} -void CFWL_FormTP::CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect) { - uint32_t dwStyles = pWidget->GetStyles(); - CFX_RectF rtWidget; - pWidget->GetWidgetRect(rtWidget); - rtWidget.Offset(-rtWidget.left, -rtWidget.top); - if (dwStyles & FWL_WGTSTYLE_MinimizeBox) { - rect.Set(rtWidget.left + kButtonMargin + kButtonSize * 2 + kButtonSpan * 3, - rtWidget.top + kButtonMargin, kButtonSize, kButtonSize); - } else { - rect.Set(rtWidget.left + kButtonMargin + kButtonSize * 2 + kButtonSpan * 3, - rtWidget.top + kButtonMargin, 0, 0); - } -} -void CFWL_FormTP::CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect) { - CFX_RectF rtWidget; - pWidget->GetWidgetRect(rtWidget); - rtWidget.Offset(-rtWidget.left, -rtWidget.top); - rect.Set(rtWidget.left + kButtonMargin, rtWidget.top + kButtonMargin - 2, - rtWidget.width - kButtonMargin * 2, - kButtonSize + 2 * kButtonMargin + 4); -} -void CFWL_FormTP::CalIcon(IFWL_Widget* pWidget, CFX_RectF& rect) {} -void CFWL_FormTP::DrawFormBorder(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive) { - CFX_RectF rt; - rt.Set(pRect->left, pRect->top, 1, pRect->height); - FX_FLOAT fBottom, fRight; - fBottom = pRect->bottom(); - fRight = pRect->right(); - CFX_Path path; - path.Create(); - CFX_Color clrLine; - path.Clear(); - path.MoveTo(pRect->left, pRect->top); - path.LineTo(pRect->left, fBottom - 1); - path.LineTo(fRight - 1, fBottom - 1); - path.LineTo(fRight - 1, pRect->top); - clrLine = m_pThemeData->clrFormBorder[iActive][2]; - pGraphics->SetStrokeColor(&clrLine); - pGraphics->StrokePath(&path, pMatrix); - path.Clear(); - path.MoveTo(pRect->left + 1, pRect->top); - path.LineTo(pRect->left + 1, fBottom - 2); - path.LineTo(fRight - 2, fBottom - 2); - path.LineTo(fRight - 2, pRect->top); - clrLine = m_pThemeData->clrFormBorder[iActive][1]; - pGraphics->SetStrokeColor(&clrLine); - pGraphics->StrokePath(&path, pMatrix); - path.Clear(); - path.MoveTo(pRect->left + 2, pRect->top); - path.LineTo(pRect->left + 2, fBottom - 3); - path.LineTo(fRight - 3, fBottom - 3); - path.LineTo(fRight - 3, pRect->top); - clrLine = m_pThemeData->clrFormBorder[iActive][0]; - pGraphics->SetStrokeColor(&clrLine); - pGraphics->StrokePath(&path, pMatrix); - path.Clear(); - path.MoveTo(pRect->left + 3, pRect->top); - path.LineTo(pRect->left + 3, fBottom - 4); - path.LineTo(fRight - 4, fBottom - 4); - path.LineTo(fRight - 4, pRect->top); - clrLine = m_pThemeData->clrFormBorder[iActive][4]; - pGraphics->SetStrokeColor(&clrLine); - pGraphics->StrokePath(&path, pMatrix); - m_rtDisLBorder.Set(pRect->left, pRect->top + 29, 4, pRect->height - 29); - m_rtDisRBorder.Set(pRect->right() - 4, pRect->top + 29, 4, - pRect->height - 29); - m_rtDisBBorder.Set(pRect->left, pRect->bottom() - 4, pRect->width, 4); - m_rtDisCaption.Set(pRect->left, pRect->top, pRect->width, 29); -} -void CFWL_FormTP::DrawCaption(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive) { - CFX_RectF rt; - FX_FLOAT fBottom, fRight; - fBottom = pRect->bottom(); - fRight = pRect->right(); - rt.Set(pRect->left, pRect->top, pRect->width, 1); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][0], &rt, - pMatrix); - rt.Offset(0, 1); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][1], &rt, - pMatrix); - rt.Offset(0, 1); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][2], &rt, - pMatrix); - rt.Set(pRect->left, pRect->bottom() - 1, pRect->width, 1); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeBottom[iActive][2], &rt, - pMatrix); - rt.Offset(0, -1); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeBottom[iActive][1], &rt, - pMatrix); - rt.Set(pRect->left, pRect->top, 1, pRect->height); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][2], &rt, - pMatrix); - rt.Set(pRect->left + 1, pRect->top + 1, 1, fBottom - 1); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][1], &rt, - pMatrix); - rt.Set(pRect->left + 2, pRect->top + 2, 1, fBottom - 2); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][0], &rt, - pMatrix); - rt.Set(fRight - 1, pRect->top, pRect->width, pRect->height); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][2], &rt, - pMatrix); - rt.Set(fRight - 2, pRect->top + 1, 1, fBottom - 1); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][1], &rt, - pMatrix); - rt.Set(fRight - 3, pRect->top + 2, 1, fBottom - 2); - FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][0], &rt, - pMatrix); - CFX_RectF rect(*pRect); - rect.Set(rect.left + 3, rect.top + 3, rect.width - 6, rect.height - 5); - if (iActive == 0) { - pGraphics->StretchImage(m_pActiveBitmap, rect, pMatrix); - } else { - pGraphics->StretchImage(m_pDeactivebitmap, rect, pMatrix); - } -} -void CFWL_FormTP::DrawNarrowCaption(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive) {} -void CFWL_FormTP::DrawCloseBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive) { - FX_FLOAT fRight = pRect->right(); - FX_FLOAT fBottom = pRect->bottom(); - FX_FLOAT fWidth = pRect->width; - FX_FLOAT fHeight = pRect->height; - pGraphics->SaveGraphState(); - CFX_RectF rt(*pRect); - pGraphics->SetLineWidth(1.0f); - CFX_Path path; - path.Create(); - path.AddRectangle(rt.left + 1, rt.top, fWidth - 2, 1); - path.AddRectangle(rt.left, rt.top + 1, 1, fHeight - 2); - path.AddRectangle(fRight - 1, rt.top + 1, 1, fHeight - 2); - path.AddRectangle(rt.left + 1, fBottom - 1, fWidth - 2, 1); - CFX_Color crFill; - crFill = m_pThemeData->clrBtnEdgeOut[iActive]; - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); - path.Clear(); - path.AddRectangle(rt.left + 1, rt.top + 1, 1, 1); - path.AddRectangle(fRight - 2, rt.top + 1, 1, 1); - path.AddRectangle(rt.left + 1, fBottom - 2, 1, 1); - path.AddRectangle(fRight - 2, fBottom - 2, 1, 1); - crFill = m_pThemeData->clrBtnCornerLight[iActive][eState - 1]; - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); - path.Clear(); - path.AddRectangle(rt.left + 2, rt.top + 1, fWidth - 4, 1); - path.AddRectangle(rt.left + 1, rt.top + 2, 1, fHeight - 4); - crFill = m_pThemeData->clrCloseBtEdgeLight[iActive][eState - 1]; - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); - path.Clear(); - path.AddRectangle(fRight - 2, rt.top + 2, 1, fHeight - 4); - path.AddRectangle(rt.left + 2, fBottom - 2, fWidth - 4, 1); - crFill = m_pThemeData->clrCloseBtEdgeDark[iActive][eState - 1]; - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); - path.Clear(); - path.AddRectangle(pRect->left + 2, pRect->top + 2, fWidth - 4, fHeight - 4); - DrawAxialShading(pGraphics, pRect->left + 2, pRect->top + 2, fRight - 2, - fBottom - 2, - m_pThemeData->clrCloseBtBKStart[iActive][eState - 1], - m_pThemeData->clrCloseBtBKEnd[iActive][eState - 1], &path, - FXFILL_WINDING, pMatrix); - CFX_RectF rtX(*pRect); - rtX.Inflate(-5, -5); - path.Clear(); - FX_FLOAT frtXRight = rtX.right(); - FX_FLOAT frtXBottom = rtX.bottom(); - path.AddLine(rtX.left, rtX.top + 1, frtXRight - 1, frtXBottom); - path.AddLine(rtX.left, rtX.top, frtXRight, frtXBottom); - path.AddLine(rtX.left + 1, rtX.top, frtXRight, frtXBottom - 1); - path.AddLine(rtX.left, frtXBottom - 1, frtXRight - 1, rtX.top); - path.AddLine(rtX.left, frtXBottom, frtXRight, rtX.top); - path.AddLine(rtX.left + 1, frtXBottom, frtXRight, rtX.top + 1); - CFX_Color clrLine(0xffffffff); - pGraphics->SetLineWidth(1.0f); - pGraphics->SetStrokeColor(&clrLine); - pGraphics->StrokePath(&path, pMatrix); - pGraphics->RestoreGraphState(); -} -void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive) { - pGraphics->SaveGraphState(); - FX_FLOAT fRight = pRect->right(); - FX_FLOAT fBottom = pRect->bottom(); - FX_FLOAT fWidth = pRect->width; - FX_FLOAT fHeight = pRect->height; - CFX_RectF rt(*pRect); - pGraphics->SetLineWidth(1.0f); - CFX_Path path; - path.Create(); - path.AddRectangle(rt.left + 1, rt.top, fWidth - 2, 1); - path.AddRectangle(rt.left, rt.top + 1, 1, fHeight - 2); - path.AddRectangle(fRight - 1, rt.top + 1, 1, fHeight - 2); - path.AddRectangle(rt.left + 1, fBottom - 1, fWidth - 2, 1); - CFX_Color crFill; - crFill = m_pThemeData->clrBtnEdgeOut[iActive]; - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); - path.Clear(); - path.AddRectangle(rt.left + 1, rt.top + 1, 1, 1); - path.AddRectangle(fRight - 2, rt.top + 1, 1, 1); - path.AddRectangle(rt.left + 1, fBottom - 2, 1, 1); - path.AddRectangle(fRight - 2, fBottom - 2, 1, 1); - crFill = m_pThemeData->clrBtnCornerLight[iActive][eState - 1]; - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); - path.Clear(); - path.AddRectangle(rt.left + 2, rt.top + 1, fWidth - 4, 1); - path.AddRectangle(rt.left + 1, rt.top + 2, 1, fHeight - 4); - crFill = m_pThemeData->clrNormalBtEdgeLight[iActive][eState - 1]; - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); - path.Clear(); - path.AddRectangle(fRight - 2, rt.top + 2, 1, fHeight - 4); - path.AddRectangle(rt.left + 2, fBottom - 2, fWidth - 4, 1); - crFill = m_pThemeData->clrNormalBtEdgeDark[iActive][eState - 1]; - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); - pGraphics->RestoreGraphState(); - path.Clear(); - path.AddRectangle(pRect->left + 2, pRect->top + 2, fWidth - 4, fHeight - 4); - DrawAxialShading(pGraphics, pRect->left + 2, pRect->top + 2, fRight - 2, - fBottom - 2, - m_pThemeData->clrNormalBtBKStart[iActive][eState - 1], - m_pThemeData->clrNormalBtBKEnd[iActive][eState - 1], &path, - FXFILL_WINDING, pMatrix); -} -void CFWL_FormTP::DrawMinimizeBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive) { - DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix); - CFX_RectF rtMin; - rtMin.Set(pRect->left + 5, pRect->top + 13, pRect->width - 14, - pRect->height - 18); - FillSoildRect(pGraphics, 0xFFFFFFFF, &rtMin, pMatrix); -} -void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - bool bMax, - CFX_Matrix* pMatrix, - int32_t iActive) { - DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix); - FX_FLOAT fWidth = pRect->width; - FX_FLOAT fHeight = pRect->height; - if (bMax) { - CFX_Path path; - path.Create(); - path.AddLine(pRect->left + 7, pRect->top + 6, pRect->left + 14, - pRect->top + 6); - path.AddLine(pRect->left + 4, pRect->top + 9, pRect->left + 11, - pRect->top + 9); - pGraphics->SaveGraphState(); - pGraphics->SetLineWidth(2); - CFX_Color crStroke(0xFFFFFFFF); - pGraphics->SetStrokeColor(&crStroke); - pGraphics->StrokePath(&path, pMatrix); - pGraphics->SetLineWidth(1); - path.Clear(); - path.AddLine(pRect->left + 4, pRect->top + 10, pRect->left + 4, - pRect->top + 14); - path.AddLine(pRect->left + 10, pRect->top + 10, pRect->left + 10, - pRect->top + 14); - path.AddLine(pRect->left + 13, pRect->top + 7, pRect->left + 13, - pRect->top + 11); - path.AddLine(pRect->left + 4, pRect->top + 14, pRect->left + 10, - pRect->top + 14); - path.AddLine(pRect->left + 12, pRect->top + 11, pRect->left + 12, - pRect->top + 11); - pGraphics->StrokePath(&path, pMatrix); - pGraphics->RestoreGraphState(); - } else { - CFX_RectF rtMax(*pRect); - rtMax.Inflate(-5, -5); - CFX_Path path; - path.Create(); - path.AddRectangle(pRect->left + 5, pRect->top + 5, fWidth - 10, - fHeight - 10); - path.AddRectangle(pRect->left + 6, pRect->top + 8, fWidth - 12, - fHeight - 14); - pGraphics->SaveGraphState(); - CFX_Color crFill(0xFFFFFFFF); - pGraphics->SetFillColor(&crFill); - pGraphics->FillPath(&path, FXFILL_ALTERNATE, pMatrix); - pGraphics->RestoreGraphState(); - } -} -void CFWL_FormTP::DrawIconImage(CFX_Graphics* pGraphics, - CFX_DIBitmap* pDIBitmap, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive) { - pGraphics->StretchImage(pDIBitmap, *pRect, pMatrix); -} -void CFWL_FormTP::SetThemeData(uint32_t dwID) { - m_pThemeData->clrTransWhite = ArgbEncode(0x65, 255, 255, 255); - m_pThemeData->clrCloseBtBKStart[0][0] = ArgbEncode(0xff, 240, 166, 148); - m_pThemeData->clrCloseBtBKEnd[0][0] = ArgbEncode(0xff, 228, 61, 5); - m_pThemeData->clrCloseBtBKStart[0][1] = ArgbEncode(0xff, 255, 184, 176); - m_pThemeData->clrCloseBtBKEnd[0][1] = ArgbEncode(0xff, 252, 107, 71); - m_pThemeData->clrCloseBtBKStart[0][2] = ArgbEncode(0xff, 141, 44, 20); - m_pThemeData->clrCloseBtBKEnd[0][2] = ArgbEncode(0xff, 202, 72, 33); - m_pThemeData->clrCloseBtEdgeLight[0][0] = ArgbEncode(0xff, 255, 122, 107); - m_pThemeData->clrCloseBtEdgeDark[0][0] = ArgbEncode(0xff, 218, 77, 54); - m_pThemeData->clrCloseBtEdgeLight[0][1] = ArgbEncode(0xff, 255, 93, 74); - m_pThemeData->clrCloseBtEdgeDark[0][1] = ArgbEncode(0xff, 218, 74, 51); - m_pThemeData->clrCloseBtEdgeLight[0][2] = ArgbEncode(0xff, 191, 61, 28); - m_pThemeData->clrCloseBtEdgeDark[0][2] = ArgbEncode(0xff, 93, 30, 13); - if (dwID) { - m_pThemeData->clrHeadBK[0][0] = ArgbEncode(0xff, 194, 205, 149); - m_pThemeData->clrHeadBK[0][1] = ArgbEncode(0xff, 170, 184, 131); - m_pThemeData->clrHeadBK[0][2] = ArgbEncode(0xff, 168, 182, 128); - m_pThemeData->clrHeadBK[0][3] = ArgbEncode(0xff, 194, 205, 149); - m_pThemeData->clrHeadEdgeLeft[0][0] = ArgbEncode(0xff, 117, 141, 94); - m_pThemeData->clrHeadEdgeLeft[0][1] = ArgbEncode(0xff, 139, 161, 105); - m_pThemeData->clrHeadEdgeLeft[0][2] = ArgbEncode(0xff, 171, 189, 133); - m_pThemeData->clrHeadEdgeRight[0][0] = ArgbEncode(0xff, 155, 175, 125); - m_pThemeData->clrHeadEdgeRight[0][1] = ArgbEncode(0xff, 128, 146, 103); - m_pThemeData->clrHeadEdgeRight[0][2] = ArgbEncode(0xff, 94, 118, 79); - m_pThemeData->clrHeadEdgeTop[0][0] = ArgbEncode(0xff, 139, 161, 105); - m_pThemeData->clrHeadEdgeTop[0][1] = ArgbEncode(0xff, 234, 245, 201); - m_pThemeData->clrHeadEdgeTop[0][2] = ArgbEncode(0xff, 194, 205, 149); - m_pThemeData->clrHeadEdgeBottom[0][0] = ArgbEncode(0xff, 175, 189, 133); - m_pThemeData->clrHeadEdgeBottom[0][1] = ArgbEncode(0xff, 153, 168, 121); - m_pThemeData->clrHeadEdgeBottom[0][2] = ArgbEncode(0xff, 150, 168, 103); - m_pThemeData->clrNormalBtBKStart[0][0] = ArgbEncode(0xff, 182, 195, 162); - m_pThemeData->clrNormalBtBKEnd[0][0] = ArgbEncode(0xff, 128, 144, 84); - m_pThemeData->clrNormalBtBKStart[0][1] = ArgbEncode(0xff, 234, 241, 208); - m_pThemeData->clrNormalBtBKEnd[0][1] = ArgbEncode(0xff, 169, 186, 112); - m_pThemeData->clrNormalBtBKStart[0][2] = ArgbEncode(0xff, 199, 199, 190); - m_pThemeData->clrNormalBtBKEnd[0][2] = ArgbEncode(0xff, 133, 148, 88); - m_pThemeData->clrNormalBtEdgeLight[0][0] = ArgbEncode(0xff, 163, 176, 137); - m_pThemeData->clrNormalBtEdgeDark[0][0] = ArgbEncode(0xff, 118, 135, 83); - m_pThemeData->clrNormalBtEdgeLight[0][1] = ArgbEncode(0xff, 154, 174, 105); - m_pThemeData->clrNormalBtEdgeDark[0][1] = ArgbEncode(0xff, 154, 174, 105); - m_pThemeData->clrNormalBtEdgeLight[0][2] = ArgbEncode(0xff, 172, 193, 123); - m_pThemeData->clrNormalBtEdgeDark[0][2] = ArgbEncode(0xff, 154, 174, 105); - m_pThemeData->clrBtnCornerLight[0][0] = ArgbEncode(0xff, 220, 220, 220); - m_pThemeData->clrBtnCornerLight[0][1] = ArgbEncode(0xff, 255, 255, 255); - m_pThemeData->clrBtnCornerLight[0][2] = ArgbEncode(0xff, 225, 225, 225); - m_pThemeData->clrBtnEdgeOut[0] = ArgbEncode(0xff, 255, 255, 255); - m_pThemeData->clrFormBorder[0][0] = ArgbEncode(0xff, 117, 141, 94); - m_pThemeData->clrFormBorder[0][1] = ArgbEncode(0xff, 139, 161, 105); - m_pThemeData->clrFormBorder[0][2] = ArgbEncode(0xff, 171, 189, 133); - m_pThemeData->clrFormBorder[0][3] = ArgbEncode(0xff, 164, 178, 127); - m_pThemeData->clrFormBorder[0][4] = ArgbEncode(0xff, 255, 255, 255); - m_pThemeData->clrFormBorderLight[0] = ArgbEncode(0xff, 171, 189, 133); - } else { - m_pThemeData->clrHeadBK[0][0] = ArgbEncode(0xff, 3, 114, 255); - m_pThemeData->clrHeadBK[0][1] = ArgbEncode(0xff, 0, 85, 226); - m_pThemeData->clrHeadBK[0][2] = ArgbEncode(0xff, 0, 85, 226); - m_pThemeData->clrHeadBK[0][3] = ArgbEncode(0xff, 3, 114, 255); - m_pThemeData->clrHeadEdgeLeft[0][2] = ArgbEncode(0xff, 0, 32, 200); - m_pThemeData->clrHeadEdgeLeft[0][1] = ArgbEncode(0xff, 0, 61, 220); - m_pThemeData->clrHeadEdgeLeft[0][0] = ArgbEncode(0xff, 0, 54, 210); - m_pThemeData->clrHeadEdgeRight[0][0] = ArgbEncode(0xff, 0, 56, 234); - m_pThemeData->clrHeadEdgeRight[0][1] = ArgbEncode(0xff, 0, 50, 193); - m_pThemeData->clrHeadEdgeRight[0][2] = ArgbEncode(0xff, 0, 19, 139); - m_pThemeData->clrHeadEdgeTop[0][0] = ArgbEncode(0xff, 0, 88, 238); - m_pThemeData->clrHeadEdgeTop[0][1] = ArgbEncode(0xff, 63, 151, 255); - m_pThemeData->clrHeadEdgeTop[0][2] = ArgbEncode(0xff, 3, 114, 255); - m_pThemeData->clrHeadEdgeBottom[0][0] = ArgbEncode(0xff, 0, 96, 252); - m_pThemeData->clrHeadEdgeBottom[0][1] = ArgbEncode(0xff, 63, 151, 255); - m_pThemeData->clrHeadEdgeBottom[0][2] = ArgbEncode(0xff, 0, 67, 207); - m_pThemeData->clrNormalBtBKStart[0][2] = ArgbEncode(0xff, 0, 49, 112); - m_pThemeData->clrNormalBtBKEnd[0][2] = ArgbEncode(0xff, 0, 87, 188); - m_pThemeData->clrNormalBtBKStart[0][0] = ArgbEncode(0xff, 154, 183, 250); - m_pThemeData->clrNormalBtBKEnd[0][0] = ArgbEncode(0xff, 17, 110, 248); - m_pThemeData->clrNormalBtBKStart[0][1] = ArgbEncode(0xff, 164, 194, 255); - m_pThemeData->clrNormalBtBKEnd[0][1] = ArgbEncode(0xff, 29, 158, 255); - m_pThemeData->clrNormalBtEdgeLight[0][0] = ArgbEncode(0xff, 68, 120, 245); - m_pThemeData->clrNormalBtEdgeDark[0][0] = ArgbEncode(0xff, 24, 72, 187); - m_pThemeData->clrNormalBtEdgeLight[0][1] = ArgbEncode(0xff, 72, 122, 245); - m_pThemeData->clrNormalBtEdgeDark[0][1] = ArgbEncode(0xff, 35, 87, 195); - m_pThemeData->clrNormalBtEdgeLight[0][2] = ArgbEncode(0xff, 60, 114, 244); - m_pThemeData->clrNormalBtEdgeDark[0][2] = ArgbEncode(0xff, 21, 70, 185); - m_pThemeData->clrBtnCornerLight[0][0] = ArgbEncode(0xff, 220, 220, 220); - m_pThemeData->clrBtnCornerLight[0][1] = ArgbEncode(0xff, 255, 255, 255); - m_pThemeData->clrBtnCornerLight[0][2] = ArgbEncode(0xff, 225, 225, 225); - m_pThemeData->clrBtnEdgeOut[0] = ArgbEncode(0xff, 255, 255, 255); - m_pThemeData->clrFormBorder[0][0] = ArgbEncode(0xff, 0, 72, 241); - m_pThemeData->clrFormBorder[0][1] = ArgbEncode(0xff, 0, 61, 220); - m_pThemeData->clrFormBorder[0][2] = ArgbEncode(0xff, 0, 30, 160); - m_pThemeData->clrFormBorder[0][3] = ArgbEncode(0xff, 0, 19, 140); - m_pThemeData->clrFormBorder[0][4] = ArgbEncode(0xff, 255, 255, 255); - m_pThemeData->clrFormBorderLight[0] = ArgbEncode(0xff, 22, 106, 239); - } - m_pThemeData->clrCloseBtBKStart[1][0] = m_pThemeData->clrCloseBtBKStart[0][0]; - m_pThemeData->clrCloseBtBKEnd[1][0] = m_pThemeData->clrCloseBtBKEnd[0][0]; - m_pThemeData->clrCloseBtBKStart[1][1] = m_pThemeData->clrCloseBtBKStart[0][1]; - m_pThemeData->clrCloseBtBKEnd[1][1] = m_pThemeData->clrCloseBtBKEnd[0][1]; - m_pThemeData->clrCloseBtBKStart[1][2] = m_pThemeData->clrCloseBtBKStart[0][2]; - m_pThemeData->clrCloseBtBKEnd[1][2] = m_pThemeData->clrCloseBtBKEnd[0][2]; - m_pThemeData->clrCloseBtEdgeLight[1][0] = - m_pThemeData->clrCloseBtEdgeLight[0][0]; - m_pThemeData->clrCloseBtEdgeDark[1][0] = - m_pThemeData->clrCloseBtEdgeDark[0][0]; - m_pThemeData->clrCloseBtEdgeLight[1][1] = - m_pThemeData->clrCloseBtEdgeLight[0][1]; - m_pThemeData->clrCloseBtEdgeDark[1][1] = - m_pThemeData->clrCloseBtEdgeDark[0][1]; - m_pThemeData->clrCloseBtEdgeLight[1][2] = - m_pThemeData->clrCloseBtEdgeLight[0][2]; - m_pThemeData->clrCloseBtEdgeDark[1][2] = - m_pThemeData->clrCloseBtEdgeDark[0][2]; - m_pThemeData->clrHeadBK[1][0] = m_pThemeData->clrHeadBK[0][0]; - m_pThemeData->clrHeadBK[1][1] = m_pThemeData->clrHeadBK[0][1]; - m_pThemeData->clrHeadBK[1][2] = m_pThemeData->clrHeadBK[0][2]; - m_pThemeData->clrHeadBK[1][3] = m_pThemeData->clrHeadBK[0][3]; - m_pThemeData->clrHeadEdgeLeft[1][2] = m_pThemeData->clrHeadEdgeLeft[0][2]; - m_pThemeData->clrHeadEdgeLeft[1][1] = m_pThemeData->clrHeadEdgeLeft[0][1]; - m_pThemeData->clrHeadEdgeLeft[1][0] = m_pThemeData->clrHeadEdgeLeft[0][0]; - m_pThemeData->clrHeadEdgeRight[1][0] = m_pThemeData->clrHeadEdgeRight[0][0]; - m_pThemeData->clrHeadEdgeRight[1][1] = m_pThemeData->clrHeadEdgeRight[0][1]; - m_pThemeData->clrHeadEdgeRight[1][2] = m_pThemeData->clrHeadEdgeRight[0][2]; - m_pThemeData->clrHeadEdgeTop[1][0] = m_pThemeData->clrHeadEdgeTop[0][0]; - m_pThemeData->clrHeadEdgeTop[1][1] = m_pThemeData->clrHeadEdgeTop[0][1]; - m_pThemeData->clrHeadEdgeTop[1][2] = m_pThemeData->clrHeadEdgeTop[0][2]; - m_pThemeData->clrHeadEdgeBottom[1][0] = m_pThemeData->clrHeadEdgeBottom[0][0]; - m_pThemeData->clrHeadEdgeBottom[1][1] = m_pThemeData->clrHeadEdgeBottom[0][1]; - m_pThemeData->clrHeadEdgeBottom[1][2] = m_pThemeData->clrHeadEdgeBottom[0][2]; - m_pThemeData->clrNormalBtBKStart[1][2] = - m_pThemeData->clrNormalBtBKStart[0][2]; - m_pThemeData->clrNormalBtBKEnd[1][2] = m_pThemeData->clrNormalBtBKEnd[0][2]; - m_pThemeData->clrNormalBtBKStart[1][0] = - m_pThemeData->clrNormalBtBKStart[0][0]; - m_pThemeData->clrNormalBtBKEnd[1][0] = m_pThemeData->clrNormalBtBKEnd[1][0]; - m_pThemeData->clrNormalBtBKStart[1][1] = - m_pThemeData->clrNormalBtBKStart[0][1]; - m_pThemeData->clrNormalBtBKEnd[1][1] = m_pThemeData->clrNormalBtBKEnd[0][1]; - m_pThemeData->clrNormalBtEdgeLight[1][0] = - m_pThemeData->clrNormalBtEdgeLight[0][0]; - m_pThemeData->clrNormalBtEdgeDark[1][0] = - m_pThemeData->clrNormalBtEdgeDark[0][0]; - m_pThemeData->clrNormalBtEdgeLight[1][1] = - m_pThemeData->clrNormalBtEdgeLight[0][1]; - m_pThemeData->clrNormalBtEdgeDark[1][1] = - m_pThemeData->clrNormalBtEdgeDark[0][1]; - m_pThemeData->clrNormalBtEdgeLight[1][2] = - m_pThemeData->clrNormalBtEdgeLight[0][2]; - m_pThemeData->clrNormalBtEdgeDark[1][2] = - m_pThemeData->clrNormalBtEdgeDark[0][2]; - m_pThemeData->clrBtnCornerLight[1][0] = m_pThemeData->clrBtnCornerLight[0][0]; - m_pThemeData->clrBtnCornerLight[1][1] = m_pThemeData->clrBtnCornerLight[0][1]; - m_pThemeData->clrBtnCornerLight[1][2] = m_pThemeData->clrBtnCornerLight[0][2]; - m_pThemeData->clrBtnEdgeOut[1] = m_pThemeData->clrBtnEdgeOut[0]; - m_pThemeData->clrFormBorder[1][0] = m_pThemeData->clrFormBorder[0][0]; - m_pThemeData->clrFormBorder[1][1] = m_pThemeData->clrFormBorder[0][1]; - m_pThemeData->clrFormBorder[1][2] = m_pThemeData->clrFormBorder[0][2]; - m_pThemeData->clrFormBorder[1][3] = m_pThemeData->clrFormBorder[0][3]; - m_pThemeData->clrFormBorder[1][4] = m_pThemeData->clrFormBorder[0][4]; - m_pThemeData->clrFormBorderLight[1] = m_pThemeData->clrFormBorderLight[0]; - DeactiveForm(); -} -void CFWL_FormTP::DeactiveForm() { - TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrHeadBK[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrHeadBK[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrHeadBK[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrHeadBK[1][3]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeLeft[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeLeft[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeLeft[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeRight[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeRight[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeRight[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeTop[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeTop[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeTop[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeBottom[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeBottom[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrHeadEdgeBottom[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtBKStart[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtBKStart[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtBKStart[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtBKEnd[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtBKEnd[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtBKEnd[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtEdgeLight[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtEdgeLight[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtEdgeLight[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtEdgeDark[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtEdgeDark[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrNormalBtEdgeDark[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrBtnCornerLight[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrBtnCornerLight[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrBtnCornerLight[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, m_pThemeData->clrBtnEdgeOut[1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrFormBorder[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrFormBorder[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrFormBorder[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrFormBorder[1][3]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrFormBorder[1][4]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrFormBorderLight[1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtBKStart[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtBKStart[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtBKStart[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtBKEnd[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtBKEnd[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtBKEnd[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtEdgeLight[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtEdgeLight[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtEdgeLight[1][2]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtEdgeDark[1][0]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtEdgeDark[1][1]); - TransModeColor(m_pThemeData->clrTransWhite, - m_pThemeData->clrCloseBtEdgeDark[1][2]); -} -void CFWL_FormTP::TransModeColor(FX_ARGB clrFore, FX_ARGB& clrBack) { - int32_t iAlfaF, iRF, iGF, iBF; - int32_t iAlfaB, iRB, iGB, iBB; - ArgbDecode(clrFore, iAlfaF, iRF, iGF, iBF); - ArgbDecode(clrBack, iAlfaB, iRB, iGB, iBB); - clrBack = ArgbEncode(0xff, iRB + (iRF - iRB) * iAlfaF / 255, - iGB + (iGF - iGB) * iAlfaF / 255, - iBB + (iBF - iBB) * iAlfaF / 255); -} -void CFWL_FormTP::InitCaption(FX_BOOL bActive) { - if (bActive) { - CFX_FxgeDevice dev; - CFX_Graphics gs; - CFX_Path path; - path.Create(); - delete m_pActiveBitmap; - m_pActiveBitmap = new CFX_DIBitmap; - m_pActiveBitmap->Create(1, kCYCaption, FXDIB_Argb); - dev.Attach(m_pActiveBitmap, false, nullptr, false); - gs.Create(&dev); - path.AddRectangle(0, 0, 1, 5); - DrawAxialShading(&gs, 0, 0, 0, 5, m_pThemeData->clrHeadBK[0][0], - m_pThemeData->clrHeadBK[0][1], &path); - path.Clear(); - path.AddRectangle(0, 5, 1, 15); - DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[0][1], - m_pThemeData->clrHeadBK[0][2], &path); - path.Clear(); - path.AddRectangle(0, 20, 1, kCYCaption - 19); - DrawAxialShading(&gs, 0, 20, 0, kCYCaption, m_pThemeData->clrHeadBK[0][2], - m_pThemeData->clrHeadBK[0][3], &path); - } else { - CFX_FxgeDevice dev; - CFX_Graphics gs; - CFX_Path path; - path.Create(); - delete m_pDeactivebitmap; - m_pDeactivebitmap = new CFX_DIBitmap; - m_pDeactivebitmap->Create(1, kCYCaption, FXDIB_Argb); - dev.Attach(m_pDeactivebitmap, false, nullptr, false); - gs.Create(&dev); - path.AddRectangle(0, 0, 1, 5); - DrawAxialShading(&gs, 0, 0, 0, 5, m_pThemeData->clrHeadBK[1][0], - m_pThemeData->clrHeadBK[1][1], &path); - path.Clear(); - path.AddRectangle(0, 5, 1, 15); - DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1], - m_pThemeData->clrHeadBK[1][2], &path); - path.Clear(); - path.AddRectangle(0, 20, 1, kCYCaption - 19); - DrawAxialShading(&gs, 0, 20, 0, kCYCaption, m_pThemeData->clrHeadBK[1][2], - m_pThemeData->clrHeadBK[1][3], &path); - } -} diff --git a/xfa/fwl/theme/cfwl_formtp.h b/xfa/fwl/theme/cfwl_formtp.h deleted file mode 100644 index ccbc71b2c2..0000000000 --- a/xfa/fwl/theme/cfwl_formtp.h +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FWL_THEME_CFWL_FORMTP_H_ -#define XFA_FWL_THEME_CFWL_FORMTP_H_ - -#include "xfa/fwl/theme/cfwl_utils.h" -#include "xfa/fwl/theme/cfwl_widgettp.h" - -class CFWL_FormTP : public CFWL_WidgetTP { - public: - CFWL_FormTP(); - ~CFWL_FormTP() override; - - // CFWL_WidgetTP - FWL_Error Initialize() override; - FWL_Error Finalize() override; - bool IsValidWidget(IFWL_Widget* pWidget) override; - uint32_t SetThemeID(IFWL_Widget* pWidget, - uint32_t dwThemeID, - FX_BOOL bChildren = TRUE) override; - FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; - FX_BOOL DrawText(CFWL_ThemeText* pParams) override; - void* GetCapacity(CFWL_ThemePart* pThemePart, - CFWL_WidgetCapacity dwCapacity) override; - FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override; - - protected: - void CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect); - void CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect); - void CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect); - void CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect); - void CalIcon(IFWL_Widget* pWidget, CFX_RectF& rect); - - void DrawFormBorder(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawCaption(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawNarrowCaption(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawCloseBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawMinMaxBoxCommon(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawMinimizeBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawMaximizeBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - bool bMax, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawIconImage(CFX_Graphics* pGraphics, - CFX_DIBitmap* pDIBitmap, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void SetThemeData(uint32_t dwID); - void TransModeColor(FX_ARGB clrFore, FX_ARGB& clrBack); - void DeactiveForm(); - void InitCaption(FX_BOOL bActive); - CFX_DIBitmap* m_pActiveBitmap; - CFX_DIBitmap* m_pDeactivebitmap; - CFX_RectF m_rtDisCaption; - CFX_RectF m_rtDisLBorder; - CFX_RectF m_rtDisRBorder; - CFX_RectF m_rtDisBBorder; - struct SBThemeData { - FX_ARGB clrHeadBK[2][4]; - FX_ARGB clrHeadEdgeLeft[2][3]; - FX_ARGB clrHeadEdgeRight[2][3]; - FX_ARGB clrHeadEdgeTop[2][3]; - FX_ARGB clrHeadEdgeBottom[2][3]; - FX_ARGB clrCloseBtBKStart[2][3]; - FX_ARGB clrCloseBtBKEnd[2][3]; - FX_ARGB clrCloseBtEdgeLight[2][3]; - FX_ARGB clrCloseBtEdgeDark[2][3]; - FX_ARGB clrNormalBtBKStart[2][3]; - FX_ARGB clrNormalBtBKEnd[2][3]; - FX_ARGB clrNormalBtEdgeLight[2][3]; - FX_ARGB clrNormalBtEdgeDark[2][3]; - FX_ARGB clrBtnEdgeOut[2]; - FX_ARGB clrBtnCornerLight[2][3]; - FX_ARGB clrHeadText[2]; - FX_ARGB clrFormBorder[2][5]; - FX_ARGB clrFormBorderLight[2]; - FX_ARGB clrTransWhite; - } * m_pThemeData; -}; - -#endif // XFA_FWL_THEME_CFWL_FORMTP_H_ |