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
82fa84e9
Kaydet (Commit)
82fa84e9
authored
May 13, 2014
tarafından
Chris Sherlock
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: clipping functions moved from window.cxx to clipping.cxx
Change-Id: Iaaabbe2002b14540bdf4a51269909b44bf5d8880
üst
aa23a839
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
227 additions
and
225 deletions
+227
-225
clipping.cxx
vcl/source/window/clipping.cxx
+227
-0
window.cxx
vcl/source/window/window.cxx
+0
-225
No files found.
vcl/source/window/clipping.cxx
Dosyayı görüntüle @
82fa84e9
...
@@ -141,6 +141,94 @@ void Window::InitClipRegion()
...
@@ -141,6 +141,94 @@ void Window::InitClipRegion()
mbInitClipRegion
=
false
;
mbInitClipRegion
=
false
;
}
}
void
Window
::
SetParentClipMode
(
sal_uInt16
nMode
)
{
if
(
mpWindowImpl
->
mpBorderWindow
)
mpWindowImpl
->
mpBorderWindow
->
SetParentClipMode
(
nMode
);
else
{
if
(
!
ImplIsOverlapWindow
()
)
{
mpWindowImpl
->
mnParentClipMode
=
nMode
;
if
(
nMode
&
PARENTCLIPMODE_CLIP
)
mpWindowImpl
->
mpParent
->
mpWindowImpl
->
mbClipChildren
=
true
;
}
}
}
sal_uInt16
Window
::
GetParentClipMode
()
const
{
if
(
mpWindowImpl
->
mpBorderWindow
)
return
mpWindowImpl
->
mpBorderWindow
->
GetParentClipMode
();
else
return
mpWindowImpl
->
mnParentClipMode
;
}
void
Window
::
ExpandPaintClipRegion
(
const
Region
&
rRegion
)
{
if
(
mpWindowImpl
->
mpPaintRegion
)
{
Region
aPixRegion
=
LogicToPixel
(
rRegion
);
Region
aDevPixRegion
=
ImplPixelToDevicePixel
(
aPixRegion
);
Region
aWinChildRegion
=
*
ImplGetWinChildClipRegion
();
// --- RTL -- only this region is in frame coordinates, so re-mirror it
if
(
ImplIsAntiparallel
()
)
{
const
OutputDevice
*
pOutDev
=
GetOutDev
();
pOutDev
->
ReMirror
(
aWinChildRegion
);
}
aDevPixRegion
.
Intersect
(
aWinChildRegion
);
if
(
!
aDevPixRegion
.
IsEmpty
()
)
{
mpWindowImpl
->
mpPaintRegion
->
Union
(
aDevPixRegion
);
mbInitClipRegion
=
true
;
}
}
}
Region
Window
::
GetWindowClipRegionPixel
(
sal_uInt16
nFlags
)
const
{
Region
aWinClipRegion
;
if
(
nFlags
&
WINDOW_GETCLIPREGION_NOCHILDREN
)
{
if
(
mpWindowImpl
->
mbInitWinClipRegion
)
((
Window
*
)
this
)
->
ImplInitWinClipRegion
();
aWinClipRegion
=
mpWindowImpl
->
maWinClipRegion
;
}
else
{
Region
*
pWinChildClipRegion
=
((
Window
*
)
this
)
->
ImplGetWinChildClipRegion
();
aWinClipRegion
=
*
pWinChildClipRegion
;
// --- RTL --- remirror clip region before passing it to somebody
if
(
ImplIsAntiparallel
()
)
{
const
OutputDevice
*
pOutDev
=
GetOutDev
();
pOutDev
->
ReMirror
(
aWinClipRegion
);
}
}
if
(
nFlags
&
WINDOW_GETCLIPREGION_NULL
)
{
Rectangle
aWinRect
(
Point
(
mnOutOffX
,
mnOutOffY
),
Size
(
mnOutWidth
,
mnOutHeight
)
);
Region
aWinRegion
(
aWinRect
);
if
(
aWinRegion
==
aWinClipRegion
)
aWinClipRegion
.
SetNull
();
}
aWinClipRegion
.
Move
(
-
mnOutOffX
,
-
mnOutOffY
);
return
aWinClipRegion
;
}
Region
Window
::
GetActiveClipRegion
()
const
Region
Window
::
GetActiveClipRegion
()
const
{
{
Region
aRegion
(
true
);
Region
aRegion
(
true
);
...
@@ -174,6 +262,145 @@ void Window::EnableClipSiblings( bool bClipSiblings )
...
@@ -174,6 +262,145 @@ void Window::EnableClipSiblings( bool bClipSiblings )
mpWindowImpl
->
mbClipSiblings
=
bClipSiblings
;
mpWindowImpl
->
mbClipSiblings
=
bClipSiblings
;
}
}
void
Window
::
ImplClipBoundaries
(
Region
&
rRegion
,
bool
bThis
,
bool
bOverlaps
)
{
if
(
bThis
)
ImplIntersectWindowClipRegion
(
rRegion
);
else
if
(
ImplIsOverlapWindow
()
)
{
// clip to frame if required
if
(
!
mpWindowImpl
->
mbFrame
)
rRegion
.
Intersect
(
Rectangle
(
Point
(
0
,
0
),
Size
(
mpWindowImpl
->
mpFrameWindow
->
mnOutWidth
,
mpWindowImpl
->
mpFrameWindow
->
mnOutHeight
)
)
);
if
(
bOverlaps
&&
!
rRegion
.
IsEmpty
()
)
{
// Clip Overlap Siblings
Window
*
pStartOverlapWindow
=
this
;
while
(
!
pStartOverlapWindow
->
mpWindowImpl
->
mbFrame
)
{
Window
*
pOverlapWindow
=
pStartOverlapWindow
->
mpWindowImpl
->
mpOverlapWindow
->
mpWindowImpl
->
mpFirstOverlap
;
while
(
pOverlapWindow
&&
(
pOverlapWindow
!=
pStartOverlapWindow
)
)
{
pOverlapWindow
->
ImplExcludeOverlapWindows2
(
rRegion
);
pOverlapWindow
=
pOverlapWindow
->
mpWindowImpl
->
mpNext
;
}
pStartOverlapWindow
=
pStartOverlapWindow
->
mpWindowImpl
->
mpOverlapWindow
;
}
// Clip Child Overlap Windows
ImplExcludeOverlapWindows
(
rRegion
);
}
}
else
ImplGetParent
()
->
ImplIntersectWindowClipRegion
(
rRegion
);
}
bool
Window
::
ImplClipChildren
(
Region
&
rRegion
)
{
bool
bOtherClip
=
false
;
Window
*
pWindow
=
mpWindowImpl
->
mpFirstChild
;
while
(
pWindow
)
{
if
(
pWindow
->
mpWindowImpl
->
mbReallyVisible
)
{
// read-out ParentClipMode-Flags
sal_uInt16
nClipMode
=
pWindow
->
GetParentClipMode
();
if
(
!
(
nClipMode
&
PARENTCLIPMODE_NOCLIP
)
&&
((
nClipMode
&
PARENTCLIPMODE_CLIP
)
||
(
GetStyle
()
&
WB_CLIPCHILDREN
))
)
pWindow
->
ImplExcludeWindowRegion
(
rRegion
);
else
bOtherClip
=
true
;
}
pWindow
=
pWindow
->
mpWindowImpl
->
mpNext
;
}
return
bOtherClip
;
}
void
Window
::
ImplClipAllChildren
(
Region
&
rRegion
)
{
Window
*
pWindow
=
mpWindowImpl
->
mpFirstChild
;
while
(
pWindow
)
{
if
(
pWindow
->
mpWindowImpl
->
mbReallyVisible
)
pWindow
->
ImplExcludeWindowRegion
(
rRegion
);
pWindow
=
pWindow
->
mpWindowImpl
->
mpNext
;
}
}
void
Window
::
ImplClipSiblings
(
Region
&
rRegion
)
{
Window
*
pWindow
=
ImplGetParent
()
->
mpWindowImpl
->
mpFirstChild
;
while
(
pWindow
)
{
if
(
pWindow
==
this
)
break
;
if
(
pWindow
->
mpWindowImpl
->
mbReallyVisible
)
pWindow
->
ImplExcludeWindowRegion
(
rRegion
);
pWindow
=
pWindow
->
mpWindowImpl
->
mpNext
;
}
}
void
Window
::
ImplInitWinClipRegion
()
{
// Build Window Region
mpWindowImpl
->
maWinClipRegion
=
Rectangle
(
Point
(
mnOutOffX
,
mnOutOffY
),
Size
(
mnOutWidth
,
mnOutHeight
)
);
if
(
mpWindowImpl
->
mbWinRegion
)
mpWindowImpl
->
maWinClipRegion
.
Intersect
(
ImplPixelToDevicePixel
(
mpWindowImpl
->
maWinRegion
)
);
// ClipSiblings
if
(
mpWindowImpl
->
mbClipSiblings
&&
!
ImplIsOverlapWindow
()
)
ImplClipSiblings
(
mpWindowImpl
->
maWinClipRegion
);
// Clip Parent Boundaries
ImplClipBoundaries
(
mpWindowImpl
->
maWinClipRegion
,
false
,
true
);
// Clip Children
if
(
(
GetStyle
()
&
WB_CLIPCHILDREN
)
||
mpWindowImpl
->
mbClipChildren
)
mpWindowImpl
->
mbInitChildRegion
=
true
;
mpWindowImpl
->
mbInitWinClipRegion
=
false
;
}
void
Window
::
ImplInitWinChildClipRegion
()
{
if
(
!
mpWindowImpl
->
mpFirstChild
)
{
if
(
mpWindowImpl
->
mpChildClipRegion
)
{
delete
mpWindowImpl
->
mpChildClipRegion
;
mpWindowImpl
->
mpChildClipRegion
=
NULL
;
}
}
else
{
if
(
!
mpWindowImpl
->
mpChildClipRegion
)
mpWindowImpl
->
mpChildClipRegion
=
new
Region
(
mpWindowImpl
->
maWinClipRegion
);
else
*
mpWindowImpl
->
mpChildClipRegion
=
mpWindowImpl
->
maWinClipRegion
;
ImplClipChildren
(
*
mpWindowImpl
->
mpChildClipRegion
);
}
mpWindowImpl
->
mbInitChildRegion
=
false
;
}
Region
*
Window
::
ImplGetWinChildClipRegion
()
{
if
(
mpWindowImpl
->
mbInitWinClipRegion
)
ImplInitWinClipRegion
();
if
(
mpWindowImpl
->
mbInitChildRegion
)
ImplInitWinChildClipRegion
();
if
(
mpWindowImpl
->
mpChildClipRegion
)
return
mpWindowImpl
->
mpChildClipRegion
;
else
return
&
mpWindowImpl
->
maWinClipRegion
;
}
bool
Window
::
ImplSysObjClip
(
const
Region
*
pOldRegion
)
bool
Window
::
ImplSysObjClip
(
const
Region
*
pOldRegion
)
{
{
...
...
vcl/source/window/window.cxx
Dosyayı görüntüle @
82fa84e9
...
@@ -1789,145 +1789,6 @@ void Window::ImplExcludeOverlapWindows2( Region& rRegion )
...
@@ -1789,145 +1789,6 @@ void Window::ImplExcludeOverlapWindows2( Region& rRegion )
ImplExcludeOverlapWindows
(
rRegion
);
ImplExcludeOverlapWindows
(
rRegion
);
}
}
void
Window
::
ImplClipBoundaries
(
Region
&
rRegion
,
bool
bThis
,
bool
bOverlaps
)
{
if
(
bThis
)
ImplIntersectWindowClipRegion
(
rRegion
);
else
if
(
ImplIsOverlapWindow
()
)
{
// clip to frame if required
if
(
!
mpWindowImpl
->
mbFrame
)
rRegion
.
Intersect
(
Rectangle
(
Point
(
0
,
0
),
Size
(
mpWindowImpl
->
mpFrameWindow
->
mnOutWidth
,
mpWindowImpl
->
mpFrameWindow
->
mnOutHeight
)
)
);
if
(
bOverlaps
&&
!
rRegion
.
IsEmpty
()
)
{
// Clip Overlap Siblings
Window
*
pStartOverlapWindow
=
this
;
while
(
!
pStartOverlapWindow
->
mpWindowImpl
->
mbFrame
)
{
Window
*
pOverlapWindow
=
pStartOverlapWindow
->
mpWindowImpl
->
mpOverlapWindow
->
mpWindowImpl
->
mpFirstOverlap
;
while
(
pOverlapWindow
&&
(
pOverlapWindow
!=
pStartOverlapWindow
)
)
{
pOverlapWindow
->
ImplExcludeOverlapWindows2
(
rRegion
);
pOverlapWindow
=
pOverlapWindow
->
mpWindowImpl
->
mpNext
;
}
pStartOverlapWindow
=
pStartOverlapWindow
->
mpWindowImpl
->
mpOverlapWindow
;
}
// Clip Child Overlap Windows
ImplExcludeOverlapWindows
(
rRegion
);
}
}
else
ImplGetParent
()
->
ImplIntersectWindowClipRegion
(
rRegion
);
}
bool
Window
::
ImplClipChildren
(
Region
&
rRegion
)
{
bool
bOtherClip
=
false
;
Window
*
pWindow
=
mpWindowImpl
->
mpFirstChild
;
while
(
pWindow
)
{
if
(
pWindow
->
mpWindowImpl
->
mbReallyVisible
)
{
// read-out ParentClipMode-Flags
sal_uInt16
nClipMode
=
pWindow
->
GetParentClipMode
();
if
(
!
(
nClipMode
&
PARENTCLIPMODE_NOCLIP
)
&&
((
nClipMode
&
PARENTCLIPMODE_CLIP
)
||
(
GetStyle
()
&
WB_CLIPCHILDREN
))
)
pWindow
->
ImplExcludeWindowRegion
(
rRegion
);
else
bOtherClip
=
true
;
}
pWindow
=
pWindow
->
mpWindowImpl
->
mpNext
;
}
return
bOtherClip
;
}
void
Window
::
ImplClipAllChildren
(
Region
&
rRegion
)
{
Window
*
pWindow
=
mpWindowImpl
->
mpFirstChild
;
while
(
pWindow
)
{
if
(
pWindow
->
mpWindowImpl
->
mbReallyVisible
)
pWindow
->
ImplExcludeWindowRegion
(
rRegion
);
pWindow
=
pWindow
->
mpWindowImpl
->
mpNext
;
}
}
void
Window
::
ImplClipSiblings
(
Region
&
rRegion
)
{
Window
*
pWindow
=
ImplGetParent
()
->
mpWindowImpl
->
mpFirstChild
;
while
(
pWindow
)
{
if
(
pWindow
==
this
)
break
;
if
(
pWindow
->
mpWindowImpl
->
mbReallyVisible
)
pWindow
->
ImplExcludeWindowRegion
(
rRegion
);
pWindow
=
pWindow
->
mpWindowImpl
->
mpNext
;
}
}
void
Window
::
ImplInitWinClipRegion
()
{
// Build Window Region
mpWindowImpl
->
maWinClipRegion
=
Rectangle
(
Point
(
mnOutOffX
,
mnOutOffY
),
Size
(
mnOutWidth
,
mnOutHeight
)
);
if
(
mpWindowImpl
->
mbWinRegion
)
mpWindowImpl
->
maWinClipRegion
.
Intersect
(
ImplPixelToDevicePixel
(
mpWindowImpl
->
maWinRegion
)
);
// ClipSiblings
if
(
mpWindowImpl
->
mbClipSiblings
&&
!
ImplIsOverlapWindow
()
)
ImplClipSiblings
(
mpWindowImpl
->
maWinClipRegion
);
// Clip Parent Boundaries
ImplClipBoundaries
(
mpWindowImpl
->
maWinClipRegion
,
false
,
true
);
// Clip Children
if
(
(
GetStyle
()
&
WB_CLIPCHILDREN
)
||
mpWindowImpl
->
mbClipChildren
)
mpWindowImpl
->
mbInitChildRegion
=
true
;
mpWindowImpl
->
mbInitWinClipRegion
=
false
;
}
void
Window
::
ImplInitWinChildClipRegion
()
{
if
(
!
mpWindowImpl
->
mpFirstChild
)
{
if
(
mpWindowImpl
->
mpChildClipRegion
)
{
delete
mpWindowImpl
->
mpChildClipRegion
;
mpWindowImpl
->
mpChildClipRegion
=
NULL
;
}
}
else
{
if
(
!
mpWindowImpl
->
mpChildClipRegion
)
mpWindowImpl
->
mpChildClipRegion
=
new
Region
(
mpWindowImpl
->
maWinClipRegion
);
else
*
mpWindowImpl
->
mpChildClipRegion
=
mpWindowImpl
->
maWinClipRegion
;
ImplClipChildren
(
*
mpWindowImpl
->
mpChildClipRegion
);
}
mpWindowImpl
->
mbInitChildRegion
=
false
;
}
Region
*
Window
::
ImplGetWinChildClipRegion
()
{
if
(
mpWindowImpl
->
mbInitWinClipRegion
)
ImplInitWinClipRegion
();
if
(
mpWindowImpl
->
mbInitChildRegion
)
ImplInitWinChildClipRegion
();
if
(
mpWindowImpl
->
mpChildClipRegion
)
return
mpWindowImpl
->
mpChildClipRegion
;
else
return
&
mpWindowImpl
->
maWinClipRegion
;
}
void
Window
::
ImplIntersectAndUnionOverlapWindows
(
const
Region
&
rInterRegion
,
Region
&
rRegion
)
void
Window
::
ImplIntersectAndUnionOverlapWindows
(
const
Region
&
rInterRegion
,
Region
&
rRegion
)
{
{
Window
*
pWindow
=
mpWindowImpl
->
mpFirstOverlap
;
Window
*
pWindow
=
mpWindowImpl
->
mpFirstOverlap
;
...
@@ -4992,31 +4853,6 @@ Font Window::GetPointFont() const
...
@@ -4992,31 +4853,6 @@ Font Window::GetPointFont() const
return
aFont
;
return
aFont
;
}
}
void
Window
::
SetParentClipMode
(
sal_uInt16
nMode
)
{
if
(
mpWindowImpl
->
mpBorderWindow
)
mpWindowImpl
->
mpBorderWindow
->
SetParentClipMode
(
nMode
);
else
{
if
(
!
ImplIsOverlapWindow
()
)
{
mpWindowImpl
->
mnParentClipMode
=
nMode
;
if
(
nMode
&
PARENTCLIPMODE_CLIP
)
mpWindowImpl
->
mpParent
->
mpWindowImpl
->
mbClipChildren
=
true
;
}
}
}
sal_uInt16
Window
::
GetParentClipMode
()
const
{
if
(
mpWindowImpl
->
mpBorderWindow
)
return
mpWindowImpl
->
mpBorderWindow
->
GetParentClipMode
();
else
return
mpWindowImpl
->
mnParentClipMode
;
}
void
Window
::
SetWindowRegionPixel
()
void
Window
::
SetWindowRegionPixel
()
{
{
...
@@ -5155,43 +4991,6 @@ bool Window::IsWindowRegionPixel() const
...
@@ -5155,43 +4991,6 @@ bool Window::IsWindowRegionPixel() const
return
mpWindowImpl
->
mbWinRegion
;
return
mpWindowImpl
->
mbWinRegion
;
}
}
Region
Window
::
GetWindowClipRegionPixel
(
sal_uInt16
nFlags
)
const
{
Region
aWinClipRegion
;
if
(
nFlags
&
WINDOW_GETCLIPREGION_NOCHILDREN
)
{
if
(
mpWindowImpl
->
mbInitWinClipRegion
)
((
Window
*
)
this
)
->
ImplInitWinClipRegion
();
aWinClipRegion
=
mpWindowImpl
->
maWinClipRegion
;
}
else
{
Region
*
pWinChildClipRegion
=
((
Window
*
)
this
)
->
ImplGetWinChildClipRegion
();
aWinClipRegion
=
*
pWinChildClipRegion
;
// --- RTL --- remirror clip region before passing it to somebody
if
(
ImplIsAntiparallel
()
)
{
const
OutputDevice
*
pOutDev
=
GetOutDev
();
pOutDev
->
ReMirror
(
aWinClipRegion
);
}
}
if
(
nFlags
&
WINDOW_GETCLIPREGION_NULL
)
{
Rectangle
aWinRect
(
Point
(
mnOutOffX
,
mnOutOffY
),
Size
(
mnOutWidth
,
mnOutHeight
)
);
Region
aWinRegion
(
aWinRect
);
if
(
aWinRegion
==
aWinClipRegion
)
aWinClipRegion
.
SetNull
();
}
aWinClipRegion
.
Move
(
-
mnOutOffX
,
-
mnOutOffY
);
return
aWinClipRegion
;
}
Region
Window
::
GetPaintRegion
()
const
Region
Window
::
GetPaintRegion
()
const
{
{
...
@@ -5208,30 +5007,6 @@ Region Window::GetPaintRegion() const
...
@@ -5208,30 +5007,6 @@ Region Window::GetPaintRegion() const
}
}
}
}
void
Window
::
ExpandPaintClipRegion
(
const
Region
&
rRegion
)
{
if
(
mpWindowImpl
->
mpPaintRegion
)
{
Region
aPixRegion
=
LogicToPixel
(
rRegion
);
Region
aDevPixRegion
=
ImplPixelToDevicePixel
(
aPixRegion
);
Region
aWinChildRegion
=
*
ImplGetWinChildClipRegion
();
// --- RTL -- only this region is in frame coordinates, so re-mirror it
if
(
ImplIsAntiparallel
()
)
{
const
OutputDevice
*
pOutDev
=
GetOutDev
();
pOutDev
->
ReMirror
(
aWinChildRegion
);
}
aDevPixRegion
.
Intersect
(
aWinChildRegion
);
if
(
!
aDevPixRegion
.
IsEmpty
()
)
{
mpWindowImpl
->
mpPaintRegion
->
Union
(
aDevPixRegion
);
mbInitClipRegion
=
true
;
}
}
}
static
SystemWindow
*
ImplGetLastSystemWindow
(
Window
*
pWin
)
static
SystemWindow
*
ImplGetLastSystemWindow
(
Window
*
pWin
)
{
{
// get the most top-level system window, the one that contains the taskpanelist
// get the most top-level system window, the one that contains the taskpanelist
...
...
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