This file is indexed.

/usr/share/doc/libratbag-dev/html/group__device.html is in libratbag-doc 0.9-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.13"/>
        <script type="text/javascript" src="file:///usr/share/javascript/jquery/jquery.js"></script>
        <title>libratbag: Querying and manipulating devices</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="file:///usr/share/javascript/mathjax/MathJax.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
<link href="bootstrap.css" rel="stylesheet" type="text/css"/>
        <link href="bootstrap.css" rel="stylesheet" type="text/css" />
        <script src="file:///usr/share/javascript/bootstrap/js/bootstrap.js"></script>
        <script type="text/javascript" src="doxy-boot.js"></script>
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">libratbag 0.9.0</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel panel-default" style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Querying and manipulating devices</div>  </div>
</div><!--header-->
<div class="contents">

<p>Device configuration is managed by "profiles" (see <a class="el" href="group__profile.html">Device profiles</a>).  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structratbag__device.html">ratbag_device</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A ratbag context represents one single device.  <a href="structratbag__device.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gadac0b3995c97da4276a6f21ecadecedf"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#gadac0b3995c97da4276a6f21ecadecedf">ratbag_device_capability</a> { <br />
&#160;&#160;<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfa5272595d43de2ecb86551be9d20bad6f">RATBAG_DEVICE_CAP_NONE</a>, 
<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfaf4fbc43472adb35835f5e1d2fed9a05e">RATBAG_DEVICE_CAP_SWITCHABLE_RESOLUTION</a>, 
<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfa610acfcea4d029aac89b10a73ddaf7dc">RATBAG_DEVICE_CAP_SWITCHABLE_PROFILE</a>, 
<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfa950d081db409d31604b86d0a0087fb45">RATBAG_DEVICE_CAP_BUTTON_KEY</a>, 
<br />
&#160;&#160;<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfaa0d892a820b48517c4ea83018ab48eda">RATBAG_DEVICE_CAP_LED</a>, 
<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfac6de8a11a57ee4971be159e511c0065e">RATBAG_DEVICE_CAP_BUTTON_MACROS</a>, 
<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfaf70724e79aec52503a32566d4f7bbb32">RATBAG_DEVICE_CAP_DEFAULT_PROFILE</a>, 
<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfacee7c64e3ea8797c2462c72001afe619">RATBAG_DEVICE_CAP_QUERY_CONFIGURATION</a>, 
<br />
&#160;&#160;<a class="el" href="group__device.html#ggadac0b3995c97da4276a6f21ecadecedfaca1ffce8a02c08124ed78ac5192869a8">RATBAG_DEVICE_CAP_DISABLE_PROFILE</a>
<br />
 }</td></tr>
