x11rb::protocol::xproto

Struct GC

pub struct GC(/* private fields */);
Expand description

§Fields

  • Function - TODO: Refer to GX
  • PlaneMask - In graphics operations, given a source and destination pixel, the result is computed bitwise on corresponding bits of the pixels; that is, a Boolean operation is performed in each bit plane. The plane-mask restricts the operation to a subset of planes, so the result is:

((src FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask))

  • Foreground - Foreground colorpixel.
  • Background - Background colorpixel.
  • LineWidth - The line-width is measured in pixels and can be greater than or equal to one, a wide line, or the special value zero, a thin line.
  • LineStyle - The line-style defines which sections of a line are drawn: Solid The full path of the line is drawn. DoubleDash The full path of the line is drawn, but the even dashes are filled differently than the odd dashes (see fill-style), with Butt cap-style used where even and odd dashes meet. OnOffDash Only the even dashes are drawn, and cap-style applies to all internal ends of the individual dashes (except NotLast is treated as Butt).
  • CapStyle - The cap-style defines how the endpoints of a path are drawn: NotLast The result is equivalent to Butt, except that for a line-width of zero the final endpoint is not drawn. Butt The result is square at the endpoint (perpendicular to the slope of the line) with no projection beyond. Round The result is a circular arc with its diameter equal to the line-width, centered on the endpoint; it is equivalent to Butt for line-width zero. Projecting The result is square at the end, but the path continues beyond the endpoint for a distance equal to half the line-width; it is equivalent to Butt for line-width zero.
  • JoinStyle - The join-style defines how corners are drawn for wide lines: Miter The outer edges of the two lines extend to meet at an angle. However, if the angle is less than 11 degrees, a Bevel join-style is used instead. Round The result is a circular arc with a diameter equal to the line-width, centered on the joinpoint. Bevel The result is Butt endpoint styles, and then the triangular notch is filled.
  • FillStyle - The fill-style defines the contents of the source for line, text, and fill requests. For all text and fill requests (for example, PolyText8, PolyText16, PolyFillRectangle, FillPoly, and PolyFillArc) as well as for line requests with line-style Solid, (for example, PolyLine, PolySegment, PolyRectangle, PolyArc) and for the even dashes for line requests with line-style OnOffDash or DoubleDash: Solid Foreground Tiled Tile OpaqueStippled A tile with the same width and height as stipple but with background everywhere stipple has a zero and with foreground everywhere stipple has a one Stippled Foreground masked by stipple For the odd dashes for line requests with line-style DoubleDash: Solid Background Tiled Same as for even dashes OpaqueStippled Same as for even dashes Stippled Background masked by stipple
  • FillRule -
  • Tile - The tile/stipple represents an infinite two-dimensional plane with the tile/stipple replicated in all dimensions. When that plane is superimposed on the drawable for use in a graphics operation, the upper-left corner of some instance of the tile/stipple is at the coordinates within the drawable specified by the tile/stipple origin. The tile/stipple and clip origins are interpreted relative to the origin of whatever destination drawable is specified in a graphics request. The tile pixmap must have the same root and depth as the gcontext (or a Match error results). The stipple pixmap must have depth one and must have the same root as the gcontext (or a Match error results). For fill-style Stippled (but not fill-style OpaqueStippled), the stipple pattern is tiled in a single plane and acts as an additional clip mask to be ANDed with the clip-mask. Any size pixmap can be used for tiling or stippling, although some sizes may be faster to use than others.
  • Stipple - The tile/stipple represents an infinite two-dimensional plane with the tile/stipple replicated in all dimensions. When that plane is superimposed on the drawable for use in a graphics operation, the upper-left corner of some instance of the tile/stipple is at the coordinates within the drawable specified by the tile/stipple origin. The tile/stipple and clip origins are interpreted relative to the origin of whatever destination drawable is specified in a graphics request. The tile pixmap must have the same root and depth as the gcontext (or a Match error results). The stipple pixmap must have depth one and must have the same root as the gcontext (or a Match error results). For fill-style Stippled (but not fill-style OpaqueStippled), the stipple pattern is tiled in a single plane and acts as an additional clip mask to be ANDed with the clip-mask. Any size pixmap can be used for tiling or stippling, although some sizes may be faster to use than others.
  • TileStippleOriginX - TODO
  • TileStippleOriginY - TODO
  • Font - Which font to use for the ImageText8 and ImageText16 requests.
  • SubwindowMode - For ClipByChildren, both source and destination windows are additionally clipped by all viewable InputOutput children. For IncludeInferiors, neither source nor destination window is clipped by inferiors. This will result in including subwindow contents in the source and drawing through subwindow boundaries of the destination. The use of IncludeInferiors with a source or destination window of one depth with mapped inferiors of differing depth is not illegal, but the semantics is undefined by the core protocol.
  • GraphicsExposures - Whether ExposureEvents should be generated (1) or not (0).

The default is 1.

  • ClipOriginX - TODO
  • ClipOriginY - TODO
  • ClipMask - The clip-mask restricts writes to the destination drawable. Only pixels where the clip-mask has bits set to 1 are drawn. Pixels are not drawn outside the area covered by the clip-mask or where the clip-mask has bits set to 0. The clip-mask affects all graphics requests, but it does not clip sources. The clip-mask origin is interpreted relative to the origin of whatever destination drawable is specified in a graphics request. If a pixmap is specified as the clip-mask, it must have depth 1 and have the same root as the gcontext (or a Match error results). If clip-mask is None, then pixels are always drawn, regardless of the clip origin. The clip-mask can also be set with the SetClipRectangles request.
  • DashOffset - TODO
  • DashList - TODO
  • ArcMode - TODO

Implementations§

§

impl GC

pub const FUNCTION: GC = _

pub const PLANE_MASK: GC = _

pub const FOREGROUND: GC = _

pub const BACKGROUND: GC = _

pub const LINE_WIDTH: GC = _

pub const LINE_STYLE: GC = _

pub const CAP_STYLE: GC = _

pub const JOIN_STYLE: GC = _

pub const FILL_STYLE: GC = _

pub const FILL_RULE: GC = _

pub const TILE: GC = _

pub const STIPPLE: GC = _

pub const TILE_STIPPLE_ORIGIN_X: GC = _

pub const TILE_STIPPLE_ORIGIN_Y: GC = _

pub const FONT: GC = _

pub const SUBWINDOW_MODE: GC = _

pub const GRAPHICS_EXPOSURES: GC = _

pub const CLIP_ORIGIN_X: GC = _

pub const CLIP_ORIGIN_Y: GC = _

pub const CLIP_MASK: GC = _

pub const DASH_OFFSET: GC = _

pub const DASH_LIST: GC = _

pub const ARC_MODE: GC = _

§

impl GC

pub fn contains(self, flag: impl Into<u32>) -> bool

Check if this object has all bits set that are also set in flag.

flag can be a single enum variant or a whole other mask.

pub fn intersects(self, flag: impl Into<u32>) -> bool

Check if this object has some bits set that are also set in flag.

flag can be a single enum variant or a whole other mask.

pub fn remove(self, flags: impl Into<u32>) -> GC

Remove some flags.

All bits that are set in the given flags are removed from the self instance, if they are present.

pub fn bits(self) -> u32

Returns the internal value of the object.

Trait Implementations§

§

impl BitAnd<u32> for GC

§

type Output = GC

The resulting type after applying the & operator.
§

fn bitand(self, other: u32) -> <GC as BitAnd<u32>>::Output

Performs the & operation. Read more
§

impl BitAnd for GC

§

type Output = GC

The resulting type after applying the & operator.
§

fn bitand(self, other: GC) -> <GC as BitAnd>::Output

Performs the & operation. Read more
§

impl BitAndAssign<u32> for GC

§

fn bitand_assign(&mut self, other: u32)

Performs the &= operation. Read more
§

impl BitAndAssign for GC

§

fn bitand_assign(&mut self, other: GC)

Performs the &= operation. Read more
§

impl BitOr<u32> for GC

§

type Output = GC

The resulting type after applying the | operator.
§

fn bitor(self, other: u32) -> <GC as BitOr<u32>>::Output

Performs the | operation. Read more
§

impl BitOr for GC

§

type Output = GC

The resulting type after applying the | operator.
§

fn bitor(self, other: GC) -> <GC as BitOr>::Output

Performs the | operation. Read more
§

impl BitOrAssign<u32> for GC

§

fn bitor_assign(&mut self, other: u32)

Performs the |= operation. Read more
§

impl BitOrAssign for GC

§

fn bitor_assign(&mut self, other: GC)

Performs the |= operation. Read more
§

impl Clone for GC

§

fn clone(&self) -> GC

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for GC

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for GC

§

fn default() -> GC

Returns the “default value” for a type. Read more
§

impl From<u16> for GC

§

fn from(value: u16) -> GC

Converts to this type from the input type.
§

impl From<u32> for GC

§

fn from(value: u32) -> GC

Converts to this type from the input type.
§

impl From<u8> for GC

§

fn from(value: u8) -> GC

Converts to this type from the input type.
§

impl Hash for GC

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for GC

§

fn cmp(&self, other: &GC) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for GC

§

fn eq(&self, other: &GC) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for GC

§

fn partial_cmp(&self, other: &GC) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Copy for GC

§

impl Eq for GC

§

impl StructuralPartialEq for GC

Auto Trait Implementations§

§

impl Freeze for GC

§

impl RefUnwindSafe for GC

§

impl Send for GC

§

impl Sync for GC

§

impl Unpin for GC

§

impl UnwindSafe for GC

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.