From 6b2736fed5bb3c5e7949be2baa4a50c9a9c9b3e2 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 8 Oct 2010 11:48:35 +0200 Subject: vcl116: #i114958# implement DBG_TESTSOALRMUTEX on all platforms --- vcl/unx/headless/svpinst.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'vcl/unx/headless/svpinst.cxx') diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index 5c3be54f9ddc..5f94a7ebf375 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -327,6 +327,19 @@ void SvpSalInstance::AcquireYieldMutex( ULONG nCount ) } } +bool SvpSalInstance::CheckYieldMutex() +{ + bool bRet = true; + + if ( m_aYieldMutex.GetThreadId() != + vos::OThread::getCurrentIdentifier() ) + { + bRet = false; + } + + return bRet; +} + void SvpSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) { // first, check for already queued events. -- cgit v1.2.3 From 95433a2374cae162aa2856b7c52a76d44ebd4509 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 8 Oct 2010 17:33:55 +0200 Subject: vcl116: #i114993# fix assertion, native menu cleanup --- vcl/aqua/inc/salinst.h | 2 +- vcl/aqua/source/window/salmenu.cxx | 3 +- vcl/inc/vcl/salinst.hxx | 9 +-- vcl/os2/inc/salinst.h | 4 -- vcl/os2/source/window/makefile.mk | 2 +- vcl/os2/source/window/salmenu.cxx | 132 ------------------------------------- vcl/source/app/salvtables.cxx | 21 ++++++ vcl/source/window/menu.cxx | 2 +- vcl/unx/headless/svpinst.cxx | 18 ----- vcl/unx/headless/svpinst.hxx | 6 -- vcl/unx/inc/salinst.h | 4 -- vcl/unx/source/window/makefile.mk | 2 +- vcl/unx/source/window/salmenu.cxx | 132 ------------------------------------- vcl/win/inc/salinst.h | 2 +- vcl/win/source/window/salmenu.cxx | 2 +- 15 files changed, 34 insertions(+), 307 deletions(-) delete mode 100644 vcl/os2/source/window/salmenu.cxx delete mode 100644 vcl/unx/source/window/salmenu.cxx mode change 100644 => 100755 vcl/win/inc/salinst.h mode change 100644 => 100755 vcl/win/source/window/salmenu.cxx (limited to 'vcl/unx/headless/svpinst.cxx') diff --git a/vcl/aqua/inc/salinst.h b/vcl/aqua/inc/salinst.h index 2d42925fc2fd..4b0385844eed 100644 --- a/vcl/aqua/inc/salinst.h +++ b/vcl/aqua/inc/salinst.h @@ -137,7 +137,7 @@ public: virtual bool CheckYieldMutex(); virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); virtual bool AnyInput( USHORT nType ); - virtual SalMenu* CreateMenu( BOOL bMenuBar ); + virtual SalMenu* CreateMenu( BOOL bMenuBar, Menu* pVCLMenu ); virtual void DestroyMenu( SalMenu* ); virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); virtual void DestroyMenuItem( SalMenuItem* ); diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx index ed3086d8506f..139f875dcb55 100644 --- a/vcl/aqua/source/window/salmenu.cxx +++ b/vcl/aqua/source/window/salmenu.cxx @@ -203,11 +203,12 @@ static void initAppMenu() // ======================================================================= -SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar ) +SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar, Menu* pVCLMenu ) { initAppMenu(); AquaSalMenu *pAquaSalMenu = new AquaSalMenu( bMenuBar ); + pAquaSalMenu->mpVCLMenu = pVCLMenu; return pAquaSalMenu; } diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx index 026e6264a27c..71b820803473 100644 --- a/vcl/inc/vcl/salinst.hxx +++ b/vcl/inc/vcl/salinst.hxx @@ -60,6 +60,7 @@ struct SalItemParams; class SalSession; struct SystemGraphicsData; struct SystemWindowData; +class Menu; namespace vos { class IMutex; } @@ -143,10 +144,10 @@ public: virtual bool AnyInput( USHORT nType ) = 0; // Menues - virtual SalMenu* CreateMenu( BOOL bMenuBar ) = 0; - virtual void DestroyMenu( SalMenu* pMenu) = 0; - virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) = 0; - virtual void DestroyMenuItem( SalMenuItem* pItem ) = 0; + virtual SalMenu* CreateMenu( BOOL bMenuBar, Menu* pMenu ); + virtual void DestroyMenu( SalMenu* pMenu); + virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); + virtual void DestroyMenuItem( SalMenuItem* pItem ); // may return NULL to disable session management virtual SalSession* CreateSalSession() = 0; diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h index 536712d37836..7826a62e1f9b 100644 --- a/vcl/os2/inc/salinst.h +++ b/vcl/os2/inc/salinst.h @@ -88,10 +88,6 @@ public: virtual bool CheckYieldMutex(); virtual void Yield( bool, bool ); virtual bool AnyInput( USHORT nType ); - virtual SalMenu* CreateMenu( BOOL bMenuBar ); - virtual void DestroyMenu( SalMenu* ); - virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); - virtual void DestroyMenuItem( SalMenuItem* ); virtual SalSession* CreateSalSession(); virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); diff --git a/vcl/os2/source/window/makefile.mk b/vcl/os2/source/window/makefile.mk index f4a6ad0cb870..560d35880b21 100644 --- a/vcl/os2/source/window/makefile.mk +++ b/vcl/os2/source/window/makefile.mk @@ -40,7 +40,7 @@ CXXFILES__YD= salframe.cxx \ salobj.cxx SLOFILES= $(SLO)$/salframe.obj \ - $(SLO)$/salobj.obj $(SLO)$/salmenu.obj + $(SLO)$/salobj.obj # --- Targets ------------------------------------------------------ diff --git a/vcl/os2/source/window/salmenu.cxx b/vcl/os2/source/window/salmenu.cxx deleted file mode 100644 index 339ab5dbfadb..000000000000 --- a/vcl/os2/source/window/salmenu.cxx +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define INCL_DOS -#define INCL_PM -#define INCL_WIN -#include -#include -#include -#include - - -// ======================================================================= - -// Os2SalInst factory methods - -SalMenu* Os2SalInstance::CreateMenu( BOOL bMenuBar ) -{ - return NULL; // no support for native menues -} - -void Os2SalInstance::DestroyMenu( SalMenu* pSalMenu ) -{ - delete pSalMenu; -} - - -SalMenuItem* Os2SalInstance::CreateMenuItem( const SalItemParams* pItemData ) -{ - return NULL; // no support for native menues -} - -void Os2SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem ) -{ - delete pSalMenuItem; -} - - -// ======================================================================= - - -/* - * Os2SalMenu - */ - - -Os2SalMenu::~Os2SalMenu() -{ -} - -BOOL Os2SalMenu::VisibleMenuBar() -{ - return FALSE; -} - -void Os2SalMenu::SetFrame( const SalFrame *pFrame ) -{ -} - -void Os2SalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) -{ -} - -void Os2SalMenu::RemoveItem( unsigned nPos ) -{ -} - -void Os2SalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) -{ -} - -void Os2SalMenu::CheckItem( unsigned nPos, BOOL bCheck ) -{ -} - -void Os2SalMenu::EnableItem( unsigned nPos, BOOL bEnable ) -{ -} - -void Os2SalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) -{ -} - -void Os2SalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText ) -{ -} - -void Os2SalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName ) -{ -} - -void Os2SalMenu::GetSystemMenuData( SystemMenuData* pData ) -{ -} - -// ======================================================================= - -/* - * SalMenuItem - */ - - -Os2SalMenuItem::~Os2SalMenuItem() -{ -} - -// ------------------------------------------------------------------- - diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 9a2404d36740..35f5599d5e55 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -74,6 +74,27 @@ void SalInstance::FillFontPathList( std::list< rtl::OString >& ) // do nothing } +SalMenu* SalInstance::CreateMenu( BOOL, Menu* ) +{ + // default: no native menus + return NULL; +} + +void SalInstance::DestroyMenu( SalMenu* pMenu ) +{ + OSL_ENSURE( pMenu == 0, "DestroyMenu called with non-native menus" ); +} + +SalMenuItem* SalInstance::CreateMenuItem( const SalItemParams* ) +{ + return NULL; +} + +void SalInstance::DestroyMenuItem( SalMenuItem* pItem ) +{ + OSL_ENSURE( pItem == 0, "DestroyMenu called with non-native menus" ); +} + SalTimer::~SalTimer() { } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index e77eacb2fddf..bf0a9c45845d 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -980,7 +980,7 @@ void Menu::ImplInit() mpLayoutData = NULL; mpFirstDel = NULL; // Dtor notification list // Native-support: returns NULL if not supported - mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar ); + mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar, this ); } Menu* Menu::ImplGetStartedFrom() const diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index 5f94a7ebf375..fc788b2a0530 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -432,24 +432,6 @@ bool SvpSalInstance::AnyInput( USHORT nType ) return false; } -SalMenu* SvpSalInstance::CreateMenu( BOOL ) -{ - return NULL; -} - -void SvpSalInstance::DestroyMenu( SalMenu* ) -{ -} - -SalMenuItem* SvpSalInstance::CreateMenuItem( const SalItemParams* ) -{ - return NULL; -} - -void SvpSalInstance::DestroyMenuItem( SalMenuItem* ) -{ -} - SalSession* SvpSalInstance::CreateSalSession() { return NULL; diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx index bf323e6e0317..02d5e3fa9494 100644 --- a/vcl/unx/headless/svpinst.hxx +++ b/vcl/unx/headless/svpinst.hxx @@ -184,12 +184,6 @@ public: virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); virtual bool AnyInput( USHORT nType ); - // Menues - virtual SalMenu* CreateMenu( BOOL bMenuBar ); - virtual void DestroyMenu( SalMenu* pMenu); - virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); - virtual void DestroyMenuItem( SalMenuItem* pItem ); - // may return NULL to disable session management virtual SalSession* CreateSalSession(); diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h index 69e7c21fd923..133f0bf6037f 100644 --- a/vcl/unx/inc/salinst.h +++ b/vcl/unx/inc/salinst.h @@ -106,10 +106,6 @@ public: virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); virtual bool AnyInput( USHORT nType ); - virtual SalMenu* CreateMenu( BOOL bMenuBar ); - virtual void DestroyMenu( SalMenu* pMenu); - virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); - virtual void DestroyMenuItem( SalMenuItem* pItem ); virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); void FillFontPathList( std::list< rtl::OString >& o_rFontPaths ); diff --git a/vcl/unx/source/window/makefile.mk b/vcl/unx/source/window/makefile.mk index 808b712903f3..c5cd95ba6b1c 100644 --- a/vcl/unx/source/window/makefile.mk +++ b/vcl/unx/source/window/makefile.mk @@ -48,7 +48,7 @@ dummy: .ELSE # "$(GUIBASE)"!="unx" SLOFILES= \ - $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj $(SLO)/salmenu.obj + $(SLO)/FWS.obj $(SLO)/salframe.obj $(SLO)/salobj.obj .ENDIF # "$(GUIBASE)"!="unx" diff --git a/vcl/unx/source/window/salmenu.cxx b/vcl/unx/source/window/salmenu.cxx deleted file mode 100644 index 0739b6cd5352..000000000000 --- a/vcl/unx/source/window/salmenu.cxx +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" - - -#include -#include -#include - - -// ======================================================================= - -// X11SalInst factory methods - -SalMenu* X11SalInstance::CreateMenu( BOOL /*bMenuBar*/ ) -{ - return NULL; // no support for native menues -} - -void X11SalInstance::DestroyMenu( SalMenu* pSalMenu ) -{ - delete pSalMenu; -} - - -SalMenuItem* X11SalInstance::CreateMenuItem( const SalItemParams* ) -{ - return NULL; // no support for native menues -} - -void X11SalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem ) -{ - delete pSalMenuItem; -} - - -// ======================================================================= - - -/* - * X11SalMenu - */ - - -X11SalMenu::~X11SalMenu() -{ -} - -BOOL X11SalMenu::VisibleMenuBar() -{ - return FALSE; -} - -void X11SalMenu::SetFrame( const SalFrame* ) -{ -} - -void X11SalMenu::InsertItem( SalMenuItem*, unsigned ) -{ -} - -void X11SalMenu::RemoveItem( unsigned ) -{ -} - -void X11SalMenu::SetSubMenu( SalMenuItem*, SalMenu*, unsigned ) -{ -} - -void X11SalMenu::CheckItem( unsigned, BOOL ) -{ -} - -void X11SalMenu::EnableItem( unsigned, BOOL ) -{ -} - -void X11SalMenu::SetItemImage( unsigned, SalMenuItem*, const Image& ) -{ -} - -void X11SalMenu::SetItemText( unsigned, SalMenuItem*, const XubString& ) -{ -} - -void X11SalMenu::SetAccelerator( unsigned, SalMenuItem*, const KeyCode&, const XubString& ) -{ -} - -void X11SalMenu::GetSystemMenuData( SystemMenuData* ) -{ -} - -// ======================================================================= - -/* - * SalMenuItem - */ - - -X11SalMenuItem::~X11SalMenuItem() -{ -} - -// ------------------------------------------------------------------- - diff --git a/vcl/win/inc/salinst.h b/vcl/win/inc/salinst.h old mode 100644 new mode 100755 index 95aad02b3678..1ab59f8f7f9f --- a/vcl/win/inc/salinst.h +++ b/vcl/win/inc/salinst.h @@ -81,7 +81,7 @@ public: virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); virtual bool AnyInput( USHORT nType ); - virtual SalMenu* CreateMenu( BOOL bMenuBar ); + virtual SalMenu* CreateMenu( BOOL bMenuBar, Menu* ); virtual void DestroyMenu( SalMenu* ); virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); virtual void DestroyMenuItem( SalMenuItem* ); diff --git a/vcl/win/source/window/salmenu.cxx b/vcl/win/source/window/salmenu.cxx old mode 100644 new mode 100755 index 1eb75969ea38..47da911b012e --- a/vcl/win/source/window/salmenu.cxx +++ b/vcl/win/source/window/salmenu.cxx @@ -59,7 +59,7 @@ BOOL SalData::IsKnownMenuHandle( HMENU hMenu ) // WinSalInst factory methods -SalMenu* WinSalInstance::CreateMenu( BOOL bMenuBar ) +SalMenu* WinSalInstance::CreateMenu( BOOL bMenuBar, Menu* ) { WinSalMenu *pSalMenu = new WinSalMenu(); -- cgit v1.2.3