<tr class="separator:gadac0b3995c97da4276a6f21ecadecedf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaaeade1470e390e04848c0fa4f15e4f2b"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#gaaeade1470e390e04848c0fa4f15e4f2b">ratbag_device_ref</a> (struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="memdesc:gaaeade1470e390e04848c0fa4f15e4f2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a reference to the device.  <a href="#gaaeade1470e390e04848c0fa4f15e4f2b">More...</a><br /></td></tr>
<tr class="separator:gaaeade1470e390e04848c0fa4f15e4f2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacb6674aea50753e1ce30fb0a2bcf4bc8"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#gacb6674aea50753e1ce30fb0a2bcf4bc8">ratbag_device_unref</a> (struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="memdesc:gacb6674aea50753e1ce30fb0a2bcf4bc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dereference the ratbag device.  <a href="#gacb6674aea50753e1ce30fb0a2bcf4bc8">More...</a><br /></td></tr>
<tr class="separator:gacb6674aea50753e1ce30fb0a2bcf4bc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa41c2f2db4ee920548aa4e9a72f86a14"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#gaa41c2f2db4ee920548aa4e9a72f86a14">ratbag_device_set_user_data</a> (struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device, void *userdata)</td></tr>
<tr class="memdesc:gaa41c2f2db4ee920548aa4e9a72f86a14"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set caller-specific data associated with this device.  <a href="#gaa41c2f2db4ee920548aa4e9a72f86a14">More...</a><br /></td></tr>
<tr class="separator:gaa41c2f2db4ee920548aa4e9a72f86a14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga72297497f8c82952604f25b30fc29e83"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#ga72297497f8c82952604f25b30fc29e83">ratbag_device_get_user_data</a> (const struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="memdesc:ga72297497f8c82952604f25b30fc29e83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the caller-specific data associated with this device, if any.  <a href="#ga72297497f8c82952604f25b30fc29e83">More...</a><br /></td></tr>
<tr class="separator:ga72297497f8c82952604f25b30fc29e83"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab463581e68404f6362537b27744fdd04"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#gab463581e68404f6362537b27744fdd04">ratbag_device_get_name</a> (const struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="separator:gab463581e68404f6362537b27744fdd04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab51b2638874739f6be746c2fc14365a5"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#gab51b2638874739f6be746c2fc14365a5">ratbag_device_get_svg_name</a> (const struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="separator:gab51b2638874739f6be746c2fc14365a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga234f5713cd4db3dc7c100461bfabe269"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#ga234f5713cd4db3dc7c100461bfabe269">ratbag_device_has_capability</a> (const struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device, enum <a class="el" href="group__device.html#gadac0b3995c97da4276a6f21ecadecedf">ratbag_device_capability</a> cap)</td></tr>
<tr class="memdesc:ga234f5713cd4db3dc7c100461bfabe269"><td class="mdescLeft">&#160;</td><td class="mdescRight">Note that a device may not support any of the capabilities but still initialize fine otherwise.  <a href="#ga234f5713cd4db3dc7c100461bfabe269">More...</a><br /></td></tr>
<tr class="separator:ga234f5713cd4db3dc7c100461bfabe269"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7ba9d519de19961846cccd63e632a2f2"><td class="memItemLeft" align="right" valign="top">enum <a class="el" href="group__base.html#ga778f6aa9aeee462860007415895baec1">ratbag_error_code</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#ga7ba9d519de19961846cccd63e632a2f2">ratbag_device_commit</a> (struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="memdesc:ga7ba9d519de19961846cccd63e632a2f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write any changes to the device.  <a href="#ga7ba9d519de19961846cccd63e632a2f2">More...</a><br /></td></tr>
<tr class="separator:ga7ba9d519de19961846cccd63e632a2f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45a7982c317f4a7ece37b42d6dcbb4c1"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#ga45a7982c317f4a7ece37b42d6dcbb4c1">ratbag_device_get_num_profiles</a> (struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="memdesc:ga45a7982c317f4a7ece37b42d6dcbb4c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of profiles supported by this device.  <a href="#ga45a7982c317f4a7ece37b42d6dcbb4c1">More...</a><br /></td></tr>
<tr class="separator:ga45a7982c317f4a7ece37b42d6dcbb4c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3b04791bc03f4f5ea6691ca346cf8c18"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#ga3b04791bc03f4f5ea6691ca346cf8c18">ratbag_device_get_num_buttons</a> (struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="memdesc:ga3b04791bc03f4f5ea6691ca346cf8c18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of buttons available on this device.  <a href="#ga3b04791bc03f4f5ea6691ca346cf8c18">More...</a><br /></td></tr>
<tr class="separator:ga3b04791bc03f4f5ea6691ca346cf8c18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5ef8f8c5e8c45ca7660fb2c9b7586f52"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__device.html#ga5ef8f8c5e8c45ca7660fb2c9b7586f52">ratbag_device_get_num_leds</a> (struct <a class="el" href="structratbag__device.html">ratbag_device</a> *device)</td></tr>
<tr class="memdesc:ga5ef8f8c5e8c45ca7660fb2c9b7586f52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of LEDs available on this device.  <a href="#ga5ef8f8c5e8c45ca7660fb2c9b7586f52">More...</a><br /></td></tr>
<tr class="separator:ga5ef8f8c5e8c45ca7660fb2c9b7586f52"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Device configuration is managed by "profiles" (see <a class="el" href="group__profile.html">Device profiles</a>). </p>
<p>In the simplest case, a device has a single profile that can be fetched, queried and manipulated and then re-applied to the device. Other devices may have multiple profiles, each of which can be queried and managed independently. </p>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gadac0b3995c97da4276a6f21ecadecedf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadac0b3995c97da4276a6f21ecadecedf">&#9670;&nbsp;</a></span>ratbag_device_capability</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__device.html#gadac0b3995c97da4276a6f21ecadecedf">ratbag_device_capability</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfa5272595d43de2ecb86551be9d20bad6f"></a>RATBAG_DEVICE_CAP_NONE&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfaf4fbc43472adb35835f5e1d2fed9a05e"></a>RATBAG_DEVICE_CAP_SWITCHABLE_RESOLUTION&#160;</td><td class="fielddoc"><p>The device can change resolution, either software-controlled or by a hardware button. </p>
<p>FIXME: what about devices that only have hw buttons? can we query that, even if we can't switch it ourselves? Maybe better to have a separate cap for that then. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfa610acfcea4d029aac89b10a73ddaf7dc"></a>RATBAG_DEVICE_CAP_SWITCHABLE_PROFILE&#160;</td><td class="fielddoc"><p>The device can switch between hardware profiles. </p>
<p>A device with this capability can store multiple profiles in the hardware and provides the ability to switch between the profiles, possibly with a button. Devices without this capability will only have a single profile. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfa950d081db409d31604b86d0a0087fb45"></a>RATBAG_DEVICE_CAP_BUTTON_KEY&#160;</td><td class="fielddoc"><p>The device supports assigning button numbers, key events or key + modifier combinations. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfaa0d892a820b48517c4ea83018ab48eda"></a>RATBAG_DEVICE_CAP_LED&#160;</td><td class="fielddoc"><p>The device supports assigning LED colors and effects. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfac6de8a11a57ee4971be159e511c0065e"></a>RATBAG_DEVICE_CAP_BUTTON_MACROS&#160;</td><td class="fielddoc"><p>The device supports user-defined key or button sequences. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfaf70724e79aec52503a32566d4f7bbb32"></a>RATBAG_DEVICE_CAP_DEFAULT_PROFILE&#160;</td><td class="fielddoc"><p>The device can have one profile assigned as a default profile. </p>
<p>A default profile is the profile that is selected when the device is plugged in. Devices without this capability may select the last-used profile or a specific profile (usually the first). </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfacee7c64e3ea8797c2462c72001afe619"></a>RATBAG_DEVICE_CAP_QUERY_CONFIGURATION&#160;</td><td class="fielddoc"><p>The device has the capability to query the current hardware configuration. </p>
<p>If this capability is missing, libratbag cannot query the device for its current configuration and the configured resolutions and button mappings are unknown. libratbag will still provide information about the structure of the device such as the number of buttons and resolutions. Clients that encounter a device without this resolution are encouraged to upload a configuration stored on-disk to the device to reset the device to a known state.</p>
<p>Any changes uploaded to the device will be cached in libratbag, once a client has sent a full configuration to the device libratbag can be used to query the device as normal. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadac0b3995c97da4276a6f21ecadecedfaca1ffce8a02c08124ed78ac5192869a8"></a>RATBAG_DEVICE_CAP_DISABLE_PROFILE&#160;</td><td class="fielddoc"><p>The device has the capability to disable and enable profiles. </p>
<p>While profiles are not immediately deleted after being disabled, it is not guaranteed that the device will remember any disabled profiles the next time ratbag runs. Furthermore, the order of profiles may get changed the next time ratbag runs if profiles are disabled. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga7ba9d519de19961846cccd63e632a2f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7ba9d519de19961846cccd63e632a2f2">&#9670;&nbsp;</a></span>ratbag_device_commit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__base.html#ga778f6aa9aeee462860007415895baec1">ratbag_error_code</a> ratbag_device_commit </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write any changes to the device. </p>
<p>Depending on the device, this may take a couple of seconds.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success or an error code otherwise </dd></dl>

</div>
</div>
<a id="gab463581e68404f6362537b27744fdd04"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab463581e68404f6362537b27744fdd04">&#9670;&nbsp;</a></span>ratbag_device_get_name()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* ratbag_device_get_name </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The name of the device associated with the given ratbag. </dd></dl>

</div>
</div>
<a id="ga3b04791bc03f4f5ea6691ca346cf8c18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3b04791bc03f4f5ea6691ca346cf8c18">&#9670;&nbsp;</a></span>ratbag_device_get_num_buttons()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int ratbag_device_get_num_buttons </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the number of buttons available on this device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of buttons available on this device. </dd></dl>

</div>
</div>
<a id="ga5ef8f8c5e8c45ca7660fb2c9b7586f52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5ef8f8c5e8c45ca7660fb2c9b7586f52">&#9670;&nbsp;</a></span>ratbag_device_get_num_leds()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int ratbag_device_get_num_leds </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the number of LEDs available on this device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of LEDs available on this device. </dd></dl>

</div>
</div>
<a id="ga45a7982c317f4a7ece37b42d6dcbb4c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga45a7982c317f4a7ece37b42d6dcbb4c1">&#9670;&nbsp;</a></span>ratbag_device_get_num_profiles()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int ratbag_device_get_num_profiles </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the number of profiles supported by this device. </p>
<p>Note that the number of profiles available may be different to the number of profiles currently active. This function returns the maximum number of profiles available and is static for the lifetime of the device.</p>
<p>A device that does not support profiles in hardware provides a single profile that reflects the current settings of the device.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of profiles available on this device. </dd></dl>

</div>
</div>
<a id="gab51b2638874739f6be746c2fc14365a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab51b2638874739f6be746c2fc14365a5">&#9670;&nbsp;</a></span>ratbag_device_get_svg_name()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* ratbag_device_get_svg_name </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The file name of the svg drawing associated with the given ratbag. If there is no file associated to the device, NULL is returned. </dd></dl>

</div>
</div>
<a id="ga72297497f8c82952604f25b30fc29e83"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga72297497f8c82952604f25b30fc29e83">&#9670;&nbsp;</a></span>ratbag_device_get_user_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* ratbag_device_get_user_data </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the caller-specific data associated with this device, if any. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The caller-specific data previously assigned in <a class="el" href="group__device.html#gaa41c2f2db4ee920548aa4e9a72f86a14" title="Set caller-specific data associated with this device. ">ratbag_device_set_user_data()</a>. </dd></dl>

</div>
</div>
<a id="ga234f5713cd4db3dc7c100461bfabe269"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga234f5713cd4db3dc7c100461bfabe269">&#9670;&nbsp;</a></span>ratbag_device_has_capability()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ratbag_device_has_capability </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="group__device.html#gadac0b3995c97da4276a6f21ecadecedf">ratbag_device_capability</a>&#160;</td>
          <td class="paramname"><em>cap</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Note that a device may not support any of the capabilities but still initialize fine otherwise. </p>
<p>This is the case for devices that have no configurable options set, or for devices that have some configuration options but none that are currently exposed by libratbag. A client is expected to handle this situation.</p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>The device has the capability </td></tr>
    <tr><td class="paramname">0</td><td>The device does not have the capability </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaaeade1470e390e04848c0fa4f15e4f2b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaeade1470e390e04848c0fa4f15e4f2b">&#9670;&nbsp;</a></span>ratbag_device_ref()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structratbag__device.html">ratbag_device</a>* ratbag_device_ref </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a reference to the device. </p>
<p>A device is destroyed whenever the reference count reaches 0. See <a class="el" href="group__device.html#gacb6674aea50753e1ce30fb0a2bcf4bc8">ratbag_device_unref</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized valid ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The passed ratbag device </dd></dl>

</div>
</div>
<a id="gaa41c2f2db4ee920548aa4e9a72f86a14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa41c2f2db4ee920548aa4e9a72f86a14">&#9670;&nbsp;</a></span>ratbag_device_set_user_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ratbag_device_set_user_data </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>userdata</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set caller-specific data associated with this device. </p>
<p>libratbag does not manage, look at, or modify this data. The caller must ensure the data is valid.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized device </td></tr>
    <tr><td class="paramname">userdata</td><td>Caller-specific data passed to the various callback interfaces. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gacb6674aea50753e1ce30fb0a2bcf4bc8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacb6674aea50753e1ce30fb0a2bcf4bc8">&#9670;&nbsp;</a></span>ratbag_device_unref()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structratbag__device.html">ratbag_device</a>* ratbag_device_unref </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structratbag__device.html">ratbag_device</a> *&#160;</td>
          <td class="paramname"><em>device</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Dereference the ratbag device. </p>
<p>When the internal refcount reaches zero, all resources associated with this object are released. The object must be considered invalid once unref is called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>A previously initialized ratbag device </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Always NULL </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 10 2018 18:56:06 for libratbag by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>