Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
9a81ba66
Kaydet (Commit)
9a81ba66
authored
May 12, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor FrameSelector to use RenderContext
Change-Id: I53123245277a76aa6f782e589d10b82e3dc1d9e7
üst
37b8f4e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
80 deletions
+83
-80
frmsel.cxx
svx/source/dialog/frmsel.cxx
+26
-28
frmselimpl.hxx
svx/source/inc/frmselimpl.hxx
+57
-52
No files found.
svx/source/dialog/frmsel.cxx
Dosyayı görüntüle @
9a81ba66
...
...
@@ -22,8 +22,8 @@
#include <algorithm>
#include <math.h>
#include
"frmselimpl.hxx"
#include
"AccessibleFrameSelector.hxx"
#include
<frmselimpl.hxx>
#include
<AccessibleFrameSelector.hxx>
#include <svx/dialmgr.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
...
...
@@ -60,9 +60,8 @@ size_t GetIndexFromFrameBorderType( FrameBorderType eBorder )
return
static_cast
<
size_t
>
(
eBorder
)
-
1
;
}
namespace
{
namespace
{
/** Space between outer control border and any graphical element of the control. */
const
long
FRAMESEL_GEOM_OUTER
=
2
;
...
...
@@ -80,7 +79,6 @@ const long FRAMESEL_GEOM_ADD_CLICK_OUTER = 5;
const
long
FRAMESEL_GEOM_ADD_CLICK_INNER
=
2
;
/** Returns the corresponding flag for a frame border. */
FrameSelFlags
lclGetFlagFromType
(
FrameBorderType
eBorder
)
{
...
...
@@ -301,12 +299,12 @@ void FrameSelectorImpl::Initialize( FrameSelFlags nFlags )
void
FrameSelectorImpl
::
InitColors
()
{
const
StyleSettings
&
rSett
=
mrFrameSel
.
GetSettings
().
GetStyleSettings
();
maBackCol
=
rSett
.
GetFieldColor
();
mbHCMode
=
rSett
.
GetHighContrastMode
();
maArrowCol
=
rSett
.
GetFieldTextColor
();
maMarkCol
.
operator
=
(
maBackCol
).
Merge
(
maArrowCol
,
mbHCMode
?
0x80
:
0xC0
);
maHCLineCol
=
rSett
.
GetLabelTextColor
();
const
StyleSettings
&
rSett
ings
=
mrFrameSel
.
GetSettings
().
GetStyleSettings
();
maBackCol
=
rSett
ings
.
GetFieldColor
();
mbHCMode
=
rSett
ings
.
GetHighContrastMode
();
maArrowCol
=
rSett
ings
.
GetFieldTextColor
();
maMarkCol
.
operator
=
(
maBackCol
).
Merge
(
maArrowCol
,
mbHCMode
?
0x80
:
0xC0
);
maHCLineCol
=
rSett
ings
.
GetLabelTextColor
();
}
void
FrameSelectorImpl
::
InitArrowImageList
()
...
...
@@ -595,8 +593,8 @@ void FrameSelectorImpl::DrawArrows( const FrameBorder& rBorder )
void
FrameSelectorImpl
::
DrawAllArrows
()
{
for
(
FrameBorderCIter
aIt
(
maEnabBorders
);
aIt
.
Is
();
++
aIt
)
DrawArrows
(
**
aIt
);
for
(
FrameBorderCIter
aIt
(
maEnabBorders
);
aIt
.
Is
();
++
aIt
)
DrawArrows
(
**
aIt
);
}
Color
FrameSelectorImpl
::
GetDrawLineColor
(
const
Color
&
rColor
)
const
...
...
@@ -669,29 +667,29 @@ void FrameSelectorImpl::DrawVirtualDevice()
mbFullRepaint
=
false
;
}
void
FrameSelectorImpl
::
CopyVirDevToControl
()
void
FrameSelectorImpl
::
CopyVirDevToControl
(
vcl
::
RenderContext
&
rRenderContext
)
{
if
(
mbFullRepaint
)
if
(
mbFullRepaint
)
DrawVirtualDevice
();
mrFrameSel
.
DrawBitmap
(
maVirDevPos
,
mpVirDev
->
GetBitmap
(
Point
(
0
,
0
),
mpVirDev
->
GetOutputSizePixel
()
)
);
rRenderContext
.
DrawBitmap
(
maVirDevPos
,
mpVirDev
->
GetBitmap
(
Point
(
0
,
0
),
mpVirDev
->
GetOutputSizePixel
())
);
}
void
FrameSelectorImpl
::
DrawAllTrackingRects
()
{
tools
::
PolyPolygon
aPPoly
;
if
(
mrFrameSel
.
IsAnyBorderSelected
()
)
if
(
mrFrameSel
.
IsAnyBorderSelected
()
)
{
for
(
SelFrameBorderCIter
aIt
(
maEnabBorders
);
aIt
.
Is
();
++
aIt
)
(
*
aIt
)
->
MergeFocusToPolyPolygon
(
aPPoly
);
aPPoly
.
Move
(
maVirDevPos
.
X
(),
maVirDevPos
.
Y
()
);
for
(
SelFrameBorderCIter
aIt
(
maEnabBorders
);
aIt
.
Is
();
++
aIt
)
(
*
aIt
)
->
MergeFocusToPolyPolygon
(
aPPoly
);
aPPoly
.
Move
(
maVirDevPos
.
X
(),
maVirDevPos
.
Y
()
);
}
else
// no frame border selected -> draw tracking rectangle around entire control
aPPoly
.
Insert
(
Polygon
(
Rectangle
(
maVirDevPos
,
mpVirDev
->
GetOutputSizePixel
()
)
)
);
aPPoly
.
Insert
(
Polygon
(
Rectangle
(
maVirDevPos
,
mpVirDev
->
GetOutputSizePixel
()))
);
aPPoly
.
Optimize
(
PolyOptimizeFlags
::
CLOSE
);
for
(
sal_uInt16
nIdx
=
0
,
nCount
=
aPPoly
.
Count
();
nIdx
<
nCount
;
++
nIdx
)
mrFrameSel
.
InvertTracking
(
aPPoly
.
GetObject
(
nIdx
),
SHOWTRACK_SMALL
|
SHOWTRACK_WINDOW
);
aPPoly
.
Optimize
(
PolyOptimizeFlags
::
CLOSE
);
for
(
sal_uInt16
nIdx
=
0
,
nCount
=
aPPoly
.
Count
();
nIdx
<
nCount
;
++
nIdx
)
mrFrameSel
.
InvertTracking
(
aPPoly
.
GetObject
(
nIdx
),
SHOWTRACK_SMALL
|
SHOWTRACK_WINDOW
);
}
Point
FrameSelectorImpl
::
GetDevPosFromMousePos
(
const
Point
&
rMousePos
)
const
...
...
@@ -1044,10 +1042,10 @@ Rectangle FrameSelector::GetClickBoundRect( FrameBorderType eBorder ) const
}
// virtual functions from base class
void
FrameSelector
::
Paint
(
vcl
::
RenderContext
&
/*rRenderContext*/
,
const
Rectangle
&
)
void
FrameSelector
::
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
)
{
mxImpl
->
CopyVirDevToControl
();
if
(
HasFocus
()
)
mxImpl
->
CopyVirDevToControl
(
rRenderContext
);
if
(
HasFocus
()
)
mxImpl
->
DrawAllTrackingRects
();
}
...
...
svx/source/inc/frmselimpl.hxx
Dosyayı görüntüle @
9a81ba66
...
...
@@ -28,73 +28,80 @@
namespace
svx
{
namespace
a11y
{
class
AccFrameSelector
;
}
namespace
a11y
{
class
AccFrameSelector
;
}
class
FrameBorder
{
public
:
explicit
FrameBorder
(
FrameBorderType
eType
);
explicit
FrameBorder
(
FrameBorderType
eType
);
inline
FrameBorderType
GetType
()
const
{
return
meType
;
}
inline
FrameBorderType
GetType
()
const
{
return
meType
;
}
inline
bool
IsEnabled
()
const
{
return
mbEnabled
;
}
void
Enable
(
FrameSelFlags
nFlags
);
inline
bool
IsEnabled
()
const
{
return
mbEnabled
;
}
void
Enable
(
FrameSelFlags
nFlags
);
inline
FrameBorderState
GetState
()
const
{
return
meState
;
}
void
SetState
(
FrameBorderState
eState
);
inline
FrameBorderState
GetState
()
const
{
return
meState
;
}
void
SetState
(
FrameBorderState
eState
);
inline
bool
IsSelected
()
const
{
return
mbSelected
;
}
inline
void
Select
(
bool
bSelect
)
{
mbSelected
=
bSelect
;
}
inline
bool
IsSelected
()
const
{
return
mbSelected
;
}
inline
void
Select
(
bool
bSelect
)
{
mbSelected
=
bSelect
;
}
const
editeng
::
SvxBorderLine
&
GetCoreStyle
()
const
{
return
maCoreStyle
;
}
void
SetCoreStyle
(
const
editeng
::
SvxBorderLine
*
pStyle
);
void
SetCoreStyle
(
const
editeng
::
SvxBorderLine
*
pStyle
);
inline
void
SetUIColorPrim
(
const
Color
&
rColor
)
{
maUIStyle
.
SetColorPrim
(
rColor
);
}
inline
void
SetUIColorSecn
(
const
Color
&
rColor
)
{
maUIStyle
.
SetColorSecn
(
rColor
);
}
inline
void
SetUIColorGap
(
bool
bUseIt
,
const
Color
&
rColor
)
{
maUIStyle
.
SetColorGap
(
bUseIt
,
rColor
);}
inline
void
SetUIColorPrim
(
const
Color
&
rColor
)
{
maUIStyle
.
SetColorPrim
(
rColor
);
}
inline
void
SetUIColorSecn
(
const
Color
&
rColor
)
{
maUIStyle
.
SetColorSecn
(
rColor
);
}
inline
void
SetUIColorGap
(
bool
bUseIt
,
const
Color
&
rColor
)
{
maUIStyle
.
SetColorGap
(
bUseIt
,
rColor
);}
inline
const
frame
::
Style
&
GetUIStyle
()
const
{
return
maUIStyle
;
}
inline
void
ClearFocusArea
()
{
maFocusArea
.
Clear
();
}
void
AddFocusPolygon
(
const
Polygon
&
rFocus
);
void
MergeFocusToPolyPolygon
(
tools
::
PolyPolygon
&
rPPoly
)
const
;
inline
void
ClearFocusArea
()
{
maFocusArea
.
Clear
();
}
void
AddFocusPolygon
(
const
Polygon
&
rFocus
);
void
MergeFocusToPolyPolygon
(
tools
::
PolyPolygon
&
rPPoly
)
const
;
inline
void
ClearClickArea
()
{
maClickArea
.
Clear
();
}
void
AddClickRect
(
const
Rectangle
&
rRect
);
bool
ContainsClickPoint
(
const
Point
&
rPos
)
const
;
Rectangle
GetClickBoundRect
()
const
;
inline
void
ClearClickArea
()
{
maClickArea
.
Clear
();
}
void
AddClickRect
(
const
Rectangle
&
rRect
);
bool
ContainsClickPoint
(
const
Point
&
rPos
)
const
;
Rectangle
GetClickBoundRect
()
const
;
void
SetKeyboardNeighbors
(
FrameBorderType
eLeft
,
FrameBorderType
eRight
,
FrameBorderType
eTop
,
FrameBorderType
eBottom
);
FrameBorderType
GetKeyboardNeighbor
(
sal_uInt16
nKeyCode
)
const
;
void
SetKeyboardNeighbors
(
FrameBorderType
eLeft
,
FrameBorderType
eRight
,
FrameBorderType
eTop
,
FrameBorderType
eBottom
);
FrameBorderType
GetKeyboardNeighbor
(
sal_uInt16
nKeyCode
)
const
;
private
:
const
FrameBorderType
meType
;
/// Frame border type (position in control).
FrameBorderState
meState
;
/// Frame border state (on/off/don't care).
editeng
::
SvxBorderLine
maCoreStyle
;
/// Core style from application.
frame
::
Style
maUIStyle
;
/// Internal style to draw lines.
FrameBorderType
meKeyLeft
;
/// Left neighbor for keyboard control.
FrameBorderType
meKeyRight
;
/// Right neighbor for keyboard control.
FrameBorderType
meKeyTop
;
/// Upper neighbor for keyboard control.
FrameBorderType
meKeyBottom
;
/// Lower neighbor for keyboard control.
tools
::
PolyPolygon
maFocusArea
;
/// Focus drawing areas.
tools
::
PolyPolygon
maClickArea
;
/// Mouse click areas.
bool
mbEnabled
;
/// true = Border enabled in control.
bool
mbSelected
;
/// true = Border selected in control.
const
FrameBorderType
meType
;
/// Frame border type (position in control).
FrameBorderState
meState
;
/// Frame border state (on/off/don't care).
editeng
::
SvxBorderLine
maCoreStyle
;
/// Core style from application.
frame
::
Style
maUIStyle
;
/// Internal style to draw lines.
FrameBorderType
meKeyLeft
;
/// Left neighbor for keyboard control.
FrameBorderType
meKeyRight
;
/// Right neighbor for keyboard control.
FrameBorderType
meKeyTop
;
/// Upper neighbor for keyboard control.
FrameBorderType
meKeyBottom
;
/// Lower neighbor for keyboard control.
tools
::
PolyPolygon
maFocusArea
;
/// Focus drawing areas.
tools
::
PolyPolygon
maClickArea
;
/// Mouse click areas.
bool
mbEnabled
:
1
;
/// true = Border enabled in control.
bool
mbSelected
:
1
;
/// true = Border selected in control.
};
typedef
std
::
vector
<
FrameBorder
*
>
FrameBorderPtrVec
;
typedef
std
::
vector
<
FrameBorder
*
>
FrameBorderPtrVec
;
struct
FrameSelectorImpl
:
public
Resource
{
typedef
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
accessibility
::
XAccessible
>
XAccessibleRef
;
typedef
std
::
vector
<
a11y
::
AccFrameSelector
*
>
AccessibleImplVec
;
typedef
std
::
vector
<
XAccessibleRef
>
XAccessibleRefVec
;
typedef
css
::
uno
::
Reference
<
css
::
accessibility
::
XAccessible
>
XAccessibleRef
;
typedef
std
::
vector
<
a11y
::
AccFrameSelector
*>
AccessibleImplVec
;
typedef
std
::
vector
<
XAccessibleRef
>
XAccessibleRefVec
;
FrameSelector
&
mrFrameSel
;
/// The control itself.
ScopedVclPtr
<
VirtualDevice
>
mpVirDev
;
/// For all buffered drawing operations.
...
...
@@ -114,7 +121,7 @@ struct FrameSelectorImpl : public Resource
FrameBorder
maVer
;
/// All data of inner vertical frame border.
FrameBorder
maTLBR
;
/// All data of top-left to bottom-right frame border.
FrameBorder
maBLTR
;
/// All data of bottom-left to top-right frame border.
editeng
::
SvxBorderLine
maCurrStyle
;
/// Current style and color for new borders.
editeng
::
SvxBorderLine
maCurrStyle
;
/// Current style and color for new borders.
frame
::
Array
maArray
;
/// Frame link array to draw an array of frame borders.
FrameSelFlags
mnFlags
;
/// Flags for enabled frame borders.
...
...
@@ -188,7 +195,7 @@ struct FrameSelectorImpl : public Resource
/** Draws all contents of the control. */
void
DrawVirtualDevice
();
/** Copies contents of the virtual device to the control. */
void
CopyVirDevToControl
();
void
CopyVirDevToControl
(
vcl
::
RenderContext
&
rRenderContext
);
/** Draws tracking rectangles for all selected frame borders. */
void
DrawAllTrackingRects
();
...
...
@@ -244,11 +251,11 @@ template< typename Cont, typename Iter, typename Pred >
class
FrameBorderIterBase
{
public
:
typedef
Cont
container_type
;
typedef
Iter
iterator_type
;
typedef
Pred
predicate_type
;
typedef
typename
Cont
::
value_type
value_type
;
typedef
FrameBorderIterBase
<
Cont
,
Iter
,
Pred
>
this_type
;
typedef
Cont
container_type
;
typedef
Iter
iterator_type
;
typedef
Pred
predicate_type
;
typedef
typename
Cont
::
value_type
value_type
;
typedef
FrameBorderIterBase
<
Cont
,
Iter
,
Pred
>
this_type
;
explicit
FrameBorderIterBase
(
container_type
&
rCont
);
inline
bool
Is
()
const
{
return
maIt
!=
maEnd
;
}
...
...
@@ -285,8 +292,6 @@ typedef FrameBorderIterBase< const FrameBorderPtrVec, FrameBorderPtrVec::const_i
typedef
FrameBorderIterBase
<
FrameBorderPtrVec
,
FrameBorderPtrVec
::
iterator
,
FrameBorderSelected_Pred
>
SelFrameBorderIter
;
}
// namespace svx
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment