mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 15:14:38 +01:00
1141 lines
57 KiB
HTML
1141 lines
57 KiB
HTML
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="en" data-content_root="./">
|
||
<head>
|
||
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>DBus API — libratbag documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
|
||
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=86f27845" />
|
||
|
||
|
||
|
||
<script src="_static/jquery.js?v=8dae8fb0"></script>
|
||
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
||
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
||
<script src="_static/doctools.js?v=888ff710"></script>
|
||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<script src="_static/js/theme.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="prev" title="The libratbag DBus API" href="index.html" />
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav">
|
||
<div class="wy-grid-for-nav">
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search" >
|
||
|
||
|
||
|
||
<a href="index.html" class="icon icon-home">
|
||
libratbag
|
||
</a>
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
||
<ul class="current">
|
||
<li class="toctree-l1 current"><a class="current reference internal" href="#"> The DBus Interfaces</a><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="#notes-on-the-dbus-api">Notes on the DBus API</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#types">Types</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#flags">Flags</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-manager">org.freedesktop.ratbag1.Manager</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#APIVersion"><code class="docutils literal notranslate"><span class="pre">APIVersion</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Devices"><code class="docutils literal notranslate"><span class="pre">Devices</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-device">org.freedesktop.ratbag1.Device</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Model"><code class="docutils literal notranslate"><span class="pre">Model</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Name"><code class="docutils literal notranslate"><span class="pre">Name</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#FirmwareVersion"><code class="docutils literal notranslate"><span class="pre">FirmwareVersion</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Profiles"><code class="docutils literal notranslate"><span class="pre">Profiles</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Commit"><code class="docutils literal notranslate"><span class="pre">Commit()</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Resync"><code class="docutils literal notranslate"><span class="pre">Resync()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-profile">org.freedesktop.ratbag1.Profile</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Index"><code class="docutils literal notranslate"><span class="pre">Index</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#id0"><code class="docutils literal notranslate"><span class="pre">Name</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Disabled"><code class="docutils literal notranslate"><span class="pre">Disabled</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#IsActive"><code class="docutils literal notranslate"><span class="pre">IsActive</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#IsDirty"><code class="docutils literal notranslate"><span class="pre">IsDirty</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Resolutions"><code class="docutils literal notranslate"><span class="pre">Resolutions</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Buttons"><code class="docutils literal notranslate"><span class="pre">Buttons</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Leds"><code class="docutils literal notranslate"><span class="pre">Leds</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#AngleSnapping"><code class="docutils literal notranslate"><span class="pre">AngleSnapping</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Debounce"><code class="docutils literal notranslate"><span class="pre">Debounce</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Debounces"><code class="docutils literal notranslate"><span class="pre">Debounces</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#ReportRate"><code class="docutils literal notranslate"><span class="pre">ReportRate</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#ReportRates"><code class="docutils literal notranslate"><span class="pre">ReportRates</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#SetActive"><code class="docutils literal notranslate"><span class="pre">SetActive()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-resolution">org.freedesktop.ratbag1.Resolution</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#id1"><code class="docutils literal notranslate"><span class="pre">Index</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Capabilities"><code class="docutils literal notranslate"><span class="pre">Capabilities</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#id2"><code class="docutils literal notranslate"><span class="pre">IsActive</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#IsDefault"><code class="docutils literal notranslate"><span class="pre">IsDefault</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#IsDisabled"><code class="docutils literal notranslate"><span class="pre">IsDisabled</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Resolution"><code class="docutils literal notranslate"><span class="pre">Resolution</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#id3"><code class="docutils literal notranslate"><span class="pre">Resolutions</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#id4"><code class="docutils literal notranslate"><span class="pre">SetActive()</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#SetDefault"><code class="docutils literal notranslate"><span class="pre">SetDefault()</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-button">org.freedesktop.ratbag1.Button</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#id5"><code class="docutils literal notranslate"><span class="pre">Index</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Mapping"><code class="docutils literal notranslate"><span class="pre">Mapping</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#ActionTypes"><code class="docutils literal notranslate"><span class="pre">ActionTypes</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-led">org.freedesktop.ratbag1.Led</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#id6"><code class="docutils literal notranslate"><span class="pre">Index</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Mode"><code class="docutils literal notranslate"><span class="pre">Mode</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Modes"><code class="docutils literal notranslate"><span class="pre">Modes</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Color"><code class="docutils literal notranslate"><span class="pre">Color</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#ColorDepth"><code class="docutils literal notranslate"><span class="pre">ColorDepth</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#EffectDuration"><code class="docutils literal notranslate"><span class="pre">EffectDuration</span></code></a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#Brightness"><code class="docutils literal notranslate"><span class="pre">Brightness</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#special-button-functions">Special button functions</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="index.html">libratbag</a>
|
||
</nav>
|
||
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content">
|
||
<div role="navigation" aria-label="Page navigation">
|
||
<ul class="wy-breadcrumbs">
|
||
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
|
||
<li class="breadcrumb-item active">DBus API</li>
|
||
<li class="wy-breadcrumbs-aside">
|
||
<a href="_sources/dbus.rst.txt" rel="nofollow"> View page source</a>
|
||
</li>
|
||
</ul>
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<section id="dbus-api">
|
||
<h1>DBus API<a class="headerlink" href="#dbus-api" title="Link to this heading"></a></h1>
|
||
<p>Note: <strong>the DBus interface is subject to change</strong></p>
|
||
<p>Interfaces:</p>
|
||
<ul class="simple">
|
||
<li><p><a class="reference internal" href="#manager"><span class="std std-ref">org.freedesktop.ratbag1.Manager</span></a></p></li>
|
||
<li><p><a class="reference internal" href="#device"><span class="std std-ref">org.freedesktop.ratbag1.Device</span></a></p></li>
|
||
<li><p><a class="reference internal" href="#profile"><span class="std std-ref">org.freedesktop.ratbag1.Profile</span></a></p></li>
|
||
<li><p><a class="reference internal" href="#resolution"><span class="std std-ref">org.freedesktop.ratbag1.Resolution</span></a></p></li>
|
||
<li><p><a class="reference internal" href="#button"><span class="std std-ref">org.freedesktop.ratbag1.Button</span></a></p></li>
|
||
<li><p><a class="reference internal" href="#led"><span class="std std-ref">org.freedesktop.ratbag1.Led</span></a></p></li>
|
||
</ul>
|
||
<p>Changing settings on a device is a three-step process:</p>
|
||
<ol class="arabic simple">
|
||
<li><p>Change the various properties to the desired value</p></li>
|
||
<li><p>Invoke <a class="reference internal" href="#Commit" title="Commit"><code class="xref py py-func docutils literal notranslate"><span class="pre">org.freedesktop.ratbag1.Device.Commit()</span></code></a></p></li>
|
||
<li><p>Optional: if an error occurred writing the new data to the device,
|
||
a <a class="reference internal" href="#Resync" title="Resync"><code class="xref py py-func docutils literal notranslate"><span class="pre">org.freedesktop.ratbag1.Resync</span></code></a> signal is emitted on the device and
|
||
all properties are updated accordingly.</p></li>
|
||
</ol>
|
||
<p>The time it takes to write settings to a device varies greatly, any caller
|
||
must be prepared to receive a <a class="reference internal" href="#Resync" title="Resync"><code class="xref py py-func docutils literal notranslate"><span class="pre">org.freedesktop.ratbag1.Device.Resync</span></code></a> signal several seconds after
|
||
<a class="reference internal" href="#Commit" title="Commit"><code class="xref py py-func docutils literal notranslate"><span class="pre">org.freedesktop.ratbag1.Device.Commit()</span></code></a>.</p>
|
||
<section id="notes-on-the-dbus-api">
|
||
<h2>Notes on the DBus API<a class="headerlink" href="#notes-on-the-dbus-api" title="Link to this heading"></a></h2>
|
||
<p>For easier debugging, objects paths are constructed from the device. e.g.
|
||
<code class="docutils literal notranslate"><span class="pre">/org/freedesktop/ratbag/button/event5/p0/b10</span></code> is the button interface for
|
||
button 10 on profile 0 on event5. The naming is subject to change. Do not
|
||
rely on a constructed object path in your application.</p>
|
||
<section id="types">
|
||
<h3>Types<a class="headerlink" href="#types" title="Link to this heading"></a></h3>
|
||
<p>Types used by these interfaces:</p>
|
||
<table class="docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Type</p></th>
|
||
<th class="head"><p>Description</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">b</span></code></p></td>
|
||
<td><p>Bool</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">o</span></code></p></td>
|
||
<td><p>Object path</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">s</span></code></p></td>
|
||
<td><p>String</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">u</span></code></p></td>
|
||
<td><p>Unsigned 32-bit integer</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(uuu)</span></code></p></td>
|
||
<td><p>A triplet of 32-bit integers</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">ao</span></code></p></td>
|
||
<td><p>Array of object paths</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">as</span></code></p></td>
|
||
<td><p>Array of strings</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">au</span></code></p></td>
|
||
<td><p>Array of 32-bit integers</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">a(uu)</span></code></p></td>
|
||
<td><p>Array of 2 32-bit integer tuples</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>For details on each type, see the <a class="reference external" href="https://dbus.freedesktop.org/doc/dbus-specification.html">DBus Specification</a>.</p>
|
||
</section>
|
||
<section id="flags">
|
||
<h3>Flags<a class="headerlink" href="#flags" title="Link to this heading"></a></h3>
|
||
<p>Properties marked as <strong>constant</strong> do not change for the lifetime of the
|
||
object. Properties marked as <strong>mutable</strong> may change, and a
|
||
<code class="docutils literal notranslate"><span class="pre">org.freedesktop.DBus.Properties.PropertyChanged</span></code> signal is sent for those
|
||
unless otherwise specified.</p>
|
||
</section>
|
||
</section>
|
||
<section id="org-freedesktop-ratbag1-manager">
|
||
<span id="manager"></span><h2>org.freedesktop.ratbag1.Manager<a class="headerlink" href="#org-freedesktop-ratbag1-manager" title="Link to this heading"></a></h2>
|
||
<p>The <strong>org.freedesktop.ratbag1.Manager</strong> interface is the entry point to
|
||
interact with ratbagd.</p>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="APIVersion">
|
||
<span class="sig-name descname"><span class="pre">APIVersion</span></span><a class="headerlink" href="#APIVersion" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>i</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only,constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The DBus API version. This is a stopgap feature while the DBus API
|
||
is still in flux. The version has no backwards or
|
||
forward-compatibility guarantees - your client must understand
|
||
<strong>exactly</strong> the same version, it is not enough to support an older
|
||
or a newer version.</p>
|
||
<p>This API will be removed once the DBus API is declared stable.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Devices">
|
||
<span class="sig-name descname"><span class="pre">Devices</span></span><a class="headerlink" href="#Devices" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>ao</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>An array of read-only object paths referencing the available
|
||
devices. The devices implement the <a class="reference internal" href="#device"><span class="std std-ref">org.freedesktop.ratbag1.Device</span></a> interface.</p>
|
||
</dd></dl>
|
||
|
||
</section>
|
||
<section id="org-freedesktop-ratbag1-device">
|
||
<span id="device"></span><h2>org.freedesktop.ratbag1.Device<a class="headerlink" href="#org-freedesktop-ratbag1-device" title="Link to this heading"></a></h2>
|
||
<p>The <strong>org.freedesktop.ratbag1.Device</strong> interface describes a single device
|
||
known to ratbagd.</p>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Model">
|
||
<span class="sig-name descname"><span class="pre">Model</span></span><a class="headerlink" href="#Model" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>s</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>An ID identifying the physical device model. This string is
|
||
guaranteed to be unique for a specific model and always identical
|
||
for devices of that model.</p>
|
||
<p>This is a string of one of the following formats:</p>
|
||
<ul class="simple">
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">usb:1234:abcd:0</span></code></p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">bluetooth:5678:ef01:0</span></code></p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">unknown</span></code></p></li>
|
||
</ul>
|
||
<p>In the future, other formats may get added. Clients must ignore
|
||
unknown string formats.</p>
|
||
<p>For a string starting with <code class="docutils literal notranslate"><span class="pre">usb:</span></code>, the format is the bus type (USB)
|
||
followed by a 4-digit lowercase hex USB vendor ID, followed by a
|
||
4-digit lowercase hex USB product ID, followed by an decimal version
|
||
number of unspecified length. These four elements are separated by a
|
||
colon (<code class="docutils literal notranslate"><span class="pre">:</span></code>).</p>
|
||
<p>For a string starting with <code class="docutils literal notranslate"><span class="pre">bluetooth:</span></code>, the format is the bus type
|
||
(Bluetooth) followed by a 4-digit lowercase hex Bluetooth vendor ID,
|
||
followed by a 4-digit lowercase hex Bluetooth product ID, followed
|
||
by an decimal version number of unspecified length. These four
|
||
elements are separated by a colon (<code class="docutils literal notranslate"><span class="pre">:</span></code>).</p>
|
||
<p>For the string <code class="docutils literal notranslate"><span class="pre">unknown</span></code>, the model of the device cannot be
|
||
determined. This is usually a bug in libratbag.</p>
|
||
<p>For a <code class="docutils literal notranslate"><span class="pre">Model</span></code> of type <code class="docutils literal notranslate"><span class="pre">usb</span></code> and <code class="docutils literal notranslate"><span class="pre">bluetooth</span></code>, the version
|
||
number is reserved for use by libratbag. Device with identical
|
||
vendor and product IDs but different versions must be considered
|
||
different devices. For example, the version may increase when a
|
||
manufacturer re-uses USB Ids.</p>
|
||
<p>Vendor or product IDs of 0 are valid IDs (e.g. used used by test
|
||
devices).</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Name">
|
||
<span class="sig-name descname"><span class="pre">Name</span></span><a class="headerlink" href="#Name" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>s</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The device’s name, suitable for presentation to the user.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="FirmwareVersion">
|
||
<span class="sig-name descname"><span class="pre">FirmwareVersion</span></span><a class="headerlink" href="#FirmwareVersion" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>s</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>A device-specific string with the firmware version, or the empty
|
||
string. For devices with a major/minor or purely numeric firmware
|
||
version, the conversion into a string is implementation-defined.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Profiles">
|
||
<span class="sig-name descname"><span class="pre">Profiles</span></span><a class="headerlink" href="#Profiles" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>ao</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>This property is mutable if the device supports adding and removing
|
||
profiles.</p>
|
||
<p>Provides the list of profile paths for all profiles on this device, see
|
||
<a class="reference internal" href="#profile"><span class="std std-ref">org.freedesktop.ratbag1.Profile</span></a></p>
|
||
</dd></dl>
|
||
|
||
<dl class="py function">
|
||
<dt class="sig sig-object py" id="Commit">
|
||
<span class="sig-name descname"><span class="pre">Commit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">)</span> <span class="pre">→</span> <span class="pre">(</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#Commit" title="Link to this definition"></a></dt>
|
||
<dd><p>Commits the changes to the device. This call always succeeds,
|
||
the data is written to the device asynchronously. Where an error
|
||
occurs, the <a class="reference internal" href="#Resync" title="Resync"><code class="xref py py-func docutils literal notranslate"><span class="pre">Resync()</span></code></a> signal is emitted and all properties are
|
||
updated to the current state.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py function">
|
||
<dt class="sig sig-object py" id="Resync">
|
||
<span class="sig-name descname"><span class="pre">Resync</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#Resync" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>Signal</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Emitted when an internal error occurs, usually on writing values to
|
||
the device after <a class="reference internal" href="#Commit" title="Commit"><code class="xref py py-func docutils literal notranslate"><span class="pre">Commit()</span></code></a>. Upon receiving this
|
||
signal, clients are expected to resync their property values with
|
||
ratbagd.</p>
|
||
</dd></dl>
|
||
|
||
</section>
|
||
<section id="org-freedesktop-ratbag1-profile">
|
||
<span id="profile"></span><h2>org.freedesktop.ratbag1.Profile<a class="headerlink" href="#org-freedesktop-ratbag1-profile" title="Link to this heading"></a></h2>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Index">
|
||
<span class="sig-name descname"><span class="pre">Index</span></span><a class="headerlink" href="#Index" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The zero-based index of this profile</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="id0">
|
||
<span class="sig-name descname"><span class="pre">Name</span></span><a class="headerlink" href="#id0" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>s</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The name of this profile. If the name is the empty string, the
|
||
profile name cannot be changed.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Disabled">
|
||
<span class="sig-name descname"><span class="pre">Disabled</span></span><a class="headerlink" href="#Disabled" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>b</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>True if this is the profile is disabled, false otherwise.</p>
|
||
<p>Note that a disabled profile might not have correct bindings, so it’s
|
||
a good thing to rebind everything before calling
|
||
<a class="reference internal" href="#Commit" title="Commit"><code class="xref py py-func docutils literal notranslate"><span class="pre">Commit()</span></code></a>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="IsActive">
|
||
<span class="sig-name descname"><span class="pre">IsActive</span></span><a class="headerlink" href="#IsActive" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>b</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>True if this is the currently active profile, false otherwise.</p>
|
||
<p>Profiles can only be set to active, but never to not active - at least one
|
||
profile must be active at all times. This property is read-only, use the
|
||
<a class="reference internal" href="#id4" title="SetActive"><code class="xref py py-func docutils literal notranslate"><span class="pre">SetActive()</span></code></a> method to activate a profile.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="IsDirty">
|
||
<span class="sig-name descname"><span class="pre">IsDirty</span></span><a class="headerlink" href="#IsDirty" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>b</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>True if this profile is dirty, false otherwise.</p>
|
||
<p>Dirty, that is, the device needs committing after being configured.
|
||
This property becomes <cite>true</cite> whenever any other property of the
|
||
profile is updated.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Resolutions">
|
||
<span class="sig-name descname"><span class="pre">Resolutions</span></span><a class="headerlink" href="#Resolutions" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>ao</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>This property is mutable if the device supports adding and removing
|
||
resolutions.</p>
|
||
<p>Provides the object paths of all resolutions in this profile, see
|
||
<a class="reference internal" href="#resolution"><span class="std std-ref">org.freedesktop.ratbag1.Resolution</span></a>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Buttons">
|
||
<span class="sig-name descname"><span class="pre">Buttons</span></span><a class="headerlink" href="#Buttons" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>ao</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Provides the object paths of all buttons in this profile, see
|
||
<a class="reference internal" href="#button"><span class="std std-ref">org.freedesktop.ratbag1.Button</span></a>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Leds">
|
||
<span class="sig-name descname"><span class="pre">Leds</span></span><a class="headerlink" href="#Leds" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>ao</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Provides the object paths of all LEDs in this profile, see
|
||
<a class="reference internal" href="#led"><span class="std std-ref">org.freedesktop.ratbag1.Led</span></a>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="AngleSnapping">
|
||
<span class="sig-name descname"><span class="pre">AngleSnapping</span></span><a class="headerlink" href="#AngleSnapping" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>i</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Sensor angle snapping boolean value as an int (1 or 0), or <cite>-1</cite> to
|
||
indicate that the device doesn’t support reading and/or writing this
|
||
value.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Debounce">
|
||
<span class="sig-name descname"><span class="pre">Debounce</span></span><a class="headerlink" href="#Debounce" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>i</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Int for the button debounce time in milliseconds assigned to this
|
||
profile. This time must be one of those listed in
|
||
<a class="reference internal" href="#Debounces" title="Debounces"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Debounces</span></code></a>, or <cite>-1</cite> to indicate that changing debounce time
|
||
for this device is not allowed.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Debounces">
|
||
<span class="sig-name descname"><span class="pre">Debounces</span></span><a class="headerlink" href="#Debounces" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>au</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>A list of permitted button debounce times. Values in this list may
|
||
be used in the <a class="reference internal" href="#Debounce" title="Debounce"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Debounce</span></code></a> property. This list is always sorted
|
||
ascending, the lowest debounce time is the first item in the list.</p>
|
||
<p>This list may be empty if the device does not support reading and/or
|
||
writing the debounce time.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="ReportRate">
|
||
<span class="sig-name descname"><span class="pre">ReportRate</span></span><a class="headerlink" href="#ReportRate" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>uint for the report rate in Hz assigned to this profile. This rate
|
||
must be one of those listed in <a class="reference internal" href="#ReportRates" title="ReportRates"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ReportRates</span></code></a>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="ReportRates">
|
||
<span class="sig-name descname"><span class="pre">ReportRates</span></span><a class="headerlink" href="#ReportRates" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>au</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>A list of permitted report rates. Values in this list may be used
|
||
in the <a class="reference internal" href="#ReportRate" title="ReportRate"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ReportRate</span></code></a> property. This list is always sorted
|
||
ascending, the lowest report rate is the first item in the list.</p>
|
||
<p>This list may be empty if the device does not support reading and/or
|
||
writing the report rate.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py function">
|
||
<dt class="sig sig-object py" id="SetActive">
|
||
<span class="sig-name descname"><span class="pre">SetActive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">)</span> <span class="pre">→</span> <span class="pre">(</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#SetActive" title="Link to this definition"></a></dt>
|
||
<dd><p>Set this profile to be the active profile</p>
|
||
</dd></dl>
|
||
|
||
</section>
|
||
<section id="org-freedesktop-ratbag1-resolution">
|
||
<span id="resolution"></span><h2>org.freedesktop.ratbag1.Resolution<a class="headerlink" href="#org-freedesktop-ratbag1-resolution" title="Link to this heading"></a></h2>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="id1">
|
||
<span class="sig-name descname"><span class="pre">Index</span></span><a class="headerlink" href="#id1" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Index of the resolution</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Capabilities">
|
||
<span class="sig-name descname"><span class="pre">Capabilities</span></span><a class="headerlink" href="#Capabilities" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>au</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Bit-mask of capabilities.</p>
|
||
<table class="docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Value</p></th>
|
||
<th class="head"><p>Definition</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p>1</p></td>
|
||
<td><p>Resolution can be set for x and y axes separately.</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>2</p></td>
|
||
<td><p>Resolution can be disabled and enabled.
|
||
Note that this capability only notes the general
|
||
capability. A specific resolution may still fail to
|
||
be disabled, e.g. when it is the active resolution
|
||
on the device.</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>(Source: <code class="xref cpp cpp-enum docutils literal notranslate"><span class="pre">ratbag_resolution_capability</span></code> in <cite>libratbag.h</cite>).</p>
|
||
<p>In the future, extra values may get added. Clients must ignore
|
||
unknown Capabilities.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="id2">
|
||
<span class="sig-name descname"><span class="pre">IsActive</span></span><a class="headerlink" href="#id2" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>b</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>True if this is the currently active resolution, false otherwise.</p>
|
||
<p>Resolutions can only be set to active, but never to not
|
||
active - at least one resolution must be active at all
|
||
times. This property is read-only, use the
|
||
<a class="reference internal" href="#id4" title="SetActive"><code class="xref py py-func docutils literal notranslate"><span class="pre">SetActive()</span></code></a> method to set a resolution as the
|
||
active resolution.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="IsDefault">
|
||
<span class="sig-name descname"><span class="pre">IsDefault</span></span><a class="headerlink" href="#IsDefault" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>b</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>True if this is the currently default resolution, false
|
||
otherwise. If the device does not have the default
|
||
resolution capability, this property is always false.</p>
|
||
<p>Resolutions can only be set to default, but never to not
|
||
default - at least one resolution must be default at all
|
||
times. This property is read-only, use the
|
||
<a class="reference internal" href="#SetDefault" title="SetDefault"><code class="xref py py-func docutils literal notranslate"><span class="pre">SetDefault()</span></code></a> method to set a resolution as
|
||
the default resolution.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="IsDisabled">
|
||
<span class="sig-name descname"><span class="pre">IsDisabled</span></span><a class="headerlink" href="#IsDisabled" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>b</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>True if this resolution is disabled, false otherwise.
|
||
If the device does not have the disabled resolution
|
||
capability, this property is always false.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Resolution">
|
||
<span class="sig-name descname"><span class="pre">Resolution</span></span><a class="headerlink" href="#Resolution" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>v</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The resolution for this entry in dpi.</p>
|
||
<p>If the variant is a single unsigned integer (<code class="docutils literal notranslate"><span class="pre">u</span></code>), the value is
|
||
the resolution for both the x- and the y- axis.</p>
|
||
<p>If the variant is a unsigned integer tuple (<code class="docutils literal notranslate"><span class="pre">(uu)</span></code>), the value is
|
||
the resolution for the x- and y- axis separately.</p>
|
||
<p>A client must leave the type intact, assigning a single <code class="docutils literal notranslate"><span class="pre">u</span></code> to a
|
||
resolution object previously exporting <code class="docutils literal notranslate"><span class="pre">(uu)</span></code> is invalid.</p>
|
||
<p>The value for the resolution must be equal to one of the values in
|
||
<a class="reference internal" href="#id3" title="Resolutions"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Resolutions</span></code></a>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="id3">
|
||
<span class="sig-name descname"><span class="pre">Resolutions</span></span><a class="headerlink" href="#id3" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>au</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>A list of permitted resolutions. Values in this list may be used in
|
||
the <a class="reference internal" href="#Resolution" title="Resolution"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Resolution</span></code></a> property. This list is always sorted
|
||
ascending, the lowest resolution is the first item in the list.</p>
|
||
<p>This list may be empty if the device does not support reading and/or
|
||
writing to resolutions.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py function">
|
||
<dt class="sig sig-object py" id="id4">
|
||
<span class="sig-name descname"><span class="pre">SetActive</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">)</span> <span class="pre">→</span> <span class="pre">(</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#id4" title="Link to this definition"></a></dt>
|
||
<dd><p>Set this resolution to be the active one</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py function">
|
||
<dt class="sig sig-object py" id="SetDefault">
|
||
<span class="sig-name descname"><span class="pre">SetDefault</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">)</span> <span class="pre">→</span> <span class="pre">(</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#SetDefault" title="Link to this definition"></a></dt>
|
||
<dd><p>Set this resolution to be the default</p>
|
||
</dd></dl>
|
||
|
||
</section>
|
||
<section id="org-freedesktop-ratbag1-button">
|
||
<span id="button"></span><h2>org.freedesktop.ratbag1.Button<a class="headerlink" href="#org-freedesktop-ratbag1-button" title="Link to this heading"></a></h2>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="id5">
|
||
<span class="sig-name descname"><span class="pre">Index</span></span><a class="headerlink" href="#id5" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Index of the button</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Mapping">
|
||
<span class="sig-name descname"><span class="pre">Mapping</span></span><a class="headerlink" href="#Mapping" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>(uv)</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The current button mapping. The first element is the <code class="docutils literal notranslate"><span class="pre">ActionType</span></code>
|
||
for this button and must be one of those in <a class="reference internal" href="#ActionTypes" title="ActionTypes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ActionTypes</span></code></a>.</p>
|
||
<p>If the ActionType is <em>Button</em>, the variant is an unsigned integer
|
||
(<code class="docutils literal notranslate"><span class="pre">u</span></code>) denoting the button number to map to.</p>
|
||
<p>If the ActionType is <em>Special</em>, the variant is an unsigned integer
|
||
(<code class="docutils literal notranslate"><span class="pre">u</span></code>) denoting the special value to map to.</p>
|
||
<p>If the ActionType is <em>Macro</em>, the variant is an array of integer
|
||
tuples (<code class="docutils literal notranslate"><span class="pre">a(uu)</span></code>) where each tuple is <code class="docutils literal notranslate"><span class="pre">(type,</span> <span class="pre">keycode)</span></code> and the
|
||
type is one of the following:</p>
|
||
<table class="docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Value</p></th>
|
||
<th class="head"><p>Description</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p>0</p></td>
|
||
<td><p>Key release event</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>1</p></td>
|
||
<td><p>Key press event</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>If the ActionType is <em>None</em>, the variant is an unsigned integer
|
||
(<code class="docutils literal notranslate"><span class="pre">u</span></code>) of value 0.</p>
|
||
<p>If the ActionType is <em>Unknown</em>, the variant is an unsigned integer
|
||
(<code class="docutils literal notranslate"><span class="pre">u</span></code>) of value 0.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="ActionTypes">
|
||
<span class="sig-name descname"><span class="pre">ActionTypes</span></span><a class="headerlink" href="#ActionTypes" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>au</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<table class="docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Value</p></th>
|
||
<th class="head"><p>Name</p></th>
|
||
<th class="head"><p>Description</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p>0</p></td>
|
||
<td><p>None</p></td>
|
||
<td><p>No mapping configured</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>1</p></td>
|
||
<td><p>Button</p></td>
|
||
<td><p>Mapping to a logical button number</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>2</p></td>
|
||
<td><p>Special</p></td>
|
||
<td><p>Mapping to a special function</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>3</p></td>
|
||
<td><p>Key</p></td>
|
||
<td><p>Mapping to a simple key action</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>4</p></td>
|
||
<td><p>Macro</p></td>
|
||
<td><p>Mapping to a macro key sequence</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>1000</p></td>
|
||
<td><p>Unknown</p></td>
|
||
<td><p>An unknown or unreadable mapping type</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>See <a class="reference internal" href="#button-special"><span class="std std-ref">Special button functions</span></a> for a list of supported special
|
||
functions.</p>
|
||
<p>Clients must ignore <a class="reference internal" href="#ActionTypes" title="ActionTypes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ActionTypes</span></code></a> unknown to them.</p>
|
||
</dd></dl>
|
||
|
||
</section>
|
||
<section id="org-freedesktop-ratbag1-led">
|
||
<span id="led"></span><h2>org.freedesktop.ratbag1.Led<a class="headerlink" href="#org-freedesktop-ratbag1-led" title="Link to this heading"></a></h2>
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="id6">
|
||
<span class="sig-name descname"><span class="pre">Index</span></span><a class="headerlink" href="#id6" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Index of the LED</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Mode">
|
||
<span class="sig-name descname"><span class="pre">Mode</span></span><a class="headerlink" href="#Mode" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>Enum describing the current mode, see <a class="reference internal" href="#Modes" title="Modes"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Modes</span></code></a>.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Modes">
|
||
<span class="sig-name descname"><span class="pre">Modes</span></span><a class="headerlink" href="#Modes" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>au</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>A list of modes supported by this LED.</p>
|
||
<table class="docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Value</p></th>
|
||
<th class="head"><p>Definition</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p>0</p></td>
|
||
<td><p>LED is off</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>1</p></td>
|
||
<td><p>LED is on with constant brightness</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>2</p></td>
|
||
<td><p>LED cycles through a set of colors.
|
||
This mode ignores the <a class="reference internal" href="#Color" title="Color"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Color</span></code></a>
|
||
values.</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>3</p></td>
|
||
<td><p>LED uses a breathing-style animation</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>In the future, extra values may get added. Clients must ignore
|
||
unknown Modes.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Color">
|
||
<span class="sig-name descname"><span class="pre">Color</span></span><a class="headerlink" href="#Color" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>(uuu)</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>32-bit unsigned int triplet (RGB) of the LED’s color. Only the least
|
||
significant bits are valid, the <a class="reference internal" href="#ColorDepth" title="ColorDepth"><code class="xref py py-attr docutils literal notranslate"><span class="pre">ColorDepth</span></code></a> property defines
|
||
the number of bits for each color. When writing to this property,
|
||
all bits outside the color depth must be 0.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="ColorDepth">
|
||
<span class="sig-name descname"><span class="pre">ColorDepth</span></span><a class="headerlink" href="#ColorDepth" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-only, constant</p>
|
||
</dd>
|
||
</dl>
|
||
<p>An enum specifying the color depth of this LED. Permitted values are:</p>
|
||
<table class="docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Value</p></th>
|
||
<th class="head"><p>Definition</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p>0</p></td>
|
||
<td><p>0 bits per color (monochrome)</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>1</p></td>
|
||
<td><p>8 bits per color</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>2</p></td>
|
||
<td><p>1 bit per color</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>In the future, extra values may get added. Clients must ignore
|
||
unknown <code class="docutils literal notranslate"><span class="pre">ColorDepths</span></code> and not manipulate the LED color where
|
||
the <code class="docutils literal notranslate"><span class="pre">ColorDepth</span></code> is unknown.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="EffectDuration">
|
||
<span class="sig-name descname"><span class="pre">EffectDuration</span></span><a class="headerlink" href="#EffectDuration" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The effect duration in ms, possible values are in the range 0 - 10000</p>
|
||
</dd></dl>
|
||
|
||
<dl class="py attribute">
|
||
<dt class="sig sig-object py" id="Brightness">
|
||
<span class="sig-name descname"><span class="pre">Brightness</span></span><a class="headerlink" href="#Brightness" title="Link to this definition"></a></dt>
|
||
<dd><dl class="field-list simple">
|
||
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
||
<dd class="field-odd"><p>u</p>
|
||
</dd>
|
||
<dt class="field-even">Flags<span class="colon">:</span></dt>
|
||
<dd class="field-even"><p>read-write, mutable</p>
|
||
</dd>
|
||
</dl>
|
||
<p>The brightness of the LED, normalized to the range 0-255, inclusive.
|
||
Where the LED supports less than 8-bit of brightness, libratbag maps
|
||
the value to a device-supported value in an implementation-defined
|
||
manner.</p>
|
||
</dd></dl>
|
||
|
||
</section>
|
||
<section id="special-button-functions">
|
||
<span id="button-special"></span><h2>Special button functions<a class="headerlink" href="#special-button-functions" title="Link to this heading"></a></h2>
|
||
<blockquote>
|
||
<div><p>All special button function values are based on the value
|
||
<code class="docutils literal notranslate"><span class="pre">0x40000000</span></code> (<code class="docutils literal notranslate"><span class="pre">1</span> <span class="pre"><<</span> <span class="pre">30</span></code>).</p>
|
||
<table class="docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>Offset</p></th>
|
||
<th class="head"><p>Value</p></th>
|
||
<th class="head"><p>Description</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p>0</p></td>
|
||
<td><p>0x40000000</p></td>
|
||
<td><p>Unknown</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>1</p></td>
|
||
<td><p>0x40000001</p></td>
|
||
<td><p>Doublelick</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>2</p></td>
|
||
<td><p>0x40000002</p></td>
|
||
<td><p>Wheel left</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>3</p></td>
|
||
<td><p>0x40000003</p></td>
|
||
<td><p>Wheel right</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>4</p></td>
|
||
<td><p>0x40000004</p></td>
|
||
<td><p>Wheel up</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>5</p></td>
|
||
<td><p>0x40000005</p></td>
|
||
<td><p>Wheel down</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>6</p></td>
|
||
<td><p>0x40000006</p></td>
|
||
<td><p>Ratchet mode switch</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>7</p></td>
|
||
<td><p>0x40000007</p></td>
|
||
<td><p>Resolution cycle up</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>8</p></td>
|
||
<td><p>0x40000008</p></td>
|
||
<td><p>Resolution cycle down</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>9</p></td>
|
||
<td><p>0x40000009</p></td>
|
||
<td><p>Resolution up</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>10</p></td>
|
||
<td><p>0x4000000a</p></td>
|
||
<td><p>Resolution down</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>11</p></td>
|
||
<td><p>0x4000000b</p></td>
|
||
<td><p>Resolution alternate</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>12</p></td>
|
||
<td><p>0x4000000c</p></td>
|
||
<td><p>Resolution default</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>13</p></td>
|
||
<td><p>0x4000000d</p></td>
|
||
<td><p>Profile cycle up</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>14</p></td>
|
||
<td><p>0x4000000e</p></td>
|
||
<td><p>Profile cycle down</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>15</p></td>
|
||
<td><p>0x4000000f</p></td>
|
||
<td><p>Profile up</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>16</p></td>
|
||
<td><p>0x40000010</p></td>
|
||
<td><p>Profile down</p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p>17</p></td>
|
||
<td><p>0x40000011</p></td>
|
||
<td><p>Second mode</p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p>18</p></td>
|
||
<td><p>0x40000012</p></td>
|
||
<td><p>Battery level</p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div></blockquote>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
||
<a href="index.html" class="btn btn-neutral float-left" title="The libratbag DBus API" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>© Copyright 2017, The ratbaggers.</p>
|
||
</div>
|
||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
<script>
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html> |