KDECore
kxerrorhandler.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KXERRORHANDLER_H
00026 #define KXERRORHANDLER_H
00027
00028 #include <qvaluelist.h>
00029 #include <qwindowdefs.h>
00030 #include <kdelibs_export.h>
00031 #include <X11/Xlib.h>
00032
00057 class KDECORE_EXPORT KXErrorHandler
00058 {
00059 public:
00064 KXErrorHandler( Display* dpy = qt_xdisplay());
00070 KXErrorHandler( bool (*handler)( int request, int error_code, unsigned long resource_id ), Display* dpy = qt_xdisplay());
00077 KXErrorHandler( int (*handler)( Display*, XErrorEvent* ), Display* dpy = qt_xdisplay());
00086 bool error( bool sync ) const;
00087 ~KXErrorHandler();
00088 private:
00089 void addHandler();
00090 int handle( Display* dpy, XErrorEvent* e );
00091 bool (*user_handler1)( int request, int error_code, unsigned long resource_id );
00092 int (*user_handler2)( Display*, XErrorEvent* );
00093 int (*old_handler)( Display*, XErrorEvent* );
00094 unsigned long first_request;
00095 Display* display;
00096 bool was_error;
00097 static int handler_wrapper( Display*, XErrorEvent* );
00098 static KXErrorHandler** handlers;
00099 static int pos;
00100 static int size;
00101 class KXErrorHandlerPrivate* d;
00102 };
00103
00104 #endif