Skip to content

Commit

Permalink
🚀 update docs from verso repository
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 20, 2024
1 parent e4efb22 commit 6a4a8ac
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 146 deletions.
2 changes: 1 addition & 1 deletion docs/search-index.js

Large diffs are not rendered by default.

26 changes: 6 additions & 20 deletions docs/src/verso/config.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#48" id="48">48</a>
<a href="#49" id="49">49</a>
<a href="#50" id="50">50</a>
<a href="#51" id="51">51</a>
<a href="#52" id="52">52</a>
<a href="#53" id="53">53</a>
<a href="#54" id="54">54</a>
<a href="#55" id="55">55</a>
<a href="#56" id="56">56</a>
<a href="#57" id="57">57</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{fs, path::PathBuf};

<span class="kw">use </span>servo::{
Expand All @@ -69,29 +62,22 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
</span><span class="kw">pub struct </span>Config {
<span class="doccomment">/// Global flag options of Servo.
</span><span class="kw">pub </span>opts: Opts,
<span class="doccomment">/// Path to resources directory.
</span><span class="kw">pub </span>resource_dir: PathBuf,
}

<span class="kw">impl </span>Config {
<span class="doccomment">/// Create a new configuration for creating Verso instance. It must provide the path of
/// resources directory.
</span><span class="kw">pub fn </span>new(path: PathBuf) -&gt; <span class="self">Self </span>{
<span class="kw">let </span><span class="kw-2">mut </span>opts = default_opts();
opts.config_dir = <span class="prelude-val">Some</span>(path);
<span class="self">Self </span>{ opts }
</span><span class="kw">pub fn </span>new(resource_dir: PathBuf) -&gt; <span class="self">Self </span>{
<span class="kw">let </span>opts = default_opts();
<span class="self">Self </span>{ opts, resource_dir }
}

<span class="doccomment">/// Init options and preferences.
///
/// TODO write down how prefs and opts work.
</span><span class="kw">pub fn </span>init(<span class="self">self</span>) {
<span class="comment">// Set the resource files and preferences of Servo.
</span><span class="kw">let </span>config_dir = <span class="self">self
</span>.opts
.config_dir
.clone()
.filter(|d| d.exists())
.expect(<span class="string">"Can't get the resources directory."</span>);
resources::set(Box::new(ResourceReader(config_dir)));
</span>resources::set(Box::new(ResourceReader(<span class="self">self</span>.resource_dir)));

<span class="comment">// Set the global options of Servo.
</span>set_options(<span class="self">self</span>.opts);
Expand Down
116 changes: 57 additions & 59 deletions docs/src/verso/verso.rs.html

Large diffs are not rendered by default.

22 changes: 9 additions & 13 deletions docs/src/verso/webview.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,13 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#275" id="275">275</a>
<a href="#276" id="276">276</a>
<a href="#277" id="277">277</a>
<a href="#278" id="278">278</a>
<a href="#279" id="279">279</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::cell::Cell;

<span class="kw">use </span>arboard::Clipboard;
<span class="kw">use </span>compositing_traits::ConstellationMsg;
<span class="kw">use </span>crossbeam_channel::Sender;
<span class="kw">use </span>servo::{
base::id::WebViewId,
base::id::{PipelineNamespace, PipelineNamespaceId, WebViewId},
compositing::{webview::UnknownWebView, IOCompositor},
embedder_traits::{CompositorEventVariant, EmbedderMsg, PromptDefinition},
euclid::Size2D,
Expand Down Expand Up @@ -339,7 +337,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
compositor: <span class="kw-2">&amp;mut </span>IOCompositor&lt;GLWindow&gt;,
clipboard: <span class="kw-2">&amp;mut </span>Clipboard,
) {
<span class="macro">log::trace!</span>(<span class="string">"Verso WebView {webview_id:?} is handling servo message: {message:?}"</span>,);
<span class="macro">log::trace!</span>(<span class="string">"Verso WebView {webview_id:?} is handling Embedder message: {message:?}"</span>,);
<span class="kw">match </span>message {
EmbedderMsg::LoadStart | EmbedderMsg::HeadParsed =&gt; {}
EmbedderMsg::LoadComplete =&gt; {
Expand Down Expand Up @@ -420,25 +418,23 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
/// - Maximize the window: `window.prompt('MAXIMIZE')`
/// - Navigate to a specific URL: `window.prompt('NAVIGATE_TO:${url}')`
</span><span class="kw">pub struct </span>Panel {
id: <span class="prelude-ty">Option</span>&lt;WebViewId&gt;,
id: WebViewId,
}

<span class="kw">impl </span>Panel {
<span class="doccomment">/// Create a panel from Winit window.
</span><span class="kw">pub fn </span>new() -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{ id: <span class="prelude-val">None </span>}
}

<span class="doccomment">/// Set web view ID of this panel.
</span><span class="kw">pub fn </span>set_id(<span class="kw-2">&amp;mut </span><span class="self">self</span>, id: WebViewId) {
<span class="self">self</span>.id = <span class="prelude-val">Some</span>(id);
<span class="comment">// Reserving a namespace to create TopLevelBrowsingContextId.
</span>PipelineNamespace::install(PipelineNamespaceId(<span class="number">0</span>));
<span class="kw">let </span>id = TopLevelBrowsingContextId::new();
<span class="self">Self </span>{ id }
}

<span class="doccomment">/// Get web view ID of this panel.
///
/// We assume this is always called after `set_id`. Calling before it will cause panic.
</span><span class="kw">pub fn </span>id(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; WebViewId {
<span class="self">self</span>.id.unwrap()
<span class="self">self</span>.id
}
}

Expand All @@ -452,7 +448,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
compositor: <span class="kw-2">&amp;mut </span>IOCompositor&lt;GLWindow&gt;,
clipboard: <span class="kw-2">&amp;mut </span>Clipboard,
) {
<span class="macro">log::trace!</span>(<span class="string">"Verso Panel {panel_id:?} is handling servo message: {message:?}"</span>,);
<span class="macro">log::trace!</span>(<span class="string">"Verso Panel {panel_id:?} is handling Embedder message: {message:?}"</span>,);
<span class="kw">match </span>message {
EmbedderMsg::LoadStart | EmbedderMsg::HeadParsed =&gt; {}
EmbedderMsg::LoadComplete =&gt; {
Expand Down
16 changes: 2 additions & 14 deletions docs/src/verso/window.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,19 +424,12 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#422" id="422">422</a>
<a href="#423" id="423">423</a>
<a href="#424" id="424">424</a>
<a href="#425" id="425">425</a>
<a href="#426" id="426">426</a>
<a href="#427" id="427">427</a>
<a href="#428" id="428">428</a>
<a href="#429" id="429">429</a>
<a href="#430" id="430">430</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{cell::Cell, ops::Deref, rc::Rc};

<span class="kw">use </span>compositing_traits::ConstellationMsg;
<span class="kw">use </span>crossbeam_channel::Sender;
<span class="kw">use </span>raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
<span class="kw">use </span>servo::{
base::id::WebViewId,
compositing::{
windowing::{AnimationState, EmbedderCoordinates, MouseWindowEvent, WindowMethods},
IOCompositor,
Expand Down Expand Up @@ -478,7 +471,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="doccomment">/// The WebView of this window.
</span><span class="kw">pub</span>(<span class="kw">crate</span>) webview: <span class="prelude-ty">Option</span>&lt;WebView&gt;,
<span class="doccomment">/// Access to webrender GL
</span>webrender_gl: Rc&lt;<span class="kw">dyn </span>gl::Gl&gt;,
</span><span class="kw">pub</span>(<span class="kw">crate</span>) webrender_gl: Rc&lt;<span class="kw">dyn </span>gl::Gl&gt;,
<span class="doccomment">/// The mouse physical position in the web view.
</span>mouse_position: Cell&lt;PhysicalPosition&lt;f64&gt;&gt;,
<span class="doccomment">/// Modifiers state of the keyboard.
Expand Down Expand Up @@ -521,11 +514,6 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}
}

<span class="doccomment">/// Set WebView ID of this window.
</span><span class="kw">pub fn </span>set_webview_id(<span class="kw-2">&amp;mut </span><span class="self">self</span>, id: WebViewId) {
<span class="self">self</span>.panel.set_id(id);
}

<span class="doccomment">/// Return the reference counted `GLWindow`.
</span><span class="kw">pub fn </span>gl_window(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; Rc&lt;GLWindow&gt; {
<span class="kw">return </span><span class="self">self</span>.gl_window.clone();
Expand Down Expand Up @@ -664,7 +652,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
}
<span class="comment">// Handle message in Verso Window
</span><span class="prelude-val">None </span>=&gt; {
<span class="macro">log::trace!</span>(<span class="string">"Verso Window is handling servo message: {message:?}"</span>);
<span class="macro">log::trace!</span>(<span class="string">"Verso Window is handling Embedder message: {message:?}"</span>);
<span class="kw">match </span>message {
EmbedderMsg::ReadyToPresent(_w) =&gt; {
<span class="self">self</span>.window.request_redraw();
Expand Down
2 changes: 1 addition & 1 deletion docs/verso/config/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!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="Utilities to read options and preferences."><title>verso::config - Rust</title><script> if (window.location.protocol !== "file:") document.write(`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2">`)</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-e935ef01ae1c1829.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="verso" data-themes="" data-resource-suffix="" data-rustdoc-version="1.78.0 (9b00956e5 2024-04-29)" data-channel="1.78.0" data-search-js="search-42d8da7a6b9792c2.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-4c98445ec4002617.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-12cf3b4f4f9dc36d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-04d5337699b92874.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.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="../../verso/index.html">verso</a><span class="version">0.0.1</span></h2></div><h2 class="location"><a href="#">Module config</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li></ul></section><h2><a href="../index.html">In crate verso</a></h2></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../verso/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">verso</a>::<wbr><a class="mod" href="#">config</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/verso/config.rs.html#1-57">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utilities to read options and preferences.</p>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../verso/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">verso</a>::<wbr><a class="mod" href="#">config</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/verso/config.rs.html#1-50">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utilities to read options and preferences.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Config.html" title="struct verso::config::Config">Config</a></div><div class="desc docblock-short">Configuration of Verso instance.</div></li></ul></section></div></main></body></html>
Loading

0 comments on commit 6a4a8ac

Please sign in to comment.