-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbus.html
1072 lines (927 loc) · 41.5 KB
/
dbus.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DBus API — libratbag documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<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" />
<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="main navigation">
<p class="caption"><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></li>
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-device">org.freedesktop.ratbag1.Device</a></li>
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-profile">org.freedesktop.ratbag1.Profile</a></li>
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-resolution">org.freedesktop.ratbag1.Resolution</a></li>
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-button">org.freedesktop.ratbag1.Button</a></li>
<li class="toctree-l2"><a class="reference internal" href="#org-freedesktop-ratbag1-led">org.freedesktop.ratbag1.Led</a></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="top navigation">
<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="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>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">
<div class="section" id="dbus-api">
<h1>DBus API<a class="headerlink" href="#dbus-api" title="Permalink to this headline">¶</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 occured 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>
<div class="section" id="notes-on-the-dbus-api">
<h2>Notes on the DBus API<a class="headerlink" href="#notes-on-the-dbus-api" title="Permalink to this headline">¶</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>
<div class="section" id="types">
<h3>Types<a class="headerlink" href="#types" title="Permalink to this headline">¶</a></h3>
<p>Types used by these interfaces:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 78%" />
</colgroup>
<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>
</div>
<div class="section" id="flags">
<h3>Flags<a class="headerlink" href="#flags" title="Permalink to this headline">¶</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>
</div>
</div>
<div class="section" id="org-freedesktop-ratbag1-manager">
<span id="manager"></span><h2>org.freedesktop.ratbag1.Manager<a class="headerlink" href="#org-freedesktop-ratbag1-manager" title="Permalink to this headline">¶</a></h2>
<p>The <strong>org.freedesktop.ratbag1.Manager</strong> interface is the entry point to
interact with ratbagd.</p>
<dl class="attribute">
<dt id="APIVersion">
<code class="sig-name descname">APIVersion</code><a class="headerlink" href="#APIVersion" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>i</p>
</dd>
<dt class="field-even">Flags</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-compatibilty 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="attribute">
<dt id="Devices">
<code class="sig-name descname">Devices</code><a class="headerlink" href="#Devices" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>ao</p>
</dd>
<dt class="field-even">Flags</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>
</div>
<div class="section" id="org-freedesktop-ratbag1-device">
<span id="device"></span><h2>org.freedesktop.ratbag1.Device<a class="headerlink" href="#org-freedesktop-ratbag1-device" title="Permalink to this headline">¶</a></h2>
<p>The <strong>org.freedesktop.ratbag1.Device</strong> interface describes a single device
known to ratbagd.</p>
<dl class="attribute">
<dt id="Model">
<code class="sig-name descname">Model</code><a class="headerlink" href="#Model" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>s</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="Name">
<code class="sig-name descname">Name</code><a class="headerlink" href="#Name" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>s</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="Profiles">
<code class="sig-name descname">Profiles</code><a class="headerlink" href="#Profiles" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>ao</p>
</dd>
<dt class="field-even">Flags</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="function">
<dt id="Commit">
<code class="sig-name descname">Commit</code><span class="sig-paren">(</span><em class="sig-param">) → (</em><span class="sig-paren">)</span><a class="headerlink" href="#Commit" title="Permalink 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="function">
<dt id="Resync">
<code class="sig-name descname">Resync</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#Resync" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</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>
</div>
<div class="section" id="org-freedesktop-ratbag1-profile">
<span id="profile"></span><h2>org.freedesktop.ratbag1.Profile<a class="headerlink" href="#org-freedesktop-ratbag1-profile" title="Permalink to this headline">¶</a></h2>
<dl class="attribute">
<dt id="Index">
<code class="sig-name descname">Index</code><a class="headerlink" href="#Index" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt>
<code class="sig-name descname">Name</code></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>s</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="Enabled">
<code class="sig-name descname">Enabled</code><a class="headerlink" href="#Enabled" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>b</p>
</dd>
<dt class="field-even">Flags</dt>
<dd class="field-even"><p>read-write, mutable</p>
</dd>
</dl>
<p>True if this is the profile is enabled, 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="attribute">
<dt id="IsActive">
<code class="sig-name descname">IsActive</code><a class="headerlink" href="#IsActive" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>b</p>
</dd>
<dt class="field-even">Flags</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="#SetActive" 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="attribute">
<dt id="Resolutions">
<code class="sig-name descname">Resolutions</code><a class="headerlink" href="#Resolutions" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>ao</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="Buttons">
<code class="sig-name descname">Buttons</code><a class="headerlink" href="#Buttons" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>ao</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="Leds">
<code class="sig-name descname">Leds</code><a class="headerlink" href="#Leds" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>ao</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="ReportRate">
<code class="sig-name descname">ReportRate</code><a class="headerlink" href="#ReportRate" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="ReportRates">
<code class="sig-name descname">ReportRates</code><a class="headerlink" href="#ReportRates" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>au</p>
</dd>
<dt class="field-even">Flags</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 to resolutions.</p>
</dd></dl>
<dl class="function">
<dt id="SetActive">
<code class="sig-name descname">SetActive</code><span class="sig-paren">(</span><em class="sig-param">) → (</em><span class="sig-paren">)</span><a class="headerlink" href="#SetActive" title="Permalink to this definition">¶</a></dt>
<dd><p>Set this profile to be the active profile</p>
</dd></dl>
</div>
<div class="section" id="org-freedesktop-ratbag1-resolution">
<span id="resolution"></span><h2>org.freedesktop.ratbag1.Resolution<a class="headerlink" href="#org-freedesktop-ratbag1-resolution" title="Permalink to this headline">¶</a></h2>
<dl class="attribute">
<dt>
<code class="sig-name descname">Index</code></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</dt>
<dd class="field-even"><p>read-only, constant</p>
</dd>
</dl>
<p>Index of the resolution</p>
</dd></dl>
<dl class="attribute">
<dt>
<code class="sig-name descname">IsActive</code></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>b</p>
</dd>
<dt class="field-even">Flags</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 resoultion must be active at all
times. This property is read-only, use the
<a class="reference internal" href="#SetActive" 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="attribute">
<dt id="IsDefault">
<code class="sig-name descname">IsDefault</code><a class="headerlink" href="#IsDefault" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>b</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="Resolution">
<code class="sig-name descname">Resolution</code><a class="headerlink" href="#Resolution" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>v</p>
</dd>
<dt class="field-even">Flags</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="#Resolutions" title="Resolutions"><code class="xref py py-attr docutils literal notranslate"><span class="pre">Resolutions</span></code></a>.</p>
</dd></dl>
<dl class="attribute">
<dt>
<code class="sig-name descname">Resolutions</code></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>au</p>
</dd>
<dt class="field-even">Flags</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="function">
<dt id="SetDefault">
<code class="sig-name descname">SetDefault</code><span class="sig-paren">(</span><em class="sig-param">) → (</em><span class="sig-paren">)</span><a class="headerlink" href="#SetDefault" title="Permalink to this definition">¶</a></dt>
<dd><p>Set this resolution to be the default</p>
</dd></dl>
<dl class="function">
<dt>
<code class="sig-name descname">SetActive</code><span class="sig-paren">(</span><em class="sig-param">) → (</em><span class="sig-paren">)</span></dt>
<dd><p>Set this resolution to be the active one</p>
</dd></dl>
</div>
<div class="section" id="org-freedesktop-ratbag1-button">
<span id="button"></span><h2>org.freedesktop.ratbag1.Button<a class="headerlink" href="#org-freedesktop-ratbag1-button" title="Permalink to this headline">¶</a></h2>
<dl class="attribute">
<dt>
<code class="sig-name descname">Index</code></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</dt>
<dd class="field-even"><p>read-only, constant</p>
</dd>
</dl>
<p>Index of the button</p>
</dd></dl>
<dl class="attribute">
<dt id="Mapping">
<code class="sig-name descname">Mapping</code><a class="headerlink" href="#Mapping" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>(uv)</p>
</dd>
<dt class="field-even">Flags</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">
<colgroup>
<col style="width: 19%" />
<col style="width: 81%" />
</colgroup>
<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>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="attribute">
<dt id="ActionTypes">
<code class="sig-name descname">ActionTypes</code><a class="headerlink" href="#ActionTypes" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>au</p>
</dd>
<dt class="field-even">Flags</dt>
<dd class="field-even"><p>read-only, constant</p>
</dd>
</dl>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 68%" />
</colgroup>
<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>Macro</p></td>
<td><p>Mapping to a macro key sequence</p></td>
</tr>
<tr class="row-even"><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>
<dl class="function">
<dt id="Disable">
<code class="sig-name descname">Disable</code><span class="sig-paren">(</span><em class="sig-param">) → (</em><span class="sig-paren">)</span><a class="headerlink" href="#Disable" title="Permalink to this definition">¶</a></dt>
<dd><p>Disable this button</p>
</dd></dl>
</div>
<div class="section" id="org-freedesktop-ratbag1-led">
<span id="led"></span><h2>org.freedesktop.ratbag1.Led<a class="headerlink" href="#org-freedesktop-ratbag1-led" title="Permalink to this headline">¶</a></h2>
<dl class="attribute">
<dt>
<code class="sig-name descname">Index</code></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</dt>
<dd class="field-even"><p>read-only, constant</p>
</dd>
</dl>
<p>Index of the LED</p>
</dd></dl>
<dl class="attribute">
<dt id="Mode">
<code class="sig-name descname">Mode</code><a class="headerlink" href="#Mode" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="Modes">
<code class="sig-name descname">Modes</code><a class="headerlink" href="#Modes" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>au</p>
</dd>
<dt class="field-even">Flags</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">
<colgroup>
<col style="width: 16%" />
<col style="width: 84%" />
</colgroup>
<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="attribute">
<dt id="Color">
<code class="sig-name descname">Color</code><a class="headerlink" href="#Color" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>(uuu)</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="ColorDepth">
<code class="sig-name descname">ColorDepth</code><a class="headerlink" href="#ColorDepth" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</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">
<colgroup>
<col style="width: 18%" />
<col style="width: 82%" />
</colgroup>
<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="attribute">
<dt id="EffectDuration">
<code class="sig-name descname">EffectDuration</code><a class="headerlink" href="#EffectDuration" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</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="attribute">
<dt id="Brightness">
<code class="sig-name descname">Brightness</code><a class="headerlink" href="#Brightness" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>u</p>
</dd>
<dt class="field-even">Flags</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>
</div>
<div class="section" id="special-button-functions">
<span id="button-special"></span><h2>Special button functions<a class="headerlink" href="#special-button-functions" title="Permalink to this headline">¶</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">
<colgroup>
<col style="width: 16%" />
<col style="width: 16%" />
<col style="width: 68%" />
</colgroup>
<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>