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
5f8b294b
Kaydet (Commit)
5f8b294b
authored
May 20, 2015
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
boost::function to std, clenup
Change-Id: Iabd3c08b215780d65136877f8c9a2592ec6e2c63
üst
cc5f9db2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
79 deletions
+65
-79
FocusManager.cxx
sfx2/source/sidebar/FocusManager.cxx
+12
-19
FocusManager.hxx
sfx2/source/sidebar/FocusManager.hxx
+27
-31
Panel.cxx
sfx2/source/sidebar/Panel.cxx
+16
-14
Panel.hxx
sfx2/source/sidebar/Panel.hxx
+10
-15
No files found.
sfx2/source/sidebar/FocusManager.cxx
Dosyayı görüntüle @
5f8b294b
...
...
@@ -35,7 +35,7 @@ FocusManager::FocusLocation::FocusLocation (const PanelComponent eComponent, con
{
}
FocusManager
::
FocusManager
(
const
::
boost
::
function
<
void
(
const
Panel
&
)
>&
rShowPanelFunctor
)
FocusManager
::
FocusManager
(
const
std
::
function
<
void
(
const
Panel
&
)
>&
rShowPanelFunctor
)
:
mpDeckTitleBar
(),
maPanels
(),
maButtons
(),
...
...
@@ -65,11 +65,9 @@ void FocusManager::Clear()
void
FocusManager
::
ClearPanels
()
{
::
std
::
vector
<
VclPtr
<
Panel
>
>
aPanels
;
std
::
vector
<
VclPtr
<
Panel
>
>
aPanels
;
aPanels
.
swap
(
maPanels
);
for
(
auto
iPanel
(
aPanels
.
begin
()),
iEnd
(
aPanels
.
end
());
iPanel
!=
iEnd
;
++
iPanel
)
for
(
auto
iPanel
(
aPanels
.
begin
()),
iEnd
(
aPanels
.
end
());
iPanel
!=
iEnd
;
++
iPanel
)
{
UnregisterWindow
(
**
iPanel
);
if
((
*
iPanel
)
->
GetTitleBar
()
!=
NULL
)
...
...
@@ -84,11 +82,9 @@ void FocusManager::ClearPanels()
void
FocusManager
::
ClearButtons
()
{
::
std
::
vector
<
VclPtr
<
Button
>
>
aButtons
;
std
::
vector
<
VclPtr
<
Button
>
>
aButtons
;
aButtons
.
swap
(
maButtons
);
for
(
auto
iButton
(
aButtons
.
begin
()),
iEnd
(
aButtons
.
end
());
iButton
!=
iEnd
;
++
iButton
)
for
(
auto
iButton
=
aButtons
.
begin
();
iButton
!=
aButtons
.
end
();
++
iButton
)
{
UnregisterWindow
(
**
iButton
);
}
...
...
@@ -113,9 +109,7 @@ void FocusManager::SetDeckTitle (DeckTitleBar* pDeckTitleBar)
void
FocusManager
::
SetPanels
(
const
SharedPanelContainer
&
rPanels
)
{
ClearPanels
();
for
(
SharedPanelContainer
::
const_iterator
iPanel
(
rPanels
.
begin
()),
iEnd
(
rPanels
.
end
());
iPanel
!=
iEnd
;
++
iPanel
)
for
(
auto
iPanel
=
rPanels
.
begin
();
iPanel
!=
rPanels
.
end
();
++
iPanel
)
{
RegisterWindow
(
**
iPanel
);
if
((
*
iPanel
)
->
GetTitleBar
()
!=
NULL
)
...
...
@@ -134,9 +128,7 @@ void FocusManager::SetPanels (const SharedPanelContainer& rPanels)
void
FocusManager
::
SetButtons
(
const
::
std
::
vector
<
Button
*>&
rButtons
)
{
ClearButtons
();
for
(
::
std
::
vector
<
Button
*>::
const_iterator
iButton
(
rButtons
.
begin
()),
iEnd
(
rButtons
.
end
());
iButton
!=
iEnd
;
++
iButton
)
for
(
auto
iButton
=
rButtons
.
begin
();
iButton
!=
rButtons
.
end
();
++
iButton
)
{
RegisterWindow
(
**
iButton
);
maButtons
.
push_back
(
*
iButton
);
...
...
@@ -165,7 +157,7 @@ FocusManager::FocusLocation FocusManager::GetFocusLocation (const vcl::Window& r
}
// Search the panels.
for
(
s
al_Int32
nIndex
=
0
,
nCount
(
maPanels
.
size
());
nIndex
<
nCount
;
++
nIndex
)
for
(
s
ize_t
nIndex
=
0
;
nIndex
<
maPanels
.
size
()
;
++
nIndex
)
{
if
(
maPanels
[
nIndex
]
==
&
rWindow
)
return
FocusLocation
(
PC_PanelContent
,
nIndex
);
...
...
@@ -177,10 +169,11 @@ FocusManager::FocusLocation FocusManager::GetFocusLocation (const vcl::Window& r
}
// Search the buttons.
for
(
sal_Int32
nIndex
=
0
,
nCount
(
maButtons
.
size
());
nIndex
<
nCount
;
++
nIndex
)
for
(
size_t
nIndex
=
0
;
nIndex
<
maButtons
.
size
();
++
nIndex
)
{
if
(
maButtons
[
nIndex
]
==
&
rWindow
)
return
FocusLocation
(
PC_TabBar
,
nIndex
);
}
return
FocusLocation
(
PC_None
,
-
1
);
}
...
...
@@ -558,7 +551,7 @@ IMPL_LINK(FocusManager, ChildEventListener, VclSimpleEvent*, pEvent)
if
(
pEvent
==
NULL
)
return
0
;
if
(
!
pEvent
->
ISA
(
VclWindowEvent
))
if
(
!
pEvent
->
ISA
(
VclWindowEvent
))
return
0
;
VclWindowEvent
*
pWindowEvent
=
static_cast
<
VclWindowEvent
*>
(
pEvent
);
...
...
sfx2/source/sidebar/FocusManager.hxx
Dosyayı görüntüle @
5f8b294b
...
...
@@ -50,7 +50,7 @@ class DeckTitleBar;
class
FocusManager
{
public
:
FocusManager
(
const
::
boost
::
function
<
void
(
const
Panel
&
)
>&
rShowPanelFunctor
);
FocusManager
(
const
std
::
function
<
void
(
const
Panel
&
)
>&
rShowPanelFunctor
);
~
FocusManager
();
/** Forget all panels and buttons. Remove all window listeners.
...
...
@@ -63,15 +63,15 @@ public:
*/
void
GrabFocus
();
void
SetDeckTitle
(
DeckTitleBar
*
pDeckTitleBar
);
void
SetPanels
(
const
SharedPanelContainer
&
rPanels
);
void
SetButtons
(
const
::
std
::
vector
<
Button
*>&
rButtons
);
void
SetDeckTitle
(
DeckTitleBar
*
pDeckTitleBar
);
void
SetPanels
(
const
SharedPanelContainer
&
rPanels
);
void
SetButtons
(
const
::
std
::
vector
<
Button
*>&
rButtons
);
private
:
VclPtr
<
DeckTitleBar
>
mpDeckTitleBar
;
::
std
::
vector
<
VclPtr
<
Panel
>
>
maPanels
;
::
std
::
vector
<
VclPtr
<
Button
>
>
maButtons
;
const
::
boost
::
function
<
void
(
const
Panel
&
)
>
maShowPanelFunctor
;
std
::
vector
<
VclPtr
<
Panel
>
>
maPanels
;
std
::
vector
<
VclPtr
<
Button
>
>
maButtons
;
const
std
::
function
<
void
(
const
Panel
&
)
>
maShowPanelFunctor
;
bool
mbObservingContentControlFocus
;
VclPtr
<
vcl
::
Window
>
mpFirstFocusedContentControl
;
VclPtr
<
vcl
::
Window
>
mpLastFocusedWindow
;
...
...
@@ -91,7 +91,7 @@ private:
public
:
PanelComponent
meComponent
;
sal_Int32
mnIndex
;
FocusLocation
(
const
PanelComponent
eComponent
,
const
sal_Int32
nIndex
);
FocusLocation
(
const
PanelComponent
eComponent
,
const
sal_Int32
nIndex
);
};
/** Listen for key events for panels and buttons.
...
...
@@ -105,16 +105,16 @@ private:
/** Let the focus manager listen for window events for the given
window.
*/
void
RegisterWindow
(
vcl
::
Window
&
rWindow
);
void
UnregisterWindow
(
vcl
::
Window
&
rWindow
);
void
RegisterWindow
(
vcl
::
Window
&
rWindow
);
void
UnregisterWindow
(
vcl
::
Window
&
rWindow
);
/** Remove the window from the panel or the button container.
*/
void
RemoveWindow
(
vcl
::
Window
&
rWindow
);
void
RemoveWindow
(
vcl
::
Window
&
rWindow
);
void
FocusDeckTitle
();
bool
IsDeckTitleVisible
()
const
;
bool
IsPanelTitleVisible
(
const
sal_Int32
nPanelIndex
)
const
;
bool
IsPanelTitleVisible
(
const
sal_Int32
nPanelIndex
)
const
;
/** Set the focus to the title bar of the panel or, if the
title bar is not visible, directly to the panel.
...
...
@@ -125,25 +125,21 @@ private:
bias defines whether to focus the deck (true) or the panel
content (false) will be focused instead.
*/
void
FocusPanel
(
const
sal_Int32
nPanelIndex
,
const
bool
bFallbackToDeckTitle
);
void
FocusPanelContent
(
const
sal_Int32
nPanelIndex
);
void
FocusButton
(
const
sal_Int32
nButtonIndex
);
void
ClickButton
(
const
sal_Int32
nButtonIndex
);
bool
MoveFocusInsidePanel
(
const
FocusLocation
&
rLocation
,
const
sal_Int32
nDirection
);
bool
MoveFocusInsideDeckTitle
(
const
FocusLocation
&
rLocation
,
const
sal_Int32
nDirection
);
void
HandleKeyEvent
(
const
vcl
::
KeyCode
&
rKeyCode
,
const
vcl
::
Window
&
rWindow
);
FocusLocation
GetFocusLocation
(
const
vcl
::
Window
&
rWindow
)
const
;
void
FocusPanel
(
const
sal_Int32
nPanelIndex
,
const
bool
bFallbackToDeckTitle
);
void
FocusPanelContent
(
const
sal_Int32
nPanelIndex
);
void
FocusButton
(
const
sal_Int32
nButtonIndex
);
void
ClickButton
(
const
sal_Int32
nButtonIndex
);
bool
MoveFocusInsidePanel
(
const
FocusLocation
&
rLocation
,
const
sal_Int32
nDirection
);
bool
MoveFocusInsideDeckTitle
(
const
FocusLocation
&
rLocation
,
const
sal_Int32
nDirection
);
void
HandleKeyEvent
(
const
vcl
::
KeyCode
&
rKeyCode
,
const
vcl
::
Window
&
rWindow
);
FocusLocation
GetFocusLocation
(
const
vcl
::
Window
&
rWindow
)
const
;
};
...
...
sfx2/source/sidebar/Panel.cxx
Dosyayı görüntüle @
5f8b294b
...
...
@@ -46,17 +46,17 @@ namespace sfx2 { namespace sidebar {
Panel
::
Panel
(
const
PanelDescriptor
&
rPanelDescriptor
,
vcl
::
Window
*
pParentWindow
,
const
bool
bIsInitiallyExpanded
,
const
boost
::
function
<
void
()
>&
rDeckLayoutTrigger
,
const
boost
::
function
<
Context
()
>&
rContextAccess
)
:
Window
(
pParentWindow
)
,
msPanelId
(
rPanelDescriptor
.
msId
),
mpTitleBar
(
VclPtr
<
PanelTitleBar
>::
Create
(
rPanelDescriptor
.
msTitle
,
pParentWindow
,
this
)),
mbIsTitleBarOptional
(
rPanelDescriptor
.
mbIsTitleBarOptional
),
mxElement
(),
mxPanelComponent
(),
mbIsExpanded
(
bIsInitiallyExpanded
),
maDeckLayoutTrigger
(
rDeckLayoutTrigger
),
maContextAccess
(
rContextAccess
)
const
std
::
function
<
void
()
>&
rDeckLayoutTrigger
,
const
std
::
function
<
Context
()
>&
rContextAccess
)
:
Window
(
pParentWindow
)
,
msPanelId
(
rPanelDescriptor
.
msId
)
,
mpTitleBar
(
VclPtr
<
PanelTitleBar
>::
Create
(
rPanelDescriptor
.
msTitle
,
pParentWindow
,
this
))
,
mbIsTitleBarOptional
(
rPanelDescriptor
.
mbIsTitleBarOptional
)
,
mxElement
()
,
mxPanelComponent
()
,
mbIsExpanded
(
bIsInitiallyExpanded
)
,
maDeckLayoutTrigger
(
rDeckLayoutTrigger
)
,
maContextAccess
(
rContextAccess
)
{
SetBackground
(
Theme
::
GetPaint
(
Theme
::
Paint_PanelBackground
).
GetWallpaper
());
...
...
@@ -114,14 +114,16 @@ void Panel::SetExpanded (const bool bIsExpanded)
maDeckLayoutTrigger
();
if
(
maContextAccess
)
{
ResourceManager
::
Instance
().
StorePanelExpansionState
(
msPanelId
,
bIsExpanded
,
maContextAccess
());
}
}
}
bool
Panel
::
HasIdPredicate
(
const
::
rtl
::
OUString
&
rsId
)
const
bool
Panel
::
HasIdPredicate
(
const
OUString
&
rsId
)
const
{
return
msPanelId
.
equals
(
rsId
);
}
...
...
@@ -140,8 +142,8 @@ void Panel::Resize()
if
(
xElementWindow
.
is
())
{
const
Size
aSize
(
GetSizePixel
());
xElementWindow
->
setPosSize
(
0
,
0
,
aSize
.
Width
(),
aSize
.
Height
(),
awt
::
PosSize
::
POSSIZE
);
xElementWindow
->
setPosSize
(
0
,
0
,
aSize
.
Width
(),
aSize
.
Height
(),
awt
::
PosSize
::
POSSIZE
);
}
}
...
...
sfx2/source/sidebar/Panel.hxx
Dosyayı görüntüle @
5f8b294b
...
...
@@ -25,7 +25,6 @@
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/ui/XSidebarPanel.hpp>
#include <boost/function.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <vector>
...
...
@@ -36,16 +35,12 @@ class PanelDescriptor;
class
TitleBar
;
class
PanelTitleBar
;
class
Panel
:
public
vcl
::
Window
class
Panel
:
public
vcl
::
Window
{
public
:
Panel
(
const
PanelDescriptor
&
rPanelDescriptor
,
vcl
::
Window
*
pParentWindow
,
const
bool
bIsInitiallyExpanded
,
const
::
boost
::
function
<
void
()
>&
rDeckLayoutTrigger
,
const
::
boost
::
function
<
Context
()
>&
rContextAccess
);
Panel
(
const
PanelDescriptor
&
rPanelDescriptor
,
vcl
::
Window
*
pParentWindow
,
const
bool
bIsInitiallyExpanded
,
const
std
::
function
<
void
()
>&
rDeckLayoutTrigger
,
const
std
::
function
<
Context
()
>&
rContextAccess
);
virtual
~
Panel
();
virtual
void
dispose
()
SAL_OVERRIDE
;
...
...
@@ -56,8 +51,8 @@ public:
css
::
uno
::
Reference
<
css
::
awt
::
XWindow
>
GetElementWindow
();
void
SetExpanded
(
const
bool
bIsExpanded
);
bool
IsExpanded
()
const
{
return
mbIsExpanded
;}
bool
HasIdPredicate
(
const
::
rtl
::
OUString
&
rsId
)
const
;
const
::
rtl
::
OUString
&
GetId
()
const
{
return
msPanelId
;}
bool
HasIdPredicate
(
const
OUString
&
rsId
)
const
;
const
OUString
&
GetId
()
const
{
return
msPanelId
;}
virtual
void
Paint
(
vcl
::
RenderContext
&
rRenderContext
,
const
Rectangle
&
rUpdateArea
)
SAL_OVERRIDE
;
virtual
void
Resize
()
SAL_OVERRIDE
;
...
...
@@ -65,16 +60,16 @@ public:
virtual
void
Activate
()
SAL_OVERRIDE
;
private
:
const
::
rtl
::
OUString
msPanelId
;
const
OUString
msPanelId
;
VclPtr
<
PanelTitleBar
>
mpTitleBar
;
const
bool
mbIsTitleBarOptional
;
css
::
uno
::
Reference
<
css
::
ui
::
XUIElement
>
mxElement
;
css
::
uno
::
Reference
<
css
::
ui
::
XSidebarPanel
>
mxPanelComponent
;
bool
mbIsExpanded
;
const
::
boost
::
function
<
void
()
>
maDeckLayoutTrigger
;
const
::
boost
::
function
<
Context
()
>
maContextAccess
;
const
std
::
function
<
void
()
>
maDeckLayoutTrigger
;
const
std
::
function
<
Context
()
>
maContextAccess
;
};
typedef
::
std
::
vector
<
VclPtr
<
Panel
>
>
SharedPanelContainer
;
typedef
std
::
vector
<
VclPtr
<
Panel
>
>
SharedPanelContainer
;
}
}
// end of namespace sfx2::sidebar
...
...
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