[−][src]Trait flutterbug::drawable::Drawable
Objects that can be drawed upon.
Required methods
fn gc_ref(&self) -> GraphicsContextReference
Get a reference to the graphics context that this item has stored.
Provided methods
fn dpy(&self) -> DisplayReference
Get the display reference stored by the object. By default, this uses the one stored in the graphics context.
fn colormap(&self) -> Result<ColorMap, FlutterbugError>
Get a reference to the colormap. By default, this gets the colormap used by the loaded display.
fn gc_properties(
&self,
mask: GraphicsContextValues
) -> Result<XGCValues, FlutterbugError>
&self,
mask: GraphicsContextValues
) -> Result<XGCValues, FlutterbugError>
Get the properties of the graphics context for this drawable.
fn set_gc_properties(
&self,
mask: GraphicsContextValues,
vals: XGCValues
) -> Result<(), FlutterbugError>
&self,
mask: GraphicsContextValues,
vals: XGCValues
) -> Result<(), FlutterbugError>
Set the properties of the graphics context for this drawable.
fn set_foreground(&self, color: Color) -> Result<(), FlutterbugError>
Set the foreground color for this drawable.
fn set_background(&self, color: Color) -> Result<(), FlutterbugError>
Set the background color for this drawable.
fn set_line_width(&self, width: u32) -> Result<(), FlutterbugError>
Set the line width for this drawable.
fn pixmap(
&self,
size: Size2D<u32>,
depth: u32
) -> Result<Pixmap, FlutterbugError>
&self,
size: Size2D<u32>,
depth: u32
) -> Result<Pixmap, FlutterbugError>
Create a pixmap object bound to this drawable.
fn draw_string(
&self,
origin: Point2D<i32>,
text: &str
) -> Result<(), FlutterbugError>
&self,
origin: Point2D<i32>,
text: &str
) -> Result<(), FlutterbugError>
Draw a string on this object.
fn copy_area(
&self,
origin: &dyn Drawable,
origin_pt: Point2D<i32>,
dest_pt: Point2D<i32>,
size: Size2D<u32>
) -> Result<(), FlutterbugError>
&self,
origin: &dyn Drawable,
origin_pt: Point2D<i32>,
dest_pt: Point2D<i32>,
size: Size2D<u32>
) -> Result<(), FlutterbugError>
Copy an area to this drawable from another drawable.
fn draw_line(
&self,
point1: Point2D<i32>,
point2: Point2D<i32>
) -> Result<(), FlutterbugError>
&self,
point1: Point2D<i32>,
point2: Point2D<i32>
) -> Result<(), FlutterbugError>
Draw a line.
fn draw_point(&self, point: Point2D<i32>) -> Result<(), FlutterbugError>
Draw a point.
fn draw_lines(
&self,
lines: &[(Point2D<i32>, Point2D<i32>)]
) -> Result<(), FlutterbugError>
&self,
lines: &[(Point2D<i32>, Point2D<i32>)]
) -> Result<(), FlutterbugError>
Draw several lines.
fn draw_points(&self, points: &[Point2D<i32>]) -> Result<(), FlutterbugError>
Draw several points.
fn image(
&self,
origin: Point2D<i32>,
size: Size2D<u32>
) -> Result<Image, FlutterbugError>
&self,
origin: Point2D<i32>,
size: Size2D<u32>
) -> Result<Image, FlutterbugError>
Get an image from a rectangle on this drawable.
fn put_image(
&self,
image: &dyn GenericImage,
src_origin: Point2D<i32>,
dest_origin: Point2D<i32>,
size: Size2D<u32>
) -> Result<(), FlutterbugError>
&self,
image: &dyn GenericImage,
src_origin: Point2D<i32>,
dest_origin: Point2D<i32>,
size: Size2D<u32>
) -> Result<(), FlutterbugError>
Draw an image onto this drawable.
fn draw_rectangle(
&self,
origin: Point2D<i32>,
size: Size2D<u32>
) -> Result<(), FlutterbugError>
&self,
origin: Point2D<i32>,
size: Size2D<u32>
) -> Result<(), FlutterbugError>
Draw a rectangle onto this drawable.
fn draw_arc(
&self,
origin: Point2D<i32>,
size: Size2D<u32>,
angles: (i32, i32)
) -> Result<(), FlutterbugError>
&self,
origin: Point2D<i32>,
size: Size2D<u32>,
angles: (i32, i32)
) -> Result<(), FlutterbugError>
Draw an arc onto this drawable.
fn draw_rectangles(
&self,
rects: &[(Point2D<i32>, Size2D<u32>)]
) -> Result<(), FlutterbugError>
&self,
rects: &[(Point2D<i32>, Size2D<u32>)]
) -> Result<(), FlutterbugError>
Draw a series of rectangles onto this drawable.
fn draw_arcs(
&self,
arcs: &[(Point2D<i32>, Size2D<u32>, (i32, i32))]
) -> Result<(), FlutterbugError>
&self,
arcs: &[(Point2D<i32>, Size2D<u32>, (i32, i32))]
) -> Result<(), FlutterbugError>
Draw a series of arcs onto this drawable.
fn fill_rectangle(
&self,
origin: Point2D<i32>,
size: Size2D<u32>
) -> Result<(), FlutterbugError>
&self,
origin: Point2D<i32>,
size: Size2D<u32>
) -> Result<(), FlutterbugError>
Fill a rectangle in this drawable.
fn fill_polygon(
&self,
points: &[Point2D<i32>],
shape: PolygonShape
) -> Result<(), FlutterbugError>
&self,
points: &[Point2D<i32>],
shape: PolygonShape
) -> Result<(), FlutterbugError>
Fill a polygon in this drawable.
fn fill_arc(
&self,
origin: Point2D<i32>,
size: Size2D<u32>,
angles: (i32, i32)
) -> Result<(), FlutterbugError>
&self,
origin: Point2D<i32>,
size: Size2D<u32>,
angles: (i32, i32)
) -> Result<(), FlutterbugError>
Fill an arc in this drawable.
fn fill_rectangles(
&self,
rects: &[(Point2D<i32>, Size2D<u32>)]
) -> Result<(), FlutterbugError>
&self,
rects: &[(Point2D<i32>, Size2D<u32>)]
) -> Result<(), FlutterbugError>
Fill several rectangles in this drawable.
fn fill_arcs(
&self,
arcs: &[(Point2D<i32>, Size2D<u32>, (i32, i32))]
) -> Result<(), FlutterbugError>
&self,
arcs: &[(Point2D<i32>, Size2D<u32>, (i32, i32))]
) -> Result<(), FlutterbugError>
Fill several arcs in this drawable.