[Libreoffice-commits] core.git: include/vcl vcl/source
Stephan Bergmann
sbergman at redhat.com
Wed Aug 26 23:45:11 PDT 2015
include/vcl/menu.hxx | 6 +++---
vcl/source/window/menu.cxx | 30 +++++++++++++++---------------
vcl/source/window/menubarwindow.hxx | 36 ++++++++++++++++++------------------
vcl/source/window/menuwindow.hxx | 30 ------------------------------
4 files changed, 36 insertions(+), 66 deletions(-)
New commits:
commit a519c883e97e35f4d11567d55ecd45837f25aa4e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Aug 27 08:44:25 2015 +0200
No need for IMenuBarWindow abstraction
Change-Id: I5be4cfb951100d36054e409043cb9becbe52338d
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 6fc495f..e6109db 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -48,7 +48,7 @@ class CommandEvent;
class MenuFloatingWindow;
namespace vcl { class Window; }
class SalMenu;
-class IMenuBarWindow;
+class MenuBarWindow;
struct SystemMenuData;
enum class FloatWinPopupFlags;
@@ -434,8 +434,8 @@ class VCL_DLLPUBLIC MenuBar : public Menu
protected:
- /// Return the IMenuBarWindow interface.
- IMenuBarWindow* getMenuBarWindow();
+ /// Return the MenuBarWindow.
+ MenuBarWindow* getMenuBarWindow();
public:
MenuBar();
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 62ec00b..5bad674 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2459,12 +2459,12 @@ void Menu::HighlightItem( sal_uInt16 nItemPos )
}
// - MenuBar -
-IMenuBarWindow* MenuBar::getMenuBarWindow()
+MenuBarWindow* MenuBar::getMenuBarWindow()
{
// so far just a dynamic_cast, hopefully to be turned into something saner
// at some stage
- IMenuBarWindow *pWin = dynamic_cast<IMenuBarWindow*>(pWindow.get());
- //either there is no window (fdo#87663) or it is an IMenuBarWindow
+ MenuBarWindow *pWin = dynamic_cast<MenuBarWindow*>(pWindow.get());
+ //either there is no window (fdo#87663) or it is a MenuBarWindow
assert(!pWindow || pWin);
return pWin;
}
@@ -2497,7 +2497,7 @@ MenuBar::~MenuBar()
void MenuBar::ClosePopup(Menu *pMenu)
{
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
if (!pMenuWin)
return;
pMenuWin->PopupClosed(pMenu);
@@ -2505,7 +2505,7 @@ void MenuBar::ClosePopup(Menu *pMenu)
sal_uLong MenuBar::DeactivateMenuBar(sal_uLong nFocusId)
{
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
nFocusId = pMenuWin ? pMenuWin->GetFocusId() : 0;
if (nFocusId)
{
@@ -2535,7 +2535,7 @@ void MenuBar::ShowButtons( bool bClose, bool bFloat, bool bHide )
mbCloseBtnVisible = bClose;
mbFloatBtnVisible = bFloat;
mbHideBtnVisible = bHide;
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
if (pMenuWin)
pMenuWin->ShowButtons(bClose, bFloat, bHide);
}
@@ -2546,7 +2546,7 @@ void MenuBar::SetDisplayable( bool bDisplayable )
if( bDisplayable != mbDisplayable )
{
mbDisplayable = bDisplayable;
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
if (pMenuWin)
pMenuWin->LayoutChanged();
}
@@ -2581,7 +2581,7 @@ void MenuBar::ImplDestroy( MenuBar* pMenu, bool bDelete )
vcl::Window *pWindow = pMenu->ImplGetWindow();
if (pWindow && bDelete)
{
- IMenuBarWindow* pMenuWin = pMenu->getMenuBarWindow();
+ MenuBarWindow* pMenuWin = pMenu->getMenuBarWindow();
if (pMenuWin)
pMenuWin->KillActivePopup();
pWindow->disposeOnce();
@@ -2602,7 +2602,7 @@ bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu )
vcl::Window* pWin = ImplGetWindow();
if (pWin && pWin->IsEnabled() && pWin->IsInputEnabled() && !pWin->IsInModalMode())
{
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
bDone = pMenuWin && pMenuWin->HandleKeyEvent(rKEvent, bFromMenu);
}
return bDone;
@@ -2646,7 +2646,7 @@ void MenuBar::SelectItem(sal_uInt16 nId)
pWindow->GrabFocus();
nId = GetItemPos( nId );
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
if (pMenuWin)
{
// #99705# popup the selected menu
@@ -2736,13 +2736,13 @@ bool MenuBar::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventId )
sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link<>& i_rLink, const OUString& i_rToolTip )
{
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
return pMenuWin ? pMenuWin->AddMenuBarButton(i_rImage, i_rLink, i_rToolTip) : 0;
}
void MenuBar::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link<>& rLink )
{
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
if (!pMenuWin)
return;
pMenuWin->SetMenuBarButtonHighlightHdl(nId, rLink);
@@ -2750,13 +2750,13 @@ void MenuBar::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link<>& rLink
Rectangle MenuBar::GetMenuBarButtonRectPixel( sal_uInt16 nId )
{
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
return pMenuWin ? pMenuWin->GetMenuBarButtonRectPixel(nId) : Rectangle();
}
void MenuBar::RemoveMenuBarButton( sal_uInt16 nId )
{
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
if (!pMenuWin)
return;
pMenuWin->RemoveMenuBarButton(nId);
@@ -2764,7 +2764,7 @@ void MenuBar::RemoveMenuBarButton( sal_uInt16 nId )
bool MenuBar::HandleMenuButtonEvent( Menu *, sal_uInt16 i_nButtonId )
{
- IMenuBarWindow* pMenuWin = getMenuBarWindow();
+ MenuBarWindow* pMenuWin = getMenuBarWindow();
return pMenuWin && pMenuWin->HandleMenuButtonEvent(i_nButtonId);
}
diff --git a/vcl/source/window/menubarwindow.hxx b/vcl/source/window/menubarwindow.hxx
index 781ab5c..7004066 100644
--- a/vcl/source/window/menubarwindow.hxx
+++ b/vcl/source/window/menubarwindow.hxx
@@ -59,7 +59,7 @@ public:
/** Class that implements the actual window of the menu bar.
*/
-class MenuBarWindow : public vcl::Window, public IMenuBarWindow
+class MenuBarWindow : public vcl::Window, public MenuWindow
{
friend class MenuBar;
friend class Menu;
@@ -92,11 +92,11 @@ private:
std::map< sal_uInt16, AddButtonEntry > m_aAddButtons;
void HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos, bool bHighlight);
- virtual void ChangeHighlightItem(sal_uInt16 n, bool bSelectPopupEntry, bool bAllowRestoreFocus = true, bool bDefaultToDocument = true) SAL_OVERRIDE;
+ void ChangeHighlightItem(sal_uInt16 n, bool bSelectPopupEntry, bool bAllowRestoreFocus = true, bool bDefaultToDocument = true);
sal_uInt16 ImplFindEntry( const Point& rMousePos ) const;
void ImplCreatePopup( bool bPreSelectFirst );
- virtual bool HandleKeyEvent(const KeyEvent& rKEvent, bool bFromMenu = true) SAL_OVERRIDE;
+ bool HandleKeyEvent(const KeyEvent& rKEvent, bool bFromMenu = true);
Rectangle ImplGetItemRect( sal_uInt16 nPos );
void ImplInitStyleSettings();
@@ -119,7 +119,7 @@ public:
virtual ~MenuBarWindow();
virtual void dispose() SAL_OVERRIDE;
- virtual void ShowButtons(bool bClose, bool bFloat, bool bHide) SAL_OVERRIDE;
+ void ShowButtons(bool bClose, bool bFloat, bool bHide);
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -129,26 +129,26 @@ public:
virtual void Resize() SAL_OVERRIDE;
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
- virtual void SetFocusId(sal_uLong nId) SAL_OVERRIDE { nSaveFocusId = nId; }
- virtual sal_uLong GetFocusId() const SAL_OVERRIDE { return nSaveFocusId; }
+ void SetFocusId(sal_uLong nId) { nSaveFocusId = nId; }
+ sal_uLong GetFocusId() const { return nSaveFocusId; }
- virtual void SetMenu(MenuBar* pMenu) SAL_OVERRIDE;
- virtual void SetHeight(long nHeight) SAL_OVERRIDE;
- virtual void KillActivePopup() SAL_OVERRIDE;
- virtual void PopupClosed(Menu* pMenu) SAL_OVERRIDE;
- virtual sal_uInt16 GetHighlightedItem() const SAL_OVERRIDE { return nHighlightedItem; }
+ void SetMenu(MenuBar* pMenu);
+ void SetHeight(long nHeight);
+ void KillActivePopup();
+ void PopupClosed(Menu* pMenu);
+ sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; }
virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() SAL_OVERRIDE;
- virtual void SetAutoPopup(bool bAuto) SAL_OVERRIDE { mbAutoPopup = bAuto; }
- virtual void LayoutChanged() SAL_OVERRIDE;
+ void SetAutoPopup(bool bAuto) { mbAutoPopup = bAuto; }
+ void LayoutChanged();
Size MinCloseButtonSize();
/// Add an arbitrary button to the menubar that will appear next to the close button.
- virtual sal_uInt16 AddMenuBarButton(const Image&, const Link<>&, const OUString&) SAL_OVERRIDE;
- virtual void SetMenuBarButtonHighlightHdl(sal_uInt16 nId, const Link<>&) SAL_OVERRIDE;
- virtual Rectangle GetMenuBarButtonRectPixel(sal_uInt16 nId) SAL_OVERRIDE;
- virtual void RemoveMenuBarButton(sal_uInt16 nId) SAL_OVERRIDE;
- virtual bool HandleMenuButtonEvent(sal_uInt16 i_nButtonId) SAL_OVERRIDE;
+ sal_uInt16 AddMenuBarButton(const Image&, const Link<>&, const OUString&);
+ void SetMenuBarButtonHighlightHdl(sal_uInt16 nId, const Link<>&);
+ Rectangle GetMenuBarButtonRectPixel(sal_uInt16 nId);
+ void RemoveMenuBarButton(sal_uInt16 nId);
+ bool HandleMenuButtonEvent(sal_uInt16 i_nButtonId);
virtual void SetMBWHideAccel (bool val) { mbHideAccel = val; }
virtual bool GetMBWHideAccel (void) const { return mbHideAccel; }
virtual void SetMBWMenuKey (bool val) { mbMenuKey = val; }
diff --git a/vcl/source/window/menuwindow.hxx b/vcl/source/window/menuwindow.hxx
index 7513f70..986b888 100644
--- a/vcl/source/window/menuwindow.hxx
+++ b/vcl/source/window/menuwindow.hxx
@@ -58,35 +58,5 @@ public:
const HelpEvent& rHEvt, const Rectangle &rHighlightRect);
};
-/// Interface for the MenuBarWindow functionality.
-class IMenuBarWindow : public MenuWindow
-{
-public:
- virtual ~IMenuBarWindow() {}
-
- virtual sal_uLong GetFocusId() const = 0;
- virtual void SetFocusId(sal_uLong nId) = 0;
-
- virtual bool HandleKeyEvent(const KeyEvent& rKEvent, bool bFromMenu = true) = 0;
- virtual void LayoutChanged() = 0;
- virtual void PopupClosed(Menu* pMenu) = 0;
- virtual void ShowButtons(bool bClose, bool bFloat, bool bHide) = 0;
-
- virtual void ChangeHighlightItem(sal_uInt16 n, bool bSelectPopupEntry, bool bAllowRestoreFocus = true, bool bDefaultToDocument = true ) = 0;
- virtual sal_uInt16 GetHighlightedItem() const = 0;
-
- virtual void SetAutoPopup(bool bAuto) = 0;
- virtual void SetMenu(MenuBar* pMenu) = 0;
- virtual void SetHeight(long nHeight) = 0;
- virtual void KillActivePopup() = 0;
-
- /// Add an arbitrary button to the menubar that will appear next to the close button.
- virtual sal_uInt16 AddMenuBarButton(const Image&, const Link<>&, const OUString&) = 0;
- virtual void SetMenuBarButtonHighlightHdl(sal_uInt16 nId, const Link<>&) = 0;
- virtual Rectangle GetMenuBarButtonRectPixel(sal_uInt16 nId) = 0;
- virtual void RemoveMenuBarButton(sal_uInt16 nId) = 0;
- virtual bool HandleMenuButtonEvent(sal_uInt16 i_nButtonId) = 0;
-};
-
#endif // INCLUDED_VCL_SOURCE_WINDOW_MENUWINDOW_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list