diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/IwyuFilter_vcl.yaml | 4 | ||||
-rw-r--r-- | vcl/commonfuzzer.mk | 1 | ||||
-rw-r--r-- | vcl/headless/svpframe.cxx | 70 | ||||
-rw-r--r-- | vcl/inc/win/salinst.h | 9 | ||||
-rw-r--r-- | vcl/jsdialog/enabled.cxx | 1 | ||||
-rw-r--r-- | vcl/osx/DropTarget.cxx | 3 | ||||
-rw-r--r-- | vcl/osx/PictToBmpFlt.cxx | 4 | ||||
-rw-r--r-- | vcl/osx/cuidraw.hxx | 2 | ||||
-rw-r--r-- | vcl/osx/vclnsapp.mm | 1 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmap.cxx | 38 | ||||
-rw-r--r-- | vcl/source/control/calendar.cxx | 30 | ||||
-rw-r--r-- | vcl/unx/gtk4/gtkaccessibletext.cxx | 46 | ||||
-rw-r--r-- | vcl/win/app/salinst.cxx | 28 | ||||
-rw-r--r-- | vcl/win/window/salframe.cxx | 32 |
14 files changed, 218 insertions, 51 deletions
diff --git a/vcl/IwyuFilter_vcl.yaml b/vcl/IwyuFilter_vcl.yaml index e4ca77d19f60..4d7da7da1c9e 100644 --- a/vcl/IwyuFilter_vcl.yaml +++ b/vcl/IwyuFilter_vcl.yaml @@ -43,10 +43,6 @@ excludelist: vcl/source/app/svmain.cxx: # Needed on WIN32 - desktop/exithelper.h - vcl/source/components/factory.cxx: - # Actually these are used - - com/sun/star/lang/XMultiServiceFactory.hpp - - com/sun/star/lang/XSingleServiceFactory.hpp vcl/source/filter/FilterConfigItem.cxx: # Needed for direct member access - com/sun/star/task/XStatusIndicator.hpp diff --git a/vcl/commonfuzzer.mk b/vcl/commonfuzzer.mk index a1df43ab435d..0892fbb5891a 100644 --- a/vcl/commonfuzzer.mk +++ b/vcl/commonfuzzer.mk @@ -16,7 +16,6 @@ fuzzer_externals = \ boost_filesystem \ boost_iostreams \ curl \ - dtoa \ harfbuzz \ graphite \ cairo \ diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 00672935d256..555e15ea31b3 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -387,9 +387,75 @@ void SvpSalFrame::EndExtTextInput( EndExtTextInputFlags ) { } -OUString SvpSalFrame::GetKeyName( sal_uInt16 ) +OUString SvpSalFrame::GetKeyName(sal_uInt16 nKeyCode) { - return OUString(); + // Skip key combinations with any modifiers that we don’t support + if ((nKeyCode & KEY_MODIFIERS_MASK & ~(KEY_SHIFT | KEY_MOD1 | KEY_MOD2)) != 0) + return OUString(); + + OUStringBuffer aResult; + + if ((nKeyCode & KEY_MOD1) != 0) + aResult.append("Ctrl+"); + if ((nKeyCode & KEY_MOD2) != 0) + aResult.append("Alt+"); + if ((nKeyCode & KEY_SHIFT) != 0) + aResult.append("Shift+"); + + static const struct + { + sal_uInt16 code; + const char* name; + } keyMap[] = { + { KEY_DOWN, "Down" }, + { KEY_UP, "Up" }, + { KEY_LEFT, "Left" }, + { KEY_RIGHT, "Right" }, + { KEY_HOME, "Home" }, + { KEY_END, "End" }, + { KEY_PAGEUP, "PgUp" }, + { KEY_PAGEDOWN, "PgDown" }, + { KEY_RETURN, "Ret" }, + { KEY_ESCAPE, "Esc" }, + { KEY_TAB, "Tab" }, + { KEY_BACKSPACE, "BkSpace" }, + { KEY_SPACE, "Space" }, + { KEY_DELETE, "Del" }, + { KEY_ADD, "+" }, + { KEY_SUBTRACT, "-" }, + { KEY_DIVIDE, "/" }, + { KEY_MULTIPLY, "*" }, + { KEY_POINT, "." }, + { KEY_COMMA, "," }, + { KEY_LESS, "<" }, + { KEY_GREATER, ">" }, + { KEY_EQUAL, "=" }, + { KEY_TILDE, "~" }, + { KEY_BRACKETLEFT, "[" }, + { KEY_BRACKETRIGHT, "]" }, + { KEY_SEMICOLON, ";" }, + { KEY_QUOTERIGHT, "'" }, + { KEY_RIGHTCURLYBRACKET, "}" }, + { KEY_NUMBERSIGN, "#" }, + { KEY_COLON, ":" }, + }; + + sal_uInt16 nUnmodifiedCode = (nKeyCode & KEY_CODE_MASK); + + if (nUnmodifiedCode >= KEY_A && nUnmodifiedCode <= KEY_Z) + aResult.append(char('A' + nUnmodifiedCode - KEY_A)); + else if (nUnmodifiedCode >= KEY_F1 && nUnmodifiedCode <= KEY_F26) + aResult.append(OUStringChar('F') + OUString::number(nUnmodifiedCode - KEY_F1 + 1)); + else if (nUnmodifiedCode >= KEY_0 && nUnmodifiedCode <= KEY_9) + aResult.append(char('0' + nUnmodifiedCode - KEY_0)); + else if (auto it = std::find_if(keyMap, keyMap + std::size(keyMap), + [=](const auto& p) { return p.code == nUnmodifiedCode; }); + it != keyMap + std::size(keyMap)) + aResult.appendAscii(it->name); + else + return OUString(); + + return aResult.makeStringAndClear(); } bool SvpSalFrame::MapUnicodeToKeyCode( sal_Unicode, LanguageType, vcl::KeyCode& ) diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index 0a0f133df89e..398efdc1888d 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -87,6 +87,15 @@ public: ImplCreateDragSource(const SystemEnvData& rSysEnv) override; virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> ImplCreateDropTarget(const SystemEnvData& rSysEnv) override; + + // Sends a message to a window, making sure to unlock solar mutex if necessary + static LRESULT SendWndMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + // Sends a message to mhComWnd, making sure to unlock solar mutex if necessary + LRESULT SendComWndMessage(UINT Msg, WPARAM wParam, LPARAM lParam) const; + +private: + // Sends a message to a window, making sure to unlock solar mutex if necessary + LRESULT SendWndMessage_impl(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) const; }; SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, SalFrameStyleFlags nSalFrameStyle ); diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index ca5b23711c44..0eb206119c98 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -69,6 +69,7 @@ constexpr auto CuiDialogList { u"cui/ui/hyperlinkdialog.ui" }, { u"cui/ui/hyperlinkinternetpage.ui" }, { u"cui/ui/hyperlinkmailpage.ui" }, + { u"cui/ui/hyperlinkmarkdialog.ui" }, { u"cui/ui/hyperlinkdocpage.ui" }, { u"cui/ui/imagetabpage.ui" }, { u"cui/ui/linedialog.ui" }, diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx index d9e34030d11f..c254c56ebf72 100644 --- a/vcl/osx/DropTarget.cxx +++ b/vcl/osx/DropTarget.cxx @@ -26,9 +26,6 @@ #include "DragActionConversion.hxx" #include "DragSource.hxx" #include <rtl/ustring.h> -#include <premac.h> -#include <Carbon/Carbon.h> -#include <postmac.h> #include <osx/salframe.h> #include <osx/salframeview.h> #include <cppuhelper/supportsservice.hxx> diff --git a/vcl/osx/PictToBmpFlt.cxx b/vcl/osx/PictToBmpFlt.cxx index a818cb5e752d..3533d830be8f 100644 --- a/vcl/osx/PictToBmpFlt.cxx +++ b/vcl/osx/PictToBmpFlt.cxx @@ -17,10 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <premac.h> -#include <Carbon/Carbon.h> -#include <postmac.h> - #include <string.h> #include "PictToBmpFlt.hxx" diff --git a/vcl/osx/cuidraw.hxx b/vcl/osx/cuidraw.hxx index de625ce0a8a9..0338a5ec06ae 100644 --- a/vcl/osx/cuidraw.hxx +++ b/vcl/osx/cuidraw.hxx @@ -22,7 +22,7 @@ #include <sal/config.h> #include <premac.h> -#include <Carbon/Carbon.h> +#include <CoreFoundation/CoreFoundation.h> #include <postmac.h> #include <config_features.h> diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm index 399134a361e4..94ef94047757 100644 --- a/vcl/osx/vclnsapp.mm +++ b/vcl/osx/vclnsapp.mm @@ -40,7 +40,6 @@ #include <premac.h> #include <objc/objc-runtime.h> -#import "Carbon/Carbon.h" #import "apple_remote/RemoteControl.h" #include <postmac.h> diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index 9e769b13cee1..f0404fa80a18 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -2141,6 +2141,44 @@ Bitmap Bitmap::Modify(const basegfx::BColorModifierStack& rBColorModifierStack) return aChangedBitmap; } +/** Get the average color of the entire image. + i.e. like scaling it down to a 1x1 pixel image. +*/ +Color Bitmap::GetAverageColor() const +{ + BitmapScopedReadAccess xContent(*this); + assert(xContent); + if(!xContent) + return Color(); + + double fRed = 0; + double fGreen = 0; + double fBlue = 0; + double fAlpha = 0; + int nCnt = 0; + for(tools::Long y(0), nHeight(xContent->Height()); y < nHeight; y++) + { + Scanline pScanline = xContent->GetScanline( y ); + for(tools::Long x(0), nWidth(xContent->Width()); x < nWidth; x++) + { + const BitmapColor aCol(xContent->GetPixelFromData(pScanline, x)); + fRed += aCol.GetRed(); + fGreen += aCol.GetGreen(); + fBlue += aCol.GetBlue(); + fAlpha += aCol.GetAlpha(); + nCnt++; + } + } + + if(!nCnt) + return Color(); + + return Color(ColorAlpha, static_cast<sal_uInt8>(fAlpha / nCnt), + static_cast<sal_uInt8>(fRed / nCnt), + static_cast<sal_uInt8>(fGreen / nCnt), + static_cast<sal_uInt8>(fBlue / nCnt)); +} + void Bitmap::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const { pOutDev->DrawBitmapEx( rDestPt, *this ); diff --git a/vcl/source/control/calendar.cxx b/vcl/source/control/calendar.cxx index 6d4f2cfd29f8..c85d8de7f66a 100644 --- a/vcl/source/control/calendar.cxx +++ b/vcl/source/control/calendar.cxx @@ -34,20 +34,22 @@ #include <strings.hrc> #include <memory> -#define DAY_OFFX 4 -#define DAY_OFFY 2 -#define MONTH_BORDERX 4 -#define MONTH_OFFY 3 -#define WEEKDAY_OFFY 3 -#define TITLE_OFFY 3 -#define TITLE_BORDERY 2 -#define SPIN_OFFX 4 -#define SPIN_OFFY TITLE_BORDERY -#define CALENDAR_HITTEST_DAY (sal_uInt16(0x0001)) -#define CALENDAR_HITTEST_MONTHTITLE (sal_uInt16(0x0004)) -#define CALENDAR_HITTEST_PREV (sal_uInt16(0x0008)) -#define CALENDAR_HITTEST_NEXT (sal_uInt16(0x0010)) -#define MENU_YEAR_COUNT 3 +constexpr tools::Long DAY_OFFX = 4; +constexpr tools::Long DAY_OFFY = 2; +constexpr tools::Long MONTH_BORDERX = 4; +constexpr tools::Long MONTH_OFFY = 3; +constexpr tools::Long WEEKDAY_OFFY = 3; +constexpr tools::Long TITLE_OFFY = 3; +constexpr tools::Long TITLE_BORDERY = 2; +constexpr tools::Long SPIN_OFFX = 4; +constexpr tools::Long SPIN_OFFY = TITLE_BORDERY; + +constexpr sal_uInt16 CALENDAR_HITTEST_DAY = 0x0001; +constexpr sal_uInt16 CALENDAR_HITTEST_MONTHTITLE = 0x0004; +constexpr sal_uInt16 CALENDAR_HITTEST_PREV = 0x0008; +constexpr sal_uInt16 CALENDAR_HITTEST_NEXT = 0x0010; + +constexpr sal_uInt16 MENU_YEAR_COUNT = 3; using namespace ::com::sun::star; diff --git a/vcl/unx/gtk4/gtkaccessibletext.cxx b/vcl/unx/gtk4/gtkaccessibletext.cxx index b00d0994dfa9..84632b658907 100644 --- a/vcl/unx/gtk4/gtkaccessibletext.cxx +++ b/vcl/unx/gtk4/gtkaccessibletext.cxx @@ -270,6 +270,48 @@ static gboolean lo_accessible_text_get_offset(GtkAccessibleText* self, } #endif +#if GTK_CHECK_VERSION(4, 21, 0) +static gboolean lo_accessible_text_set_caret_position(GtkAccessibleText* self, unsigned int offset) +{ + css::uno::Reference<css::accessibility::XAccessibleText> xText = getXText(self); + if (!xText.is()) + return false; + + if (offset > o3tl::make_unsigned(xText->getCharacterCount())) + { + SAL_WARN("vcl.gtk", + "lo_accessible_text_set_caret_position called with invalid offset: " << offset); + return false; + } + + xText->setCaretPosition(offset); + return true; +} + +static gboolean lo_accessible_text_set_selection(GtkAccessibleText* self, gsize i, + GtkAccessibleTextRange* range) +{ + if (i != 0) + return false; + + css::uno::Reference<css::accessibility::XAccessibleText> xText = getXText(self); + if (!xText.is()) + return false; + + const gsize nEndIndex = range->start + range->length; + const sal_Int32 nTextLength = xText->getCharacterCount(); + if (range->start > o3tl::make_unsigned(nTextLength) + || nEndIndex > o3tl::make_unsigned(nTextLength)) + { + SAL_WARN("vcl.qt", "lo_accessible_text_set_selection called with invalid index."); + return false; + } + + xText->setSelection(range->start, nEndIndex); + return true; +} +#endif + void lo_accessible_text_init(gpointer iface_, gpointer) { auto const iface = static_cast<GtkAccessibleTextInterface*>(iface_); @@ -283,6 +325,10 @@ void lo_accessible_text_init(gpointer iface_, gpointer) iface->get_extents = lo_accessible_text_get_extents; iface->get_offset = lo_accessible_text_get_offset; #endif +#if GTK_CHECK_VERSION(4, 21, 0) + iface->set_caret_position = lo_accessible_text_set_caret_position; + iface->set_selection = lo_accessible_text_set_selection; +#endif } #endif diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index aa36856ec78e..aa0cbfd12bb2 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -763,10 +763,28 @@ bool WinSalInstance::AnyInput( VclInputFlags nType ) return false; } +LRESULT WinSalInstance::SendWndMessage_impl(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) const +{ + std::optional<SolarMutexReleaser> oReleaser; + if (!IsMainThread()) + oReleaser.emplace(); + return SendMessageW(hWnd, Msg, wParam, lParam); +} + +LRESULT WinSalInstance::SendWndMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + return GetSalData()->mpInstance->SendWndMessage_impl(hWnd, Msg, wParam, lParam); +} + +LRESULT WinSalInstance::SendComWndMessage(UINT Msg, WPARAM wParam, LPARAM lParam) const +{ + return SendWndMessage_impl(mhComWnd, Msg, wParam, lParam); +} + SalFrame* WinSalInstance::CreateChildFrame( SystemParentData* pSystemParentData, SalFrameStyleFlags nSalFrameStyle ) { // to switch to Main-Thread - return reinterpret_cast<SalFrame*>(static_cast<sal_IntPtr>(SendMessageW( mhComWnd, SAL_MSG_CREATEFRAME, static_cast<WPARAM>(nSalFrameStyle), reinterpret_cast<LPARAM>(pSystemParentData->hWnd) ))); + return reinterpret_cast<SalFrame*>(static_cast<sal_IntPtr>(SendComWndMessage( SAL_MSG_CREATEFRAME, static_cast<WPARAM>(nSalFrameStyle), reinterpret_cast<LPARAM>(pSystemParentData->hWnd) ))); } SalFrame* WinSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nSalFrameStyle ) @@ -777,13 +795,13 @@ SalFrame* WinSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nSa hWndParent = static_cast<WinSalFrame*>(pParent)->mhWnd; else hWndParent = nullptr; - return reinterpret_cast<SalFrame*>(static_cast<sal_IntPtr>(SendMessageW( mhComWnd, SAL_MSG_CREATEFRAME, static_cast<WPARAM>(nSalFrameStyle), reinterpret_cast<LPARAM>(hWndParent) ))); + return reinterpret_cast<SalFrame*>(static_cast<sal_IntPtr>(SendComWndMessage( SAL_MSG_CREATEFRAME, static_cast<WPARAM>(nSalFrameStyle), reinterpret_cast<LPARAM>(hWndParent) ))); } void WinSalInstance::DestroyFrame( SalFrame* pFrame ) { OpenGLContext::prepareForYield(); - SendMessageW( mhComWnd, SAL_MSG_DESTROYFRAME, 0, reinterpret_cast<LPARAM>(pFrame) ); + SendComWndMessage(SAL_MSG_DESTROYFRAME, 0, reinterpret_cast<LPARAM>(pFrame)); } SalObject* WinSalInstance::CreateObject( SalFrame* pParent, @@ -791,12 +809,12 @@ SalObject* WinSalInstance::CreateObject( SalFrame* pParent, bool /*bShow*/ ) { // to switch to Main-Thread - return reinterpret_cast<SalObject*>(static_cast<sal_IntPtr>(SendMessageW( mhComWnd, SAL_MSG_CREATEOBJECT, 0, reinterpret_cast<LPARAM>(static_cast<WinSalFrame*>(pParent)) ))); + return reinterpret_cast<SalObject*>(static_cast<sal_IntPtr>(SendComWndMessage( SAL_MSG_CREATEOBJECT, 0, reinterpret_cast<LPARAM>(static_cast<WinSalFrame*>(pParent)) ))); } void WinSalInstance::DestroyObject( SalObject* pObject ) { - SendMessageW( mhComWnd, SAL_MSG_DESTROYOBJECT, 0, reinterpret_cast<LPARAM>(pObject) ); + SendComWndMessage(SAL_MSG_DESTROYOBJECT, 0, reinterpret_cast<LPARAM>(pObject)); } /** Add a file to the system shells recent document list if there is any. diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index e5a3a38bb4fb..76572eb4fa08 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -958,7 +958,7 @@ WinSalFrame::~WinSalFrame() if (hDC) { mpThreadGraphics->setHDC(nullptr); - SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_RELEASEDC, + pSalData->mpInstance->SendComWndMessage(SAL_MSG_RELEASEDC, reinterpret_cast<WPARAM>(mhWnd), reinterpret_cast<LPARAM>(hDC) ); } delete mpThreadGraphics; @@ -1012,7 +1012,7 @@ SalGraphics* WinSalFrame::AcquireGraphics() // WM_ERASEBACKGROUND message if ( !pSalData->mpInstance->IsMainThread() ) { - HDC hDC = reinterpret_cast<HDC>(static_cast<sal_IntPtr>(SendMessageW( pSalData->mpInstance->mhComWnd, + HDC hDC = reinterpret_cast<HDC>(static_cast<sal_IntPtr>(pSalData->mpInstance->SendComWndMessage( SAL_MSG_GETCACHEDDC, reinterpret_cast<WPARAM>(mhWnd), 0 ))); if ( !hDC ) return nullptr; @@ -1049,7 +1049,7 @@ void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) HDC hDC = mpThreadGraphics->getHDC(); assert(hDC); mpThreadGraphics->setHDC(nullptr); - SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_RELEASEDC, + pSalData->mpInstance->SendComWndMessage(SAL_MSG_RELEASEDC, reinterpret_cast<WPARAM>(mhWnd), reinterpret_cast<LPARAM>(hDC) ); } mbGraphicsAcquired = false; @@ -1068,7 +1068,7 @@ void WinSalFrame::SetTitle( const OUString& rTitle ) { static_assert( sizeof( WCHAR ) == sizeof( sal_Unicode ), "must be the same size" ); - SetWindowTextW( mhWnd, o3tl::toW(rTitle.getStr()) ); + WinSalInstance::SendWndMessage(mhWnd, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(rTitle.getStr())); } void WinSalFrame::SetIcon( sal_uInt16 nIcon ) @@ -1087,8 +1087,8 @@ void WinSalFrame::SetIcon( sal_uInt16 nIcon ) SAL_WARN_IF( !hIcon , "vcl", "WinSalFrame::SetIcon(): Could not load large icon !" ); SAL_WARN_IF( !hSmIcon , "vcl", "WinSalFrame::SetIcon(): Could not load small icon !" ); - SendMessageW( mhWnd, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(hIcon) ); - SendMessageW( mhWnd, WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(hSmIcon) ); + WinSalInstance::SendWndMessage(mhWnd, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(hIcon)); + WinSalInstance::SendWndMessage(mhWnd, WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(hSmIcon)); } void WinSalFrame::SetMenu( SalMenu* pSalMenu ) @@ -1495,7 +1495,7 @@ void WinSalFrame::ImplSetParentFrame( HWND hNewParentWnd, bool bAsChild ) hBrush = static_cast<HBRUSH>(GetCurrentObject( hDC, OBJ_BRUSH )); mpThreadGraphics->setHDC(nullptr); - SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_RELEASEDC, + pSalData->mpInstance->SendComWndMessage(SAL_MSG_RELEASEDC, reinterpret_cast<WPARAM>(mhWnd), reinterpret_cast<LPARAM>(hDC) ); bHadThreadGraphics = true; @@ -1514,7 +1514,7 @@ void WinSalFrame::ImplSetParentFrame( HWND hNewParentWnd, bool bAsChild ) // create a new hwnd with the same styles HWND hWndParent = hNewParentWnd; // forward to main thread - HWND hWnd = reinterpret_cast<HWND>(static_cast<sal_IntPtr>(SendMessageW( pSalData->mpInstance->mhComWnd, + HWND hWnd = reinterpret_cast<HWND>(static_cast<sal_IntPtr>(pSalData->mpInstance->SendComWndMessage( bAsChild ? SAL_MSG_RECREATECHILDHWND : SAL_MSG_RECREATEHWND, reinterpret_cast<WPARAM>(hWndParent), reinterpret_cast<LPARAM>(mhWnd) ))); @@ -1526,7 +1526,7 @@ void WinSalFrame::ImplSetParentFrame( HWND hNewParentWnd, bool bAsChild ) { mpThreadGraphics->setHWND( hWnd ); HDC hDC = reinterpret_cast<HDC>(static_cast<sal_IntPtr>( - SendMessageW( pSalData->mpInstance->mhComWnd, + pSalData->mpInstance->SendComWndMessage( SAL_MSG_GETCACHEDDC, reinterpret_cast<WPARAM>(hWnd), 0 ))); if ( hDC ) { @@ -1561,7 +1561,7 @@ void WinSalFrame::ImplSetParentFrame( HWND hNewParentWnd, bool bAsChild ) systemChildren.clear(); // Now destroy original HWND in the thread where it was created. - SendMessageW( GetSalData()->mpInstance->mhComWnd, + pSalData->mpInstance->SendComWndMessage( SAL_MSG_DESTROYHWND, WPARAM(0), reinterpret_cast<LPARAM>(hWndOld)); } @@ -2163,7 +2163,7 @@ void WinSalFrame::CaptureMouse( bool bCapture ) nMsg = SAL_MSG_CAPTUREMOUSE; else nMsg = SAL_MSG_RELEASEMOUSE; - SendMessageW( mhWnd, nMsg, 0, 0 ); + WinSalInstance::SendWndMessage(mhWnd, nMsg, 0, 0); } void WinSalFrame::SetPointerPos( tools::Long nX, tools::Long nY ) @@ -2253,7 +2253,7 @@ static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pCont void WinSalFrame::SetInputContext( SalInputContext* pContext ) { // Must be called in the main thread! - SendMessageW( mhWnd, SAL_MSG_SETINPUTCONTEXT, 0, reinterpret_cast<LPARAM>(pContext) ); + WinSalInstance::SendWndMessage(mhWnd, SAL_MSG_SETINPUTCONTEXT, 0, reinterpret_cast<LPARAM>(pContext)); } static void ImplSalFrameEndExtTextInput( HWND hWnd, EndExtTextInputFlags nFlags ) @@ -2275,7 +2275,7 @@ static void ImplSalFrameEndExtTextInput( HWND hWnd, EndExtTextInputFlags nFlags void WinSalFrame::EndExtTextInput( EndExtTextInputFlags nFlags ) { // Must be called in the main thread! - SendMessageW( mhWnd, SAL_MSG_ENDEXTTEXTINPUT, static_cast<WPARAM>(nFlags), 0 ); + WinSalInstance::SendWndMessage(mhWnd, SAL_MSG_ENDEXTTEXTINPUT, static_cast<WPARAM>(nFlags), 0); } static void ImplGetKeyNameText(UINT lParam, OUStringBuffer& rBuf, const char* pReplace) @@ -3300,7 +3300,7 @@ static bool ImplHandleMouseMsg( HWND hWnd, UINT nMsg, SalData* pSalData = GetSalData(); // Test for MouseLeave if ( pSalData->mhWantLeaveMsg && (pSalData->mhWantLeaveMsg != hWnd) ) - SendMessageW( pSalData->mhWantLeaveMsg, SAL_MSG_MOUSELEAVE, 0, GetMessagePos() ); + WinSalInstance::SendWndMessage(pSalData->mhWantLeaveMsg, SAL_MSG_MOUSELEAVE, 0, GetMessagePos()); pSalData->mhWantLeaveMsg = hWnd; aMouseEvt.mnButton = 0; @@ -5697,7 +5697,7 @@ void SalTestMouseLeave() cachedPoint = aPt; if ( pSalData->mhWantLeaveMsg != WindowFromPoint( aPt ) ) - SendMessageW( pSalData->mhWantLeaveMsg, SAL_MSG_MOUSELEAVE, 0, MAKELPARAM( aPt.x, aPt.y ) ); + WinSalInstance::SendWndMessage(pSalData->mhWantLeaveMsg, SAL_MSG_MOUSELEAVE, 0, MAKELPARAM(aPt.x, aPt.y)); } } @@ -5722,7 +5722,7 @@ static bool ImplSalWheelMousePos( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP if ( hWheelWnd && (hWheelWnd != hWnd) && (hWheelWnd != ::GetFocus()) && IsWindowEnabled( hWheelWnd ) ) { - rResult = SendMessageW( hWheelWnd, nMsg, wParam, lParam ); + rResult = WinSalInstance::SendWndMessage(hWheelWnd, nMsg, wParam, lParam); return false; } |