This commit is contained in:
wash2 2026-04-18 20:11:25 +00:00
commit 0fa87f2b35
16382 changed files with 734838 additions and 0 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,45 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Canvases can be leveraged to draw interactive 2D graphics."><title>cosmic::iced::widget::canvas - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module canvas</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example-drawing-a-simple-circle" title="Example: Drawing a Simple Circle">Example: Drawing a Simple Circle</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>iced::<wbr>widget</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">iced</a>::<wbr><a href="../index.html">widget</a></div><h1>Module <span>canvas</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Canvases can be leveraged to draw interactive 2D graphics.</p>
<h2 id="example-drawing-a-simple-circle"><a class="doc-anchor" href="#example-drawing-a-simple-circle">§</a>Example: Drawing a Simple Circle</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>iced::mouse;
<span class="kw">use </span>iced::widget::canvas;
<span class="kw">use </span>iced::{Color, Rectangle, Renderer, Theme};
<span class="comment">// First, we define the data we need for drawing
</span><span class="attr">#[derive(Debug)]
</span><span class="kw">struct </span>Circle {
radius: f32,
}
<span class="comment">// Then, we implement the `Program` trait
</span><span class="kw">impl</span>&lt;Message&gt; canvas::Program&lt;Message&gt; <span class="kw">for </span>Circle {
<span class="comment">// No internal state
</span><span class="kw">type </span>State = ();
<span class="kw">fn </span>draw(
<span class="kw-2">&amp;</span><span class="self">self</span>,
_state: <span class="kw-2">&amp;</span>(),
renderer: <span class="kw-2">&amp;</span>Renderer,
_theme: <span class="kw-2">&amp;</span>Theme,
bounds: Rectangle,
_cursor: mouse::Cursor
) -&gt; Vec&lt;canvas::Geometry&gt; {
<span class="comment">// We prepare a new `Frame`
</span><span class="kw">let </span><span class="kw-2">mut </span>frame = canvas::Frame::new(renderer, bounds.size());
<span class="comment">// We create a `Path` representing a simple circle
</span><span class="kw">let </span>circle = canvas::Path::circle(frame.center(), <span class="self">self</span>.radius);
<span class="comment">// And fill it with some color
</span>frame.fill(<span class="kw-2">&amp;</span>circle, Color::BLACK);
<span class="comment">// Then, we produce the geometry
</span><span class="macro">vec!</span>[frame.into_geometry()]
}
}
<span class="comment">// Finally, we simply use our `Circle` to create the `Canvas`!
</span><span class="kw">fn </span>view&lt;<span class="lifetime">'a</span>, Message: <span class="lifetime">'a</span>&gt;(_state: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>State) -&gt; Element&lt;<span class="lifetime">'a</span>, Message&gt; {
canvas(Circle { radius: <span class="number">50.0 </span>}).into()
}</code></pre></div>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Action.html" title="struct cosmic::iced::widget::canvas::Action">Action</a></dt><dd>A runtime action that can be performed by some widgets.</dd><dt><a class="struct" href="struct.Canvas.html" title="struct cosmic::iced::widget::canvas::Canvas">Canvas</a></dt><dd>A widget capable of drawing 2D graphics.</dd><dt><a class="struct" href="struct.Fill.html" title="struct cosmic::iced::widget::canvas::Fill">Fill</a></dt><dd>The style used to fill geometry.</dd><dt><a class="struct" href="struct.Group.html" title="struct cosmic::iced::widget::canvas::Group">Group</a></dt><dd>A cache group.</dd><dt><a class="struct" href="struct.Image.html" title="struct cosmic::iced::widget::canvas::Image">Image</a></dt><dd>A raster image that can be drawn.</dd><dt><a class="struct" href="struct.LineDash.html" title="struct cosmic::iced::widget::canvas::LineDash">Line<wbr>Dash</a></dt><dd>The dash pattern used when stroking the line.</dd><dt><a class="struct" href="struct.Path.html" title="struct cosmic::iced::widget::canvas::Path">Path</a></dt><dd>An immutable set of points that may or may not be connected.</dd><dt><a class="struct" href="struct.Stroke.html" title="struct cosmic::iced::widget::canvas::Stroke">Stroke</a></dt><dd>The style of a stroke.</dd><dt><a class="struct" href="struct.Text.html" title="struct cosmic::iced::widget::canvas::Text">Text</a></dt><dd>A bunch of text that can be drawn to a canvas</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Event.html" title="enum cosmic::iced::widget::canvas::Event">Event</a></dt><dd>A user interface event.</dd><dt><a class="enum" href="enum.Gradient.html" title="enum cosmic::iced::widget::canvas::Gradient">Gradient</a></dt><dd>A fill which linearly interpolates colors along a direction.</dd><dt><a class="enum" href="enum.LineCap.html" title="enum cosmic::iced::widget::canvas::LineCap">LineCap</a></dt><dd>The shape used at the end of open subpaths when they are stroked.</dd><dt><a class="enum" href="enum.LineJoin.html" title="enum cosmic::iced::widget::canvas::LineJoin">Line<wbr>Join</a></dt><dd>The shape used at the corners of paths or basic shapes when they are
stroked.</dd><dt><a class="enum" href="enum.Style.html" title="enum cosmic::iced::widget::canvas::Style">Style</a></dt><dd>The coloring style of some drawing.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Program.html" title="trait cosmic::iced::widget::canvas::Program">Program</a></dt><dd>The state and logic of a <a href="../../../widget/struct.Canvas.html" title="struct cosmic::widget::Canvas"><code>Canvas</code></a>.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Cache.html" title="type cosmic::iced::widget::canvas::Cache">Cache</a></dt><dd>A simple cache that stores generated <a href="../../../widget/canvas/type.Geometry.html" title="type cosmic::widget::canvas::Geometry"><code>Geometry</code></a> to avoid recomputation.</dd><dt><a class="type" href="type.Frame.html" title="type cosmic::iced::widget::canvas::Frame">Frame</a></dt><dd>The frame supported by a renderer.</dd><dt><a class="type" href="type.Geometry.html" title="type cosmic::iced::widget::canvas::Geometry">Geometry</a></dt><dd>The geometry supported by a renderer.</dd></dl></section></div></main></body></html>

