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 { namespace sun { namespace star { namespace datatransfer {
30  namespace clipboard { class XClipboard; }
31 } } } }
32 
33 class SalXLib;
34 class X11SalGraphics;
35 class SalX11Display;
36 
38 {
39 private:
40  std::unordered_map< Atom, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > m_aInstances;
41 
42 protected:
44 
45  virtual SalX11Display* CreateDisplay() const;
46 
47 public:
48  explicit X11SalInstance(std::unique_ptr<SalYieldMutex> pMutex);
49  virtual ~X11SalInstance() override;
50 
51  virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override;
52  virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override;
53  virtual void DestroyFrame( SalFrame* pFrame ) override;
54 
55  virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool bShow ) override;
56  virtual void DestroyObject( SalObject* pObject ) override;
57 
59  static std::unique_ptr<SalVirtualDevice> CreateX11VirtualDevice(SalGraphics const * pGraphics, long &nDX, long &nDY,
60  DeviceFormat eFormat, const SystemGraphicsData* pData, std::unique_ptr<X11SalGraphics> pNewGraphics);
61 
62  virtual std::unique_ptr<SalVirtualDevice>
63  CreateVirtualDevice( SalGraphics* pGraphics,
64  long &nDX, long &nDY,
65  DeviceFormat eFormat, const SystemGraphicsData *pData = nullptr ) override;
66  virtual void PostPrintersChanged() override;
67  virtual std::unique_ptr<GenPspGraphics> CreatePrintGraphics() override;
68 
69  virtual SalTimer* CreateSalTimer() override;
70  virtual SalSystem* CreateSalSystem() override;
71  virtual std::shared_ptr<SalBitmap> CreateSalBitmap() override;
72  virtual std::unique_ptr<SalSession> CreateSalSession() override;
73  virtual OpenGLContext* CreateOpenGLContext() override;
74 
75  virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override;
76  virtual bool AnyInput( VclInputFlags nType ) override;
77  virtual bool IsMainThread() const override { return true; }
78 
79  virtual OUString GetConnectionIdentifier() override;
80  void SetLib( SalXLib *pXLib ) { mpXLib = pXLib; }
81 
82  virtual void AfterAppInit() override;
83 
84  // dtrans implementation
85  virtual css::uno::Reference< css::uno::XInterface >
86  CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) override;
87  virtual css::uno::Reference< css::uno::XInterface > CreateDragSource() override;
88  virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() override;
89  virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override;
90 };
91 
92 #endif // INCLUDED_VCL_INC_UNX_SALINST_H
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget()
Definition: dtranscomp.cxx:451
virtual OpenGLContext * CreateOpenGLContext()=0
std::unordered_map< Atom, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > m_aInstances
Definition: unx/salinst.h:40
virtual css::uno::Reference< css::uno::XInterface > CreateClipboard(const css::uno::Sequence< css::uno::Any > &i_rArguments)
Definition: dtranscomp.cxx:441
virtual SalFrame * CreateChildFrame(SystemParentData *pParent, SalFrameStyleFlags nStyle)=0
SalXLib * mpXLib
Definition: unx/salinst.h:43
void SetLib(SalXLib *pXLib)
Definition: unx/salinst.h:80
virtual bool AnyInput(VclInputFlags nType)=0
VclInputFlags
Definition: inputtypes.hxx:25
virtual css::uno::Reference< css::uno::XInterface > CreateDragSource()
Definition: dtranscomp.cxx:446
virtual SalTimer * CreateSalTimer()=0
virtual void DestroyObject(SalObject *pObject)=0
virtual void AfterAppInit()
Definition: salinst.hxx:91
#define VCLPLUG_GEN_PUBLIC
Definition: vclpluginapi.h:29
virtual SalFrame * CreateFrame(SalFrame *pParent, SalFrameStyleFlags nStyle)=0
virtual SalSystem * CreateSalSystem()=0
virtual std::unique_ptr< SalVirtualDevice > CreateVirtualDevice(SalGraphics *pGraphics, long &rDX, long &rDY, DeviceFormat eFormat, const SystemGraphicsData *pData=nullptr)=0
virtual std::unique_ptr< SalSession > CreateSalSession()
Definition: salvtables.cxx:130
virtual std::unique_ptr< GenPspGraphics > CreatePrintGraphics()=0
virtual void DestroyFrame(SalFrame *pFrame)=0
DeviceFormat
Definition: salgtype.hxx:28
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
virtual std::shared_ptr< SalBitmap > CreateSalBitmap()=0
SalFrameStyleFlags
Definition: salframe.hxx:64
virtual void AddToRecentDocumentList(const OUString &rFileUrl, const OUString &rMimeType, const OUString &rDocumentService)=0
virtual OUString GetConnectionIdentifier()=0
virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents)=0
Wait for the next event (if bWait) and dispatch it, includes posted events, and timers.
virtual bool IsMainThread() const override
Definition: unx/salinst.h:77
virtual void PostPrintersChanged()=0
virtual SalObject * CreateObject(SalFrame *pParent, SystemWindowData *pWindowData, bool bShow)=0