kxerrorhandler.h
/*
Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef KXERRORHANDLER_H
#define KXERRORHANDLER_H
#include <qvaluelist.h>
#include <qwindowdefs.h>
#include <kdelibs_export.h>
#include <X11/Xlib.h>
class KDECORE_EXPORT KXErrorHandler
{
public:
KXErrorHandler( Display* dpy = qt_xdisplay());
KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = qt_xdisplay());
KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy = qt_xdisplay());
bool error( bool sync ) const;
~KXErrorHandler();
private:
void addHandler();
int handle( Display* dpy, XErrorEvent* e );
bool (*user_handler1)( int request, int error_code, unsigned long resource_id );
int (*user_handler2)( Display*, XErrorEvent* );
int (*old_handler)( Display*, XErrorEvent* );
unsigned long first_request;
Display* display;
bool was_error;
static int handler_wrapper( Display*, XErrorEvent* );
static KXErrorHandler** handlers;
static int pos;
static int size;
class KXErrorHandlerPrivate* d;
};
#endif
KXErrorHandler
This class simplifies handling of X errors.
Definition: kxerrorhandler.h:57

KDE Home | KDE Accessibility Home | Description of Access Keys