View file

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["Event","Gradient","LineCap","LineJoin","Style"],"struct":["Action","Canvas","Fill","Group","Image","LineDash","Path","Stroke","Text"],"trait":["Program"],"type":["Cache","Frame","Geometry"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,84 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The state and logic of a `Canvas`."><title>Program in cosmic::iced::widget::canvas - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Program</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.State" title="State">State</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.draw" title="draw">draw</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.mouse_interaction" title="mouse_interaction">mouse_interaction</a></li><li><a href="#method.update" title="update">update</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Program%3CMessage,+Theme,+Renderer%3E-for-%26T" title="&#38;T">&#38;T</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>iced::<wbr>widget::<wbr>canvas</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">iced</a>::<wbr><a href="../index.html">widget</a>::<wbr><a href="index.html">canvas</a></div><h1>Trait <span class="trait">Program</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub trait Program&lt;Message, Theme = <a class="enum" href="../../enum.Theme.html" title="enum cosmic::iced::Theme">Theme</a>, Renderer = Renderer&gt;<div class="where">where
Renderer: <a class="trait" href="../../daemon/program/graphics/geometry/trait.Renderer.html" title="trait cosmic::iced::daemon::program::graphics::geometry::Renderer">Renderer</a>,</div>{
type <a href="#associatedtype.State" class="associatedtype">State</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + 'static;
// Required method
fn <a href="#tymethod.draw" class="fn">draw</a>(
&amp;self,
state: &amp;Self::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
renderer: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Renderer</a>,
theme: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Theme</a>,
bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="struct" href="../../../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a>&lt;&lt;Renderer as <a class="trait" href="../../daemon/program/graphics/geometry/trait.Renderer.html" title="trait cosmic::iced::daemon::program::graphics::geometry::Renderer">Renderer</a>&gt;::<a class="associatedtype" href="../../daemon/program/graphics/geometry/trait.Renderer.html#associatedtype.Geometry" title="type cosmic::iced::daemon::program::graphics::geometry::Renderer::Geometry">Geometry</a>&gt;;
// Provided methods
fn <a href="#method.update" class="fn">update</a>(
&amp;self,
_state: &amp;mut Self::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
_event: &amp;<a class="enum" href="../../enum.Event.html" title="enum cosmic::iced::Event">Event</a>,
_bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../../widget/canvas/struct.Action.html" title="struct cosmic::widget::canvas::Action">Action</a>&lt;Message&gt;&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.mouse_interaction" class="fn">mouse_interaction</a>(
&amp;self,
_state: &amp;Self::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
_bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="enum" href="../../mouse/enum.Interaction.html" title="enum cosmic::iced::mouse::Interaction">Interaction</a> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The state and logic of a <a href="../../../widget/struct.Canvas.html" title="struct cosmic::widget::Canvas"><code>Canvas</code></a>.</p>
<p>A <a href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program"><code>Program</code></a> can mutate internal state and produce messages for an
application.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.State" class="method"><h4 class="code-header">type <a href="#associatedtype.State" class="associatedtype">State</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + 'static</h4></section></summary><div class="docblock"><p>The internal state mutated by the <a href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program"><code>Program</code></a>.</p>
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.draw" class="method"><h4 class="code-header">fn <a href="#tymethod.draw" class="fn">draw</a>(
&amp;self,
state: &amp;Self::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
renderer: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Renderer</a>,
theme: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Theme</a>,
bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="struct" href="../../../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a>&lt;&lt;Renderer as <a class="trait" href="../../daemon/program/graphics/geometry/trait.Renderer.html" title="trait cosmic::iced::daemon::program::graphics::geometry::Renderer">Renderer</a>&gt;::<a class="associatedtype" href="../../daemon/program/graphics/geometry/trait.Renderer.html#associatedtype.Geometry" title="type cosmic::iced::daemon::program::graphics::geometry::Renderer::Geometry">Geometry</a>&gt;</h4></section></summary><div class="docblock"><p>Draws the state of the <a href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program"><code>Program</code></a>, producing a bunch of <a href="../../../widget/canvas/type.Geometry.html" title="type cosmic::widget::canvas::Geometry"><code>Geometry</code></a>.</p>
<p><a href="../../../widget/canvas/type.Geometry.html" title="type cosmic::widget::canvas::Geometry"><code>Geometry</code></a> can be easily generated with a <a href="../../../widget/canvas/type.Frame.html" title="type cosmic::widget::canvas::Frame"><code>Frame</code></a> or stored in a
<a href="../../../widget/canvas/type.Cache.html" title="type cosmic::widget::canvas::Cache"><code>Cache</code></a>.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.update" class="method"><h4 class="code-header">fn <a href="#method.update" class="fn">update</a>(
&amp;self,
_state: &amp;mut Self::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
_event: &amp;<a class="enum" href="../../enum.Event.html" title="enum cosmic::iced::Event">Event</a>,
_bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../../widget/canvas/struct.Action.html" title="struct cosmic::widget::canvas::Action">Action</a>&lt;Message&gt;&gt;</h4></section></summary><div class="docblock"><p>Updates the <a href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="associated type iced_widget::canvas::program::Program::State::State"><code>State</code></a> of the <a href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program"><code>Program</code></a>.</p>
<p>When a <a href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program"><code>Program</code></a> is used in a <a href="../../../widget/struct.Canvas.html" title="struct cosmic::widget::Canvas"><code>Canvas</code></a>, the runtime will call this
method for each <a href="../../enum.Event.html" title="enum cosmic::iced::Event"><code>Event</code></a>.</p>
<p>This method can optionally return an <a href="../../../widget/canvas/struct.Action.html" title="struct cosmic::widget::canvas::Action"><code>Action</code></a> to either notify an
application of any meaningful interactions, capture the event, or
request a redraw.</p>
<p>By default, this method does and returns nothing.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.mouse_interaction" class="method"><h4 class="code-header">fn <a href="#method.mouse_interaction" class="fn">mouse_interaction</a>(
&amp;self,
_state: &amp;Self::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
_bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
_cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="enum" href="../../mouse/enum.Interaction.html" title="enum cosmic::iced::mouse::Interaction">Interaction</a></h4></section></summary><div class="docblock"><p>Returns the current mouse interaction of the <a href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program"><code>Program</code></a>.</p>
<p>The interaction returned will be in effect even if the cursor position
is out of bounds of the programs <a href="../../../widget/struct.Canvas.html" title="struct cosmic::widget::Canvas"><code>Canvas</code></a>.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Program%3CMessage,+Theme,+Renderer%3E-for-%26T" class="impl"><a href="#impl-Program%3CMessage,+Theme,+Renderer%3E-for-%26T" class="anchor">§</a><h3 class="code-header">impl&lt;Message, Theme, Renderer, T&gt; <a class="trait" href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program">Program</a>&lt;Message, Theme, Renderer&gt; for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a><div class="where">where
Renderer: <a class="trait" href="../../daemon/program/graphics/geometry/trait.Renderer.html" title="trait cosmic::iced::daemon::program::graphics::geometry::Renderer">Renderer</a>,
T: <a class="trait" href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program">Program</a>&lt;Message, Theme, Renderer&gt;,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.State-1" class="associatedtype trait-impl"><a href="#associatedtype.State-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.State" class="associatedtype">State</a> = &lt;T as <a class="trait" href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program">Program</a>&lt;Message, Theme, Renderer&gt;&gt;::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a></h4></section><section id="method.update-1" class="method trait-impl"><a href="#method.update-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.update" class="fn">update</a>(
&amp;self,
state: &amp;mut &lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a> as <a class="trait" href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program">Program</a>&lt;Message, Theme, Renderer&gt;&gt;::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
event: &amp;<a class="enum" href="../../enum.Event.html" title="enum cosmic::iced::Event">Event</a>,
bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../../../widget/canvas/struct.Action.html" title="struct cosmic::widget::canvas::Action">Action</a>&lt;Message&gt;&gt;</h4></section><section id="method.draw" class="method trait-impl"><a href="#method.draw" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.draw" class="fn">draw</a>(
&amp;self,
state: &amp;&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a> as <a class="trait" href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program">Program</a>&lt;Message, Theme, Renderer&gt;&gt;::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
renderer: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Renderer</a>,
theme: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;Theme</a>,
bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="struct" href="../../../cctk/sctk/reexports/client/backend/smallvec/alloc/vec/struct.Vec.html" title="struct cosmic::cctk::sctk::reexports::client::backend::smallvec::alloc::vec::Vec">Vec</a>&lt;&lt;Renderer as <a class="trait" href="../../daemon/program/graphics/geometry/trait.Renderer.html" title="trait cosmic::iced::daemon::program::graphics::geometry::Renderer">Renderer</a>&gt;::<a class="associatedtype" href="../../daemon/program/graphics/geometry/trait.Renderer.html#associatedtype.Geometry" title="type cosmic::iced::daemon::program::graphics::geometry::Renderer::Geometry">Geometry</a>&gt;</h4></section><section id="method.mouse_interaction-1" class="method trait-impl"><a href="#method.mouse_interaction-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.mouse_interaction" class="fn">mouse_interaction</a>(
&amp;self,
state: &amp;&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;T</a> as <a class="trait" href="../../../widget/canvas/trait.Program.html" title="trait cosmic::widget::canvas::Program">Program</a>&lt;Message, Theme, Renderer&gt;&gt;::<a class="associatedtype" href="../../../widget/canvas/trait.Program.html#associatedtype.State" title="type cosmic::widget::canvas::Program::State">State</a>,
bounds: <a class="struct" href="../../struct.Rectangle.html" title="struct cosmic::iced::Rectangle">Rectangle</a>,
cursor: <a class="enum" href="../../mouse/enum.Cursor.html" title="enum cosmic::iced::mouse::Cursor">Cursor</a>,
) -&gt; <a class="enum" href="../../mouse/enum.Interaction.html" title="enum cosmic::iced::mouse::Interaction">Interaction</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../../../trait.impl/iced_widget/canvas/program/trait.Program.js" async></script></section></div></main></body></html>

View file

@ -0,0 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A simple cache that stores generated `Geometry` to avoid recomputation."><title>Cache in cosmic::iced::widget::canvas - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Cache</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>iced::<wbr>widget::<wbr>canvas</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">iced</a>::<wbr><a href="../index.html">widget</a>::<wbr><a href="index.html">canvas</a></div><h1>Type Alias <span class="type">Cache</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub type Cache&lt;Renderer = Renderer&gt; = <a class="struct" href="../../daemon/program/graphics/geometry/struct.Cache.html" title="struct cosmic::iced::daemon::program::graphics::geometry::Cache">Cache</a>&lt;Renderer&gt;;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A simple cache that stores generated <a href="../../../widget/canvas/type.Geometry.html" title="type cosmic::widget::canvas::Geometry"><code>Geometry</code></a> to avoid recomputation.</p>
<p>A <a href="../../../widget/canvas/type.Cache.html" title="type cosmic::widget::canvas::Cache"><code>Cache</code></a> will not redraw its geometry unless the dimensions of its layer
change or it is explicitly cleared.</p>
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Cache&lt;Renderer = Renderer&gt; { <span class="comment">/* private fields */</span> }</code></pre><script src="../../../../type.impl/cosmic/iced/daemon/program/graphics/geometry/struct.Cache.js" data-self-path="cosmic::widget::canvas::Cache" async></script></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The frame supported by a renderer."><title>Frame in cosmic::iced::widget::canvas - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Frame</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>iced::<wbr>widget::<wbr>canvas</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">iced</a>::<wbr><a href="../index.html">widget</a>::<wbr><a href="index.html">canvas</a></div><h1>Type Alias <span class="type">Frame</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub type Frame&lt;Renderer = Renderer&gt; = <a class="struct" href="../../daemon/program/graphics/geometry/struct.Frame.html" title="struct cosmic::iced::daemon::program::graphics::geometry::Frame">Frame</a>&lt;Renderer&gt;;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The frame supported by a renderer.</p>
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Frame&lt;Renderer = Renderer&gt; { <span class="comment">/* private fields */</span> }</code></pre><script src="../../../../type.impl/cosmic/iced/daemon/program/graphics/geometry/struct.Frame.js" data-self-path="cosmic::widget::canvas::Frame" async></script></section></div></main></body></html>

View file

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The geometry supported by a renderer."><title>Geometry in cosmic::iced::widget::canvas - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>iced::<wbr>widget::<wbr>canvas</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">iced</a>::<wbr><a href="../index.html">widget</a>::<wbr><a href="index.html">canvas</a></div><h1>Type Alias <span class="type">Geometry</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub type Geometry&lt;Renderer = Renderer&gt; = &lt;Renderer as <a class="trait" href="../../daemon/program/graphics/geometry/trait.Renderer.html" title="trait cosmic::iced::daemon::program::graphics::geometry::Renderer">Renderer</a>&gt;::<a class="associatedtype" href="../../daemon/program/graphics/geometry/trait.Renderer.html#associatedtype.Geometry" title="type cosmic::iced::daemon::program::graphics::geometry::Renderer::Geometry">Geometry</a>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The geometry supported by a renderer.</p>
</div></details></section></div></main></body></html>