Struct x11rb_protocol::protocol::xproto::SendEventRequest
source · [−]pub struct SendEventRequest<'input> {
pub propagate: bool,
pub destination: Window,
pub event_mask: u32,
pub event: Cow<'input, [u8; 32]>,
}
Expand description
send an event.
Identifies the destination
window, determines which clients should receive
the specified event and ignores any active grabs.
The event
must be one of the core events or an event defined by an extension,
so that the X server can correctly byte-swap the contents as necessary. The
contents of event
are otherwise unaltered and unchecked except for the
send_event
field which is forced to ‘true’.
Fields
destination
- The window to send this event to. Every client which selects any event withinevent_mask
ondestination
will get the event.
The special value XCB_SEND_EVENT_DEST_POINTER_WINDOW
refers to the window
that contains the mouse pointer.
The special value XCB_SEND_EVENT_DEST_ITEM_FOCUS
refers to the window which
has the keyboard focus.
event_mask
- Event_mask for determining which clients should receive the specified event. Seedestination
andpropagate
.propagate
- Ifpropagate
is true and no clients have selected any event ondestination
, the destination is replaced with the closest ancestor ofdestination
for which some client has selected a type inevent_mask
and for which no intervening window has that type in its do-not-propagate-mask. If no such window exists or if the window is an ancestor of the focus window andInputFocus
was originally specified as the destination, the event is not sent to any clients. Otherwise, the event is reported to every client selecting on the final destination any of the types specified inevent_mask
.event
- The event to send to the specifieddestination
.
Errors
Window
- The specifieddestination
window does not exist.Value
- The givenevent
is neither a core event nor an event defined by an extension.
See
ConfigureNotify
: event
Example
/*
* Tell the given window that it was configured to a size of 800x600 pixels.
*
*/
void my_example(xcb_connection_t *conn, xcb_window_t window) {
/* Every X11 event is 32 bytes long. Therefore, XCB will copy 32 bytes.
* In order to properly initialize these bytes, we allocate 32 bytes even
* though we only need less for an xcb_configure_notify_event_t */
xcb_configure_notify_event_t *event = calloc(32, 1);
event->event = window;
event->window = window;
event->response_type = XCB_CONFIGURE_NOTIFY;
event->x = 0;
event->y = 0;
event->width = 800;
event->height = 600;
event->border_width = 0;
event->above_sibling = XCB_NONE;
event->override_redirect = false;
xcb_send_event(conn, false, window, XCB_EVENT_MASK_STRUCTURE_NOTIFY,
(char*)event);
xcb_flush(conn);
free(event);
}
Fields
propagate: bool
destination: Window
event_mask: u32
event: Cow<'input, [u8; 32]>
Implementations
sourceimpl<'input> SendEventRequest<'input>
impl<'input> SendEventRequest<'input>
sourcepub fn serialize(self) -> BufWithFds<PiecewiseBuf<'input>>
pub fn serialize(self) -> BufWithFds<PiecewiseBuf<'input>>
Serialize this request into bytes for the provided connection
sourcepub fn try_parse_request(
header: RequestHeader,
value: &'input [u8]
) -> Result<Self, ParseError>
pub fn try_parse_request(
header: RequestHeader,
value: &'input [u8]
) -> Result<Self, ParseError>
Parse this request given its header, its body, and any fds that go along with it
sourcepub fn into_owned(self) -> SendEventRequest<'static>
pub fn into_owned(self) -> SendEventRequest<'static>
Clone all borrowed data in this SendEventRequest.
Trait Implementations
sourceimpl<'input> Clone for SendEventRequest<'input>
impl<'input> Clone for SendEventRequest<'input>
sourcefn clone(&self) -> SendEventRequest<'input>
fn clone(&self) -> SendEventRequest<'input>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'input> Debug for SendEventRequest<'input>
impl<'input> Debug for SendEventRequest<'input>
sourceimpl<'input> Default for SendEventRequest<'input>
impl<'input> Default for SendEventRequest<'input>
sourcefn default() -> SendEventRequest<'input>
fn default() -> SendEventRequest<'input>
Returns the “default value” for a type. Read more
sourceimpl<'input> Hash for SendEventRequest<'input>
impl<'input> Hash for SendEventRequest<'input>
sourceimpl<'input> Ord for SendEventRequest<'input>
impl<'input> Ord for SendEventRequest<'input>
sourceimpl<'input> PartialEq<SendEventRequest<'input>> for SendEventRequest<'input>
impl<'input> PartialEq<SendEventRequest<'input>> for SendEventRequest<'input>
sourcefn eq(&self, other: &SendEventRequest<'input>) -> bool
fn eq(&self, other: &SendEventRequest<'input>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SendEventRequest<'input>) -> bool
fn ne(&self, other: &SendEventRequest<'input>) -> bool
This method tests for !=
.
sourceimpl<'input> PartialOrd<SendEventRequest<'input>> for SendEventRequest<'input>
impl<'input> PartialOrd<SendEventRequest<'input>> for SendEventRequest<'input>
sourcefn partial_cmp(&self, other: &SendEventRequest<'input>) -> Option<Ordering>
fn partial_cmp(&self, other: &SendEventRequest<'input>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<'input> Request for SendEventRequest<'input>
impl<'input> Request for SendEventRequest<'input>
impl<'input> Eq for SendEventRequest<'input>
impl<'input> StructuralEq for SendEventRequest<'input>
impl<'input> StructuralPartialEq for SendEventRequest<'input>
impl<'input> VoidRequest for SendEventRequest<'input>
Auto Trait Implementations
impl<'input> RefUnwindSafe for SendEventRequest<'input>
impl<'input> Send for SendEventRequest<'input>
impl<'input> Sync for SendEventRequest<'input>
impl<'input> Unpin for SendEventRequest<'input>
impl<'input> UnwindSafe for SendEventRequest<'input>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more