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
29namespace com::sun::star::datatransfer::clipboard { class XClipboard; }
30class SalXLib;
31class X11SalGraphics;
32class SalX11Display;
33
35{
36private:
37 std::unordered_map< Atom, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > m_aInstances;
38
40
41 virtual SalX11Display* CreateDisplay() const;
42
43public:
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(const SalGraphics& rGraphics, tools::Long &nDX, tools::Long &nDY,
56 DeviceFormat eFormat, const SystemGraphicsData* pData, std::unique_ptr<X11SalGraphics> pNewGraphics);
57
58 virtual std::unique_ptr<SalVirtualDevice>
60 tools::Long &nDX, tools::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 // dtrans implementation
81 virtual css::uno::Reference< css::uno::XInterface >
82 CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) override;
83 virtual css::uno::Reference<css::uno::XInterface> ImplCreateDragSource(const SystemEnvData*) override;
84 virtual css::uno::Reference<css::uno::XInterface> ImplCreateDropTarget(const SystemEnvData*) override;
85 virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override;
86};
87
88#endif // INCLUDED_VCL_INC_UNX_SALINST_H
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
void SetLib(SalXLib *pXLib)
Definition: unx/salinst.h:76
virtual css::uno::Reference< css::uno::XInterface > ImplCreateDropTarget(const SystemEnvData *) override
virtual bool IsMainThread() const override
Definition: unx/salinst.h:73
virtual std::unique_ptr< SalVirtualDevice > CreateVirtualDevice(SalGraphics &rGraphics, tools::Long &nDX, tools::Long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData=nullptr) override
X11SalInstance(std::unique_ptr< SalYieldMutex > pMutex)
virtual std::unique_ptr< GenPspGraphics > CreatePrintGraphics() override
virtual OUString GetConnectionIdentifier() override
virtual ~X11SalInstance() override
virtual SalFrame * CreateFrame(SalFrame *pParent, SalFrameStyleFlags nStyle) override
SalXLib * mpXLib
Definition: unx/salinst.h:39
virtual bool AnyInput(VclInputFlags nType) override
virtual void AfterAppInit() override
virtual css::uno::Reference< css::uno::XInterface > CreateClipboard(const css::uno::Sequence< css::uno::Any > &i_rArguments) override
std::unordered_map< Atom, css::uno::Reference< css::datatransfer::clipboard::XClipboard > > m_aInstances
Definition: unx/salinst.h:37
virtual SalX11Display * CreateDisplay() const
virtual std::shared_ptr< SalBitmap > CreateSalBitmap() override
virtual SalFrame * CreateChildFrame(SystemParentData *pParent, SalFrameStyleFlags nStyle) override
virtual void DestroyFrame(SalFrame *pFrame) override
virtual void PostPrintersChanged() override
virtual SalSystem * CreateSalSystem() override
virtual void AddToRecentDocumentList(const OUString &rFileUrl, const OUString &rMimeType, const OUString &rDocumentService) override
static std::unique_ptr< SalVirtualDevice > CreateX11VirtualDevice(const SalGraphics &rGraphics, tools::Long &nDX, tools::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 SalTimer * CreateSalTimer() override
virtual css::uno::Reference< css::uno::XInterface > ImplCreateDragSource(const SystemEnvData *) override
virtual OpenGLContext * CreateOpenGLContext() override
virtual SalObject * CreateObject(SalFrame *pParent, SystemWindowData *pWindowData, bool bShow) override
virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override
Wait for the next event (if bWait) and dispatch it, includes posted events, and timers.
virtual std::unique_ptr< SalSession > CreateSalSession() override
virtual void DestroyObject(SalObject *pObject) override
VclInputFlags
Definition: inputtypes.hxx:25
long Long
SalFrameStyleFlags
Definition: salframe.hxx:65
DeviceFormat
Definition: salgtype.hxx:28