rusty_snek_gaem/target/doc/winit/struct.Window.html
2018-10-28 21:14:05 -05:00

111 lines
41 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="API documentation for the Rust `Window` struct in crate `winit`."><meta name="keywords" content="rust, rustlang, rust-lang, Window"><title>winit::Window - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../dark.css"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script src="../storage.js"></script></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><p class='location'>Struct Window</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.set_title">set_title</a><a href="#method.show">show</a><a href="#method.hide">hide</a><a href="#method.get_position">get_position</a><a href="#method.get_inner_position">get_inner_position</a><a href="#method.set_position">set_position</a><a href="#method.get_inner_size">get_inner_size</a><a href="#method.get_outer_size">get_outer_size</a><a href="#method.set_inner_size">set_inner_size</a><a href="#method.set_min_dimensions">set_min_dimensions</a><a href="#method.set_max_dimensions">set_max_dimensions</a><a href="#method.set_resizable">set_resizable</a><a href="#method.get_hidpi_factor">get_hidpi_factor</a><a href="#method.set_cursor">set_cursor</a><a href="#method.set_cursor_position">set_cursor_position</a><a href="#method.grab_cursor">grab_cursor</a><a href="#method.hide_cursor">hide_cursor</a><a href="#method.set_maximized">set_maximized</a><a href="#method.set_fullscreen">set_fullscreen</a><a href="#method.set_decorations">set_decorations</a><a href="#method.set_always_on_top">set_always_on_top</a><a href="#method.set_window_icon">set_window_icon</a><a href="#method.set_ime_spot">set_ime_spot</a><a href="#method.get_current_monitor">get_current_monitor</a><a href="#method.get_available_monitors">get_available_monitors</a><a href="#method.get_primary_monitor">get_primary_monitor</a><a href="#method.id">id</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-WindowExt">WindowExt</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>winit</a></p><script>window.sidebarCurrent = {name: 'Window', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press S to search, ? for more options…" type="search"><a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>winit</a>::<wbr><a class="struct" href=''>Window</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../src/winit/lib.rs.html#148-150' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct Window { /* fields omitted */ }</pre></div><div class='docblock'><p>Represents a window.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">winit</span>::{<span class="ident">Event</span>, <span class="ident">EventsLoop</span>, <span class="ident">Window</span>, <span class="ident">WindowEvent</span>, <span class="ident">ControlFlow</span>};
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">events_loop</span> <span class="op">=</span> <span class="ident">EventsLoop</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="ident">window</span> <span class="op">=</span> <span class="ident">Window</span>::<span class="ident">new</span>(<span class="kw-2">&amp;</span><span class="ident">events_loop</span>).<span class="ident">unwrap</span>();
<span class="ident">events_loop</span>.<span class="ident">run_forever</span>(<span class="op">|</span><span class="ident">event</span><span class="op">|</span> {
<span class="kw">match</span> <span class="ident">event</span> {
<span class="ident">Event</span>::<span class="ident">WindowEvent</span> { <span class="ident">event</span>: <span class="ident">WindowEvent</span>::<span class="ident">CloseRequested</span>, .. } <span class="op">=&gt;</span> {
<span class="ident">ControlFlow</span>::<span class="ident">Break</span>
},
<span class="kw">_</span> <span class="op">=&gt;</span> <span class="ident">ControlFlow</span>::<span class="ident">Continue</span>,
}
});</pre>
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../winit/struct.Window.html" title="struct winit::Window">Window</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#165-430' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>(events_loop: &amp;<a class="struct" href="../winit/struct.EventsLoop.html" title="struct winit::EventsLoop">EventsLoop</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../winit/struct.Window.html" title="struct winit::Window">Window</a>, <a class="enum" href="../winit/enum.CreationError.html" title="enum winit::CreationError">CreationError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#173-176' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a new Window for platforms where this is appropriate.</p>
<p>This function is equivalent to <code>WindowBuilder::new().build(events_loop)</code>.</p>
<p>Error should be very rare and only occur in case of permission denied, incompatible system,
out of memory, etc.</p>
</div><h4 id='method.set_title' class="method"><span id='set_title.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_title' class='fnname'>set_title</a>(&amp;self, title: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#182-184' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Modifies the title of the window.</p>
<p>This is a no-op if the window has already been closed.</p>
</div><h4 id='method.show' class="method"><span id='show.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.show' class='fnname'>show</a>(&amp;self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#193-195' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Shows the window if it was hidden.</p>
<h2 id="platform-specific" class="section-header"><a href="#platform-specific">Platform-specific</a></h2>
<ul>
<li>Has no effect on Android</li>
</ul>
</div><h4 id='method.hide' class="method"><span id='hide.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.hide' class='fnname'>hide</a>(&amp;self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#204-206' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Hides the window if it was visible.</p>
<h2 id="platform-specific-1" class="section-header"><a href="#platform-specific-1">Platform-specific</a></h2>
<ul>
<li>Has no effect on Android</li>
</ul>
</div><h4 id='method.get_position' class="method"><span id='get_position.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_position' class='fnname'>get_position</a>(&amp;self) -&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="../winit/dpi/struct.LogicalPosition.html" title="struct winit::dpi::LogicalPosition">LogicalPosition</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#220-222' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the position of the top-left hand corner of the window relative to the
top-left hand corner of the desktop.</p>
<p>Note that the top-left hand corner of the desktop is not necessarily the same as
the screen. If the user uses a desktop with multiple monitors, the top-left hand corner
of the desktop is the top-left hand corner of the monitor at the top-left of the desktop.</p>
<p>The coordinates can be negative if the top-left hand corner of the window is outside
of the visible screen region.</p>
<p>Returns <code>None</code> if the window no longer exists.</p>
</div><h4 id='method.get_inner_position' class="method"><span id='get_inner_position.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_inner_position' class='fnname'>get_inner_position</a>(&amp;self) -&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="../winit/dpi/struct.LogicalPosition.html" title="struct winit::dpi::LogicalPosition">LogicalPosition</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#229-231' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the position of the top-left hand corner of the window's client area relative to the
top-left hand corner of the desktop.</p>
<p>The same conditions that apply to <code>get_position</code> apply to this method.</p>
</div><h4 id='method.set_position' class="method"><span id='set_position.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_position' class='fnname'>set_position</a>(&amp;self, position: <a class="struct" href="../winit/dpi/struct.LogicalPosition.html" title="struct winit::dpi::LogicalPosition">LogicalPosition</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#239-241' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Modifies the position of the window.</p>
<p>See <code>get_position</code> for more information about the coordinates.</p>
<p>This is a no-op if the window has already been closed.</p>
</div><h4 id='method.get_inner_size' class="method"><span id='get_inner_size.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_inner_size' class='fnname'>get_inner_size</a>(&amp;self) -&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="../winit/dpi/struct.LogicalSize.html" title="struct winit::dpi::LogicalSize">LogicalSize</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#251-253' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the logical size of the window's client area.</p>
<p>The client area is the content of the window, excluding the title bar and borders.</p>
<p>Converting the returned <code>LogicalSize</code> to <code>PhysicalSize</code> produces the size your framebuffer should be.</p>
<p>Returns <code>None</code> if the window no longer exists.</p>
</div><h4 id='method.get_outer_size' class="method"><span id='get_outer_size.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_outer_size' class='fnname'>get_outer_size</a>(&amp;self) -&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="../winit/dpi/struct.LogicalSize.html" title="struct winit::dpi::LogicalSize">LogicalSize</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#262-264' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the logical size of the entire window.</p>
<p>These dimensions include the title bar and borders. If you don't want that (and you usually don't),
use <code>get_inner_size</code> instead.</p>
<p>Returns <code>None</code> if the window no longer exists.</p>
</div><h4 id='method.set_inner_size' class="method"><span id='set_inner_size.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_inner_size' class='fnname'>set_inner_size</a>(&amp;self, size: <a class="struct" href="../winit/dpi/struct.LogicalSize.html" title="struct winit::dpi::LogicalSize">LogicalSize</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#272-274' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Modifies the inner size of the window.</p>
<p>See <code>get_inner_size</code> for more information about the values.</p>
<p>This is a no-op if the window has already been closed.</p>
</div><h4 id='method.set_min_dimensions' class="method"><span id='set_min_dimensions.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_min_dimensions' class='fnname'>set_min_dimensions</a>(&amp;self, dimensions: <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="../winit/dpi/struct.LogicalSize.html" title="struct winit::dpi::LogicalSize">LogicalSize</a>&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#278-280' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets a minimum dimension size for the window.</p>
</div><h4 id='method.set_max_dimensions' class="method"><span id='set_max_dimensions.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_max_dimensions' class='fnname'>set_max_dimensions</a>(&amp;self, dimensions: <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="../winit/dpi/struct.LogicalSize.html" title="struct winit::dpi::LogicalSize">LogicalSize</a>&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#284-286' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets a maximum dimension size for the window.</p>
</div><h4 id='method.set_resizable' class="method"><span id='set_resizable.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_resizable' class='fnname'>set_resizable</a>(&amp;self, resizable: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#299-301' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets whether the window is resizable or not.</p>
<p>Note that making the window unresizable doesn't exempt you from handling <code>Resized</code>, as that event can still be
triggered by DPI scaling, entering fullscreen mode, etc.</p>
<h2 id="platform-specific-2" class="section-header"><a href="#platform-specific-2">Platform-specific</a></h2>
<p>This only has an effect on desktop platforms.</p>
<p>Due to a bug in XFCE, this has no effect on Xfwm.</p>
</div><h4 id='method.get_hidpi_factor' class="method"><span id='get_hidpi_factor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_hidpi_factor' class='fnname'>get_hidpi_factor</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#316-318' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the DPI factor that can be used to map logical pixels to physical pixels, and vice versa.</p>
<p>See the <a href="dpi/index.html"><code>dpi</code></a> module for more information.</p>
<p>Note that this value can change depending on user action (for example if the window is
moved to another screen); as such, tracking <code>WindowEvent::HiDpiFactorChanged</code> events is
the most robust way to track the DPI you need to use to draw.</p>
<h2 id="platform-specific-3" class="section-header"><a href="#platform-specific-3">Platform-specific</a></h2>
<ul>
<li><strong>X11:</strong> Can be overridden using the <code>WINIT_HIDPI_FACTOR</code> environment variable.</li>
<li><strong>Android:</strong> Always returns 1.0.</li>
</ul>
</div><h4 id='method.set_cursor' class="method"><span id='set_cursor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_cursor' class='fnname'>set_cursor</a>(&amp;self, cursor: <a class="enum" href="../winit/enum.MouseCursor.html" title="enum winit::MouseCursor">MouseCursor</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#323-325' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Modifies the mouse cursor of the window.
Has no effect on Android.</p>
</div><h4 id='method.set_cursor_position' class="method"><span id='set_cursor_position.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_cursor_position' class='fnname'>set_cursor_position</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;position: <a class="struct" href="../winit/dpi/struct.LogicalPosition.html" title="struct winit::dpi::LogicalPosition">LogicalPosition</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#329-331' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Changes the position of the cursor in window coordinates.</p>
</div><h4 id='method.grab_cursor' class="method"><span id='grab_cursor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.grab_cursor' class='fnname'>grab_cursor</a>(&amp;self, grab: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#341-343' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Grabs the cursor, preventing it from leaving the window.</p>
<h2 id="platform-specific-4" class="section-header"><a href="#platform-specific-4">Platform-specific</a></h2>
<p>On macOS, this presently merely locks the cursor in a fixed location, which looks visually awkward.</p>
<p>This has no effect on Android or iOS.</p>
</div><h4 id='method.hide_cursor' class="method"><span id='hide_cursor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.hide_cursor' class='fnname'>hide_cursor</a>(&amp;self, hide: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#356-358' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Hides the cursor, making it invisible but still usable.</p>
<h2 id="platform-specific-5" class="section-header"><a href="#platform-specific-5">Platform-specific</a></h2>
<p>On Windows and X11, the cursor is only hidden within the confines of the window.</p>
<p>On macOS, the cursor is hidden as long as the window has input focus, even if the cursor is outside of the
window.</p>
<p>This has no effect on Android or iOS.</p>
</div><h4 id='method.set_maximized' class="method"><span id='set_maximized.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_maximized' class='fnname'>set_maximized</a>(&amp;self, maximized: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#362-364' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the window to maximized or back</p>
</div><h4 id='method.set_fullscreen' class="method"><span id='set_fullscreen.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_fullscreen' class='fnname'>set_fullscreen</a>(&amp;self, monitor: <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="../winit/struct.MonitorId.html" title="struct winit::MonitorId">MonitorId</a>&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#368-370' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the window to fullscreen or back</p>
</div><h4 id='method.set_decorations' class="method"><span id='set_decorations.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_decorations' class='fnname'>set_decorations</a>(&amp;self, decorations: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#374-376' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Turn window decorations on or off.</p>
</div><h4 id='method.set_always_on_top' class="method"><span id='set_always_on_top.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_always_on_top' class='fnname'>set_always_on_top</a>(&amp;self, always_on_top: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#380-382' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Change whether or not the window will always be on top of other windows.</p>
</div><h4 id='method.set_window_icon' class="method"><span id='set_window_icon.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_window_icon' class='fnname'>set_window_icon</a>(&amp;self, window_icon: <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="../winit/struct.Icon.html" title="struct winit::Icon">Icon</a>&gt;)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#393-395' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the window icon. On Windows and X11, this is typically the small icon in the top-left
corner of the titlebar.</p>
<p>For more usage notes, see <code>WindowBuilder::with_window_icon</code>.</p>
<h2 id="platform-specific-6" class="section-header"><a href="#platform-specific-6">Platform-specific</a></h2>
<p>This only has an effect on Windows and X11.</p>
</div><h4 id='method.set_ime_spot' class="method"><span id='set_ime_spot.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_ime_spot' class='fnname'>set_ime_spot</a>(&amp;self, position: <a class="struct" href="../winit/dpi/struct.LogicalPosition.html" title="struct winit::dpi::LogicalPosition">LogicalPosition</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#399-401' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets location of IME candidate box in client area coordinates relative to the top left.</p>
</div><h4 id='method.get_current_monitor' class="method"><span id='get_current_monitor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_current_monitor' class='fnname'>get_current_monitor</a>(&amp;self) -&gt; <a class="struct" href="../winit/struct.MonitorId.html" title="struct winit::MonitorId">MonitorId</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#405-407' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the monitor on which the window currently resides</p>
</div><h4 id='method.get_available_monitors' class="method"><div class="important-traits"><div class='tooltip'><span class='tooltiptext'>Important traits for <a class="struct" href="../winit/struct.AvailableMonitorsIter.html" title="struct winit::AvailableMonitorsIter">AvailableMonitorsIter</a></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="../winit/struct.AvailableMonitorsIter.html" title="struct winit::AvailableMonitorsIter">AvailableMonitorsIter</a></h3><code class="content"><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="../winit/struct.AvailableMonitorsIter.html" title="struct winit::AvailableMonitorsIter">AvailableMonitorsIter</a></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="struct" href="../winit/struct.MonitorId.html" title="struct winit::MonitorId">MonitorId</a>;</span></code></div></div><span id='get_available_monitors.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_available_monitors' class='fnname'>get_available_monitors</a>(&amp;self) -&gt; <a class="struct" href="../winit/struct.AvailableMonitorsIter.html" title="struct winit::AvailableMonitorsIter">AvailableMonitorsIter</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#413-416' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the list of all the monitors available on the system.</p>
<p>This is the same as <code>EventsLoop::get_available_monitors</code>, and is provided for convenience.</p>
</div><h4 id='method.get_primary_monitor' class="method"><span id='get_primary_monitor.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_primary_monitor' class='fnname'>get_primary_monitor</a>(&amp;self) -&gt; <a class="struct" href="../winit/struct.MonitorId.html" title="struct winit::MonitorId">MonitorId</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#422-424' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the primary monitor of the system.</p>
<p>This is the same as <code>EventsLoop::get_primary_monitor</code>, and is provided for convenience.</p>
</div><h4 id='method.id' class="method"><span id='id.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.id' class='fnname'>id</a>(&amp;self) -&gt; <a class="struct" href="../winit/struct.WindowId.html" title="struct winit::WindowId">WindowId</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/window.rs.html#427-429' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-WindowExt' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../winit/os/unix/trait.WindowExt.html" title="trait winit::os::unix::WindowExt">WindowExt</a> for <a class="struct" href="../winit/struct.Window.html" title="struct winit::Window">Window</a></code><a href='#impl-WindowExt' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#140-209' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.get_xlib_window' class="method"><span id='get_xlib_window.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../winit/os/unix/trait.WindowExt.html#tymethod.get_xlib_window' class='fnname'>get_xlib_window</a>(&amp;self) -&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="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_ulong.html" title="type std::os::raw::c_ulong">c_ulong</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#142-147' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the ID of the <code>Window</code> xlib object that is used by this window. <a href="../winit/os/unix/trait.WindowExt.html#tymethod.get_xlib_window">Read more</a></p>
</div><h4 id='method.get_xlib_display' class="method"><span id='get_xlib_display.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../winit/os/unix/trait.WindowExt.html#tymethod.get_xlib_display' class='fnname'>get_xlib_display</a>(&amp;self) -&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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="enum" href="https://doc.rust-lang.org/nightly/std/os/raw/enum.c_void.html" title="enum std::os::raw::c_void">c_void</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#150-155' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a pointer to the <code>Display</code> object of xlib that is used by this window. <a href="../winit/os/unix/trait.WindowExt.html#tymethod.get_xlib_display">Read more</a></p>
</div><h4 id='method.get_xlib_screen_id' class="method"><span id='get_xlib_screen_id.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../winit/os/unix/trait.WindowExt.html#tymethod.get_xlib_screen_id' class='fnname'>get_xlib_screen_id</a>(&amp;self) -&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="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_int.html" title="type std::os::raw::c_int">c_int</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#158-163' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.get_xcb_connection' class="method"><span id='get_xcb_connection.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../winit/os/unix/trait.WindowExt.html#tymethod.get_xcb_connection' class='fnname'>get_xcb_connection</a>(&amp;self) -&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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="enum" href="https://doc.rust-lang.org/nightly/std/os/raw/enum.c_void.html" title="enum std::os::raw::c_void">c_void</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#175-180' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This function returns the underlying <code>xcb_connection_t</code> of an xlib <code>Display</code>. <a href="../winit/os/unix/trait.WindowExt.html#tymethod.get_xcb_connection">Read more</a></p>
</div><h4 id='method.set_urgent' class="method"><span id='set_urgent.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../winit/os/unix/trait.WindowExt.html#tymethod.set_urgent' class='fnname'>set_urgent</a>(&amp;self, is_urgent: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#183-187' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set window urgency hint (<code>XUrgencyHint</code>). Only relevant on X.</p>
</div><h4 id='method.get_wayland_surface' class="method"><span id='get_wayland_surface.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../winit/os/unix/trait.WindowExt.html#tymethod.get_wayland_surface' class='fnname'>get_wayland_surface</a>(&amp;self) -&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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="enum" href="https://doc.rust-lang.org/nightly/std/os/raw/enum.c_void.html" title="enum std::os::raw::c_void">c_void</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#190-195' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a pointer to the <code>wl_surface</code> object of wayland that is used by this window. <a href="../winit/os/unix/trait.WindowExt.html#tymethod.get_wayland_surface">Read more</a></p>
</div><h4 id='method.get_wayland_display' class="method"><span id='get_wayland_display.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../winit/os/unix/trait.WindowExt.html#tymethod.get_wayland_display' class='fnname'>get_wayland_display</a>(&amp;self) -&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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="enum" href="https://doc.rust-lang.org/nightly/std/os/raw/enum.c_void.html" title="enum std::os::raw::c_void">c_void</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#198-203' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a pointer to the <code>wl_display</code> object of wayland that is used by this window. <a href="../winit/os/unix/trait.WindowExt.html#tymethod.get_wayland_display">Read more</a></p>
</div><h4 id='method.is_ready' class="method"><span id='is_ready.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../winit/os/unix/trait.WindowExt.html#tymethod.is_ready' class='fnname'>is_ready</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/winit/os/unix.rs.html#206-208' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated</div></div><div class='docblock'><p>Check if the window is ready for drawing <a href="../winit/os/unix/trait.WindowExt.html#tymethod.is_ready">Read more</a></p>
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../winit/struct.Window.html" title="struct winit::Window">Window</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../winit/struct.Window.html" title="struct winit::Window">Window</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "winit";</script><script src="../aliases.js"></script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html>