1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: maliit-discuss@lists.maliit.org
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License version 2.1 as published by the Free Software Foundation
11
* and appearing in the file LICENSE.LGPL included in the packaging
15
#ifndef MIMXERRORTRAP_H
16
#define MIMXERRORTRAP_H
18
#include "mimxextension.h"
23
* \ingroup maliitserver
24
* \brief A helper class to enable trapping of X errors.
26
* \warning This class is not thread safe and must be only used in the main UI
32
//! Constructs a MImXErrorTrap object and start traping X errors with the specific
33
//! \a majorCode and \a minorCode
34
explicit MImXErrorTrap(int majorCode, int minorCode = 0);
35
//! Constructs a MImXErrorTrap object and start traping X errors generated by
36
//! \a extension with \a minorCode
37
explicit MImXErrorTrap(const MImXExtension &extension, int minorCode);
40
//! Flushes the X output buffer when \a sync. Stops trapping for the X error.
41
//! Returns the error code for an error which occured or Success.
42
int untrap(bool sync = true);
45
bool matches(XErrorEvent *e);
50
XErrorHandler old_handler;
52
friend int mim_x_error_handler(Display *, XErrorEvent *);
56
#endif // MIMXERRORTRAP_H