pub struct GC(/* private fields */);
Expand description
Fields
Function
- TODO: Refer to GXPlaneMask
- 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 stippleFillRule
-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
- TODOTileStippleOriginY
- TODOFont
- Which font to use for theImageText8
andImageText16
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
- TODOClipOriginY
- TODOClipMask
- 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
- TODODashList
- TODOArcMode
- TODO
Implementations§
source§impl GC
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 = _
source§impl GC
impl GC
sourcepub fn contains(self, flag: impl Into<u32>) -> bool
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.
sourcepub fn intersects(self, flag: impl Into<u32>) -> bool
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.
Trait Implementations§
source§impl BitAndAssign<u32> for GC
impl BitAndAssign<u32> for GC
source§fn bitand_assign(&mut self, other: u32)
fn bitand_assign(&mut self, other: u32)
Performs the
&=
operation. Read moresource§impl BitAndAssign for GC
impl BitAndAssign for GC
source§fn bitand_assign(&mut self, other: GC)
fn bitand_assign(&mut self, other: GC)
Performs the
&=
operation. Read moresource§impl BitOrAssign<u32> for GC
impl BitOrAssign<u32> for GC
source§fn bitor_assign(&mut self, other: u32)
fn bitor_assign(&mut self, other: u32)
Performs the
|=
operation. Read moresource§impl BitOrAssign for GC
impl BitOrAssign for GC
source§fn bitor_assign(&mut self, other: GC)
fn bitor_assign(&mut self, other: GC)
Performs the
|=
operation. Read moresource§impl Ord for GC
impl Ord for GC
source§impl PartialOrd for GC
impl PartialOrd for GC
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moreimpl Copy for GC
impl Eq for GC
impl StructuralEq for GC
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more