1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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>
38 #if defined LINUX || defined NETBSD || defined AIX || \
39 defined FREEBSD || defined OPENBSD || defined DRAGONFLY || \
43 typedef unsigned int pthread_t
;
46 class VCLPLUG_GEN_PUBLIC X11SalData
: public SalGenericData
48 static int XErrorHdl( Display
*, XErrorEvent
* );
49 static int XIOErrorHdl( Display
* );
51 struct XErrorStackEntry
55 unsigned int m_nLastErrorRequest
;
56 XErrorHandler m_aHandler
;
58 std::vector
< XErrorStackEntry
> m_aXErrorHandlerStack
;
59 XIOErrorHandler m_aOrigXIOErrorHandler
;
65 X11SalData( SalGenericDataType t
, SalInstance
*pInstance
);
66 virtual ~X11SalData();
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();
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: */