LibreOffice Module vcl (master)  1
unx/salinst.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_VCL_INC_UNX_SALINST_H
21 #define INCLUDED_VCL_INC_UNX_SALINST_H
22 
23 #include <vclpluginapi.h>
24 #include <salinst.hxx>
25 #include <unx/geninst.h>
26 
27 #include <X11/X.h>
28 
29 namespace com::sun::star::datatransfer::clipboard { class XClipboard; }
30 class SalXLib;
31 class X11SalGraphics;
32 class SalX11Display;
33 
34 class X11SalInstance final : public SalGenericInstance
35 {
36 private:
37  std::unordered_map< Atom, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > m_aInstances;
38 
40 
41  virtual SalX11Display* CreateDisplay() const;
42 
43 public:
44  explicit X11SalInstance(std::unique_ptr<SalYieldMutex> pMutex);
45  virtual ~X11SalInstance() override;
46 
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 
51  virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool bShow ) override;
52  virtual void DestroyObject( SalObject* pObject ) override;
53 
55  static std::unique_ptr<SalVirtualDevice> CreateX11VirtualDevice(SalGraphics const * pGraphics, long &nDX, long &nDY,
56  DeviceFormat eFormat, const SystemGraphicsData* pData, std::unique_ptr<X11SalGraphics> pNewGraphics);
57 
58  virtual std::unique_ptr<SalVirtualDevice>
59  CreateVirtualDevice( SalGraphics* pGraphics,
60  long &nDX, long &nDY,
61  DeviceFormat eFormat, const SystemGraphicsData *pData = nullptr ) override;
62  virtual void PostPrintersChanged() override;
63  virtual std::unique_ptr<GenPspGraphics> CreatePrintGraphics() override;
64 
65  virtual SalTimer* CreateSalTimer() override;
66  virtual SalSystem* CreateSalSystem() override;
67  virtual std::shared_ptr<SalBitmap> CreateSalBitmap() override;
68  virtual std::unique_ptr<SalSession> CreateSalSession() override;
69  virtual OpenGLContext* CreateOpenGLContext() override;
70 
71  virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override;
72  virtual bool AnyInput( VclInputFlags nType ) override;
73  virtual bool IsMainThread() const override { return true; }
74 
75  virtual OUString GetConnectionIdentifier() override;
76  void SetLib( SalXLib *pXLib ) { mpXLib = pXLib; }
77 
78  virtual void AfterAppInit() override;
79 
80  std::shared_ptr<vcl::BackendCapabilities> GetBackendCapabilities() override;
81 
82  // dtrans implementation
83  virtual css::uno::Reference< css::uno::XInterface >
84  CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) override;
85  virtual css::uno::Reference< css::uno::XInterface > CreateDragSource() override;
86  virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() override;
87  virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override;
88 };
89 
90 #endif // INCLUDED_VCL_INC_UNX_SALINST_H
91 
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SalFrame * CreateFrame(SalFrame *pParent, SalFrameStyleFlags nStyle) override
virtual void DestroyObject(SalObject *pObject) override
virtual SalFrame * CreateChildFrame(SystemParentData *pParent, SalFrameStyleFlags nStyle) override
std::unordered_map< Atom, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > m_aInstances
Definition: unx/salinst.h:37
virtual void AddToRecentDocumentList(const OUString &rFileUrl, const OUString &rMimeType, const OUString &rDocumentService) override
SalXLib * mpXLib
Definition: unx/salinst.h:39
void SetLib(SalXLib *pXLib)
Definition: unx/salinst.h:76
virtual css::uno::Reference< css::uno::XInterface > CreateClipboard(const css::uno::Sequence< css::uno::Any > &i_rArguments) override
virtual void DestroyFrame(SalFrame *pFrame) override
virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() override
virtual OpenGLContext * CreateOpenGLContext() override
virtual css::uno::Reference< css::uno::XInterface > CreateDragSource() override
VclInputFlags
Definition: inputtypes.hxx:25
virtual std::unique_ptr< SalSession > CreateSalSession() override
virtual OUString GetConnectionIdentifier() override
virtual ~X11SalInstance() override
X11SalInstance(std::unique_ptr< SalYieldMutex > pMutex)
virtual void PostPrintersChanged() override
std::shared_ptr< vcl::BackendCapabilities > GetBackendCapabilities() override
virtual void AfterAppInit() override
virtual SalSystem * CreateSalSystem() override
DeviceFormat
Definition: salgtype.hxx:28
virtual SalTimer * CreateSalTimer() override
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
virtual SalObject * CreateObject(SalFrame *pParent, SystemWindowData *pWindowData, bool bShow) override
virtual std::unique_ptr< GenPspGraphics > CreatePrintGraphics() override
virtual std::unique_ptr< SalVirtualDevice > CreateVirtualDevice(SalGraphics *pGraphics, long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData=nullptr) override
SalFrameStyleFlags
Definition: salframe.hxx:64
static std::unique_ptr< SalVirtualDevice > CreateX11VirtualDevice(SalGraphics const *pGraphics, long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData, std::unique_ptr< X11SalGraphics > pNewGraphics)
Gtk vclplug needs to pass GtkSalGraphics to X11SalVirtualDevice, so create it, and pass as pNewGraphi...
virtual std::shared_ptr< SalBitmap > CreateSalBitmap() override
virtual SalX11Display * CreateDisplay() const
virtual bool IsMainThread() const override
Definition: unx/salinst.h:73
virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override
Wait for the next event (if bWait) and dispatch it, includes posted events, and timers.
virtual bool AnyInput(VclInputFlags nType) override