Struct x11rb::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: GC = _

source

pub const PLANE_MASK: GC = _

source

pub const FOREGROUND: GC = _

source

pub const BACKGROUND: GC = _

source

pub const LINE_WIDTH: GC = _

source

pub const LINE_STYLE: GC = _

source

pub const CAP_STYLE: GC = _

source

pub const JOIN_STYLE: GC = _

source

pub const FILL_STYLE: GC = _

source

pub const FILL_RULE: GC = _

source

pub const TILE: GC = _

source

pub const STIPPLE: GC = _

source

pub const TILE_STIPPLE_ORIGIN_X: GC = _

source

pub const TILE_STIPPLE_ORIGIN_Y: GC = _

source

pub const FONT: GC = _

source

pub const SUBWINDOW_MODE: GC = _

source

pub const GRAPHICS_EXPOSURES: GC = _

source

pub const CLIP_ORIGIN_X: GC = _

source

pub const CLIP_ORIGIN_Y: GC = _

source

pub const CLIP_MASK: GC = _

source

pub const DASH_OFFSET: GC = _

source

pub const DASH_LIST: GC = _

source

pub const ARC_MODE: GC = _

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>) -> GC

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<u32> for GC

§

type Output = GC

The resulting type after applying the & operator.
source§

fn bitand(self, other: u32) -> <GC as BitAnd<u32>>::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: GC) -> <GC as BitAnd>::Output

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<u32> for GC

§

type Output = GC

The resulting type after applying the | operator.
source§

fn bitor(self, other: u32) -> <GC as BitOr<u32>>::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: GC) -> <GC as BitOr>::Output

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<(), Error>

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 From<u16> for GC

source§

fn from(value: u16) -> GC

Converts to this type from the input type.
source§

impl From<u32> for GC

source§

fn from(value: u32) -> GC

Converts to this type from the input type.
source§

impl From<u8> for GC

source§

fn from(value: u8) -> GC

Converts to this type from the input type.
source§

impl Hash for GC

source§

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
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 Copy for GC

source§

impl Eq for GC

source§

impl StructuralEq for GC

source§

impl StructuralPartialEq for GC

Auto Trait Implementations§

§

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.