fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / vcl / inc / unx / saldata.hxx
blobf0e0bb6eef39bd53e2159724d1010398eaf8aa17
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 _SV_SALDATA_HXX
21 #define _SV_SALDATA_HXX
23 #include <prex.h>
24 #include <postx.h>
26 #include <unx/salunx.h>
27 #include <vcl/salgtype.hxx>
28 #include <salframe.hxx>
29 #include <unx/salinst.h>
30 #include <generic/gendata.hxx>
31 #include <osl/module.h>
32 #include <vclpluginapi.h>
34 class SalXLib;
35 class SalDisplay;
36 class SalPrinter;
38 #if defined LINUX || defined NETBSD || defined AIX || \
39 defined FREEBSD || defined OPENBSD || defined DRAGONFLY || \
40 defined ANDROID
41 #include <pthread.h>
42 #else
43 typedef unsigned int pthread_t;
44 #endif
46 class VCLPLUG_GEN_PUBLIC X11SalData : public SalGenericData
48 static int XErrorHdl( Display*, XErrorEvent* );
49 static int XIOErrorHdl( Display* );
51 struct XErrorStackEntry
53 bool m_bIgnore;
54 bool m_bWas;
55 unsigned int m_nLastErrorRequest;
56 XErrorHandler m_aHandler;
58 std::vector< XErrorStackEntry > m_aXErrorHandlerStack;
59 XIOErrorHandler m_aOrigXIOErrorHandler;
61 protected:
62 SalXLib *pXLib_;
64 public:
65 X11SalData( SalGenericDataType t, SalInstance *pInstance );
66 virtual ~X11SalData();
68 virtual void Init();
69 virtual void Dispose();
71 virtual void initNWF();
72 virtual void deInitNWF();
74 SalDisplay* GetX11Display() const { return GetSalDisplay(); }
75 void DeleteDisplay(); // for shutdown
77 inline SalXLib* GetLib() const { return pXLib_; }
79 void StartTimer( sal_uLong nMS );
80 inline void StopTimer();
81 void Timeout() const;
83 // X errors
84 virtual void ErrorTrapPush();
85 virtual bool ErrorTrapPop( bool bIgnoreError );
86 void XError( Display *pDisp, XErrorEvent *pEvent );
87 bool HasXErrorOccurred() const
88 { return m_aXErrorHandlerStack.back().m_bWas; }
89 unsigned int GetLastXErrorRequestCode() const
90 { return m_aXErrorHandlerStack.back().m_nLastErrorRequest; }
91 void ResetXErrorOccurred()
92 { m_aXErrorHandlerStack.back().m_bWas = false; }
93 void PushXErrorLevel( bool bIgnore );
94 void PopXErrorLevel();
97 X11SalData* GetX11SalData();
99 #endif // _SV_SALDATA_HXX
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */