Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / vcl / inc / unx / salinst.h
bloba35c2755b5d89a00b2d285b191381ed904d72c17
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_VCL_INC_UNX_SALINST_H
21 #define INCLUDED_VCL_INC_UNX_SALINST_H
23 #include <osl/thread.hxx>
24 #include <vclpluginapi.h>
25 #include <salinst.hxx>
26 #include <unx/geninst.h>
28 #include <X11/Xlib.h>
29 #include <X11/Xutil.h>
31 namespace com { namespace sun { namespace star { namespace datatransfer {
32 namespace clipboard { class XClipboard; }
33 } } } }
35 class SalXLib;
36 class X11SalGraphics;
37 class SalX11Display;
39 class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalGenericInstance
41 private:
42 std::unordered_map< Atom, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > m_aInstances;
44 protected:
45 SalXLib *mpXLib;
47 virtual SalX11Display* CreateDisplay() const;
49 public:
50 explicit X11SalInstance(SalYieldMutex* pMutex);
51 virtual ~X11SalInstance() override;
53 virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override;
54 virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override;
55 virtual void DestroyFrame( SalFrame* pFrame ) override;
57 virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool bShow ) override;
58 virtual void DestroyObject( SalObject* pObject ) override;
60 /// Gtk vclplug needs to pass GtkSalGraphics to X11SalVirtualDevice, so create it, and pass as pNewGraphics.
61 static std::unique_ptr<SalVirtualDevice> CreateX11VirtualDevice(SalGraphics const * pGraphics, long &nDX, long &nDY,
62 DeviceFormat eFormat, const SystemGraphicsData* pData, X11SalGraphics* pNewGraphics);
64 virtual std::unique_ptr<SalVirtualDevice>
65 CreateVirtualDevice( SalGraphics* pGraphics,
66 long &nDX, long &nDY,
67 DeviceFormat eFormat, const SystemGraphicsData *pData = nullptr ) override;
68 virtual void PostPrintersChanged() override;
69 virtual GenPspGraphics *CreatePrintGraphics() override;
71 virtual SalTimer* CreateSalTimer() override;
72 virtual SalI18NImeStatus* CreateI18NImeStatus() override;
73 virtual SalSystem* CreateSalSystem() override;
74 virtual SalBitmap* CreateSalBitmap() override;
75 virtual SalSession* CreateSalSession() override;
76 virtual OpenGLContext* CreateOpenGLContext() override;
78 virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override;
79 virtual bool AnyInput( VclInputFlags nType ) override;
80 virtual bool IsMainThread() const override { return true; }
82 virtual OUString GetConnectionIdentifier() override;
83 void SetLib( SalXLib *pXLib ) { mpXLib = pXLib; }
85 virtual void AfterAppInit() override;
87 // dtrans implementation
88 virtual css::uno::Reference< css::uno::XInterface >
89 CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) override;
90 virtual css::uno::Reference< css::uno::XInterface > CreateDragSource() override;
91 virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() override;
92 virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override;
95 #endif // INCLUDED_VCL_INC_UNX_SALINST_H
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */