Struct x11rb::protocol::xproto::ChangeGCRequest [−][src]
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 bitmaskvalue_mask
. The order has to correspond to the order of possiblevalue_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: Gcontext
value_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]
self,
conn: &Conn
) -> Result<VoidCookie<'_, Conn>, ConnectionError> where
Conn: RequestConnection,
pub fn try_parse_request(
header: RequestHeader,
value: &'input [u8]
) -> Result<Self, ParseError>
[src]
header: RequestHeader,
value: &'input [u8]
) -> Result<Self, ParseError>
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]
fn clone(&self) -> ChangeGCRequest<'input>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'input> Debug for ChangeGCRequest<'input>
[src]
impl<'input> Eq for ChangeGCRequest<'input>
[src]
impl<'input> PartialEq<ChangeGCRequest<'input>> for ChangeGCRequest<'input>
[src]
fn eq(&self, other: &ChangeGCRequest<'input>) -> bool
[src]
fn ne(&self, other: &ChangeGCRequest<'input>) -> bool
[src]
impl<'input> Request for ChangeGCRequest<'input>
[src]
type Reply = ()
The kind of reply that this request generates.
fn parse_reply<'a>(
bytes: &'a [u8],
fds: &mut Vec<RawFdContainer>
) -> Result<(Reply, &'a [u8]), ParseError>
[src]
bytes: &'a [u8],
fds: &mut Vec<RawFdContainer>
) -> Result<(Reply, &'a [u8]), ParseError>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,