17 lines
5.5 KiB
HTML
17 lines
5.5 KiB
HTML
<!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="X11 resource manager library."><title>x11rb::resource_manager - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="x11rb" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.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="../../x11rb/index.html">x11rb</a><span class="version">0.13.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module resource_<wbr>manager</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate x11rb</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">x11rb</a></span><h1>Module <span>resource_manager</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/x11rb/resource_manager/mod.rs.html#1-69">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>X11 resource manager library.</p>
|
||
<p>Usage example (please cache the database returned by <a href="fn.new_from_default.html" title="fn x11rb::resource_manager::new_from_default"><code>new_from_default</code></a> in real applications
|
||
instead of re-opening it whenever a value is needed):</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>x11rb::{connection::Connection, errors::ReplyError, resource_manager::new_from_default};
|
||
<span class="kw">fn </span>get_xft_dpi(conn: <span class="kw-2">&</span><span class="kw">impl </span>Connection) -> <span class="prelude-ty">Result</span><<span class="prelude-ty">Option</span><u32>, ReplyError> {
|
||
<span class="kw">let </span>db = new_from_default(conn)<span class="question-mark">?</span>;
|
||
<span class="kw">let </span>value = db.get_value(<span class="string">"Xft.dpi"</span>, <span class="string">""</span>);
|
||
<span class="prelude-val">Ok</span>(value.ok().flatten())
|
||
}</code></pre></div>
|
||
<p>This functionality is similar to what is available to C code through xcb-util-xrm and Xlib’s
|
||
<code>Xrm*</code> function family. Not all their functionality is available in this library. Please open a
|
||
feature request if you need something that is not available.</p>
|
||
<p>The code in this module is only available when the <code>resource_manager</code> feature of the library is
|
||
enabled.</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.Database.html" title="struct x11rb::resource_manager::Database">Database</a></div><div class="desc docblock-short">A X11 resource database.</div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.new_from_default.html" title="fn x11rb::resource_manager::new_from_default">new_<wbr>from_<wbr>default</a></div><div class="desc docblock-short">Create a new X11 resource database from the default locations.</div></li><li><div class="item-name"><a class="fn" href="fn.new_from_resource_manager.html" title="fn x11rb::resource_manager::new_from_resource_manager">new_<wbr>from_<wbr>resource_<wbr>manager</a></div><div class="desc docblock-short">Create a new X11 resource database from the <code>RESOURCE_MANAGER</code> property of the first
|
||
screen’s root window.</div></li></ul></section></div></main></body></html> |