Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cfwl_listboxtp.cpp
Go to the documentation of this file.
1
// Copyright 2014 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
include
"xfa/fwl/theme/cfwl_listboxtp.h"
8
9
#
include
"build/build_config.h"
10
#
include
"xfa/fgas/graphics/cfgas_gecolor.h"
11
#
include
"xfa/fgas/graphics/cfgas_gegraphics.h"
12
#
include
"xfa/fgas/graphics/cfgas_gepath.h"
13
#
include
"xfa/fwl/cfwl_listbox.h"
14
#
include
"xfa/fwl/cfwl_themebackground.h"
15
#
include
"xfa/fwl/cfwl_widget.h"
16
17
namespace
pdfium
{
18
19
CFWL_ListBoxTP::CFWL_ListBoxTP() =
default
;
20
21
CFWL_ListBoxTP::~
CFWL_ListBoxTP
() =
default
;
22
23
void
CFWL_ListBoxTP::
DrawBackground
(
const
CFWL_ThemeBackground& pParams) {
24
switch
(pParams
.
GetPart
()) {
25
case
CFWL_ThemePart
::
Part
::
kBorder
: {
26
DrawBorder
(
pParams
.
GetGraphics
(
)
,
pParams.m_PartRect
,
pParams.m_matrix
)
;
27
break
;
28
}
29
case
CFWL_ThemePart
::
Part
::
kBackground
: {
30
FillSolidRect
(
pParams
.
GetGraphics
(
)
,
ArgbEncode
(
255
,
255
,
255
,
255
)
,
31
pParams.m_PartRect
,
pParams.m_matrix
)
;
32
if
(pParams.m_pRtData) {
33
FillSolidRect
(
pParams
.
GetGraphics
(
)
,
FWLTHEME_COLOR_Background
,
34
*pParams.m_pRtData
,
pParams.m_matrix
)
;
35
}
36
break
;
37
}
38
case
CFWL_ThemePart
::
Part
::
kListItem
: {
39
DrawListBoxItem(pParams
.
GetGraphics
(
)
, pParams.m_dwStates,
40
pParams.m_PartRect, pParams.m_pRtData, pParams.m_matrix);
41
break
;
42
}
43
case
CFWL_ThemePart
::
Part
::
kCheck
: {
44
uint32_t color = 0xFF000000;
45
if
(pParams.m_dwStates ==
CFWL_PartState
::
kChecked
) {
46
color = 0xFFFF0000;
47
}
else
if
(pParams.m_dwStates ==
CFWL_PartState
::
kNormal
) {
48
color = 0xFF0000FF;
49
}
50
FillSolidRect
(
pParams
.
GetGraphics
(
)
,
color
,
pParams.m_PartRect
,
51
pParams.m_matrix
)
;
52
break
;
53
}
54
default
:
55
break
;
56
}
57
}
58
59
void
CFWL_ListBoxTP::DrawListBoxItem(
CFGAS_GEGraphics
* pGraphics,
60
Mask
<
CFWL_PartState
> dwStates,
61
const
CFX_RectF
& rtItem,
62
const
CFX_RectF
* pData,
63
const
CFX_Matrix
& matrix) {
64
if
(dwStates &
CFWL_PartState
::
kSelected
) {
65
CFGAS_GEGraphics
::
StateRestorer
restorer
(
pGraphics
)
;
66
pGraphics
->
SetFillColor
(
CFGAS_GEColor
(
FWLTHEME_COLOR_BKSelected
)
)
;
67
CFGAS_GEPath path;
68
#
if
BUILDFLAG
(
IS_APPLE
)
69
path.AddRectangle(rtItem.left, rtItem.top, rtItem.width - 1,
70
rtItem.height - 1);
71
#
else
72
path
.
AddRectangle
(
rtItem
.
left
,
rtItem
.
top
,
rtItem
.
width
,
rtItem
.
height
)
;
73
#
endif
74
pGraphics
->
FillPath
(
path
,
CFX_FillRenderOptions
::
FillType
::
kWinding
,
75
matrix
)
;
76
}
77
if
((dwStates &
CFWL_PartState
::
kFocused
) && pData)
78
DrawFocus
(pGraphics, *pData, matrix);
79
}
80
81
}
// namespace pdfium
FWLTHEME_COLOR_BKSelected
#define FWLTHEME_COLOR_BKSelected
Definition
cfwl_utils.h:23
FWLTHEME_COLOR_Background
#define FWLTHEME_COLOR_Background
Definition
cfwl_utils.h:22
CFGAS_GEColor
Definition
cfgas_gecolor.h:19
CFGAS_GEColor::CFGAS_GEColor
CFGAS_GEColor(FX_ARGB argb)
Definition
cfgas_gecolor.cpp:9
CFGAS_GEGraphics::StateRestorer
Definition
cfgas_gegraphics.h:28
CFGAS_GEGraphics::StateRestorer::StateRestorer
StateRestorer(CFGAS_GEGraphics *graphics)
Definition
cfgas_gegraphics.cpp:421
CFGAS_GEGraphics
Definition
cfgas_gegraphics.h:26
CFGAS_GEGraphics::FillPath
void FillPath(const CFGAS_GEPath &path, CFX_FillRenderOptions::FillType fill_type, const CFX_Matrix &matrix)
Definition
cfgas_gegraphics.cpp:178
CFGAS_GEGraphics::SetFillColor
void SetFillColor(const CFGAS_GEColor &color)
Definition
cfgas_gegraphics.cpp:169
CFGAS_GEPath::AddRectangle
void AddRectangle(float left, float top, float width, float height)
Definition
cfgas_gepath.cpp:83
CFX_Matrix
Definition
fx_coordinates.h:440
CFX_RectF
Definition
fx_coordinates.h:276
CFX_RectF::width
float width
Definition
fx_coordinates.h:430
CFX_RectF::left
float left
Definition
fx_coordinates.h:428
CFX_RectF::height
float height
Definition
fx_coordinates.h:431
CFX_RectF::top
float top
Definition
fx_coordinates.h:429
fxcrt::Mask
Definition
mask.h:15
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
pdfium::CFWL_ListBoxTP::DrawBackground
void DrawBackground(const CFWL_ThemeBackground &pParams) override
Definition
cfwl_listboxtp.cpp:23
pdfium::CFWL_ListBoxTP::~CFWL_ListBoxTP
~CFWL_ListBoxTP() override
pdfium::CFWL_ThemeBackground::GetGraphics
CFGAS_GEGraphics * GetGraphics() const
Definition
cfwl_themebackground.h:28
pdfium::CFWL_ThemePart
Definition
cfwl_themepart.h:39
pdfium::CFWL_ThemePart::GetPart
Part GetPart() const
Definition
cfwl_themepart.h:92
pdfium::CFWL_ThemePart::Part
Part
Definition
cfwl_themepart.h:41
pdfium::CFWL_ThemePart::Part::kListItem
@ kListItem
Definition
cfwl_themepart.h:65
pdfium::CFWL_ThemePart::Part::kCheck
@ kCheck
Definition
cfwl_themepart.h:48
pdfium::CFWL_ThemePart::Part::kBackground
@ kBackground
Definition
cfwl_themepart.h:45
pdfium::CFWL_ThemePart::Part::kBorder
@ kBorder
Definition
cfwl_themepart.h:46
pdfium::CFWL_WidgetTP::DrawFocus
void DrawFocus(CFGAS_GEGraphics *pGraphics, const CFX_RectF &rect, const CFX_Matrix &matrix)
Definition
cfwl_widgettp.cpp:120
pdfium::CFWL_WidgetTP::DrawBorder
void DrawBorder(CFGAS_GEGraphics *pGraphics, const CFX_RectF &rect, const CFX_Matrix &matrix)
Definition
cfwl_widgettp.cpp:83
pdfium::CFWL_WidgetTP::FillSolidRect
void FillSolidRect(CFGAS_GEGraphics *pGraphics, FX_ARGB fillColor, const CFX_RectF &rect, const CFX_Matrix &matrix)
Definition
cfwl_widgettp.cpp:105
ArgbEncode
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
Definition
fx_dib.h:188
pdfium::CFWL_PartState
CFWL_PartState
Definition
cfwl_themepart.h:22
pdfium::CFWL_PartState::kNormal
@ kNormal
Definition
cfwl_themepart.h:23
pdfium::CFWL_PartState::kSelected
@ kSelected
Definition
cfwl_themepart.h:36
pdfium::CFWL_PartState::kChecked
@ kChecked
Definition
cfwl_themepart.h:24
pdfium::CFWL_PartState::kFocused
@ kFocused
Definition
cfwl_themepart.h:28
CFX_FillRenderOptions
Definition
cfx_fillrenderoptions.h:11
CFX_FillRenderOptions::FillType
FillType
Definition
cfx_fillrenderoptions.h:13
CFX_FillRenderOptions::FillType::kWinding
@ kWinding
Definition
cfx_fillrenderoptions.h:23
qtwebengine
src
3rdparty
chromium
third_party
pdfium
xfa
fwl
theme
cfwl_listboxtp.cpp
Generated on
for Qt by
1.18.0