Struct x11rb::protocol::xproto::ChangeGCRequest[][src]

pub struct ChangeGCRequest<'input> {
    pub gc: Gcontext,
    pub value_list: Cow<'input, ChangeGCAux>,
}

change graphics context components.

Changes the components specified by value_mask for the specified graphics context.

Fields

  • gc - The graphics context to change.
  • value_mask -
  • value_list - Values for each of the components specified in the bitmask value_mask. The order has to correspond to the order of possible value_mask bits. See the example.

Errors

  • Font - TODO: reasons?
  • GContext - TODO: reasons?
  • Match - TODO: reasons?
  • Pixmap - TODO: reasons?
  • Value - TODO: reasons?
  • Alloc - The X server could not allocate the requested resources (no memory?).

Example

/*
 * Changes the foreground color component of the specified graphics context.
 *
 */
void my_example(xcb_connection_t *conn, xcb_gcontext_t gc, uint32_t fg, uint32_t bg) {
    /* C99 allows us to use a compact way of changing a single component: */
    xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){ fg });

    /* The more explicit way. Beware that the order of values is important! */
    uint32_t mask = 0;
    mask |= XCB_GC_FOREGROUND;
    mask |= XCB_GC_BACKGROUND;

    uint32_t values[] = {
        fg,
        bg
    };
    xcb_change_gc(conn, gc, mask, values);
    xcb_flush(conn);
}

Fields

gc: Gcontextvalue_list: Cow<'input, ChangeGCAux>

Implementations

impl<'input> ChangeGCRequest<'input>[src]

pub fn send<Conn: ?Sized>(
    self,
    conn: &Conn
) -> Result<VoidCookie<'_, Conn>, ConnectionError> where
    Conn: RequestConnection
[src]

pub fn try_parse_request(
    header: RequestHeader,
    value: &'input [u8]
) -> Result<Self, ParseError>
[src]

Parse this request given its header, its body, and any fds that go along with it

pub fn into_owned(self) -> ChangeGCRequest<'static>[src]

Clone all borrowed data in this ChangeGCRequest.

Trait Implementations

impl<'input> Clone for ChangeGCRequest<'input>[src]

impl<'input> Debug for ChangeGCRequest<'input>[src]

impl<'input> Eq for ChangeGCRequest<'input>[src]

impl<'input> PartialEq<ChangeGCRequest<'input>> for ChangeGCRequest<'input>[src]

impl<'input> Request for ChangeGCRequest<'input>[src]

type Reply = ()

The kind of reply that this request generates.

impl<'input> StructuralEq for ChangeGCRequest<'input>[src]

impl<'input> StructuralPartialEq for ChangeGCRequest<'input>[src]

Auto Trait Implementations

impl<'input> RefUnwindSafe for ChangeGCRequest<'input>

impl<'input> Send for ChangeGCRequest<'input>

impl<'input> Sync for ChangeGCRequest<'input>

impl<'input> Unpin for ChangeGCRequest<'input>

impl<'input> UnwindSafe for ChangeGCRequest<'input>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.