kdecore Library API Documentation

kxerrorhandler.h

00001 /*
00002 
00003   Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org>
00004 
00005   Permission is hereby granted, free of charge, to any person obtaining a
00006   copy of this software and associated documentation files (the "Software"),
00007   to deal in the Software without restriction, including without limitation
00008   the rights to use, copy, modify, merge, publish, distribute, sublicense,
00009   and/or sell copies of the Software, and to permit persons to whom the
00010   Software is furnished to do so, subject to the following conditions:
00011 
00012   The above copyright notice and this permission notice shall be included in
00013   all copies or substantial portions of the Software.
00014 
00015   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00018   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00020   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00021   DEALINGS IN THE SOFTWARE.
00022 
00023 */
00024 
00025 #ifndef KXERRORHANDLER_H
00026 #define KXERRORHANDLER_H
00027 
00028 #include <qvaluelist.h>
00029 #include <qwindowdefs.h>
00030 #include <X11/Xlib.h>
00031 
00056 class KXErrorHandler
00057     {
00058     public:
00063         KXErrorHandler( Display* dpy = qt_xdisplay());
00069         KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = qt_xdisplay());
00076         KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy = qt_xdisplay());
00085         bool error( bool sync ) const;
00086         ~KXErrorHandler();
00087     private:
00088         void addHandler();
00089         int handle( Display* dpy, XErrorEvent* e );
00090         bool (*user_handler1)( int request, int error_code, unsigned long resource_id );
00091         int (*user_handler2)( Display*, XErrorEvent* );
00092         int (*old_handler)( Display*, XErrorEvent* );
00093         unsigned long first_request;
00094         Display* display;
00095         bool was_error;
00096         static int handler_wrapper( Display*, XErrorEvent* );
00097         static KXErrorHandler** handlers;
00098         static int pos;
00099         static int size;
00100         class KXErrorHandlerPrivate* d;
00101     };
00102 
00103 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 30 05:15:56 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003