|
NAMEX11::Xlib::XEvent - Polymorphic class for XEvent structuresDESCRiPTIONThis object wraps an XEvent. XEvent is a union of many different C structs, though they all share a few common fields. The storage space of an XEvent is constant regardless of type, and so this class is backed by a simple scalar ref.The active struct of the union is determined by the "type" field. This object heirarchy attempts to help you make correct usage of the union with respect to the current "type", so as you change the value of "type" the object will automatically re-bless itself into the appropriate subclass, giving you access to new struct fields. Most of the "magic" occurs from Perl code, not XS, so it is possible to define new event types if this module lacks any in your local copy of Xlib. You can also access the "bytes" directly any time you want. And, you don't even have to use this object at all; any scalar or scalarref of the correct length can be passed to the X11::Xlib methods that expect an XEvent pointer. METHODSnewmy $xevent= X11::Xlib::XEvent->new(); my $xevent= X11::Xlib::XEvent->new( %fields ); my $xevent= X11::Xlib::XEvent->new( \%fields ); You can construct XEvent as an empty buffer, or initialize it with a hash or hashref of fields. Initialization is performed via "pack". Un-set fields are initialized to zero, and the "bytes" is always padded to the length of an XEvent. bytesDirect access to the bytes of the XEvent.apply$xevent->apply( %fields ); Alias for " pack( \%fields, 1, 1 ) " pack$xevent->pack( \%fields, $consume, $warn ); Assign a set of fields to the packed struct, optionally removing them from the hashref ($consume) and warning about un-known names ($warn). If you supply a new value for "type", the XEvent will get re-blessed to the appropriate type and all union-specific fields will be zeroed before applying the rest of the supplied fields. unpackmy $field_hashref= $xevent->unpack; Unpack the fields of an XEvent into a hashref. The Display field gets inflated to an X11::Xlib object. summarizeReturn a human-readable string describing the Event. The format is intended to be readable by humans, and is subject to change.COMMON ATTRIBUTESAll XEvent subclasses have the following attributes:typeThis is the key attribute that determines all the rest. Setting this value will re-bless the object to the relevant sub-class. If the type is unknown, it becomes "X11::Xlib::XEvent".displayThe handle to the X11 connection that this message came from.serialThe X11 serial numbersend_eventBoolean indicating whether the event was sent with "XSendEvent"SUBCLASS ATTRIBUTESFor detailed information about these structures, consult the official documentation <https://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html>XButtonEventUsed for event type: ButtonPress, ButtonReleasebutton - unsigned int root - Window same_screen - Bool state - unsigned int subwindow - Window time - Time window - Window x - int x_root - int y - int y_root - int XCirculateEventUsed for event type: CirculateNotifyevent - Window place - int window - Window XCirculateRequestEventUsed for event type: CirculateRequestparent - Window place - int window - Window XClientMessageEventUsed for event type: ClientMessageb - char [ 20 ] l - long [ 5 ] s - short [ 10 ] format - int message_type - Atom window - Window XColormapEventUsed for event type: ColormapNotifycolormap - Colormap new - Bool state - int window - Window XConfigureEventUsed for event type: ConfigureNotifyabove - Window border_width - int event - Window height - int override_redirect - Bool width - int window - Window x - int y - int XConfigureRequestEventUsed for event type: ConfigureRequestabove - Window border_width - int detail - int height - int parent - Window value_mask - unsigned long width - int window - Window x - int y - int XCreateWindowEventUsed for event type: CreateNotifyborder_width - int height - int override_redirect - Bool parent - Window width - int window - Window x - int y - int XCrossingEventUsed for event type: EnterNotify, LeaveNotifydetail - int focus - Bool mode - int root - Window same_screen - Bool state - unsigned int subwindow - Window time - Time window - Window x - int x_root - int y - int y_root - int XDestroyWindowEventUsed for event type: DestroyNotifyevent - Window window - Window XErrorEventUsed for event type: 0error_code - unsigned char minor_code - unsigned char request_code - unsigned char resourceid - XID XExposeEventUsed for event type: Exposecount - int height - int width - int window - Window x - int y - int XFocusChangeEventUsed for event type: FocusIn, FocusOutdetail - int mode - int window - Window XGenericEventUsed for event type: GenericEventevtype - int extension - int XGraphicsExposeEventUsed for event type: GraphicsExposecount - int drawable - Drawable height - int major_code - int minor_code - int width - int x - int y - int XGravityEventUsed for event type: GravityNotifyevent - Window window - Window x - int y - int XKeyEventUsed for event type: KeyPress, KeyReleasekeycode - unsigned int root - Window same_screen - Bool state - unsigned int subwindow - Window time - Time window - Window x - int x_root - int y - int y_root - int XKeymapEventUsed for event type: KeymapNotifykey_vector - char [ 32 ] window - Window XMapEventUsed for event type: MapNotifyevent - Window override_redirect - Bool window - Window XMapRequestEventUsed for event type: MapRequestparent - Window window - Window XMappingEventUsed for event type: MappingNotifycount - int first_keycode - int request - int window - Window XMotionEventUsed for event type: MotionNotifyis_hint - char root - Window same_screen - Bool state - unsigned int subwindow - Window time - Time window - Window x - int x_root - int y - int y_root - int XNoExposeEventUsed for event type: NoExposedrawable - Drawable major_code - int minor_code - int XPropertyEventUsed for event type: PropertyNotifyatom - Atom state - int time - Time window - Window XReparentEventUsed for event type: ReparentNotifyevent - Window override_redirect - Bool parent - Window window - Window x - int y - int XResizeRequestEventUsed for event type: ResizeRequestheight - int width - int window - Window XSelectionClearEventUsed for event type: SelectionClearselection - Atom time - Time window - Window XSelectionEventUsed for event type: SelectionNotifyproperty - Atom requestor - Window selection - Atom target - Atom time - Time XSelectionRequestEventUsed for event type: SelectionRequestowner - Window property - Atom requestor - Window selection - Atom target - Atom time - Time XUnmapEventUsed for event type: UnmapNotifyevent - Window from_configure - Bool window - Window XVisibilityEventUsed for event type: VisibilityNotifystate - int window - Window AUTHOROlivier Thauvin, <nanardon@nanardon.zarb.org>Michael Conrad, <mike@nrdvana.net> COPYRIGHT AND LICENSECopyright (C) 2009-2010 by Olivier ThauvinCopyright (C) 2017 by Michael Conrad This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
Visit the GSP FreeBSD Man Page Interface. |