XGetEventData(3)


HOME

XGetEventData

NAME
SYNTAX
ARGUMENTS
STRUCTURES
DESCRIPTION
EXAMPLE CODE
NOTES
SEE ALSO

NAME

XGetEventData, XFreeEventData, XGenericEventCookie − retrieve and free additional event data through cookies.

SYNTAX

Bool XGetEventData(Display *display, XGenericEventCookie *cookie);

void XFreeEventData(Display *display, XGenericEventCookie *cookie);

ARGUMENTS

display

Specifies the connection to the X server.

cookie

Specifies the cookie to free or retrieve the data for.

STRUCTURES

typedef struct {

int type;

unsigned long serial;

Bool send_event;

Display *display;

int extension;

int evtype;

unsigned int cookie;

void *data;

} XGenericEventCookie;

DESCRIPTION

Some extension XGenericEvents require additional memory to store information. For these events, the library returns a XGenericEventCookie with a token (’cookie’) unique to this event. The XGenericEventCookie’s data pointer is undefined until XGetEventData is called.

The XGetEventData function retrieves this extra data for the given cookie. No round-trip to the server is required. If the cookie is invalid or the event is not an event handled by cookie handlers, False is returned. If XGetEventData returns True, the cookie’s data pointer points to the memory containing the event information. A client must call XFreeEventData to free this memory. XGetEventData returns False for multiple calls for the same event cookie.

The XFreeEventData function frees the data associated with a cookie. A client must call XFreeEventData for each cookie claimed with XGetEventData.

EXAMPLE CODE

XEvent event;
XGenericEventCookie *cookie = &ev;

XNextEvent(display, &event);
if (XGetEventData(display, cookie)) {
handle_cookie_event(cookie->data);
} else
handle_event(&event);
}
XFreeEventData(display, cookie);

NOTES

A cookie is defined as unclaimed if it has been returned to the client through XNextEvent but its data has not been retrieved via XGetEventData. Subsequent calls to XNextEvent may free memory associated with unclaimed cookies. Multi-threaded X clients must ensure that XGetEventData is called before the next call to XNextEvent.

SEE ALSO

XNextEvent(3),
Xlib − C Language X Interface



More Linux Commands

manpages/ntfsls.8.html
ntfsls(8) - list directory contents on an NTFS filesystem...
ntfsls is used to list information about the files specified by the PATH option (the root directory by default). DEVICE is the special file corresponding to the

manpages/Tcl_DStringResult.3.html
Tcl_DStringResult(3) - manipulate dynamic strings (ManPage)
Dynamic strings provide a mechanism for building up arbitrarily long strings by gradually appending information. If the dynamic string is short then there will

manpages/set_current_field.3form.html
set_current_field(3form) - set and get form page number.....
The function set_current field sets the current field of the given form; current_field returns the current field of the given form. The function set_form_page s

manpages/gssd.8.html
gssd(8) - rpcsec_gss daemon (Admin - Linux man page)........
To establish GSS security contexts using these credential files, the Linux kernel RPC client depends on a userspace daemon called rpc.gssd. The rpc.gssd daemon

manpages/arch.1.html
arch(1) - print machine hardware name (same as uname -m)....
Print machine architecture. --help display this help and exit --version output version information and exit GNU coreutils online help: <http://www.gnu.org/softw

manpages/XtClass.3.html
XtClass(3) - obtain and verify a widget's class (Man Page)
The XtClass function returns a pointer to the widgets class structure. The XtSuperclass function returns a pointer to the widgets superclass class structure. Th

manpages/B::Showlex.3pm.html
B::Showlex(3pm) - Show lexical variables used in functions o
When a comma-separated list of subroutine names is given as options, Showlex prints the lexical variables used in those subroutines. Otherwise, it prints the fi

manpages/powf.3.html
powf(3) - power functions (Library - Linux man page)........
The pow() function returns the value of x raised to the power of y. RETURN VALUE On success, these functions return the value of x to the power of y. If x is a

manpages/forkpty.3.html
forkpty(3) - tty utility functions - Linux manual page......
The openpty() function finds an available pseudoterminal and returns file descriptors for the master and slave in amaster and aslave. If name is not NULL, the f

manpages/gfortran-4.6.1.html
gfortran-4.6(1) - GNU Fortran compiler - Linux manual page
The gfortran command supports all the options supported by the gcc command. Only options specific to GNU Fortran are documented here. All GCC and GNU Fortran op

manpages/Tcl_DoWhenIdle.3.html
Tcl_DoWhenIdle(3) - invoke a procedure when there are no pen
Tcl_DoWhenIdle arranges for proc to be invoked when the application becomes idle. The application is considered to be idle when Tcl_DoOneEvent has been called,

manpages/Mail::SpamAssassin::Plugin::URIDetail.3pm.html
Mail::SpamAssassin::Plugin::URIDetail(3pm) - test URIs using
This plugin creates a new rule test type, known as "uri_detail". These rules apply to all URIs found in the message. loadplugin Mail::SpamAssassin::Plugin::U...





We can't live, work or learn in freedom unless the software we use is free.