.TH "KXErrorHandler" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KXErrorHandler \- This class simplifies handling of X errors. Handler for X errors.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kxerrorhandler.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKXErrorHandler\fP (Display *dpy=qt_xdisplay())"
.br
.ti -1c
.RI "\fBKXErrorHandler\fP (bool(*handler)(int request, int error_code, unsigned long resource_id), Display *dpy=qt_xdisplay())"
.br
.ti -1c
.RI "\fBKXErrorHandler\fP (int(*handler)(Display *, XErrorEvent *), Display *dpy=qt_xdisplay())"
.br
.ti -1c
.RI "bool \fBerror\fP (bool sync) const "
.br
.in -1c
.SH "Detailed Description"
.PP 
This class simplifies handling of X errors. Handler for X errors. 

It shouldn't be necessary to use with \fBQt\fP classes, as the toolkit should handle X errors itself, so this class will be mainly used with direct Xlib usage, and some lowlevel classes like \fBNETWinInfo\fP.
.PP
The usual usage is to create a KXErrorHandler instance right before starting operations that might cause X errors, and checking if there was an error by calling \fBerror()\fP after the operations are finished. The handlers may be nested, but must be destroyed in reverse order they were created.
.PP
There's no need to do X sync before creating an instance, every instance will handle only errors for request issued after the instance was created. Errors for older requests will be passed to previous error handler. When checking for error by calling \fBerror()\fP at the end, it is necessary to sync with X, to catch all errors that were caused by requests issued before the call to \fBerror()\fP. This can be done by passing true to \fBerror()\fP to cause explicit XSync(), however, if the last X request needed a roundtrip (e.g. XGetWindowAttributes(), XGetGeometry(), etc.), it is not required to do an explicit sync.
.PP
\fBAuthor:\fP
.RS 4
Lubos Lunak <l.lunak@kde.org> 
.RE
.PP

.PP
Definition at line 57 of file kxerrorhandler.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KXErrorHandler::KXErrorHandler (Display * dpy = \fCqt_xdisplay()\fP)"
.PP
Creates error handler that will set error flag after encountering any X error. 
.PP
Definition at line 36 of file kxerrorhandler.cpp.
.SS "KXErrorHandler::KXErrorHandler (bool(*)(int request, int error_code, unsigned long resource_id) handler, Display * dpy = \fCqt_xdisplay()\fP)"
.PP
This constructor takes pointer to a function that will get request number, error code number and resource id of the failed request, as provided by XErrorEvent. 
.PP
If the function returns true, the error flag will be set. 
.PP
Definition at line 47 of file kxerrorhandler.cpp.
.SS "KXErrorHandler::KXErrorHandler (int(*)(Display *, XErrorEvent *) handler, Display * dpy = \fCqt_xdisplay()\fP)"
.PP
This constructor takes pointer to a function whose prototype matches the one that's used with the XSetErrorHandler() Xlib function. 
.PP
NOTE: For the error flag to be set, the function must return non-zero value. 
.PP
Definition at line 58 of file kxerrorhandler.cpp.
.SH "Member Function Documentation"
.PP 
.SS "bool KXErrorHandler::error (bool sync) const"
.PP
This function returns true if the error flag is set (i.e. 
.PP
no custom handler function was used and there was any error, or the custom handler indicated an error by its return value).
.PP
\fBParameters:\fP
.RS 4
\fIsync\fP if true, and explicit XSync() will be done. Not necessary when the last X request required a roundtrip. 
.RE
.PP

.PP
Definition at line 86 of file kxerrorhandler.cpp.
.PP
Referenced by KSelectionWatcher::owner().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
