1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <sal/config.h>
24 #include <osl/conditn.hxx>
26 #include <salinst.hxx>
27 #include <win/salframe.h>
31 class WinSalInstance
: public SalInstance
36 /// invisible Window so non-main threads can SendMessage() the main thread
39 osl::Condition maWaitingYieldCond
;
40 unsigned m_nNoYieldLock
;
44 virtual ~WinSalInstance() override
;
46 virtual void AfterAppInit() override
;
47 virtual SalFrame
* CreateChildFrame( SystemParentData
* pParent
, SalFrameStyleFlags nStyle
) override
;
48 virtual SalFrame
* CreateFrame( SalFrame
* pParent
, SalFrameStyleFlags nStyle
) override
;
49 virtual void DestroyFrame( SalFrame
* pFrame
) override
;
50 virtual SalObject
* CreateObject( SalFrame
* pParent
, SystemWindowData
* pWindowData
, bool bShow
) override
;
51 virtual void DestroyObject( SalObject
* pObject
) override
;
52 virtual std::unique_ptr
<SalVirtualDevice
>
53 CreateVirtualDevice( SalGraphics
& rGraphics
,
54 tools::Long
&nDX
, tools::Long
&nDY
,
55 DeviceFormat eFormat
, const SystemGraphicsData
*pData
= nullptr ) override
;
56 virtual SalInfoPrinter
* CreateInfoPrinter( SalPrinterQueueInfo
* pQueueInfo
,
57 ImplJobSetup
* pSetupData
) override
;
58 virtual void DestroyInfoPrinter( SalInfoPrinter
* pPrinter
) override
;
59 virtual std::unique_ptr
<SalPrinter
> CreatePrinter( SalInfoPrinter
* pInfoPrinter
) override
;
60 virtual void GetPrinterQueueInfo( ImplPrnQueueList
* pList
) override
;
61 virtual void GetPrinterQueueState( SalPrinterQueueInfo
* pInfo
) override
;
62 virtual OUString
GetDefaultPrinter() override
;
63 virtual SalTimer
* CreateSalTimer() override
;
64 virtual SalSystem
* CreateSalSystem() override
;
65 virtual std::shared_ptr
<SalBitmap
> CreateSalBitmap() override
;
66 virtual bool IsMainThread() const override
;
68 virtual bool DoYield(bool bWait
, bool bHandleAllCurrentEvents
) override
;
69 virtual bool AnyInput( VclInputFlags nType
) override
;
70 virtual std::unique_ptr
<SalMenu
> CreateMenu( bool bMenuBar
, Menu
* ) override
;
71 virtual std::unique_ptr
<SalMenuItem
> CreateMenuItem( const SalItemParams
& rItemData
) override
;
72 virtual OpenGLContext
* CreateOpenGLContext() override
;
73 virtual OUString
GetConnectionIdentifier() override
;
74 virtual void AddToRecentDocumentList(const OUString
& rFileUrl
, const OUString
& rMimeType
, const OUString
& rDocumentService
) override
;
76 static DWORD
getWindowsBuildNumber();
77 virtual OUString
getOSVersion() override
;
78 virtual void BeforeAbort(const OUString
&, bool) override
;
80 static int WorkaroundExceptionHandlingInUSER32Lib(int nExcept
, LPEXCEPTION_POINTERS pExceptionInfo
);
82 virtual css::uno::Reference
<css::uno::XInterface
> ImplCreateDragSource(const SystemEnvData
*) override
;
83 virtual css::uno::Reference
<css::uno::XInterface
> ImplCreateDropTarget(const SystemEnvData
*) override
;
86 SalFrame
* ImplSalCreateFrame( WinSalInstance
* pInst
, HWND hWndParent
, SalFrameStyleFlags nSalFrameStyle
);
87 SalObject
* ImplSalCreateObject( WinSalInstance
* pInst
, WinSalFrame
* pParent
);
88 HWND
ImplSalReCreateHWND( HWND hWndParent
, HWND oldhWnd
, bool bAsChild
);
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */