Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / vcl / inc / unx / saldata.hxx
blob9e8928122a97f7ef8ae9109fba6b938a5d9ec536
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_SALDATA_HXX
21 #define INCLUDED_VCL_INC_UNX_SALDATA_HXX
23 #include <X11/Xlib.h>
24 #include <X11/Xutil.h>
26 #include <unx/saldisp.hxx>
27 #include <unx/salunx.h>
28 #include <vcl/salgtype.hxx>
29 #include <salframe.hxx>
30 #include <unx/salinst.h>
31 #include <unx/gendata.hxx>
32 #include <osl/module.h>
33 #include <vclpluginapi.h>
35 class SalXLib;
36 class SalDisplay;
37 class SalPrinter;
39 #if defined LINUX || defined NETBSD || defined AIX || \
40 defined FREEBSD || defined OPENBSD || defined DRAGONFLY || \
41 defined ANDROID
42 #include <pthread.h>
43 #else
44 typedef unsigned int pthread_t;
45 #endif
47 class VCLPLUG_GEN_PUBLIC X11SalData : public SalGenericData
49 struct XErrorStackEntry
51 bool m_bIgnore;
52 bool m_bWas;
53 XErrorHandler m_aHandler;
55 std::vector< XErrorStackEntry > m_aXErrorHandlerStack;
56 XIOErrorHandler m_aOrigXIOErrorHandler;
58 protected:
59 SalXLib *pXLib_;
61 public:
62 X11SalData( SalGenericDataType t, SalInstance *pInstance );
63 virtual ~X11SalData() override;
65 virtual void Init();
66 virtual void Dispose() override;
68 virtual void initNWF();
69 virtual void deInitNWF();
71 void DeleteDisplay(); // for shutdown
73 SalXLib* GetLib() const { return pXLib_; }
75 static void Timeout( bool idle );
77 // X errors
78 virtual void ErrorTrapPush() override;
79 virtual bool ErrorTrapPop( bool bIgnoreError = true ) override;
80 void XError( Display *pDisp, XErrorEvent *pEvent );
81 bool HasXErrorOccurred() const
82 { return m_aXErrorHandlerStack.back().m_bWas; }
83 void ResetXErrorOccurred()
84 { m_aXErrorHandlerStack.back().m_bWas = false; }
85 void PushXErrorLevel( bool bIgnore );
86 void PopXErrorLevel();
89 X11SalData* GetX11SalData();
91 #endif // INCLUDED_VCL_INC_UNX_SALDATA_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */