Struct x11rb_protocol::protocol::xproto::GC

source ·
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§

source§

impl GC

source

pub const FUNCTION: Self = _

source

pub const PLANE_MASK: Self = _

source

pub const FOREGROUND: Self = _

source

pub const BACKGROUND: Self = _

source

pub const LINE_WIDTH: Self = _

source

pub const LINE_STYLE: Self = _

source

pub const CAP_STYLE: Self = _

source

pub const JOIN_STYLE: Self = _

source

pub const FILL_STYLE: Self = _

source

pub const FILL_RULE: Self = _

source

pub const TILE: Self = _

source

pub const STIPPLE: Self = _

source

pub const TILE_STIPPLE_ORIGIN_X: Self = _

source

pub const TILE_STIPPLE_ORIGIN_Y: Self = _

source

pub const FONT: Self = _

source

pub const SUBWINDOW_MODE: Self = _

source

pub const GRAPHICS_EXPOSURES: Self = _

source

pub const CLIP_ORIGIN_X: Self = _

source

pub const CLIP_ORIGIN_Y: Self = _

source

pub const CLIP_MASK: Self = _

source

pub const DASH_OFFSET: Self = _

source

pub const DASH_LIST: Self = _

source

pub const ARC_MODE: Self = _

source§

impl GC

source

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.

source

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.

source

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

Remove some flags.

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

source

pub fn bits(self) -> u32

Returns the internal value of the object.

Trait Implementations§

source§

impl BitAnd<GC> for u32

§

type Output = GC

The resulting type after applying the & operator.
source§

fn bitand(self, other: GC) -> Self::Output

Performs the & operation. Read more
source§

impl BitAnd<u32> for GC

§

type Output = GC

The resulting type after applying the & operator.
source§

fn bitand(self, other: u32) -> Self::Output

Performs the & operation. Read more
source§

impl BitAnd for GC

§

type Output = GC

The resulting type after applying the & operator.
source§

fn bitand(self, other: Self) -> Self::Output

Performs the & operation. Read more
source§

impl BitAndAssign<GC> for u32

source§

fn bitand_assign(&mut self, other: GC)

Performs the &= operation. Read more
source§

impl BitAndAssign<u32> for GC

source§

fn bitand_assign(&mut self, other: u32)

Performs the &= operation. Read more
source§

impl BitAndAssign for GC

source§

fn bitand_assign(&mut self, other: GC)

Performs the &= operation. Read more
source§

impl BitOr<GC> for u32

§

type Output = GC

The resulting type after applying the | operator.
source§

fn bitor(self, other: GC) -> Self::Output

Performs the | operation. Read more
source§

impl BitOr<u32> for GC

§

type Output = GC

The resulting type after applying the | operator.
source§

fn bitor(self, other: u32) -> Self::Output

Performs the | operation. Read more
source§

impl BitOr for GC

§

type Output = GC

The resulting type after applying the | operator.
source§

fn bitor(self, other: Self) -> Self::Output

Performs the | operation. Read more
source§

impl BitOrAssign<GC> for u32

source§

fn bitor_assign(&mut self, other: GC)

Performs the |= operation. Read more
source§

impl BitOrAssign<u32> for GC

source§

fn bitor_assign(&mut self, other: u32)

Performs the |= operation. Read more
source§

impl BitOrAssign for GC

source§

fn bitor_assign(&mut self, other: GC)

Performs the |= operation. Read more
source§

impl Clone for GC

source§

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
source§

impl Debug for GC

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for GC

source§

fn default() -> GC

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

impl<'de> Deserialize<'de> for GC

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<GC> for Option<u32>

source§

fn from(input: GC) -> Self

Converts to this type from the input type.
source§

impl From<GC> for u32

source§

fn from(input: GC) -> Self

Converts to this type from the input type.
source§

impl From<u16> for GC

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for GC

source§

fn from(value: u32) -> Self

Converts to this type from the input type.
source§

impl From<u8> for GC

source§

fn from(value: u8) -> Self

Converts to this type from the input type.
source§

impl Hash for GC

source§

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

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
source§

impl Ord for GC

source§

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 + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for GC

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl PartialOrd for GC

source§

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

This method 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

This method 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

This method 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

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

impl Serialize for GC

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for GC

source§

impl Eq for GC

source§

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> 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,

§

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>,

§

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>,

§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,