summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 (via Travis CI) <[email protected]>2020-08-18 17:06:55 +0000
committerraveit65 (via Travis CI) <[email protected]>2020-08-18 17:06:55 +0000
commit5a3083d23ab4cc54f43034d42d4f62707fab623b (patch)
treeac9bf719d664440772f277a48aa777463d91d872
downloadmate-media-gh-pages.tar.bz2
mate-media-gh-pages.tar.xz
Deploy mate-desktop/mate-media to github.com/mate-desktop/mate-media.git:gh-pagesgh-pages
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_enum-conversion/0.html1038
-rw-r--r--[email protected]_enum-conversion/1.html2368
-rw-r--r--[email protected]_enum-conversion/2.html1110
-rw-r--r--[email protected]_enum-conversion/index.html108
-rw-r--r--[email protected]_enum-conversion/stats.html93
-rw-r--r--[email protected]_enum-conversion/style.css149
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_travis/0.html1038
-rw-r--r--[email protected]_travis/1.html2368
-rw-r--r--[email protected]_travis/2.html1110
-rw-r--r--[email protected]_travis/index.html108
-rw-r--r--[email protected]_travis/stats.html93
-rw-r--r--[email protected]_travis/style.css149
-rw-r--r--[email protected]_travis/0.html1038
-rw-r--r--2020-04-21-012206-8805-cpp[email protected]_travis/1.html2368
-rw-r--r--[email protected]_travis/2.html1110
-rw-r--r--[email protected]_travis/index.html108
-rw-r--r--[email protected]_travis/stats.html93
-rw-r--r--[email protected]_travis/style.css149
-rw-r--r--[email protected]_travis/0.html1038
-rw-r--r--[email protected]_travis/1.html2368
-rw-r--r--[email protected]_travis/2.html1110
-rw-r--r--[email protected]_travis/index.html108
-rw-r--r--[email protected]_travis/stats.html93
-rw-r--r--[email protected]_travis/style.css149
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_travis-ci/0.html1038
-rw-r--r--[email protected]_travis-ci/1.html2368
-rw-r--r--[email protected]_travis-ci/2.html1110
-rw-r--r--[email protected]_travis-ci/index.html108
-rw-r--r--[email protected]_travis-ci/stats.html93
-rw-r--r--[email protected]_travis-ci/style.css149
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_on_notebook_scroll_event/0.html1038
-rw-r--r--[email protected]_on_notebook_scroll_event/1.html2368
-rw-r--r--[email protected]_on_notebook_scroll_event/2.html1110
-rw-r--r--[email protected]_on_notebook_scroll_event/index.html108
-rw-r--r--[email protected]_on_notebook_scroll_event/stats.html93
-rw-r--r--[email protected]_on_notebook_scroll_event/style.css149
-rw-r--r--[email protected]_on_notebook_scroll_event/0.html1038
-rw-r--r--[email protected]_on_notebook_scroll_event/1.html2368
-rw-r--r--[email protected]_on_notebook_scroll_event/2.html1110
-rw-r--r--[email protected]_on_notebook_scroll_event/index.html108
-rw-r--r--[email protected]_on_notebook_scroll_event/stats.html93
-rw-r--r--[email protected]_on_notebook_scroll_event/style.css149
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_master/0.html1038
-rw-r--r--[email protected]_master/1.html2368
-rw-r--r--[email protected]_master/2.html1110
-rw-r--r--[email protected]_master/index.html108
-rw-r--r--[email protected]_master/stats.html93
-rw-r--r--[email protected]_master/style.css149
-rw-r--r--[email protected]_master/0.html1054
-rw-r--r--[email protected]_master/1.html2384
-rw-r--r--[email protected]_master/2.html1126
-rw-r--r--[email protected]_master/index.html124
-rw-r--r--[email protected]_master/stats.html109
-rw-r--r--[email protected]_master/style.css137
-rw-r--r--[email protected]_master/0.html1054
-rw-r--r--[email protected]_master/1.html2384
-rw-r--r--[email protected]_master/2.html1126
-rw-r--r--[email protected]_master/index.html124
-rw-r--r--[email protected]_master/stats.html109
-rw-r--r--[email protected]_master/style.css137
-rw-r--r--[email protected]_master/0.html1054
-rw-r--r--[email protected]_master/1.html2384
-rw-r--r--[email protected]_master/2.html1126
-rw-r--r--[email protected]_master/index.html124
-rw-r--r--[email protected]_master/stats.html109
-rw-r--r--[email protected]_master/style.css137
-rw-r--r--[email protected]_v1.25.0/0.html1054
-rw-r--r--[email protected]_v1.25.0/1.html2384
-rw-r--r--[email protected]_v1.25.0/2.html1126
-rw-r--r--[email protected]_v1.25.0/index.html124
-rw-r--r--[email protected]_v1.25.0/stats.html109
-rw-r--r--[email protected]_v1.25.0/style.css137
-rw-r--r--CNAME1
-rw-r--r--index.html47
122 files changed, 97640 insertions, 0 deletions
diff --git a/[email protected]_master/0.html b/[email protected]_master/0.html
new file mode 100644
index 0000000..e262ed0
--- /dev/null
+++ b/[email protected]_master/0.html
@@ -0,0 +1,1038 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-media</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ function toggle_all(){
+ var elts = document.getElementsByTagName("input");
+ for (var i = 1; i < elts.length; i++) {
+ var el = elts[i];
+ el.checked ? el.checked=false : el.checked=true;
+ toggle_class_visibility(el.id);
+ }
+ }
+
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - mate-media: mate-volume-control/gvc-combo-box.c </h1>
+ </div>
+ <div id="menu" dir="rtl">
+ <p id="filename"><a href="index.html">Defects:</a> gvc-combo-box.c</p>
+<a href='0.html#line-70'> unknownMacro 70</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 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</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span>
+<a name="line-2"></a><span class="cm"> *</span>
+<a name="line-3"></a><span class="cm"> * Copyright (C) 2009 Bastien Nocera</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2014 Michal Ratajsky &lt;[email protected]&gt;</span>
+<a name="line-5"></a><span class="cm"> *</span>
+<a name="line-6"></a><span class="cm"> * This program is free software; you can redistribute it and/or modify</span>
+<a name="line-7"></a><span class="cm"> * it under the terms of the GNU General Public License as published by</span>
+<a name="line-8"></a><span class="cm"> * the Free Software Foundation; either version 2 of the License, or</span>
+<a name="line-9"></a><span class="cm"> * (at your option) any later version.</span>
+<a name="line-10"></a><span class="cm"> *</span>
+<a name="line-11"></a><span class="cm"> * This program is distributed in the hope that it will be useful,</span>
+<a name="line-12"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-13"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
+<a name="line-14"></a><span class="cm"> * GNU General Public License for more details.</span>
+<a name="line-15"></a><span class="cm"> *</span>
+<a name="line-16"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-17"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-18"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-19"></a><span class="cm"> *</span>
+<a name="line-20"></a><span class="cm"> */</span>
+<a name="line-21"></a>
+<a name="line-22"></a><span class="cp">#include</span> <span class="cpf">&lt;glib.h&gt;</span><span class="cp"></span>
+<a name="line-23"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-24"></a><span class="cp">#include</span> <span class="cpf">&lt;glib-object.h&gt;</span><span class="cp"></span>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-26"></a>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;libmatemixer/matemixer.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a>
+<a name="line-29"></a><span class="cp">#include</span> <span class="cpf">&quot;gvc-combo-box.h&quot;</span><span class="cp"></span>
+<a name="line-30"></a>
+<a name="line-31"></a><span class="k">struct</span> <span class="n">_GvcComboBoxPrivate</span>
+<a name="line-32"></a><span class="p">{</span>
+<a name="line-33"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">drop_box</span><span class="p">;</span>
+<a name="line-34"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">start_box</span><span class="p">;</span>
+<a name="line-35"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">end_box</span><span class="p">;</span>
+<a name="line-36"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">label</span><span class="p">;</span>
+<a name="line-37"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">button</span><span class="p">;</span>
+<a name="line-38"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-39"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">combobox</span><span class="p">;</span>
+<a name="line-40"></a> <span class="n">MateMixerSwitch</span> <span class="o">*</span><span class="n">swtch</span><span class="p">;</span>
+<a name="line-41"></a><span class="p">};</span>
+<a name="line-42"></a>
+<a name="line-43"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-44"></a> <span class="n">COL_NAME</span><span class="p">,</span>
+<a name="line-45"></a> <span class="n">COL_HUMAN_NAME</span><span class="p">,</span>
+<a name="line-46"></a> <span class="n">NUM_COLS</span>
+<a name="line-47"></a><span class="p">};</span>
+<a name="line-48"></a>
+<a name="line-49"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-50"></a> <span class="n">CHANGING</span><span class="p">,</span>
+<a name="line-51"></a> <span class="n">BUTTON_CLICKED</span><span class="p">,</span>
+<a name="line-52"></a> <span class="n">LAST_SIGNAL</span>
+<a name="line-53"></a><span class="p">};</span>
+<a name="line-54"></a>
+<a name="line-55"></a><span class="k">static</span> <span class="n">guint</span> <span class="n">signals</span><span class="p">[</span><span class="n">LAST_SIGNAL</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> <span class="mi">0</span><span class="p">,</span> <span class="p">};</span>
+<a name="line-56"></a>
+<a name="line-57"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-58"></a> <span class="n">PROP_0</span><span class="p">,</span>
+<a name="line-59"></a> <span class="n">PROP_SWITCH</span><span class="p">,</span>
+<a name="line-60"></a> <span class="n">PROP_LABEL</span><span class="p">,</span>
+<a name="line-61"></a> <span class="n">PROP_SHOW_BUTTON</span><span class="p">,</span>
+<a name="line-62"></a> <span class="n">PROP_BUTTON_LABEL</span><span class="p">,</span>
+<a name="line-63"></a> <span class="n">N_PROPERTIES</span>
+<a name="line-64"></a><span class="p">};</span>
+<a name="line-65"></a>
+<a name="line-66"></a><span class="k">static</span> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">properties</span><span class="p">[</span><span class="n">N_PROPERTIES</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> <span class="nb">NULL</span><span class="p">,</span> <span class="p">};</span>
+<a name="line-67"></a>
+<a name="line-68"></a><span class="k">static</span> <span class="kt">void</span> <span class="nf">gvc_combo_box_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">);</span>
+<a name="line-69"></a>
+<a name="line-70"></a><span class="hll"><span class="n">G_DEFINE_TYPE_WITH_PRIVATE</span> <span class="p">(</span><span class="n">GvcComboBox</span><span class="p">,</span> <span class="n">gvc_combo_box</span><span class="p">,</span> <span class="n">GTK_TYPE_BOX</span><span class="p">)</span><span class='error2'>&lt;--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.</span>
+</span><a name="line-71"></a>
+<a name="line-72"></a><span class="n">MateMixerSwitch</span> <span class="o">*</span>
+<a name="line-73"></a><span class="n">gvc_combo_box_get_switch</span> <span class="p">(</span><span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-74"></a><span class="p">{</span>
+<a name="line-75"></a> <span class="n">g_return_val_if_fail</span> <span class="p">(</span><span class="n">GVC_IS_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-76"></a>
+<a name="line-77"></a> <span class="k">return</span> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">;</span>
+<a name="line-78"></a><span class="p">}</span>
+<a name="line-79"></a>
+<a name="line-80"></a><span class="kt">void</span>
+<a name="line-81"></a><span class="n">gvc_combo_box_set_size_group</span> <span class="p">(</span><span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">,</span>
+<a name="line-82"></a> <span class="n">GtkSizeGroup</span> <span class="o">*</span><span class="n">group</span><span class="p">,</span>
+<a name="line-83"></a> <span class="n">gboolean</span> <span class="n">symmetric</span><span class="p">)</span>
+<a name="line-84"></a><span class="p">{</span>
+<a name="line-85"></a> <span class="n">g_return_if_fail</span> <span class="p">(</span><span class="n">GVC_IS_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="p">));</span>
+<a name="line-86"></a> <span class="n">g_return_if_fail</span> <span class="p">(</span><span class="n">GTK_IS_SIZE_GROUP</span> <span class="p">(</span><span class="n">group</span><span class="p">));</span>
+<a name="line-87"></a>
+<a name="line-88"></a> <span class="k">if</span> <span class="p">(</span><span class="n">group</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-89"></a> <span class="n">gtk_size_group_add_widget</span> <span class="p">(</span><span class="n">group</span><span class="p">,</span> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">start_box</span><span class="p">);</span>
+<a name="line-90"></a> <span class="k">if</span> <span class="p">(</span><span class="n">symmetric</span> <span class="o">==</span> <span class="n">TRUE</span><span class="p">)</span>
+<a name="line-91"></a> <span class="n">gtk_size_group_add_widget</span> <span class="p">(</span><span class="n">group</span><span class="p">,</span> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">end_box</span><span class="p">);</span>
+<a name="line-92"></a> <span class="p">}</span>
+<a name="line-93"></a> <span class="n">gtk_widget_queue_draw</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">combobox</span><span class="p">));</span>
+<a name="line-94"></a><span class="p">}</span>
+<a name="line-95"></a>
+<a name="line-96"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-97"></a><span class="n">on_switch_active_option_notify</span> <span class="p">(</span><span class="n">MateMixerSwitch</span> <span class="o">*</span><span class="n">swtch</span><span class="p">,</span>
+<a name="line-98"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">,</span>
+<a name="line-99"></a> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-100"></a><span class="p">{</span>
+<a name="line-101"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-102"></a> <span class="n">MateMixerSwitchOption</span> <span class="o">*</span><span class="n">active</span><span class="p">;</span>
+<a name="line-103"></a> <span class="n">gboolean</span> <span class="n">cont</span><span class="p">;</span>
+<a name="line-104"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-105"></a>
+<a name="line-106"></a> <span class="n">active</span> <span class="o">=</span> <span class="n">mate_mixer_switch_get_active_option</span> <span class="p">(</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-107"></a> <span class="k">if</span> <span class="p">(</span><span class="n">G_UNLIKELY</span> <span class="p">(</span><span class="n">active</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-108"></a> <span class="n">g_warn_if_reached</span> <span class="p">();</span>
+<a name="line-109"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-110"></a> <span class="p">}</span>
+<a name="line-111"></a>
+<a name="line-112"></a> <span class="cm">/* Select the newly activated switch option in the combo box */</span>
+<a name="line-113"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">mate_mixer_switch_option_get_name</span> <span class="p">(</span><span class="n">active</span><span class="p">);</span>
+<a name="line-114"></a> <span class="n">cont</span> <span class="o">=</span> <span class="n">gtk_tree_model_get_iter_first</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-115"></a> <span class="k">while</span> <span class="p">(</span><span class="n">cont</span> <span class="o">==</span> <span class="n">TRUE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-116"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">current</span><span class="p">;</span>
+<a name="line-117"></a>
+<a name="line-118"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-119"></a> <span class="n">COL_NAME</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">current</span><span class="p">,</span>
+<a name="line-120"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-121"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_strcmp0</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">current</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-122"></a> <span class="n">gtk_combo_box_set_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-123"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">current</span><span class="p">);</span>
+<a name="line-124"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-125"></a> <span class="p">}</span>
+<a name="line-126"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">current</span><span class="p">);</span>
+<a name="line-127"></a>
+<a name="line-128"></a> <span class="n">cont</span> <span class="o">=</span> <span class="n">gtk_tree_model_iter_next</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-129"></a> <span class="p">}</span>
+<a name="line-130"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Could not find switch option &#39;%s&#39; in combo box&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">);</span>
+<a name="line-131"></a><span class="p">}</span>
+<a name="line-132"></a>
+<a name="line-133"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-134"></a><span class="n">gvc_combo_box_set_switch</span> <span class="p">(</span><span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">,</span> <span class="n">MateMixerSwitch</span> <span class="o">*</span><span class="n">swtch</span><span class="p">)</span>
+<a name="line-135"></a><span class="p">{</span>
+<a name="line-136"></a> <span class="n">MateMixerSwitchOption</span> <span class="o">*</span><span class="n">active</span><span class="p">;</span>
+<a name="line-137"></a> <span class="k">const</span> <span class="n">GList</span> <span class="o">*</span><span class="n">options</span><span class="p">;</span>
+<a name="line-138"></a>
+<a name="line-139"></a> <span class="n">g_return_if_fail</span> <span class="p">(</span><span class="n">GVC_IS_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="p">));</span>
+<a name="line-140"></a> <span class="n">g_return_if_fail</span> <span class="p">(</span><span class="n">MATE_MIXER_IS_SWITCH</span> <span class="p">(</span><span class="n">swtch</span><span class="p">));</span>
+<a name="line-141"></a>
+<a name="line-142"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span> <span class="o">=</span> <span class="n">g_object_ref</span> <span class="p">(</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-143"></a>
+<a name="line-144"></a> <span class="n">active</span> <span class="o">=</span> <span class="n">mate_mixer_switch_get_active_option</span> <span class="p">(</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-145"></a> <span class="n">options</span> <span class="o">=</span> <span class="n">mate_mixer_switch_list_options</span> <span class="p">(</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-146"></a> <span class="k">while</span> <span class="p">(</span><span class="n">options</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-147"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-148"></a> <span class="n">MateMixerSwitchOption</span> <span class="o">*</span><span class="n">option</span> <span class="o">=</span> <span class="n">MATE_MIXER_SWITCH_OPTION</span> <span class="p">(</span><span class="n">options</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">);</span>
+<a name="line-149"></a>
+<a name="line-150"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">),</span>
+<a name="line-151"></a> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-152"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-153"></a> <span class="n">COL_NAME</span><span class="p">,</span>
+<a name="line-154"></a> <span class="n">mate_mixer_switch_option_get_name</span> <span class="p">(</span><span class="n">option</span><span class="p">),</span>
+<a name="line-155"></a> <span class="n">COL_HUMAN_NAME</span><span class="p">,</span>
+<a name="line-156"></a> <span class="n">mate_mixer_switch_option_get_label</span> <span class="p">(</span><span class="n">option</span><span class="p">),</span>
+<a name="line-157"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-158"></a>
+<a name="line-159"></a> <span class="cm">/* Select the currently active option of the switch */</span>
+<a name="line-160"></a> <span class="k">if</span> <span class="p">(</span><span class="n">option</span> <span class="o">==</span> <span class="n">active</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-161"></a> <span class="n">gtk_combo_box_set_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-162"></a> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-163"></a> <span class="p">}</span>
+<a name="line-164"></a> <span class="n">options</span> <span class="o">=</span> <span class="n">options</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
+<a name="line-165"></a> <span class="p">}</span>
+<a name="line-166"></a>
+<a name="line-167"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">swtch</span><span class="p">),</span>
+<a name="line-168"></a> <span class="s">&quot;notify::active-option&quot;</span><span class="p">,</span>
+<a name="line-169"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_switch_active_option_notify</span><span class="p">),</span>
+<a name="line-170"></a> <span class="n">combobox</span><span class="p">);</span>
+<a name="line-171"></a><span class="p">}</span>
+<a name="line-172"></a>
+<a name="line-173"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-174"></a><span class="n">gvc_combo_box_set_property</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">,</span>
+<a name="line-175"></a> <span class="n">guint</span> <span class="n">prop_id</span><span class="p">,</span>
+<a name="line-176"></a> <span class="k">const</span> <span class="n">GValue</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span>
+<a name="line-177"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">)</span>
+<a name="line-178"></a><span class="p">{</span>
+<a name="line-179"></a> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">self</span> <span class="o">=</span> <span class="n">GVC_COMBO_BOX</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-180"></a>
+<a name="line-181"></a> <span class="k">switch</span> <span class="p">(</span><span class="n">prop_id</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-182"></a> <span class="k">case</span> <span class="nl">PROP_SWITCH</span><span class="p">:</span>
+<a name="line-183"></a> <span class="n">gvc_combo_box_set_switch</span> <span class="p">(</span><span class="n">self</span><span class="p">,</span> <span class="n">g_value_get_object</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-184"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-185"></a> <span class="k">case</span> <span class="nl">PROP_LABEL</span><span class="p">:</span>
+<a name="line-186"></a> <span class="n">gtk_label_set_text_with_mnemonic</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">),</span> <span class="n">g_value_get_string</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-187"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-188"></a> <span class="k">case</span> <span class="nl">PROP_BUTTON_LABEL</span><span class="p">:</span>
+<a name="line-189"></a> <span class="n">gtk_button_set_label</span> <span class="p">(</span><span class="n">GTK_BUTTON</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">),</span> <span class="n">g_value_get_string</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-190"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-191"></a> <span class="k">case</span> <span class="nl">PROP_SHOW_BUTTON</span><span class="p">:</span>
+<a name="line-192"></a> <span class="n">gtk_widget_set_visible</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">,</span> <span class="n">g_value_get_boolean</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-193"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-194"></a> <span class="k">default</span><span class="o">:</span>
+<a name="line-195"></a> <span class="n">G_OBJECT_WARN_INVALID_PROPERTY_ID</span> <span class="p">(</span><span class="n">object</span><span class="p">,</span> <span class="n">prop_id</span><span class="p">,</span> <span class="n">pspec</span><span class="p">);</span>
+<a name="line-196"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-197"></a> <span class="p">}</span>
+<a name="line-198"></a><span class="p">}</span>
+<a name="line-199"></a>
+<a name="line-200"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-201"></a><span class="n">gvc_combo_box_get_property</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">,</span>
+<a name="line-202"></a> <span class="n">guint</span> <span class="n">prop_id</span><span class="p">,</span>
+<a name="line-203"></a> <span class="n">GValue</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span>
+<a name="line-204"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">)</span>
+<a name="line-205"></a><span class="p">{</span>
+<a name="line-206"></a> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">self</span> <span class="o">=</span> <span class="n">GVC_COMBO_BOX</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-207"></a>
+<a name="line-208"></a> <span class="k">switch</span> <span class="p">(</span><span class="n">prop_id</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-209"></a> <span class="k">case</span> <span class="nl">PROP_SWITCH</span><span class="p">:</span>
+<a name="line-210"></a> <span class="n">g_value_set_object</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-211"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-212"></a> <span class="k">case</span> <span class="nl">PROP_LABEL</span><span class="p">:</span>
+<a name="line-213"></a> <span class="n">g_value_set_string</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">gtk_label_get_text</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">)));</span>
+<a name="line-214"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-215"></a> <span class="k">case</span> <span class="nl">PROP_BUTTON_LABEL</span><span class="p">:</span>
+<a name="line-216"></a> <span class="n">g_value_set_string</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">gtk_button_get_label</span> <span class="p">(</span><span class="n">GTK_BUTTON</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">)));</span>
+<a name="line-217"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-218"></a> <span class="k">case</span> <span class="nl">PROP_SHOW_BUTTON</span><span class="p">:</span>
+<a name="line-219"></a> <span class="n">g_value_set_boolean</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">gtk_widget_get_visible</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">));</span>
+<a name="line-220"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-221"></a> <span class="k">default</span><span class="o">:</span>
+<a name="line-222"></a> <span class="n">G_OBJECT_WARN_INVALID_PROPERTY_ID</span> <span class="p">(</span><span class="n">object</span><span class="p">,</span> <span class="n">prop_id</span><span class="p">,</span> <span class="n">pspec</span><span class="p">);</span>
+<a name="line-223"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-224"></a> <span class="p">}</span>
+<a name="line-225"></a><span class="p">}</span>
+<a name="line-226"></a>
+<a name="line-227"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-228"></a><span class="n">gvc_combo_box_class_init</span> <span class="p">(</span><span class="n">GvcComboBoxClass</span> <span class="o">*</span><span class="n">klass</span><span class="p">)</span>
+<a name="line-229"></a><span class="p">{</span>
+<a name="line-230"></a> <span class="n">GObjectClass</span> <span class="o">*</span><span class="n">object_class</span> <span class="o">=</span> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">);</span>
+<a name="line-231"></a>
+<a name="line-232"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="o">=</span> <span class="n">gvc_combo_box_dispose</span><span class="p">;</span>
+<a name="line-233"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">set_property</span> <span class="o">=</span> <span class="n">gvc_combo_box_set_property</span><span class="p">;</span>
+<a name="line-234"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">get_property</span> <span class="o">=</span> <span class="n">gvc_combo_box_get_property</span><span class="p">;</span>
+<a name="line-235"></a>
+<a name="line-236"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_SWITCH</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-237"></a> <span class="n">g_param_spec_object</span> <span class="p">(</span><span class="s">&quot;switch&quot;</span><span class="p">,</span>
+<a name="line-238"></a> <span class="s">&quot;switch&quot;</span><span class="p">,</span>
+<a name="line-239"></a> <span class="s">&quot;The MateMixerSwitch&quot;</span><span class="p">,</span>
+<a name="line-240"></a> <span class="n">MATE_MIXER_TYPE_SWITCH</span><span class="p">,</span>
+<a name="line-241"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-242"></a> <span class="n">G_PARAM_CONSTRUCT_ONLY</span> <span class="o">|</span>
+<a name="line-243"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-244"></a>
+<a name="line-245"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_LABEL</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-246"></a> <span class="n">g_param_spec_string</span> <span class="p">(</span><span class="s">&quot;label&quot;</span><span class="p">,</span>
+<a name="line-247"></a> <span class="s">&quot;label&quot;</span><span class="p">,</span>
+<a name="line-248"></a> <span class="s">&quot;The combo box label&quot;</span><span class="p">,</span>
+<a name="line-249"></a> <span class="n">_</span><span class="p">(</span><span class="s">&quot;_Profile:&quot;</span><span class="p">),</span>
+<a name="line-250"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-251"></a> <span class="n">G_PARAM_CONSTRUCT</span> <span class="o">|</span>
+<a name="line-252"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-253"></a>
+<a name="line-254"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_SHOW_BUTTON</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-255"></a> <span class="n">g_param_spec_boolean</span> <span class="p">(</span><span class="s">&quot;show-button&quot;</span><span class="p">,</span>
+<a name="line-256"></a> <span class="s">&quot;show-button&quot;</span><span class="p">,</span>
+<a name="line-257"></a> <span class="s">&quot;Whether to show the button&quot;</span><span class="p">,</span>
+<a name="line-258"></a> <span class="n">FALSE</span><span class="p">,</span>
+<a name="line-259"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-260"></a> <span class="n">G_PARAM_CONSTRUCT</span> <span class="o">|</span>
+<a name="line-261"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-262"></a>
+<a name="line-263"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_BUTTON_LABEL</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-264"></a> <span class="n">g_param_spec_string</span> <span class="p">(</span><span class="s">&quot;button-label&quot;</span><span class="p">,</span>
+<a name="line-265"></a> <span class="s">&quot;button-label&quot;</span><span class="p">,</span>
+<a name="line-266"></a> <span class="s">&quot;The button&#39;s label&quot;</span><span class="p">,</span>
+<a name="line-267"></a> <span class="s">&quot;&quot;</span><span class="p">,</span>
+<a name="line-268"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-269"></a> <span class="n">G_PARAM_CONSTRUCT</span> <span class="o">|</span>
+<a name="line-270"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-271"></a>
+<a name="line-272"></a> <span class="n">g_object_class_install_properties</span> <span class="p">(</span><span class="n">object_class</span><span class="p">,</span> <span class="n">N_PROPERTIES</span><span class="p">,</span> <span class="n">properties</span><span class="p">);</span>
+<a name="line-273"></a>
+<a name="line-274"></a> <span class="n">signals</span><span class="p">[</span><span class="n">CHANGING</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-275"></a> <span class="n">g_signal_new</span> <span class="p">(</span><span class="s">&quot;changing&quot;</span><span class="p">,</span>
+<a name="line-276"></a> <span class="n">G_TYPE_FROM_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">),</span>
+<a name="line-277"></a> <span class="n">G_SIGNAL_RUN_LAST</span><span class="p">,</span>
+<a name="line-278"></a> <span class="n">G_STRUCT_OFFSET</span> <span class="p">(</span><span class="n">GvcComboBoxClass</span><span class="p">,</span> <span class="n">changing</span><span class="p">),</span>
+<a name="line-279"></a> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-280"></a> <span class="n">g_cclosure_marshal_VOID__OBJECT</span><span class="p">,</span>
+<a name="line-281"></a> <span class="n">G_TYPE_NONE</span><span class="p">,</span>
+<a name="line-282"></a> <span class="mi">1</span><span class="p">,</span>
+<a name="line-283"></a> <span class="n">MATE_MIXER_TYPE_SWITCH_OPTION</span><span class="p">);</span>
+<a name="line-284"></a>
+<a name="line-285"></a> <span class="n">signals</span><span class="p">[</span><span class="n">BUTTON_CLICKED</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-286"></a> <span class="n">g_signal_new</span> <span class="p">(</span><span class="s">&quot;button-clicked&quot;</span><span class="p">,</span>
+<a name="line-287"></a> <span class="n">G_TYPE_FROM_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">),</span>
+<a name="line-288"></a> <span class="n">G_SIGNAL_RUN_LAST</span><span class="p">,</span>
+<a name="line-289"></a> <span class="n">G_STRUCT_OFFSET</span> <span class="p">(</span><span class="n">GvcComboBoxClass</span><span class="p">,</span> <span class="n">button_clicked</span><span class="p">),</span>
+<a name="line-290"></a> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-291"></a> <span class="n">g_cclosure_marshal_VOID__VOID</span><span class="p">,</span>
+<a name="line-292"></a> <span class="n">G_TYPE_NONE</span><span class="p">,</span>
+<a name="line-293"></a> <span class="mi">0</span><span class="p">);</span>
+<a name="line-294"></a><span class="p">}</span>
+<a name="line-295"></a>
+<a name="line-296"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-297"></a><span class="n">on_combo_box_changed</span> <span class="p">(</span><span class="n">GtkComboBox</span> <span class="o">*</span><span class="n">widget</span><span class="p">,</span> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-298"></a><span class="p">{</span>
+<a name="line-299"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-300"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-301"></a> <span class="n">MateMixerSwitchOption</span> <span class="o">*</span><span class="n">option</span><span class="p">;</span>
+<a name="line-302"></a>
+<a name="line-303"></a> <span class="k">if</span> <span class="p">(</span><span class="n">G_UNLIKELY</span> <span class="p">(</span><span class="n">gtk_combo_box_get_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">widget</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">))</span>
+<a name="line-304"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-305"></a>
+<a name="line-306"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-307"></a> <span class="n">COL_NAME</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">name</span><span class="p">,</span>
+<a name="line-308"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-309"></a>
+<a name="line-310"></a> <span class="n">option</span> <span class="o">=</span> <span class="n">mate_mixer_switch_get_option</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">,</span> <span class="n">name</span><span class="p">);</span>
+<a name="line-311"></a> <span class="k">if</span> <span class="p">(</span><span class="n">G_UNLIKELY</span> <span class="p">(</span><span class="n">option</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-312"></a> <span class="n">g_warn_if_reached</span> <span class="p">();</span>
+<a name="line-313"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-314"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-315"></a> <span class="p">}</span>
+<a name="line-316"></a>
+<a name="line-317"></a> <span class="cm">/* Inform that we are about to change the active option of the switch */</span>
+<a name="line-318"></a> <span class="n">g_signal_emit</span> <span class="p">(</span><span class="n">combobox</span><span class="p">,</span> <span class="n">signals</span><span class="p">[</span><span class="n">CHANGING</span><span class="p">],</span> <span class="mi">0</span><span class="p">,</span> <span class="n">option</span><span class="p">);</span>
+<a name="line-319"></a>
+<a name="line-320"></a> <span class="n">mate_mixer_switch_set_active_option</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">,</span> <span class="n">option</span><span class="p">);</span>
+<a name="line-321"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-322"></a><span class="p">}</span>
+<a name="line-323"></a>
+<a name="line-324"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-325"></a><span class="n">on_combo_box_button_clicked</span> <span class="p">(</span><span class="n">GtkButton</span> <span class="o">*</span><span class="n">button</span><span class="p">,</span> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-326"></a><span class="p">{</span>
+<a name="line-327"></a> <span class="cm">/* The meaning of the button is defined by the owner, so only notify</span>
+<a name="line-328"></a><span class="cm"> * when it is clicked on */</span>
+<a name="line-329"></a> <span class="n">g_signal_emit</span> <span class="p">(</span><span class="n">combobox</span><span class="p">,</span> <span class="n">signals</span><span class="p">[</span><span class="n">BUTTON_CLICKED</span><span class="p">],</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-330"></a><span class="p">}</span>
+<a name="line-331"></a>
+<a name="line-332"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-333"></a><span class="n">gvc_combo_box_init</span> <span class="p">(</span><span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-334"></a><span class="p">{</span>
+<a name="line-335"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">frame</span><span class="p">;</span>
+<a name="line-336"></a> <span class="n">GtkCellRenderer</span> <span class="o">*</span><span class="n">renderer</span><span class="p">;</span>
+<a name="line-337"></a>
+<a name="line-338"></a> <span class="n">frame</span> <span class="o">=</span> <span class="n">gtk_frame_new</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
+<a name="line-339"></a> <span class="n">gtk_frame_set_shadow_type</span> <span class="p">(</span><span class="n">GTK_FRAME</span> <span class="p">(</span><span class="n">frame</span><span class="p">),</span> <span class="n">GTK_SHADOW_NONE</span><span class="p">);</span>
+<a name="line-340"></a>
+<a name="line-341"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span> <span class="o">=</span> <span class="n">gvc_combo_box_get_instance_private</span> <span class="p">(</span><span class="n">combobox</span><span class="p">);</span>
+<a name="line-342"></a>
+<a name="line-343"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span> <span class="o">=</span> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="n">NUM_COLS</span><span class="p">,</span>
+<a name="line-344"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-345"></a> <span class="n">G_TYPE_STRING</span><span class="p">));</span>
+<a name="line-346"></a>
+<a name="line-347"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span> <span class="o">=</span> <span class="n">gtk_combo_box_new_with_model</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">);</span>
+<a name="line-348"></a>
+<a name="line-349"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span> <span class="o">=</span> <span class="n">gtk_label_new</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
+<a name="line-350"></a>
+<a name="line-351"></a> <span class="n">gtk_label_set_xalign</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">),</span> <span class="mf">0.0</span><span class="p">);</span>
+<a name="line-352"></a> <span class="n">gtk_label_set_yalign</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">),</span> <span class="mf">0.5</span><span class="p">);</span>
+<a name="line-353"></a> <span class="n">gtk_label_set_mnemonic_widget</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">),</span>
+<a name="line-354"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">);</span>
+<a name="line-355"></a>
+<a name="line-356"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-357"></a> <span class="n">gtk_cell_layout_pack_start</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-358"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-359"></a> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-360"></a> <span class="n">gtk_cell_layout_add_attribute</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-361"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-362"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span>
+<a name="line-363"></a> <span class="n">COL_HUMAN_NAME</span><span class="p">);</span>
+<a name="line-364"></a>
+<a name="line-365"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-366"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">start_box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-367"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">end_box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-368"></a>
+<a name="line-369"></a> <span class="cm">/* Make sure the combo box does not get too long on long profile names */</span>
+<a name="line-370"></a> <span class="n">g_object_set</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">renderer</span><span class="p">),</span>
+<a name="line-371"></a> <span class="s">&quot;ellipsize&quot;</span><span class="p">,</span>
+<a name="line-372"></a> <span class="n">PANGO_ELLIPSIZE_END</span><span class="p">,</span>
+<a name="line-373"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-374"></a>
+<a name="line-375"></a> <span class="n">gtk_combo_box_set_popup_fixed_width</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-376"></a>
+<a name="line-377"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-378"></a> <span class="n">frame</span><span class="p">,</span>
+<a name="line-379"></a> <span class="n">TRUE</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-380"></a>
+<a name="line-381"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">),</span>
+<a name="line-382"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">start_box</span><span class="p">,</span>
+<a name="line-383"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-384"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">start_box</span><span class="p">),</span>
+<a name="line-385"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">,</span>
+<a name="line-386"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-387"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">),</span>
+<a name="line-388"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">,</span>
+<a name="line-389"></a> <span class="n">TRUE</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-390"></a>
+<a name="line-391"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span> <span class="o">=</span> <span class="n">gtk_button_new_with_label</span> <span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">);</span>
+<a name="line-392"></a>
+<a name="line-393"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">),</span>
+<a name="line-394"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">,</span>
+<a name="line-395"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-396"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">),</span>
+<a name="line-397"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">end_box</span><span class="p">,</span>
+<a name="line-398"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-399"></a>
+<a name="line-400"></a> <span class="n">gtk_container_add</span> <span class="p">(</span><span class="n">GTK_CONTAINER</span> <span class="p">(</span><span class="n">frame</span><span class="p">),</span> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">);</span>
+<a name="line-401"></a>
+<a name="line-402"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-403"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span>
+<a name="line-404"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_combo_box_changed</span><span class="p">),</span>
+<a name="line-405"></a> <span class="n">combobox</span><span class="p">);</span>
+<a name="line-406"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">),</span>
+<a name="line-407"></a> <span class="s">&quot;clicked&quot;</span><span class="p">,</span>
+<a name="line-408"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_combo_box_button_clicked</span><span class="p">),</span>
+<a name="line-409"></a> <span class="n">combobox</span><span class="p">);</span>
+<a name="line-410"></a>
+<a name="line-411"></a> <span class="n">gtk_widget_set_no_show_all</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-412"></a> <span class="n">gtk_widget_show_all</span> <span class="p">(</span><span class="n">frame</span><span class="p">);</span>
+<a name="line-413"></a><span class="p">}</span>
+<a name="line-414"></a>
+<a name="line-415"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-416"></a><span class="n">gvc_combo_box_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">)</span>
+<a name="line-417"></a><span class="p">{</span>
+<a name="line-418"></a> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">;</span>
+<a name="line-419"></a>
+<a name="line-420"></a> <span class="n">combobox</span> <span class="o">=</span> <span class="n">GVC_COMBO_BOX</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-421"></a>
+<a name="line-422"></a> <span class="k">if</span> <span class="p">(</span><span class="n">G_LIKELY</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-423"></a> <span class="n">g_signal_handlers_disconnect_by_func</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">),</span>
+<a name="line-424"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_switch_active_option_notify</span><span class="p">),</span>
+<a name="line-425"></a> <span class="n">combobox</span><span class="p">);</span>
+<a name="line-426"></a> <span class="n">g_clear_object</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-427"></a> <span class="p">}</span>
+<a name="line-428"></a>
+<a name="line-429"></a> <span class="n">g_clear_object</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">);</span>
+<a name="line-430"></a>
+<a name="line-431"></a> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">gvc_combo_box_parent_class</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-432"></a><span class="p">}</span>
+<a name="line-433"></a>
+<a name="line-434"></a><span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-435"></a><span class="n">gvc_combo_box_new</span> <span class="p">(</span><span class="n">MateMixerSwitch</span> <span class="o">*</span><span class="n">swtch</span><span class="p">,</span> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">label</span><span class="p">)</span>
+<a name="line-436"></a><span class="p">{</span>
+<a name="line-437"></a> <span class="k">return</span> <span class="n">g_object_new</span> <span class="p">(</span><span class="n">GVC_TYPE_COMBO_BOX</span><span class="p">,</span>
+<a name="line-438"></a> <span class="s">&quot;switch&quot;</span><span class="p">,</span> <span class="n">swtch</span><span class="p">,</span>
+<a name="line-439"></a> <span class="s">&quot;label&quot;</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span>
+<a name="line-440"></a> <span class="s">&quot;orientation&quot;</span><span class="p">,</span> <span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span>
+<a name="line-441"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-442"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck 1.90 - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/[email protected]_master/1.html b/[email protected]_master/1.html
new file mode 100644
index 0000000..67179f2
--- /dev/null
+++ b/[email protected]_master/1.html
@@ -0,0 +1,2368 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-media</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ function toggle_all(){
+ var elts = document.getElementsByTagName("input");
+ for (var i = 1; i < elts.length; i++) {
+ var el = elts[i];
+ el.checked ? el.checked=false : el.checked=true;
+ toggle_class_visibility(el.id);
+ }
+ }
+
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - mate-media: mate-volume-control/gvc-sound-theme-chooser.c </h1>
+ </div>
+ <div id="menu" dir="rtl">
+ <p id="filename"><a href="index.html">Defects:</a> gvc-sound-theme-chooser.c</p>
+<a href='1.html#line-735'> ConfigurationNotChecked 735</a><a href='1.html#line-746'> ConfigurationNotChecked 746</a><a href='1.html#line-758'> ConfigurationNotChecked 758</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 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
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span>
+<a name="line-2"></a><span class="cm"> *</span>
+<a name="line-3"></a><span class="cm"> * Copyright (C) 2008 Bastien Nocera &lt;[email protected]&gt;</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2008 William Jon McCann</span>
+<a name="line-5"></a><span class="cm"> *</span>
+<a name="line-6"></a><span class="cm"> * This program is free software; you can redistribute it and/or modify</span>
+<a name="line-7"></a><span class="cm"> * it under the terms of the GNU General Public License as published by</span>
+<a name="line-8"></a><span class="cm"> * the Free Software Foundation; either version 2 of the License, or</span>
+<a name="line-9"></a><span class="cm"> * (at your option) any later version.</span>
+<a name="line-10"></a><span class="cm"> *</span>
+<a name="line-11"></a><span class="cm"> * This program is distributed in the hope that it will be useful,</span>
+<a name="line-12"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-13"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
+<a name="line-14"></a><span class="cm"> * GNU General Public License for more details.</span>
+<a name="line-15"></a><span class="cm"> *</span>
+<a name="line-16"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-17"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-18"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-19"></a><span class="cm"> *</span>
+<a name="line-20"></a><span class="cm"> */</span>
+<a name="line-21"></a>
+<a name="line-22"></a><span class="cp">#include</span> <span class="cpf">&quot;config.h&quot;</span><span class="cp"></span>
+<a name="line-23"></a>
+<a name="line-24"></a><span class="cp">#include</span> <span class="cpf">&lt;stdlib.h&gt;</span><span class="cp"></span>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp"></span>
+<a name="line-26"></a><span class="cp">#include</span> <span class="cpf">&lt;unistd.h&gt;</span><span class="cp"></span>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;utime.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a><span class="cp">#include</span> <span class="cpf">&lt;errno.h&gt;</span><span class="cp"></span>
+<a name="line-29"></a>
+<a name="line-30"></a><span class="cp">#include</span> <span class="cpf">&lt;glib.h&gt;</span><span class="cp"></span>
+<a name="line-31"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-32"></a><span class="cp">#include</span> <span class="cpf">&lt;glib-object.h&gt;</span><span class="cp"></span>
+<a name="line-33"></a><span class="cp">#include</span> <span class="cpf">&lt;gio/gio.h&gt;</span><span class="cp"></span>
+<a name="line-34"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-35"></a><span class="cp">#include</span> <span class="cpf">&lt;canberra-gtk.h&gt;</span><span class="cp"></span>
+<a name="line-36"></a><span class="cp">#include</span> <span class="cpf">&lt;libxml/tree.h&gt;</span><span class="cp"></span>
+<a name="line-37"></a>
+<a name="line-38"></a><span class="cp">#include</span> <span class="cpf">&quot;gvc-sound-theme-chooser.h&quot;</span><span class="cp"></span>
+<a name="line-39"></a><span class="cp">#include</span> <span class="cpf">&quot;sound-theme-file-utils.h&quot;</span><span class="cp"></span>
+<a name="line-40"></a>
+<a name="line-41"></a><span class="k">struct</span> <span class="n">GvcSoundThemeChooserPrivate</span>
+<a name="line-42"></a><span class="p">{</span>
+<a name="line-43"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">combo_box</span><span class="p">;</span>
+<a name="line-44"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">treeview</span><span class="p">;</span>
+<a name="line-45"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">theme_box</span><span class="p">;</span>
+<a name="line-46"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">selection_box</span><span class="p">;</span>
+<a name="line-47"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">click_feedback_button</span><span class="p">;</span>
+<a name="line-48"></a> <span class="n">GSettings</span> <span class="o">*</span><span class="n">sound_settings</span><span class="p">;</span>
+<a name="line-49"></a><span class="p">};</span>
+<a name="line-50"></a>
+<a name="line-51"></a><span class="k">static</span> <span class="kt">void</span> <span class="nf">gvc_sound_theme_chooser_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">);</span>
+<a name="line-52"></a>
+<a name="line-53"></a><span class="n">G_DEFINE_TYPE_WITH_PRIVATE</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span><span class="p">,</span> <span class="n">gvc_sound_theme_chooser</span><span class="p">,</span> <span class="n">GTK_TYPE_BOX</span><span class="p">)</span>
+<a name="line-54"></a>
+<a name="line-55"></a><span class="cp">#define KEY_SOUNDS_SCHEMA &quot;org.mate.sound&quot;</span>
+<a name="line-56"></a><span class="cp">#define EVENT_SOUNDS_KEY &quot;event-sounds&quot;</span>
+<a name="line-57"></a><span class="cp">#define INPUT_SOUNDS_KEY &quot;input-feedback-sounds&quot;</span>
+<a name="line-58"></a><span class="cp">#define SOUND_THEME_KEY &quot;theme-name&quot;</span>
+<a name="line-59"></a>
+<a name="line-60"></a><span class="cp">#define DEFAULT_ALERT_ID &quot;__default&quot;</span>
+<a name="line-61"></a><span class="cp">#define CUSTOM_THEME_NAME &quot;__custom&quot;</span>
+<a name="line-62"></a><span class="cp">#define NO_SOUNDS_THEME_NAME &quot;__no_sounds&quot;</span>
+<a name="line-63"></a>
+<a name="line-64"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-65"></a> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span>
+<a name="line-66"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span>
+<a name="line-67"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span>
+<a name="line-68"></a> <span class="n">THEME_NUM_COLS</span>
+<a name="line-69"></a><span class="p">};</span>
+<a name="line-70"></a>
+<a name="line-71"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-72"></a> <span class="n">ALERT_DISPLAY_COL</span><span class="p">,</span>
+<a name="line-73"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span>
+<a name="line-74"></a> <span class="n">ALERT_SOUND_TYPE_COL</span><span class="p">,</span>
+<a name="line-75"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span>
+<a name="line-76"></a> <span class="n">ALERT_NUM_COLS</span>
+<a name="line-77"></a><span class="p">};</span>
+<a name="line-78"></a>
+<a name="line-79"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-80"></a> <span class="n">SOUND_TYPE_UNSET</span><span class="p">,</span>
+<a name="line-81"></a> <span class="n">SOUND_TYPE_OFF</span><span class="p">,</span>
+<a name="line-82"></a> <span class="n">SOUND_TYPE_DEFAULT_FROM_THEME</span><span class="p">,</span>
+<a name="line-83"></a> <span class="n">SOUND_TYPE_BUILTIN</span><span class="p">,</span>
+<a name="line-84"></a> <span class="n">SOUND_TYPE_CUSTOM</span>
+<a name="line-85"></a><span class="p">};</span>
+<a name="line-86"></a>
+<a name="line-87"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-88"></a><span class="nf">on_combobox_changed</span> <span class="p">(</span><span class="n">GtkComboBox</span> <span class="o">*</span><span class="n">widget</span><span class="p">,</span>
+<a name="line-89"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-90"></a><span class="p">{</span>
+<a name="line-91"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-92"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-93"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">theme_name</span><span class="p">;</span>
+<a name="line-94"></a>
+<a name="line-95"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_combo_box_get_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-96"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-97"></a> <span class="p">}</span>
+<a name="line-98"></a>
+<a name="line-99"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">));</span>
+<a name="line-100"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">theme_name</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-101"></a>
+<a name="line-102"></a> <span class="n">g_assert</span> <span class="p">(</span><span class="n">theme_name</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-103"></a>
+<a name="line-104"></a> <span class="cm">/* It is necessary to update the theme name before any other setting as</span>
+<a name="line-105"></a><span class="cm"> * the &quot;changed&quot; notification will reload the contents of the widget */</span>
+<a name="line-106"></a> <span class="n">g_settings_set_string</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">SOUND_THEME_KEY</span><span class="p">,</span> <span class="n">theme_name</span><span class="p">);</span>
+<a name="line-107"></a>
+<a name="line-108"></a> <span class="cm">/* special case for no sounds */</span>
+<a name="line-109"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">theme_name</span><span class="p">,</span> <span class="n">NO_SOUNDS_THEME_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-110"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">EVENT_SOUNDS_KEY</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-111"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-112"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-113"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">EVENT_SOUNDS_KEY</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-114"></a> <span class="p">}</span>
+<a name="line-115"></a>
+<a name="line-116"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">theme_name</span><span class="p">);</span>
+<a name="line-117"></a>
+<a name="line-118"></a> <span class="cm">/* FIXME: reset alert model */</span>
+<a name="line-119"></a><span class="p">}</span>
+<a name="line-120"></a>
+<a name="line-121"></a><span class="k">static</span> <span class="kt">char</span> <span class="o">*</span>
+<a name="line-122"></a><span class="nf">load_index_theme_name</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">index</span><span class="p">,</span>
+<a name="line-123"></a> <span class="kt">char</span> <span class="o">**</span><span class="n">parent</span><span class="p">)</span>
+<a name="line-124"></a><span class="p">{</span>
+<a name="line-125"></a> <span class="n">GKeyFile</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+<a name="line-126"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">indexname</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-127"></a> <span class="n">gboolean</span> <span class="n">hidden</span><span class="p">;</span>
+<a name="line-128"></a>
+<a name="line-129"></a> <span class="n">file</span> <span class="o">=</span> <span class="n">g_key_file_new</span> <span class="p">();</span>
+<a name="line-130"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_key_file_load_from_file</span> <span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">G_KEY_FILE_KEEP_TRANSLATIONS</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-131"></a> <span class="n">g_key_file_free</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-132"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-133"></a> <span class="p">}</span>
+<a name="line-134"></a> <span class="cm">/* Don&#39;t add hidden themes to the list */</span>
+<a name="line-135"></a> <span class="n">hidden</span> <span class="o">=</span> <span class="n">g_key_file_get_boolean</span> <span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="s">&quot;Sound Theme&quot;</span><span class="p">,</span> <span class="s">&quot;Hidden&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-136"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">hidden</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-137"></a> <span class="n">indexname</span> <span class="o">=</span> <span class="n">g_key_file_get_locale_string</span> <span class="p">(</span><span class="n">file</span><span class="p">,</span>
+<a name="line-138"></a> <span class="s">&quot;Sound Theme&quot;</span><span class="p">,</span>
+<a name="line-139"></a> <span class="s">&quot;Name&quot;</span><span class="p">,</span>
+<a name="line-140"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-141"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-142"></a>
+<a name="line-143"></a> <span class="cm">/* Save the parent theme, if there&#39;s one */</span>
+<a name="line-144"></a> <span class="k">if</span> <span class="p">(</span><span class="n">parent</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-145"></a> <span class="o">*</span><span class="n">parent</span> <span class="o">=</span> <span class="n">g_key_file_get_string</span> <span class="p">(</span><span class="n">file</span><span class="p">,</span>
+<a name="line-146"></a> <span class="s">&quot;Sound Theme&quot;</span><span class="p">,</span>
+<a name="line-147"></a> <span class="s">&quot;Inherits&quot;</span><span class="p">,</span>
+<a name="line-148"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-149"></a> <span class="p">}</span>
+<a name="line-150"></a> <span class="p">}</span>
+<a name="line-151"></a>
+<a name="line-152"></a> <span class="n">g_key_file_free</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-153"></a> <span class="k">return</span> <span class="n">indexname</span><span class="p">;</span>
+<a name="line-154"></a><span class="p">}</span>
+<a name="line-155"></a>
+<a name="line-156"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-157"></a><span class="nf">sound_theme_in_dir</span> <span class="p">(</span><span class="n">GHashTable</span> <span class="o">*</span><span class="n">hash</span><span class="p">,</span>
+<a name="line-158"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">dir</span><span class="p">)</span>
+<a name="line-159"></a><span class="p">{</span>
+<a name="line-160"></a> <span class="n">GDir</span> <span class="o">*</span><span class="n">d</span><span class="p">;</span>
+<a name="line-161"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-162"></a>
+<a name="line-163"></a> <span class="n">d</span> <span class="o">=</span> <span class="n">g_dir_open</span> <span class="p">(</span><span class="n">dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-164"></a> <span class="k">if</span> <span class="p">(</span><span class="n">d</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-165"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-166"></a> <span class="p">}</span>
+<a name="line-167"></a>
+<a name="line-168"></a> <span class="k">while</span> <span class="p">((</span><span class="n">name</span> <span class="o">=</span> <span class="n">g_dir_read_name</span> <span class="p">(</span><span class="n">d</span><span class="p">))</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-169"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">dirname</span><span class="p">,</span> <span class="o">*</span><span class="n">index</span><span class="p">,</span> <span class="o">*</span><span class="n">indexname</span><span class="p">;</span>
+<a name="line-170"></a>
+<a name="line-171"></a> <span class="cm">/* Look for directories */</span>
+<a name="line-172"></a> <span class="n">dirname</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">dir</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-173"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="n">G_FILE_TEST_IS_DIR</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-174"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dirname</span><span class="p">);</span>
+<a name="line-175"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-176"></a> <span class="p">}</span>
+<a name="line-177"></a>
+<a name="line-178"></a> <span class="cm">/* Look for index files */</span>
+<a name="line-179"></a> <span class="n">index</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="s">&quot;index.theme&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-180"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dirname</span><span class="p">);</span>
+<a name="line-181"></a>
+<a name="line-182"></a> <span class="cm">/* Check the name of the theme in the index.theme file */</span>
+<a name="line-183"></a> <span class="n">indexname</span> <span class="o">=</span> <span class="n">load_index_theme_name</span> <span class="p">(</span><span class="n">index</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-184"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">index</span><span class="p">);</span>
+<a name="line-185"></a> <span class="k">if</span> <span class="p">(</span><span class="n">indexname</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-186"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-187"></a> <span class="p">}</span>
+<a name="line-188"></a>
+<a name="line-189"></a> <span class="n">g_hash_table_insert</span> <span class="p">(</span><span class="n">hash</span><span class="p">,</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">indexname</span><span class="p">);</span>
+<a name="line-190"></a> <span class="p">}</span>
+<a name="line-191"></a>
+<a name="line-192"></a> <span class="n">g_dir_close</span> <span class="p">(</span><span class="n">d</span><span class="p">);</span>
+<a name="line-193"></a><span class="p">}</span>
+<a name="line-194"></a>
+<a name="line-195"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-196"></a><span class="nf">add_theme_to_store</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span>
+<a name="line-197"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span>
+<a name="line-198"></a> <span class="n">GtkListStore</span> <span class="o">*</span><span class="n">store</span><span class="p">)</span>
+<a name="line-199"></a><span class="p">{</span>
+<a name="line-200"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">parent</span><span class="p">;</span>
+<a name="line-201"></a>
+<a name="line-202"></a> <span class="n">parent</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-203"></a>
+<a name="line-204"></a> <span class="cm">/* Get the parent, if we&#39;re checking the custom theme */</span>
+<a name="line-205"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-206"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">,</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-207"></a>
+<a name="line-208"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">custom_theme_dir_path</span> <span class="p">(</span><span class="s">&quot;index.theme&quot;</span><span class="p">);</span>
+<a name="line-209"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">load_index_theme_name</span> <span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-210"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-211"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
+<a name="line-212"></a> <span class="p">}</span>
+<a name="line-213"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-214"></a> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span>
+<a name="line-215"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span>
+<a name="line-216"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span>
+<a name="line-217"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-218"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-219"></a><span class="p">}</span>
+<a name="line-220"></a>
+<a name="line-221"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-222"></a><span class="nf">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-223"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">)</span>
+<a name="line-224"></a><span class="p">{</span>
+<a name="line-225"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-226"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-227"></a> <span class="n">gboolean</span> <span class="n">found</span><span class="p">;</span>
+<a name="line-228"></a>
+<a name="line-229"></a> <span class="cm">/* If the name is empty, use &quot;freedesktop&quot; */</span>
+<a name="line-230"></a> <span class="k">if</span> <span class="p">(</span><span class="n">name</span> <span class="o">==</span> <span class="nb">NULL</span> <span class="o">||</span> <span class="o">*</span><span class="n">name</span> <span class="o">==</span> <span class="sc">&#39;\0&#39;</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-231"></a> <span class="n">name</span> <span class="o">=</span> <span class="s">&quot;freedesktop&quot;</span><span class="p">;</span>
+<a name="line-232"></a> <span class="p">}</span>
+<a name="line-233"></a>
+<a name="line-234"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">));</span>
+<a name="line-235"></a>
+<a name="line-236"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_tree_model_get_iter_first</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-237"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-238"></a> <span class="p">}</span>
+<a name="line-239"></a>
+<a name="line-240"></a> <span class="k">do</span> <span class="p">{</span>
+<a name="line-241"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">value</span><span class="p">;</span>
+<a name="line-242"></a>
+<a name="line-243"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">value</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-244"></a> <span class="n">found</span> <span class="o">=</span> <span class="p">(</span><span class="n">value</span> <span class="o">!=</span> <span class="nb">NULL</span> <span class="o">&amp;&amp;</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-245"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">value</span><span class="p">);</span>
+<a name="line-246"></a>
+<a name="line-247"></a> <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">found</span> <span class="o">&amp;&amp;</span> <span class="n">gtk_tree_model_iter_next</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">));</span>
+<a name="line-248"></a>
+<a name="line-249"></a> <span class="cm">/* When we can&#39;t find the theme we need to set, try to set the default</span>
+<a name="line-250"></a><span class="cm"> * one &quot;freedesktop&quot; */</span>
+<a name="line-251"></a> <span class="k">if</span> <span class="p">(</span><span class="n">found</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-252"></a> <span class="n">gtk_combo_box_set_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-253"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="s">&quot;freedesktop&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-254"></a> <span class="n">g_debug</span> <span class="p">(</span><span class="s">&quot;not found, falling back to fdo&quot;</span><span class="p">);</span>
+<a name="line-255"></a> <span class="n">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="s">&quot;freedesktop&quot;</span><span class="p">);</span>
+<a name="line-256"></a> <span class="p">}</span>
+<a name="line-257"></a><span class="p">}</span>
+<a name="line-258"></a>
+<a name="line-259"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-260"></a><span class="nf">set_input_feedback_enabled</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-261"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">)</span>
+<a name="line-262"></a><span class="p">{</span>
+<a name="line-263"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">),</span>
+<a name="line-264"></a> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-265"></a><span class="p">}</span>
+<a name="line-266"></a>
+<a name="line-267"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-268"></a><span class="nf">setup_theme_selector</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-269"></a><span class="p">{</span>
+<a name="line-270"></a> <span class="n">GHashTable</span> <span class="o">*</span><span class="n">hash</span><span class="p">;</span>
+<a name="line-271"></a> <span class="n">GtkListStore</span> <span class="o">*</span><span class="n">store</span><span class="p">;</span>
+<a name="line-272"></a> <span class="n">GtkCellRenderer</span> <span class="o">*</span><span class="n">renderer</span><span class="p">;</span>
+<a name="line-273"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="k">const</span> <span class="o">*</span><span class="n">data_dirs</span><span class="p">;</span>
+<a name="line-274"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">data_dir</span><span class="p">;</span>
+<a name="line-275"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">dir</span><span class="p">;</span>
+<a name="line-276"></a> <span class="n">guint</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-277"></a>
+<a name="line-278"></a> <span class="cm">/* Add the theme names and their display name to a hash table,</span>
+<a name="line-279"></a><span class="cm"> * makes it easy to avoid duplicate themes */</span>
+<a name="line-280"></a> <span class="n">hash</span> <span class="o">=</span> <span class="n">g_hash_table_new_full</span> <span class="p">(</span><span class="n">g_str_hash</span><span class="p">,</span> <span class="n">g_str_equal</span><span class="p">,</span> <span class="n">g_free</span><span class="p">,</span> <span class="n">g_free</span><span class="p">);</span>
+<a name="line-281"></a>
+<a name="line-282"></a> <span class="n">data_dirs</span> <span class="o">=</span> <span class="n">g_get_system_data_dirs</span> <span class="p">();</span>
+<a name="line-283"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">data_dirs</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-284"></a> <span class="n">dir</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">data_dirs</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="s">&quot;sounds&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-285"></a> <span class="n">sound_theme_in_dir</span> <span class="p">(</span><span class="n">hash</span><span class="p">,</span> <span class="n">dir</span><span class="p">);</span>
+<a name="line-286"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dir</span><span class="p">);</span>
+<a name="line-287"></a> <span class="p">}</span>
+<a name="line-288"></a>
+<a name="line-289"></a> <span class="n">data_dir</span> <span class="o">=</span> <span class="n">g_get_user_data_dir</span> <span class="p">();</span>
+<a name="line-290"></a> <span class="n">dir</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">data_dir</span><span class="p">,</span> <span class="s">&quot;sounds&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-291"></a> <span class="n">sound_theme_in_dir</span> <span class="p">(</span><span class="n">hash</span><span class="p">,</span> <span class="n">dir</span><span class="p">);</span>
+<a name="line-292"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dir</span><span class="p">);</span>
+<a name="line-293"></a>
+<a name="line-294"></a> <span class="cm">/* If there isn&#39;t at least one theme, make everything</span>
+<a name="line-295"></a><span class="cm"> * insensitive, LAME! */</span>
+<a name="line-296"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_hash_table_size</span> <span class="p">(</span><span class="n">hash</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-297"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-298"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Bad setup, install the freedesktop sound theme&quot;</span><span class="p">);</span>
+<a name="line-299"></a> <span class="n">g_hash_table_destroy</span> <span class="p">(</span><span class="n">hash</span><span class="p">);</span>
+<a name="line-300"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-301"></a> <span class="p">}</span>
+<a name="line-302"></a>
+<a name="line-303"></a> <span class="cm">/* Setup the tree model, 3 columns:</span>
+<a name="line-304"></a><span class="cm"> * - internal theme name/directory</span>
+<a name="line-305"></a><span class="cm"> * - display theme name</span>
+<a name="line-306"></a><span class="cm"> * - the internal id for the parent theme, used for the custom theme */</span>
+<a name="line-307"></a> <span class="n">store</span> <span class="o">=</span> <span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="n">THEME_NUM_COLS</span><span class="p">,</span>
+<a name="line-308"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-309"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-310"></a> <span class="n">G_TYPE_STRING</span><span class="p">);</span>
+<a name="line-311"></a>
+<a name="line-312"></a> <span class="cm">/* Add the themes to a combobox */</span>
+<a name="line-313"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span>
+<a name="line-314"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-315"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-316"></a> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;No sounds&quot;</span><span class="p">),</span>
+<a name="line-317"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="s">&quot;__no_sounds&quot;</span><span class="p">,</span>
+<a name="line-318"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-319"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-320"></a> <span class="n">g_hash_table_foreach</span> <span class="p">(</span><span class="n">hash</span><span class="p">,</span> <span class="p">(</span><span class="n">GHFunc</span><span class="p">)</span> <span class="n">add_theme_to_store</span><span class="p">,</span> <span class="n">store</span><span class="p">);</span>
+<a name="line-321"></a> <span class="n">g_hash_table_destroy</span> <span class="p">(</span><span class="n">hash</span><span class="p">);</span>
+<a name="line-322"></a>
+<a name="line-323"></a> <span class="cm">/* Set the display */</span>
+<a name="line-324"></a> <span class="n">gtk_combo_box_set_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span>
+<a name="line-325"></a> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">store</span><span class="p">));</span>
+<a name="line-326"></a>
+<a name="line-327"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-328"></a> <span class="n">gtk_cell_layout_pack_start</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span>
+<a name="line-329"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-330"></a> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-331"></a> <span class="n">gtk_cell_layout_set_attributes</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span>
+<a name="line-332"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-333"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span>
+<a name="line-334"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-335"></a>
+<a name="line-336"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span>
+<a name="line-337"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span>
+<a name="line-338"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_combobox_changed</span><span class="p">),</span>
+<a name="line-339"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-340"></a><span class="p">}</span>
+<a name="line-341"></a>
+<a name="line-342"></a><span class="cp">#define GVC_SOUND_SOUND (xmlChar *) &quot;sound&quot;</span>
+<a name="line-343"></a><span class="cp">#define GVC_SOUND_NAME (xmlChar *) &quot;name&quot;</span>
+<a name="line-344"></a><span class="cp">#define GVC_SOUND_FILENAME (xmlChar *) &quot;filename&quot;</span>
+<a name="line-345"></a>
+<a name="line-346"></a><span class="cm">/* Adapted from yelp-toc-pager.c */</span>
+<a name="line-347"></a><span class="k">static</span> <span class="n">xmlChar</span> <span class="o">*</span>
+<a name="line-348"></a><span class="nf">xml_get_and_trim_names</span> <span class="p">(</span><span class="n">xmlNodePtr</span> <span class="n">node</span><span class="p">)</span>
+<a name="line-349"></a><span class="p">{</span>
+<a name="line-350"></a> <span class="n">xmlNodePtr</span> <span class="n">cur</span><span class="p">;</span>
+<a name="line-351"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">keep_lang</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-352"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">value</span><span class="p">;</span>
+<a name="line-353"></a> <span class="kt">int</span> <span class="n">j</span><span class="p">,</span> <span class="n">keep_pri</span> <span class="o">=</span> <span class="n">INT_MAX</span><span class="p">;</span>
+<a name="line-354"></a>
+<a name="line-355"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span> <span class="k">const</span> <span class="o">*</span> <span class="n">langs</span> <span class="o">=</span> <span class="n">g_get_language_names</span> <span class="p">();</span>
+<a name="line-356"></a>
+<a name="line-357"></a> <span class="n">value</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-358"></a>
+<a name="line-359"></a> <span class="k">for</span> <span class="p">(</span><span class="n">cur</span> <span class="o">=</span> <span class="n">node</span><span class="o">-&gt;</span><span class="n">children</span><span class="p">;</span> <span class="n">cur</span><span class="p">;</span> <span class="n">cur</span> <span class="o">=</span> <span class="n">cur</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-360"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">cur</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_NAME</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-361"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">cur_lang</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-362"></a> <span class="kt">int</span> <span class="n">cur_pri</span> <span class="o">=</span> <span class="n">INT_MAX</span><span class="p">;</span>
+<a name="line-363"></a>
+<a name="line-364"></a> <span class="n">cur_lang</span> <span class="o">=</span> <span class="n">xmlNodeGetLang</span> <span class="p">(</span><span class="n">cur</span><span class="p">);</span>
+<a name="line-365"></a>
+<a name="line-366"></a> <span class="k">if</span> <span class="p">(</span><span class="n">cur_lang</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-367"></a> <span class="k">for</span> <span class="p">(</span><span class="n">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">langs</span><span class="p">[</span><span class="n">j</span><span class="p">];</span> <span class="n">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-368"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_str_equal</span> <span class="p">(</span><span class="n">cur_lang</span><span class="p">,</span> <span class="n">langs</span><span class="p">[</span><span class="n">j</span><span class="p">]))</span> <span class="p">{</span>
+<a name="line-369"></a> <span class="n">cur_pri</span> <span class="o">=</span> <span class="n">j</span><span class="p">;</span>
+<a name="line-370"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-371"></a> <span class="p">}</span>
+<a name="line-372"></a> <span class="p">}</span>
+<a name="line-373"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-374"></a> <span class="n">cur_pri</span> <span class="o">=</span> <span class="n">INT_MAX</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-375"></a> <span class="p">}</span>
+<a name="line-376"></a>
+<a name="line-377"></a> <span class="k">if</span> <span class="p">(</span><span class="n">cur_pri</span> <span class="o">&lt;=</span> <span class="n">keep_pri</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-378"></a> <span class="k">if</span> <span class="p">(</span><span class="n">keep_lang</span><span class="p">)</span>
+<a name="line-379"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">keep_lang</span><span class="p">);</span>
+<a name="line-380"></a> <span class="k">if</span> <span class="p">(</span><span class="n">value</span><span class="p">)</span>
+<a name="line-381"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">value</span><span class="p">);</span>
+<a name="line-382"></a>
+<a name="line-383"></a> <span class="n">value</span> <span class="o">=</span> <span class="n">xmlNodeGetContent</span> <span class="p">(</span><span class="n">cur</span><span class="p">);</span>
+<a name="line-384"></a>
+<a name="line-385"></a> <span class="n">keep_lang</span> <span class="o">=</span> <span class="n">cur_lang</span><span class="p">;</span>
+<a name="line-386"></a> <span class="n">keep_pri</span> <span class="o">=</span> <span class="n">cur_pri</span><span class="p">;</span>
+<a name="line-387"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-388"></a> <span class="k">if</span> <span class="p">(</span><span class="n">cur_lang</span><span class="p">)</span>
+<a name="line-389"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">cur_lang</span><span class="p">);</span>
+<a name="line-390"></a> <span class="p">}</span>
+<a name="line-391"></a> <span class="p">}</span>
+<a name="line-392"></a> <span class="p">}</span>
+<a name="line-393"></a>
+<a name="line-394"></a> <span class="cm">/* Delete all GVC_SOUND_NAME nodes */</span>
+<a name="line-395"></a> <span class="n">cur</span> <span class="o">=</span> <span class="n">node</span><span class="o">-&gt;</span><span class="n">children</span><span class="p">;</span>
+<a name="line-396"></a> <span class="k">while</span> <span class="p">(</span><span class="n">cur</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-397"></a> <span class="n">xmlNodePtr</span> <span class="n">this</span> <span class="o">=</span> <span class="n">cur</span><span class="p">;</span>
+<a name="line-398"></a> <span class="n">cur</span> <span class="o">=</span> <span class="n">cur</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
+<a name="line-399"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">this</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_NAME</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-400"></a> <span class="n">xmlUnlinkNode</span> <span class="p">(</span><span class="n">this</span><span class="p">);</span>
+<a name="line-401"></a> <span class="n">xmlFreeNode</span> <span class="p">(</span><span class="n">this</span><span class="p">);</span>
+<a name="line-402"></a> <span class="p">}</span>
+<a name="line-403"></a> <span class="p">}</span>
+<a name="line-404"></a>
+<a name="line-405"></a> <span class="k">return</span> <span class="n">value</span><span class="p">;</span>
+<a name="line-406"></a><span class="p">}</span>
+<a name="line-407"></a>
+<a name="line-408"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-409"></a><span class="nf">populate_model_from_node</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-410"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">,</span>
+<a name="line-411"></a> <span class="n">xmlNodePtr</span> <span class="n">node</span><span class="p">)</span>
+<a name="line-412"></a><span class="p">{</span>
+<a name="line-413"></a> <span class="n">xmlNodePtr</span> <span class="n">child</span><span class="p">;</span>
+<a name="line-414"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">filename</span><span class="p">;</span>
+<a name="line-415"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-416"></a>
+<a name="line-417"></a> <span class="n">filename</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-418"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">xml_get_and_trim_names</span> <span class="p">(</span><span class="n">node</span><span class="p">);</span>
+<a name="line-419"></a> <span class="k">for</span> <span class="p">(</span><span class="n">child</span> <span class="o">=</span> <span class="n">node</span><span class="o">-&gt;</span><span class="n">children</span><span class="p">;</span> <span class="n">child</span><span class="p">;</span> <span class="n">child</span> <span class="o">=</span> <span class="n">child</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-420"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xmlNodeIsText</span> <span class="p">(</span><span class="n">child</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-421"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-422"></a> <span class="p">}</span>
+<a name="line-423"></a>
+<a name="line-424"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">child</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_FILENAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-425"></a> <span class="n">filename</span> <span class="o">=</span> <span class="n">xmlNodeGetContent</span> <span class="p">(</span><span class="n">child</span><span class="p">);</span>
+<a name="line-426"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">child</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-427"></a> <span class="cm">/* EH? should have been trimmed */</span>
+<a name="line-428"></a> <span class="p">}</span>
+<a name="line-429"></a> <span class="p">}</span>
+<a name="line-430"></a>
+<a name="line-431"></a> <span class="k">if</span> <span class="p">(</span><span class="n">filename</span> <span class="o">!=</span> <span class="nb">NULL</span> <span class="o">&amp;&amp;</span> <span class="n">name</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-432"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">model</span><span class="p">),</span>
+<a name="line-433"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-434"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-435"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span>
+<a name="line-436"></a> <span class="n">ALERT_DISPLAY_COL</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span>
+<a name="line-437"></a> <span class="n">ALERT_SOUND_TYPE_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Built-in&quot;</span><span class="p">),</span>
+<a name="line-438"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span>
+<a name="line-439"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-440"></a> <span class="p">}</span>
+<a name="line-441"></a>
+<a name="line-442"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-443"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-444"></a><span class="p">}</span>
+<a name="line-445"></a>
+<a name="line-446"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-447"></a><span class="nf">populate_model_from_file</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-448"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">,</span>
+<a name="line-449"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">filename</span><span class="p">)</span>
+<a name="line-450"></a><span class="p">{</span>
+<a name="line-451"></a> <span class="n">xmlDocPtr</span> <span class="n">doc</span><span class="p">;</span>
+<a name="line-452"></a> <span class="n">xmlNodePtr</span> <span class="n">root</span><span class="p">;</span>
+<a name="line-453"></a> <span class="n">xmlNodePtr</span> <span class="n">child</span><span class="p">;</span>
+<a name="line-454"></a> <span class="n">gboolean</span> <span class="n">exists</span><span class="p">;</span>
+<a name="line-455"></a>
+<a name="line-456"></a> <span class="n">exists</span> <span class="o">=</span> <span class="n">g_file_test</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">G_FILE_TEST_EXISTS</span><span class="p">);</span>
+<a name="line-457"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">exists</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-458"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-459"></a> <span class="p">}</span>
+<a name="line-460"></a>
+<a name="line-461"></a> <span class="n">doc</span> <span class="o">=</span> <span class="n">xmlParseFile</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-462"></a> <span class="k">if</span> <span class="p">(</span><span class="n">doc</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-463"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-464"></a> <span class="p">}</span>
+<a name="line-465"></a>
+<a name="line-466"></a> <span class="n">root</span> <span class="o">=</span> <span class="n">xmlDocGetRootElement</span> <span class="p">(</span><span class="n">doc</span><span class="p">);</span>
+<a name="line-467"></a>
+<a name="line-468"></a> <span class="k">for</span> <span class="p">(</span><span class="n">child</span> <span class="o">=</span> <span class="n">root</span><span class="o">-&gt;</span><span class="n">children</span><span class="p">;</span> <span class="n">child</span><span class="p">;</span> <span class="n">child</span> <span class="o">=</span> <span class="n">child</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-469"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xmlNodeIsText</span> <span class="p">(</span><span class="n">child</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-470"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-471"></a> <span class="p">}</span>
+<a name="line-472"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">child</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_SOUND</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-473"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-474"></a> <span class="p">}</span>
+<a name="line-475"></a>
+<a name="line-476"></a> <span class="n">populate_model_from_node</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">model</span><span class="p">,</span> <span class="n">child</span><span class="p">);</span>
+<a name="line-477"></a> <span class="p">}</span>
+<a name="line-478"></a>
+<a name="line-479"></a> <span class="n">xmlFreeDoc</span> <span class="p">(</span><span class="n">doc</span><span class="p">);</span>
+<a name="line-480"></a><span class="p">}</span>
+<a name="line-481"></a>
+<a name="line-482"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-483"></a><span class="nf">populate_model_from_dir</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-484"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">,</span>
+<a name="line-485"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">dirname</span><span class="p">)</span>
+<a name="line-486"></a><span class="p">{</span>
+<a name="line-487"></a> <span class="n">GDir</span> <span class="o">*</span><span class="n">d</span><span class="p">;</span>
+<a name="line-488"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-489"></a>
+<a name="line-490"></a> <span class="n">d</span> <span class="o">=</span> <span class="n">g_dir_open</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-491"></a> <span class="k">if</span> <span class="p">(</span><span class="n">d</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-492"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-493"></a> <span class="p">}</span>
+<a name="line-494"></a>
+<a name="line-495"></a> <span class="k">while</span> <span class="p">((</span><span class="n">name</span> <span class="o">=</span> <span class="n">g_dir_read_name</span> <span class="p">(</span><span class="n">d</span><span class="p">))</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-496"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-497"></a>
+<a name="line-498"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">g_str_has_suffix</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="s">&quot;.xml&quot;</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-499"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-500"></a> <span class="p">}</span>
+<a name="line-501"></a>
+<a name="line-502"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-503"></a> <span class="n">populate_model_from_file</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">model</span><span class="p">,</span> <span class="n">path</span><span class="p">);</span>
+<a name="line-504"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
+<a name="line-505"></a> <span class="p">}</span>
+<a name="line-506"></a>
+<a name="line-507"></a> <span class="n">g_dir_close</span> <span class="p">(</span><span class="n">d</span><span class="p">);</span>
+<a name="line-508"></a><span class="p">}</span>
+<a name="line-509"></a>
+<a name="line-510"></a><span class="k">static</span> <span class="n">gboolean</span>
+<a name="line-511"></a><span class="nf">save_alert_sounds</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-512"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">id</span><span class="p">)</span>
+<a name="line-513"></a><span class="p">{</span>
+<a name="line-514"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">sounds</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> <span class="s">&quot;bell-terminal&quot;</span><span class="p">,</span> <span class="s">&quot;bell-window-system&quot;</span><span class="p">,</span> <span class="nb">NULL</span> <span class="p">};</span>
+<a name="line-515"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-516"></a>
+<a name="line-517"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">id</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-518"></a> <span class="n">delete_old_files</span> <span class="p">(</span><span class="n">sounds</span><span class="p">);</span>
+<a name="line-519"></a> <span class="n">delete_disabled_files</span> <span class="p">(</span><span class="n">sounds</span><span class="p">);</span>
+<a name="line-520"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-521"></a> <span class="n">delete_old_files</span> <span class="p">(</span><span class="n">sounds</span><span class="p">);</span>
+<a name="line-522"></a> <span class="n">delete_disabled_files</span> <span class="p">(</span><span class="n">sounds</span><span class="p">);</span>
+<a name="line-523"></a> <span class="n">add_custom_file</span> <span class="p">(</span><span class="n">sounds</span><span class="p">,</span> <span class="n">id</span><span class="p">);</span>
+<a name="line-524"></a> <span class="p">}</span>
+<a name="line-525"></a>
+<a name="line-526"></a> <span class="cm">/* And poke the directory so the theme gets updated */</span>
+<a name="line-527"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">custom_theme_dir_path</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
+<a name="line-528"></a> <span class="k">if</span> <span class="p">(</span><span class="n">utime</span> <span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-529"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Failed to update mtime for directory &#39;%s&#39;: %s&quot;</span><span class="p">,</span>
+<a name="line-530"></a> <span class="n">path</span><span class="p">,</span> <span class="n">g_strerror</span> <span class="p">(</span><span class="n">errno</span><span class="p">));</span>
+<a name="line-531"></a> <span class="p">}</span>
+<a name="line-532"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
+<a name="line-533"></a>
+<a name="line-534"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-535"></a><span class="p">}</span>
+<a name="line-536"></a>
+<a name="line-537"></a>
+<a name="line-538"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-539"></a><span class="nf">update_alert_model</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-540"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">id</span><span class="p">)</span>
+<a name="line-541"></a><span class="p">{</span>
+<a name="line-542"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-543"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-544"></a>
+<a name="line-545"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-546"></a> <span class="n">gtk_tree_model_get_iter_first</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-547"></a> <span class="k">do</span> <span class="p">{</span>
+<a name="line-548"></a> <span class="n">gboolean</span> <span class="n">toggled</span><span class="p">;</span>
+<a name="line-549"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">this_id</span><span class="p">;</span>
+<a name="line-550"></a>
+<a name="line-551"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-552"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">this_id</span><span class="p">,</span>
+<a name="line-553"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-554"></a>
+<a name="line-555"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">this_id</span><span class="p">,</span> <span class="n">id</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-556"></a> <span class="n">toggled</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-557"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-558"></a> <span class="n">toggled</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-559"></a> <span class="p">}</span>
+<a name="line-560"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">this_id</span><span class="p">);</span>
+<a name="line-561"></a>
+<a name="line-562"></a> <span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">model</span><span class="p">),</span>
+<a name="line-563"></a> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-564"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span> <span class="n">toggled</span><span class="p">,</span>
+<a name="line-565"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-566"></a> <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">gtk_tree_model_iter_next</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">));</span>
+<a name="line-567"></a><span class="p">}</span>
+<a name="line-568"></a>
+<a name="line-569"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-570"></a><span class="nf">update_alert</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-571"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">alert_id</span><span class="p">)</span>
+<a name="line-572"></a><span class="p">{</span>
+<a name="line-573"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">theme_model</span><span class="p">;</span>
+<a name="line-574"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-575"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">theme</span><span class="p">;</span>
+<a name="line-576"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">parent</span><span class="p">;</span>
+<a name="line-577"></a> <span class="n">gboolean</span> <span class="n">is_custom</span><span class="p">;</span>
+<a name="line-578"></a> <span class="n">gboolean</span> <span class="n">is_default</span><span class="p">;</span>
+<a name="line-579"></a> <span class="n">gboolean</span> <span class="n">add_custom</span><span class="p">;</span>
+<a name="line-580"></a> <span class="n">gboolean</span> <span class="n">remove_custom</span><span class="p">;</span>
+<a name="line-581"></a>
+<a name="line-582"></a> <span class="n">theme_model</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">));</span>
+<a name="line-583"></a> <span class="cm">/* Get the current theme&#39;s name, and set the parent */</span>
+<a name="line-584"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_combo_box_get_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-585"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-586"></a> <span class="p">}</span>
+<a name="line-587"></a>
+<a name="line-588"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-589"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">theme</span><span class="p">,</span>
+<a name="line-590"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">parent</span><span class="p">,</span>
+<a name="line-591"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-592"></a> <span class="n">is_custom</span> <span class="o">=</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">theme</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-593"></a> <span class="n">is_default</span> <span class="o">=</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">alert_id</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-594"></a>
+<a name="line-595"></a> <span class="cm">/* So a few possibilities:</span>
+<a name="line-596"></a><span class="cm"> * 1. Named theme, default alert selected: noop</span>
+<a name="line-597"></a><span class="cm"> * 2. Named theme, alternate alert selected: create new custom with sound</span>
+<a name="line-598"></a><span class="cm"> * 3. Custom theme, default alert selected: remove sound and possibly custom</span>
+<a name="line-599"></a><span class="cm"> * 4. Custom theme, alternate alert selected: update custom sound</span>
+<a name="line-600"></a><span class="cm"> */</span>
+<a name="line-601"></a> <span class="n">add_custom</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-602"></a> <span class="n">remove_custom</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-603"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">is_custom</span> <span class="o">&amp;&amp;</span> <span class="n">is_default</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-604"></a> <span class="cm">/* remove custom just in case */</span>
+<a name="line-605"></a> <span class="n">remove_custom</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-606"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">is_custom</span> <span class="o">&amp;&amp;</span> <span class="o">!</span> <span class="n">is_default</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-607"></a> <span class="n">create_custom_theme</span> <span class="p">(</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-608"></a> <span class="n">save_alert_sounds</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">alert_id</span><span class="p">);</span>
+<a name="line-609"></a> <span class="n">add_custom</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-610"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">is_custom</span> <span class="o">&amp;&amp;</span> <span class="n">is_default</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-611"></a> <span class="n">save_alert_sounds</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">alert_id</span><span class="p">);</span>
+<a name="line-612"></a> <span class="cm">/* after removing files check if it is empty */</span>
+<a name="line-613"></a> <span class="k">if</span> <span class="p">(</span><span class="n">custom_theme_dir_is_empty</span> <span class="p">())</span> <span class="p">{</span>
+<a name="line-614"></a> <span class="n">remove_custom</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-615"></a> <span class="p">}</span>
+<a name="line-616"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">is_custom</span> <span class="o">&amp;&amp;</span> <span class="o">!</span> <span class="n">is_default</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-617"></a> <span class="n">save_alert_sounds</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">alert_id</span><span class="p">);</span>
+<a name="line-618"></a> <span class="p">}</span>
+<a name="line-619"></a>
+<a name="line-620"></a> <span class="k">if</span> <span class="p">(</span><span class="n">add_custom</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-621"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">),</span>
+<a name="line-622"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-623"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-624"></a> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Custom&quot;</span><span class="p">),</span>
+<a name="line-625"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">,</span>
+<a name="line-626"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="n">theme</span><span class="p">,</span>
+<a name="line-627"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-628"></a> <span class="n">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">);</span>
+<a name="line-629"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">remove_custom</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-630"></a> <span class="n">gtk_tree_model_get_iter_first</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-631"></a> <span class="k">do</span> <span class="p">{</span>
+<a name="line-632"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">this_parent</span><span class="p">;</span>
+<a name="line-633"></a>
+<a name="line-634"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-635"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">this_parent</span><span class="p">,</span>
+<a name="line-636"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-637"></a> <span class="k">if</span> <span class="p">(</span><span class="n">this_parent</span> <span class="o">!=</span> <span class="nb">NULL</span> <span class="o">&amp;&amp;</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">this_parent</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-638"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">this_parent</span><span class="p">);</span>
+<a name="line-639"></a> <span class="n">gtk_list_store_remove</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-640"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-641"></a> <span class="p">}</span>
+<a name="line-642"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">this_parent</span><span class="p">);</span>
+<a name="line-643"></a> <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">gtk_tree_model_iter_next</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">));</span>
+<a name="line-644"></a>
+<a name="line-645"></a> <span class="n">delete_custom_theme_dir</span> <span class="p">();</span>
+<a name="line-646"></a>
+<a name="line-647"></a> <span class="n">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">parent</span><span class="p">);</span>
+<a name="line-648"></a> <span class="p">}</span>
+<a name="line-649"></a>
+<a name="line-650"></a> <span class="n">update_alert_model</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">alert_id</span><span class="p">);</span>
+<a name="line-651"></a>
+<a name="line-652"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">theme</span><span class="p">);</span>
+<a name="line-653"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-654"></a><span class="p">}</span>
+<a name="line-655"></a>
+<a name="line-656"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-657"></a><span class="nf">on_alert_toggled</span> <span class="p">(</span><span class="n">GtkCellRendererToggle</span> <span class="o">*</span><span class="n">renderer</span><span class="p">,</span>
+<a name="line-658"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">path_str</span><span class="p">,</span>
+<a name="line-659"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-660"></a><span class="p">{</span>
+<a name="line-661"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-662"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-663"></a> <span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-664"></a> <span class="n">gboolean</span> <span class="n">toggled</span><span class="p">;</span>
+<a name="line-665"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">id</span><span class="p">;</span>
+<a name="line-666"></a>
+<a name="line-667"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-668"></a>
+<a name="line-669"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">gtk_tree_path_new_from_string</span> <span class="p">(</span><span class="n">path_str</span><span class="p">);</span>
+<a name="line-670"></a> <span class="n">gtk_tree_model_get_iter</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="n">path</span><span class="p">);</span>
+<a name="line-671"></a> <span class="n">gtk_tree_path_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
+<a name="line-672"></a>
+<a name="line-673"></a> <span class="n">id</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-674"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-675"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">id</span><span class="p">,</span>
+<a name="line-676"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">toggled</span><span class="p">,</span>
+<a name="line-677"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-678"></a>
+<a name="line-679"></a> <span class="n">toggled</span> <span class="o">^=</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-680"></a> <span class="k">if</span> <span class="p">(</span><span class="n">toggled</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-681"></a> <span class="n">update_alert</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">id</span><span class="p">);</span>
+<a name="line-682"></a> <span class="p">}</span>
+<a name="line-683"></a>
+<a name="line-684"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">id</span><span class="p">);</span>
+<a name="line-685"></a><span class="p">}</span>
+<a name="line-686"></a>
+<a name="line-687"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-688"></a><span class="nf">play_preview_for_path</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span> <span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">)</span>
+<a name="line-689"></a><span class="p">{</span>
+<a name="line-690"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-691"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-692"></a> <span class="n">GtkTreeIter</span> <span class="n">theme_iter</span><span class="p">;</span>
+<a name="line-693"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">id</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-694"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">parent_theme</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-695"></a>
+<a name="line-696"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-697"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_tree_model_get_iter</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="n">path</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-698"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-699"></a>
+<a name="line-700"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-701"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">id</span><span class="p">,</span>
+<a name="line-702"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-703"></a> <span class="k">if</span> <span class="p">(</span><span class="n">id</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-704"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-705"></a>
+<a name="line-706"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_combo_box_get_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">theme_iter</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-707"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">theme_model</span><span class="p">;</span>
+<a name="line-708"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">theme_id</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-709"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">parent_id</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-710"></a>
+<a name="line-711"></a> <span class="n">theme_model</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">));</span>
+<a name="line-712"></a>
+<a name="line-713"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">theme_iter</span><span class="p">,</span>
+<a name="line-714"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">theme_id</span><span class="p">,</span>
+<a name="line-715"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">parent_id</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-716"></a> <span class="k">if</span> <span class="p">(</span><span class="n">theme_id</span> <span class="o">&amp;&amp;</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">theme_id</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+<a name="line-717"></a> <span class="n">parent_theme</span> <span class="o">=</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">parent_id</span><span class="p">);</span>
+<a name="line-718"></a>
+<a name="line-719"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">theme_id</span><span class="p">);</span>
+<a name="line-720"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent_id</span><span class="p">);</span>
+<a name="line-721"></a> <span class="p">}</span>
+<a name="line-722"></a>
+<a name="line-723"></a> <span class="cm">/* special case: for the default item on custom themes</span>
+<a name="line-724"></a><span class="cm"> * play the alert for the parent theme */</span>
+<a name="line-725"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">id</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-726"></a> <span class="k">if</span> <span class="p">(</span><span class="n">parent_theme</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-727"></a> <span class="n">ca_gtk_play_for_widget</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-728"></a> <span class="n">CA_PROP_APPLICATION_NAME</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Sound Preferences&quot;</span><span class="p">),</span>
+<a name="line-729"></a> <span class="n">CA_PROP_EVENT_ID</span><span class="p">,</span> <span class="s">&quot;bell-window-system&quot;</span><span class="p">,</span>
+<a name="line-730"></a> <span class="n">CA_PROP_CANBERRA_XDG_THEME_NAME</span><span class="p">,</span> <span class="n">parent_theme</span><span class="p">,</span>
+<a name="line-731"></a> <span class="n">CA_PROP_EVENT_DESCRIPTION</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Testing event sound&quot;</span><span class="p">),</span>
+<a name="line-732"></a> <span class="n">CA_PROP_CANBERRA_CACHE_CONTROL</span><span class="p">,</span> <span class="s">&quot;never&quot;</span><span class="p">,</span>
+<a name="line-733"></a> <span class="n">CA_PROP_APPLICATION_ID</span><span class="p">,</span> <span class="s">&quot;org.mate.VolumeControl&quot;</span><span class="p">,</span>
+<a name="line-734"></a><span class="cp">#ifdef CA_PROP_CANBERRA_ENABLE</span>
+<a name="line-735"></a><span class="hll"> <span class="n">CA_PROP_CANBERRA_ENABLE</span><span class="p">,</span> <span class="s">&quot;1&quot;</span><span class="p">,</span><span class='error2'>&lt;--- Skipping configuration 'CA_PROP_CANBERRA_ENABLE' since the value of 'CA_PROP_CANBERRA_ENABLE' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</span>
+</span><a name="line-736"></a><span class="cp">#endif</span>
+<a name="line-737"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-738"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-739"></a> <span class="n">ca_gtk_play_for_widget</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-740"></a> <span class="n">CA_PROP_APPLICATION_NAME</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Sound Preferences&quot;</span><span class="p">),</span>
+<a name="line-741"></a> <span class="n">CA_PROP_EVENT_ID</span><span class="p">,</span> <span class="s">&quot;bell-window-system&quot;</span><span class="p">,</span>
+<a name="line-742"></a> <span class="n">CA_PROP_EVENT_DESCRIPTION</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Testing event sound&quot;</span><span class="p">),</span>
+<a name="line-743"></a> <span class="n">CA_PROP_CANBERRA_CACHE_CONTROL</span><span class="p">,</span> <span class="s">&quot;never&quot;</span><span class="p">,</span>
+<a name="line-744"></a> <span class="n">CA_PROP_APPLICATION_ID</span><span class="p">,</span> <span class="s">&quot;org.mate.VolumeControl&quot;</span><span class="p">,</span>
+<a name="line-745"></a><span class="cp">#ifdef CA_PROP_CANBERRA_ENABLE</span>
+<a name="line-746"></a><span class="hll"> <span class="n">CA_PROP_CANBERRA_ENABLE</span><span class="p">,</span> <span class="s">&quot;1&quot;</span><span class="p">,</span><span class='error2'>&lt;--- Skipping configuration 'CA_PROP_CANBERRA_ENABLE' since the value of 'CA_PROP_CANBERRA_ENABLE' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</span>
+</span><a name="line-747"></a><span class="cp">#endif</span>
+<a name="line-748"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-749"></a> <span class="p">}</span>
+<a name="line-750"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-751"></a> <span class="n">ca_gtk_play_for_widget</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-752"></a> <span class="n">CA_PROP_APPLICATION_NAME</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Sound Preferences&quot;</span><span class="p">),</span>
+<a name="line-753"></a> <span class="n">CA_PROP_MEDIA_FILENAME</span><span class="p">,</span> <span class="n">id</span><span class="p">,</span>
+<a name="line-754"></a> <span class="n">CA_PROP_EVENT_DESCRIPTION</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Testing event sound&quot;</span><span class="p">),</span>
+<a name="line-755"></a> <span class="n">CA_PROP_CANBERRA_CACHE_CONTROL</span><span class="p">,</span> <span class="s">&quot;never&quot;</span><span class="p">,</span>
+<a name="line-756"></a> <span class="n">CA_PROP_APPLICATION_ID</span><span class="p">,</span> <span class="s">&quot;org.mate.VolumeControl&quot;</span><span class="p">,</span>
+<a name="line-757"></a><span class="cp">#ifdef CA_PROP_CANBERRA_ENABLE</span>
+<a name="line-758"></a><span class="hll"> <span class="n">CA_PROP_CANBERRA_ENABLE</span><span class="p">,</span> <span class="s">&quot;1&quot;</span><span class="p">,</span><span class='error2'>&lt;--- Skipping configuration 'CA_PROP_CANBERRA_ENABLE' since the value of 'CA_PROP_CANBERRA_ENABLE' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</span>
+</span><a name="line-759"></a><span class="cp">#endif</span>
+<a name="line-760"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-761"></a>
+<a name="line-762"></a> <span class="p">}</span>
+<a name="line-763"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent_theme</span><span class="p">);</span>
+<a name="line-764"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">id</span><span class="p">);</span>
+<a name="line-765"></a><span class="p">}</span>
+<a name="line-766"></a>
+<a name="line-767"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-768"></a><span class="nf">on_treeview_row_activated</span> <span class="p">(</span><span class="n">GtkTreeView</span> <span class="o">*</span><span class="n">treeview</span><span class="p">,</span>
+<a name="line-769"></a> <span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span>
+<a name="line-770"></a> <span class="n">GtkTreeViewColumn</span> <span class="o">*</span><span class="n">column</span><span class="p">,</span>
+<a name="line-771"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-772"></a><span class="p">{</span>
+<a name="line-773"></a> <span class="n">play_preview_for_path</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">path</span><span class="p">);</span>
+<a name="line-774"></a><span class="p">}</span>
+<a name="line-775"></a>
+<a name="line-776"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-777"></a><span class="nf">on_treeview_selection_changed</span> <span class="p">(</span><span class="n">GtkTreeSelection</span> <span class="o">*</span><span class="n">selection</span><span class="p">,</span>
+<a name="line-778"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-779"></a><span class="p">{</span>
+<a name="line-780"></a> <span class="n">GList</span> <span class="o">*</span><span class="n">paths</span><span class="p">;</span>
+<a name="line-781"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-782"></a> <span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-783"></a>
+<a name="line-784"></a> <span class="k">if</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-785"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-786"></a>
+<a name="line-787"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-788"></a>
+<a name="line-789"></a> <span class="n">paths</span> <span class="o">=</span> <span class="n">gtk_tree_selection_get_selected_rows</span> <span class="p">(</span><span class="n">selection</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">model</span><span class="p">);</span>
+<a name="line-790"></a> <span class="k">if</span> <span class="p">(</span><span class="n">paths</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-791"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-792"></a>
+<a name="line-793"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">paths</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">;</span>
+<a name="line-794"></a> <span class="n">play_preview_for_path</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">path</span><span class="p">);</span>
+<a name="line-795"></a>
+<a name="line-796"></a> <span class="n">g_list_foreach</span> <span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="p">(</span><span class="n">GFunc</span><span class="p">)</span><span class="n">gtk_tree_path_free</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-797"></a> <span class="n">g_list_free</span> <span class="p">(</span><span class="n">paths</span><span class="p">);</span>
+<a name="line-798"></a><span class="p">}</span>
+<a name="line-799"></a>
+<a name="line-800"></a><span class="k">static</span> <span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-801"></a><span class="nf">create_alert_treeview</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-802"></a><span class="p">{</span>
+<a name="line-803"></a> <span class="n">GtkListStore</span> <span class="o">*</span><span class="n">store</span><span class="p">;</span>
+<a name="line-804"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">treeview</span><span class="p">;</span>
+<a name="line-805"></a> <span class="n">GtkCellRenderer</span> <span class="o">*</span><span class="n">renderer</span><span class="p">;</span>
+<a name="line-806"></a> <span class="n">GtkTreeViewColumn</span> <span class="o">*</span><span class="n">column</span><span class="p">;</span>
+<a name="line-807"></a> <span class="n">GtkTreeSelection</span> <span class="o">*</span><span class="n">selection</span><span class="p">;</span>
+<a name="line-808"></a>
+<a name="line-809"></a> <span class="n">treeview</span> <span class="o">=</span> <span class="n">gtk_tree_view_new</span> <span class="p">();</span>
+<a name="line-810"></a>
+<a name="line-811"></a> <span class="n">gtk_tree_view_set_headers_visible</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-812"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span>
+<a name="line-813"></a> <span class="s">&quot;row-activated&quot;</span><span class="p">,</span>
+<a name="line-814"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_treeview_row_activated</span><span class="p">),</span>
+<a name="line-815"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-816"></a>
+<a name="line-817"></a> <span class="n">selection</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_selection</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-818"></a>
+<a name="line-819"></a> <span class="n">gtk_tree_selection_set_mode</span> <span class="p">(</span><span class="n">selection</span><span class="p">,</span> <span class="n">GTK_SELECTION_SINGLE</span><span class="p">);</span>
+<a name="line-820"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">selection</span><span class="p">),</span>
+<a name="line-821"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span>
+<a name="line-822"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_treeview_selection_changed</span><span class="p">),</span>
+<a name="line-823"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-824"></a>
+<a name="line-825"></a> <span class="cm">/* Setup the tree model, 3 columns:</span>
+<a name="line-826"></a><span class="cm"> * - display name</span>
+<a name="line-827"></a><span class="cm"> * - sound id</span>
+<a name="line-828"></a><span class="cm"> * - sound type</span>
+<a name="line-829"></a><span class="cm"> */</span>
+<a name="line-830"></a> <span class="n">store</span> <span class="o">=</span> <span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="n">ALERT_NUM_COLS</span><span class="p">,</span>
+<a name="line-831"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-832"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-833"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-834"></a> <span class="n">G_TYPE_BOOLEAN</span><span class="p">);</span>
+<a name="line-835"></a>
+<a name="line-836"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span>
+<a name="line-837"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-838"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-839"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">,</span>
+<a name="line-840"></a> <span class="n">ALERT_DISPLAY_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Default&quot;</span><span class="p">),</span>
+<a name="line-841"></a> <span class="n">ALERT_SOUND_TYPE_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;From theme&quot;</span><span class="p">),</span>
+<a name="line-842"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span>
+<a name="line-843"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-844"></a>
+<a name="line-845"></a> <span class="n">populate_model_from_dir</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">store</span><span class="p">),</span> <span class="n">SOUND_SET_DIR</span><span class="p">);</span>
+<a name="line-846"></a>
+<a name="line-847"></a> <span class="n">gtk_tree_view_set_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span>
+<a name="line-848"></a> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">store</span><span class="p">));</span>
+<a name="line-849"></a>
+<a name="line-850"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_toggle_new</span> <span class="p">();</span>
+<a name="line-851"></a> <span class="n">gtk_cell_renderer_toggle_set_radio</span> <span class="p">(</span><span class="n">GTK_CELL_RENDERER_TOGGLE</span> <span class="p">(</span><span class="n">renderer</span><span class="p">),</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-852"></a>
+<a name="line-853"></a> <span class="n">column</span> <span class="o">=</span> <span class="n">gtk_tree_view_column_new_with_attributes</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">,</span>
+<a name="line-854"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-855"></a> <span class="s">&quot;active&quot;</span><span class="p">,</span> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span>
+<a name="line-856"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-857"></a> <span class="n">gtk_tree_view_append_column</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span> <span class="n">column</span><span class="p">);</span>
+<a name="line-858"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">renderer</span><span class="p">,</span>
+<a name="line-859"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span>
+<a name="line-860"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_alert_toggled</span><span class="p">),</span>
+<a name="line-861"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-862"></a>
+<a name="line-863"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-864"></a> <span class="n">column</span> <span class="o">=</span> <span class="n">gtk_tree_view_column_new_with_attributes</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Name&quot;</span><span class="p">),</span>
+<a name="line-865"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-866"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span> <span class="n">ALERT_DISPLAY_COL</span><span class="p">,</span>
+<a name="line-867"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-868"></a> <span class="n">gtk_tree_view_append_column</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span> <span class="n">column</span><span class="p">);</span>
+<a name="line-869"></a>
+<a name="line-870"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-871"></a> <span class="n">column</span> <span class="o">=</span> <span class="n">gtk_tree_view_column_new_with_attributes</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Type&quot;</span><span class="p">),</span>
+<a name="line-872"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-873"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span> <span class="n">ALERT_SOUND_TYPE_COL</span><span class="p">,</span>
+<a name="line-874"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-875"></a>
+<a name="line-876"></a> <span class="n">gtk_tree_view_append_column</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span> <span class="n">column</span><span class="p">);</span>
+<a name="line-877"></a>
+<a name="line-878"></a> <span class="k">return</span> <span class="n">treeview</span><span class="p">;</span>
+<a name="line-879"></a><span class="p">}</span>
+<a name="line-880"></a>
+<a name="line-881"></a><span class="k">static</span> <span class="kt">int</span>
+<a name="line-882"></a><span class="nf">get_file_type</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">sound_name</span><span class="p">,</span>
+<a name="line-883"></a> <span class="kt">char</span> <span class="o">**</span><span class="n">linked_name</span><span class="p">)</span>
+<a name="line-884"></a><span class="p">{</span>
+<a name="line-885"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">,</span> <span class="o">*</span><span class="n">filename</span><span class="p">;</span>
+<a name="line-886"></a>
+<a name="line-887"></a> <span class="o">*</span><span class="n">linked_name</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-888"></a>
+<a name="line-889"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;%s.disabled&quot;</span><span class="p">,</span> <span class="n">sound_name</span><span class="p">);</span>
+<a name="line-890"></a> <span class="n">filename</span> <span class="o">=</span> <span class="n">custom_theme_dir_path</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-891"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-892"></a>
+<a name="line-893"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">G_FILE_TEST_IS_REGULAR</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-894"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-895"></a> <span class="k">return</span> <span class="n">SOUND_TYPE_OFF</span><span class="p">;</span>
+<a name="line-896"></a> <span class="p">}</span>
+<a name="line-897"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-898"></a>
+<a name="line-899"></a> <span class="cm">/* We only check for .ogg files because those are the</span>
+<a name="line-900"></a><span class="cm"> * only ones we create */</span>
+<a name="line-901"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;%s.ogg&quot;</span><span class="p">,</span> <span class="n">sound_name</span><span class="p">);</span>
+<a name="line-902"></a> <span class="n">filename</span> <span class="o">=</span> <span class="n">custom_theme_dir_path</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-903"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-904"></a>
+<a name="line-905"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">G_FILE_TEST_IS_SYMLINK</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-906"></a> <span class="o">*</span><span class="n">linked_name</span> <span class="o">=</span> <span class="n">g_file_read_link</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-907"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-908"></a> <span class="k">return</span> <span class="n">SOUND_TYPE_CUSTOM</span><span class="p">;</span>
+<a name="line-909"></a> <span class="p">}</span>
+<a name="line-910"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-911"></a>
+<a name="line-912"></a> <span class="k">return</span> <span class="n">SOUND_TYPE_BUILTIN</span><span class="p">;</span>
+<a name="line-913"></a><span class="p">}</span>
+<a name="line-914"></a>
+<a name="line-915"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-916"></a><span class="nf">update_alerts_from_theme_name</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-917"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">)</span>
+<a name="line-918"></a><span class="p">{</span>
+<a name="line-919"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-920"></a> <span class="cm">/* reset alert to default */</span>
+<a name="line-921"></a> <span class="n">update_alert</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">);</span>
+<a name="line-922"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-923"></a> <span class="kt">int</span> <span class="n">sound_type</span><span class="p">;</span>
+<a name="line-924"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">linkname</span><span class="p">;</span>
+<a name="line-925"></a>
+<a name="line-926"></a> <span class="n">linkname</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-927"></a> <span class="n">sound_type</span> <span class="o">=</span> <span class="n">get_file_type</span> <span class="p">(</span><span class="s">&quot;bell-terminal&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">linkname</span><span class="p">);</span>
+<a name="line-928"></a> <span class="n">g_debug</span> <span class="p">(</span><span class="s">&quot;Found link: %s&quot;</span><span class="p">,</span> <span class="n">linkname</span><span class="p">);</span>
+<a name="line-929"></a> <span class="k">if</span> <span class="p">(</span><span class="n">sound_type</span> <span class="o">==</span> <span class="n">SOUND_TYPE_CUSTOM</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-930"></a> <span class="n">update_alert</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">linkname</span><span class="p">);</span>
+<a name="line-931"></a> <span class="p">}</span>
+<a name="line-932"></a> <span class="p">}</span>
+<a name="line-933"></a><span class="p">}</span>
+<a name="line-934"></a>
+<a name="line-935"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-936"></a><span class="nf">update_theme</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-937"></a><span class="p">{</span>
+<a name="line-938"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">theme_name</span><span class="p">;</span>
+<a name="line-939"></a> <span class="n">gboolean</span> <span class="n">events_enabled</span><span class="p">;</span>
+<a name="line-940"></a> <span class="n">gboolean</span> <span class="n">feedback_enabled</span><span class="p">;</span>
+<a name="line-941"></a>
+<a name="line-942"></a> <span class="n">feedback_enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">INPUT_SOUNDS_KEY</span><span class="p">);</span>
+<a name="line-943"></a> <span class="n">set_input_feedback_enabled</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">feedback_enabled</span><span class="p">);</span>
+<a name="line-944"></a>
+<a name="line-945"></a> <span class="n">events_enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">EVENT_SOUNDS_KEY</span><span class="p">);</span>
+<a name="line-946"></a> <span class="k">if</span> <span class="p">(</span><span class="n">events_enabled</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-947"></a> <span class="n">theme_name</span> <span class="o">=</span> <span class="n">g_settings_get_string</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">SOUND_THEME_KEY</span><span class="p">);</span>
+<a name="line-948"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-949"></a> <span class="n">theme_name</span> <span class="o">=</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">NO_SOUNDS_THEME_NAME</span><span class="p">);</span>
+<a name="line-950"></a> <span class="p">}</span>
+<a name="line-951"></a>
+<a name="line-952"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">selection_box</span><span class="p">,</span> <span class="n">events_enabled</span><span class="p">);</span>
+<a name="line-953"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">,</span> <span class="n">events_enabled</span><span class="p">);</span>
+<a name="line-954"></a>
+<a name="line-955"></a> <span class="n">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">theme_name</span><span class="p">);</span>
+<a name="line-956"></a>
+<a name="line-957"></a> <span class="n">update_alerts_from_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">theme_name</span><span class="p">);</span>
+<a name="line-958"></a>
+<a name="line-959"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">theme_name</span><span class="p">);</span>
+<a name="line-960"></a><span class="p">}</span>
+<a name="line-961"></a>
+<a name="line-962"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-963"></a><span class="nf">gvc_sound_theme_chooser_class_init</span> <span class="p">(</span><span class="n">GvcSoundThemeChooserClass</span> <span class="o">*</span><span class="n">klass</span><span class="p">)</span>
+<a name="line-964"></a><span class="p">{</span>
+<a name="line-965"></a> <span class="n">GObjectClass</span> <span class="o">*</span><span class="n">object_class</span> <span class="o">=</span> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">);</span>
+<a name="line-966"></a>
+<a name="line-967"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="o">=</span> <span class="n">gvc_sound_theme_chooser_dispose</span><span class="p">;</span>
+<a name="line-968"></a><span class="p">}</span>
+<a name="line-969"></a>
+<a name="line-970"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-971"></a><span class="nf">on_click_feedback_toggled</span> <span class="p">(</span><span class="n">GtkToggleButton</span> <span class="o">*</span><span class="n">button</span><span class="p">,</span>
+<a name="line-972"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-973"></a><span class="p">{</span>
+<a name="line-974"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-975"></a>
+<a name="line-976"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">gtk_toggle_button_get_active</span> <span class="p">(</span><span class="n">button</span><span class="p">);</span>
+<a name="line-977"></a>
+<a name="line-978"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">INPUT_SOUNDS_KEY</span><span class="p">,</span> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-979"></a><span class="p">}</span>
+<a name="line-980"></a>
+<a name="line-981"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-982"></a><span class="nf">on_key_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-983"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span>
+<a name="line-984"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-985"></a><span class="p">{</span>
+<a name="line-986"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">EVENT_SOUNDS_KEY</span><span class="p">)</span> <span class="o">||</span>
+<a name="line-987"></a> <span class="o">!</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">SOUND_THEME_KEY</span><span class="p">)</span> <span class="o">||</span>
+<a name="line-988"></a> <span class="o">!</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">INPUT_SOUNDS_KEY</span><span class="p">))</span>
+<a name="line-989"></a> <span class="n">update_theme</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-990"></a><span class="p">}</span>
+<a name="line-991"></a>
+<a name="line-992"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-993"></a><span class="nf">setup_list_size_constraint</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">widget</span><span class="p">,</span>
+<a name="line-994"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">to_size</span><span class="p">)</span>
+<a name="line-995"></a><span class="p">{</span>
+<a name="line-996"></a> <span class="n">GtkRequisition</span> <span class="n">req</span><span class="p">;</span>
+<a name="line-997"></a> <span class="n">gint</span> <span class="n">sc_height</span><span class="p">;</span>
+<a name="line-998"></a> <span class="kt">int</span> <span class="n">max_height</span><span class="p">;</span>
+<a name="line-999"></a>
+<a name="line-1000"></a> <span class="cm">/* Constrain height to be the tree height up to a max */</span>
+<a name="line-1001"></a> <span class="n">gdk_window_get_geometry</span> <span class="p">(</span><span class="n">gdk_screen_get_root_window</span> <span class="p">(</span><span class="n">gtk_widget_get_screen</span> <span class="p">(</span><span class="n">widget</span><span class="p">)),</span>
+<a name="line-1002"></a> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">sc_height</span><span class="p">);</span>
+<a name="line-1003"></a>
+<a name="line-1004"></a> <span class="n">max_height</span> <span class="o">=</span> <span class="n">sc_height</span> <span class="o">/</span> <span class="mi">4</span><span class="p">;</span>
+<a name="line-1005"></a>
+<a name="line-1006"></a> <span class="c1">// XXX this doesn&#39;t work</span>
+<a name="line-1007"></a> <span class="n">gtk_widget_get_preferred_size</span> <span class="p">(</span><span class="n">to_size</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">);</span>
+<a name="line-1008"></a>
+<a name="line-1009"></a> <span class="n">gtk_scrolled_window_set_min_content_height</span> <span class="p">(</span><span class="n">GTK_SCROLLED_WINDOW</span> <span class="p">(</span><span class="n">widget</span><span class="p">),</span>
+<a name="line-1010"></a> <span class="n">MIN</span> <span class="p">(</span><span class="n">req</span><span class="p">.</span><span class="n">height</span><span class="p">,</span> <span class="n">max_height</span><span class="p">));</span>
+<a name="line-1011"></a><span class="p">}</span>
+<a name="line-1012"></a>
+<a name="line-1013"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-1014"></a><span class="nf">gvc_sound_theme_chooser_init</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-1015"></a><span class="p">{</span>
+<a name="line-1016"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">box</span><span class="p">;</span>
+<a name="line-1017"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">label</span><span class="p">;</span>
+<a name="line-1018"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">scrolled_window</span><span class="p">;</span>
+<a name="line-1019"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">str</span><span class="p">;</span>
+<a name="line-1020"></a>
+<a name="line-1021"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span> <span class="o">=</span> <span class="n">gvc_sound_theme_chooser_get_instance_private</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-1022"></a>
+<a name="line-1023"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">theme_box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-1024"></a>
+<a name="line-1025"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span>
+<a name="line-1026"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">theme_box</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-1027"></a>
+<a name="line-1028"></a> <span class="n">label</span> <span class="o">=</span> <span class="n">gtk_label_new_with_mnemonic</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Sound _theme:&quot;</span><span class="p">));</span>
+<a name="line-1029"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">theme_box</span><span class="p">),</span> <span class="n">label</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-1030"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span> <span class="o">=</span> <span class="n">gtk_combo_box_new</span> <span class="p">();</span>
+<a name="line-1031"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">theme_box</span><span class="p">),</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-1032"></a> <span class="n">gtk_label_set_mnemonic_widget</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">);</span>
+<a name="line-1033"></a>
+<a name="line-1034"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">KEY_SOUNDS_SCHEMA</span><span class="p">);</span>
+<a name="line-1035"></a>
+<a name="line-1036"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">),</span>
+<a name="line-1037"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span>
+<a name="line-1038"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_key_changed</span><span class="p">),</span>
+<a name="line-1039"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-1040"></a>
+<a name="line-1041"></a> <span class="n">str</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;&lt;b&gt;%s&lt;/b&gt;&quot;</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;C_hoose an alert sound:&quot;</span><span class="p">));</span>
+<a name="line-1042"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">selection_box</span> <span class="o">=</span> <span class="n">box</span> <span class="o">=</span> <span class="n">gtk_frame_new</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-1043"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-1044"></a>
+<a name="line-1045"></a> <span class="n">label</span> <span class="o">=</span> <span class="n">gtk_frame_get_label_widget</span> <span class="p">(</span><span class="n">GTK_FRAME</span> <span class="p">(</span><span class="n">box</span><span class="p">));</span>
+<a name="line-1046"></a> <span class="n">gtk_label_set_use_underline</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-1047"></a> <span class="n">gtk_label_set_use_markup</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-1048"></a> <span class="n">gtk_frame_set_shadow_type</span> <span class="p">(</span><span class="n">GTK_FRAME</span> <span class="p">(</span><span class="n">box</span><span class="p">),</span> <span class="n">GTK_SHADOW_NONE</span><span class="p">);</span>
+<a name="line-1049"></a>
+<a name="line-1050"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="n">box</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-1051"></a>
+<a name="line-1052"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span> <span class="o">=</span> <span class="n">create_alert_treeview</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-1053"></a> <span class="n">gtk_label_set_mnemonic_widget</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">);</span>
+<a name="line-1054"></a>
+<a name="line-1055"></a> <span class="n">scrolled_window</span> <span class="o">=</span> <span class="n">gtk_scrolled_window_new</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-1056"></a> <span class="n">gtk_widget_set_hexpand</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-1057"></a> <span class="n">gtk_widget_set_vexpand</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-1058"></a> <span class="n">gtk_widget_set_margin_top</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-1059"></a>
+<a name="line-1060"></a> <span class="n">gtk_scrolled_window_set_policy</span> <span class="p">(</span><span class="n">GTK_SCROLLED_WINDOW</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">),</span>
+<a name="line-1061"></a> <span class="n">GTK_POLICY_NEVER</span><span class="p">,</span>
+<a name="line-1062"></a> <span class="n">GTK_POLICY_AUTOMATIC</span><span class="p">);</span>
+<a name="line-1063"></a> <span class="n">gtk_scrolled_window_set_shadow_type</span> <span class="p">(</span><span class="n">GTK_SCROLLED_WINDOW</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">),</span>
+<a name="line-1064"></a> <span class="n">GTK_SHADOW_IN</span><span class="p">);</span>
+<a name="line-1065"></a>
+<a name="line-1066"></a> <span class="n">gtk_container_add</span> <span class="p">(</span><span class="n">GTK_CONTAINER</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">),</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">);</span>
+<a name="line-1067"></a> <span class="n">gtk_container_add</span> <span class="p">(</span><span class="n">GTK_CONTAINER</span> <span class="p">(</span><span class="n">box</span><span class="p">),</span> <span class="n">scrolled_window</span><span class="p">);</span>
+<a name="line-1068"></a>
+<a name="line-1069"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span> <span class="o">=</span> <span class="n">gtk_check_button_new_with_mnemonic</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Enable _window and button sounds&quot;</span><span class="p">));</span>
+<a name="line-1070"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">),</span>
+<a name="line-1071"></a> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">INPUT_SOUNDS_KEY</span><span class="p">));</span>
+<a name="line-1072"></a>
+<a name="line-1073"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span>
+<a name="line-1074"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">,</span>
+<a name="line-1075"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-1076"></a>
+<a name="line-1077"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">),</span>
+<a name="line-1078"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span>
+<a name="line-1079"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_click_feedback_toggled</span><span class="p">),</span>
+<a name="line-1080"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-1081"></a>
+<a name="line-1082"></a> <span class="n">setup_theme_selector</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-1083"></a> <span class="n">update_theme</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-1084"></a>
+<a name="line-1085"></a> <span class="n">setup_list_size_constraint</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">,</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">);</span>
+<a name="line-1086"></a><span class="p">}</span>
+<a name="line-1087"></a>
+<a name="line-1088"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-1089"></a><span class="nf">gvc_sound_theme_chooser_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">)</span>
+<a name="line-1090"></a><span class="p">{</span>
+<a name="line-1091"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">;</span>
+<a name="line-1092"></a>
+<a name="line-1093"></a> <span class="n">chooser</span> <span class="o">=</span> <span class="n">GVC_SOUND_THEME_CHOOSER</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-1094"></a>
+<a name="line-1095"></a> <span class="n">g_clear_object</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">);</span>
+<a name="line-1096"></a>
+<a name="line-1097"></a> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">gvc_sound_theme_chooser_parent_class</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-1098"></a><span class="p">}</span>
+<a name="line-1099"></a>
+<a name="line-1100"></a><span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-1101"></a><span class="nf">gvc_sound_theme_chooser_new</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-1102"></a><span class="p">{</span>
+<a name="line-1103"></a> <span class="k">return</span> <span class="n">g_object_new</span> <span class="p">(</span><span class="n">GVC_TYPE_SOUND_THEME_CHOOSER</span><span class="p">,</span>
+<a name="line-1104"></a> <span class="s">&quot;spacing&quot;</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span>
+<a name="line-1105"></a> <span class="s">&quot;orientation&quot;</span><span class="p">,</span> <span class="n">GTK_ORIENTATION_VERTICAL</span><span class="p">,</span>
+<a name="line-1106"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-1107"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck 1.90 - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/[email protected]_master/2.html b/[email protected]_master/2.html
new file mode 100644
index 0000000..bacfabb
--- /dev/null
+++ b/[email protected]_master/2.html
@@ -0,0 +1,1110 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-media</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ function toggle_all(){
+ var elts = document.getElementsByTagName("input");
+ for (var i = 1; i < elts.length; i++) {
+ var el = elts[i];
+ el.checked ? el.checked=false : el.checked=true;
+ toggle_class_visibility(el.id);
+ }
+ }
+
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - mate-media: mate-volume-control/gvc-speaker-test.c </h1>
+ </div>
+ <div id="menu" dir="rtl">
+ <p id="filename"><a href="index.html">Defects:</a> gvc-speaker-test.c</p>
+<a href='2.html#line-53'> unknownMacro 53</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 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</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span>
+<a name="line-2"></a><span class="cm"> *</span>
+<a name="line-3"></a><span class="cm"> * Copyright (C) 2009 Bastien Nocera</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2014 Michal Ratajsky &lt;[email protected]&gt;</span>
+<a name="line-5"></a><span class="cm"> *</span>
+<a name="line-6"></a><span class="cm"> * This program is free software; you can redistribute it and/or modify</span>
+<a name="line-7"></a><span class="cm"> * it under the terms of the GNU General Public License as published by</span>
+<a name="line-8"></a><span class="cm"> * the Free Software Foundation; either version 2 of the License, or</span>
+<a name="line-9"></a><span class="cm"> * (at your option) any later version.</span>
+<a name="line-10"></a><span class="cm"> *</span>
+<a name="line-11"></a><span class="cm"> * This program is distributed in the hope that it will be useful,</span>
+<a name="line-12"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-13"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
+<a name="line-14"></a><span class="cm"> * GNU General Public License for more details.</span>
+<a name="line-15"></a><span class="cm"> *</span>
+<a name="line-16"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-17"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-18"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-19"></a><span class="cm"> *</span>
+<a name="line-20"></a><span class="cm"> */</span>
+<a name="line-21"></a>
+<a name="line-22"></a><span class="cp">#include</span> <span class="cpf">&quot;config.h&quot;</span><span class="cp"></span>
+<a name="line-23"></a>
+<a name="line-24"></a><span class="cp">#include</span> <span class="cpf">&lt;glib.h&gt;</span><span class="cp"></span>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-26"></a><span class="cp">#include</span> <span class="cpf">&lt;glib-object.h&gt;</span><span class="cp"></span>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a>
+<a name="line-29"></a><span class="cp">#include</span> <span class="cpf">&lt;canberra.h&gt;</span><span class="cp"></span>
+<a name="line-30"></a><span class="cp">#include</span> <span class="cpf">&lt;libmatemixer/matemixer.h&gt;</span><span class="cp"></span>
+<a name="line-31"></a>
+<a name="line-32"></a><span class="cp">#include</span> <span class="cpf">&quot;gvc-speaker-test.h&quot;</span><span class="cp"></span>
+<a name="line-33"></a><span class="cp">#include</span> <span class="cpf">&quot;gvc-utils.h&quot;</span><span class="cp"></span>
+<a name="line-34"></a>
+<a name="line-35"></a><span class="k">struct</span> <span class="n">_GvcSpeakerTestPrivate</span>
+<a name="line-36"></a><span class="p">{</span>
+<a name="line-37"></a> <span class="n">GArray</span> <span class="o">*</span><span class="n">controls</span><span class="p">;</span>
+<a name="line-38"></a> <span class="n">ca_context</span> <span class="o">*</span><span class="n">canberra</span><span class="p">;</span>
+<a name="line-39"></a> <span class="n">MateMixerStream</span> <span class="o">*</span><span class="n">stream</span><span class="p">;</span>
+<a name="line-40"></a><span class="p">};</span>
+<a name="line-41"></a>
+<a name="line-42"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-43"></a> <span class="n">PROP_0</span><span class="p">,</span>
+<a name="line-44"></a> <span class="n">PROP_STREAM</span><span class="p">,</span>
+<a name="line-45"></a> <span class="n">N_PROPERTIES</span>
+<a name="line-46"></a><span class="p">};</span>
+<a name="line-47"></a>
+<a name="line-48"></a><span class="k">static</span> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">properties</span><span class="p">[</span><span class="n">N_PROPERTIES</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> <span class="nb">NULL</span><span class="p">,</span> <span class="p">};</span>
+<a name="line-49"></a>
+<a name="line-50"></a><span class="k">static</span> <span class="kt">void</span> <span class="nf">gvc_speaker_test_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">);</span>
+<a name="line-51"></a><span class="k">static</span> <span class="kt">void</span> <span class="nf">gvc_speaker_test_finalize</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">);</span>
+<a name="line-52"></a>
+<a name="line-53"></a><span class="hll"><span class="n">G_DEFINE_TYPE_WITH_PRIVATE</span> <span class="p">(</span><span class="n">GvcSpeakerTest</span><span class="p">,</span> <span class="n">gvc_speaker_test</span><span class="p">,</span> <span class="n">GTK_TYPE_GRID</span><span class="p">)</span><span class='error2'>&lt;--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.</span>
+</span><a name="line-54"></a>
+<a name="line-55"></a><span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
+<a name="line-56"></a> <span class="n">MateMixerChannelPosition</span> <span class="n">position</span><span class="p">;</span>
+<a name="line-57"></a> <span class="n">guint</span> <span class="n">left</span><span class="p">;</span>
+<a name="line-58"></a> <span class="n">guint</span> <span class="n">top</span><span class="p">;</span>
+<a name="line-59"></a><span class="p">}</span> <span class="n">TablePosition</span><span class="p">;</span>
+<a name="line-60"></a>
+<a name="line-61"></a><span class="k">static</span> <span class="k">const</span> <span class="n">TablePosition</span> <span class="n">positions</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span>
+<a name="line-62"></a> <span class="cm">/* Position, X, Y */</span>
+<a name="line-63"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_FRONT_LEFT</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-64"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_FRONT_LEFT_CENTER</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-65"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_FRONT_CENTER</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-66"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_MONO</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-67"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_FRONT_RIGHT_CENTER</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-68"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_FRONT_RIGHT</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-69"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_SIDE_LEFT</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-70"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_SIDE_RIGHT</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-71"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_BACK_LEFT</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-72"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_BACK_CENTER</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-73"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_BACK_RIGHT</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="p">},</span>
+<a name="line-74"></a> <span class="p">{</span> <span class="n">MATE_MIXER_CHANNEL_LFE</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">2</span> <span class="p">}</span>
+<a name="line-75"></a><span class="p">};</span>
+<a name="line-76"></a>
+<a name="line-77"></a><span class="n">MateMixerStream</span> <span class="o">*</span>
+<a name="line-78"></a><span class="nf">gvc_speaker_test_get_stream</span> <span class="p">(</span><span class="n">GvcSpeakerTest</span> <span class="o">*</span><span class="n">test</span><span class="p">)</span>
+<a name="line-79"></a><span class="p">{</span>
+<a name="line-80"></a> <span class="n">g_return_val_if_fail</span> <span class="p">(</span><span class="n">GVC_IS_SPEAKER_TEST</span> <span class="p">(</span><span class="n">test</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-81"></a>
+<a name="line-82"></a> <span class="k">return</span> <span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">stream</span><span class="p">;</span>
+<a name="line-83"></a><span class="p">}</span>
+<a name="line-84"></a>
+<a name="line-85"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-86"></a><span class="nf">gvc_speaker_test_set_stream</span> <span class="p">(</span><span class="n">GvcSpeakerTest</span> <span class="o">*</span><span class="n">test</span><span class="p">,</span> <span class="n">MateMixerStream</span> <span class="o">*</span><span class="n">stream</span><span class="p">)</span>
+<a name="line-87"></a><span class="p">{</span>
+<a name="line-88"></a> <span class="n">MateMixerStreamControl</span> <span class="o">*</span><span class="n">control</span><span class="p">;</span>
+<a name="line-89"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-90"></a> <span class="n">guint</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-91"></a>
+<a name="line-92"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">mate_mixer_stream_get_name</span> <span class="p">(</span><span class="n">stream</span><span class="p">);</span>
+<a name="line-93"></a> <span class="n">control</span> <span class="o">=</span> <span class="n">mate_mixer_stream_get_default_control</span> <span class="p">(</span><span class="n">stream</span><span class="p">);</span>
+<a name="line-94"></a>
+<a name="line-95"></a> <span class="n">ca_context_change_device</span> <span class="p">(</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">canberra</span><span class="p">,</span> <span class="n">name</span><span class="p">);</span>
+<a name="line-96"></a>
+<a name="line-97"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">G_N_ELEMENTS</span> <span class="p">(</span><span class="n">positions</span><span class="p">);</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-98"></a> <span class="n">gboolean</span> <span class="n">has_position</span> <span class="o">=</span>
+<a name="line-99"></a> <span class="n">mate_mixer_stream_control_has_channel_position</span> <span class="p">(</span><span class="n">control</span><span class="p">,</span> <span class="n">positions</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">position</span><span class="p">);</span>
+<a name="line-100"></a>
+<a name="line-101"></a> <span class="n">gtk_widget_set_visible</span> <span class="p">(</span><span class="n">g_array_index</span> <span class="p">(</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">controls</span><span class="p">,</span> <span class="n">GtkWidget</span> <span class="o">*</span><span class="p">,</span> <span class="n">i</span><span class="p">),</span>
+<a name="line-102"></a> <span class="n">has_position</span><span class="p">);</span>
+<a name="line-103"></a> <span class="p">}</span>
+<a name="line-104"></a>
+<a name="line-105"></a> <span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">stream</span> <span class="o">=</span> <span class="n">g_object_ref</span> <span class="p">(</span><span class="n">stream</span><span class="p">);</span>
+<a name="line-106"></a><span class="p">}</span>
+<a name="line-107"></a>
+<a name="line-108"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-109"></a><span class="nf">gvc_speaker_test_set_property</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">,</span>
+<a name="line-110"></a> <span class="n">guint</span> <span class="n">prop_id</span><span class="p">,</span>
+<a name="line-111"></a> <span class="k">const</span> <span class="n">GValue</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span>
+<a name="line-112"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">)</span>
+<a name="line-113"></a><span class="p">{</span>
+<a name="line-114"></a> <span class="n">GvcSpeakerTest</span> <span class="o">*</span><span class="n">self</span> <span class="o">=</span> <span class="n">GVC_SPEAKER_TEST</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-115"></a>
+<a name="line-116"></a> <span class="k">switch</span> <span class="p">(</span><span class="n">prop_id</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-117"></a> <span class="k">case</span> <span class="nl">PROP_STREAM</span><span class="p">:</span>
+<a name="line-118"></a> <span class="n">gvc_speaker_test_set_stream</span> <span class="p">(</span><span class="n">self</span><span class="p">,</span> <span class="n">g_value_get_object</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-119"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-120"></a> <span class="k">default</span><span class="o">:</span>
+<a name="line-121"></a> <span class="n">G_OBJECT_WARN_INVALID_PROPERTY_ID</span> <span class="p">(</span><span class="n">object</span><span class="p">,</span> <span class="n">prop_id</span><span class="p">,</span> <span class="n">pspec</span><span class="p">);</span>
+<a name="line-122"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-123"></a> <span class="p">}</span>
+<a name="line-124"></a><span class="p">}</span>
+<a name="line-125"></a>
+<a name="line-126"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-127"></a><span class="nf">gvc_speaker_test_get_property</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">,</span>
+<a name="line-128"></a> <span class="n">guint</span> <span class="n">prop_id</span><span class="p">,</span>
+<a name="line-129"></a> <span class="n">GValue</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span>
+<a name="line-130"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">)</span>
+<a name="line-131"></a><span class="p">{</span>
+<a name="line-132"></a> <span class="n">GvcSpeakerTest</span> <span class="o">*</span><span class="n">self</span> <span class="o">=</span> <span class="n">GVC_SPEAKER_TEST</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-133"></a>
+<a name="line-134"></a> <span class="k">switch</span> <span class="p">(</span><span class="n">prop_id</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-135"></a> <span class="k">case</span> <span class="nl">PROP_STREAM</span><span class="p">:</span>
+<a name="line-136"></a> <span class="n">g_value_set_object</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">stream</span><span class="p">);</span>
+<a name="line-137"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-138"></a> <span class="k">default</span><span class="o">:</span>
+<a name="line-139"></a> <span class="n">G_OBJECT_WARN_INVALID_PROPERTY_ID</span> <span class="p">(</span><span class="n">object</span><span class="p">,</span> <span class="n">prop_id</span><span class="p">,</span> <span class="n">pspec</span><span class="p">);</span>
+<a name="line-140"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-141"></a> <span class="p">}</span>
+<a name="line-142"></a><span class="p">}</span>
+<a name="line-143"></a>
+<a name="line-144"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-145"></a><span class="nf">gvc_speaker_test_class_init</span> <span class="p">(</span><span class="n">GvcSpeakerTestClass</span> <span class="o">*</span><span class="n">klass</span><span class="p">)</span>
+<a name="line-146"></a><span class="p">{</span>
+<a name="line-147"></a> <span class="n">GObjectClass</span> <span class="o">*</span><span class="n">object_class</span> <span class="o">=</span> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">);</span>
+<a name="line-148"></a>
+<a name="line-149"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="o">=</span> <span class="n">gvc_speaker_test_dispose</span><span class="p">;</span>
+<a name="line-150"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">finalize</span> <span class="o">=</span> <span class="n">gvc_speaker_test_finalize</span><span class="p">;</span>
+<a name="line-151"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">set_property</span> <span class="o">=</span> <span class="n">gvc_speaker_test_set_property</span><span class="p">;</span>
+<a name="line-152"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">get_property</span> <span class="o">=</span> <span class="n">gvc_speaker_test_get_property</span><span class="p">;</span>
+<a name="line-153"></a>
+<a name="line-154"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_STREAM</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-155"></a> <span class="n">g_param_spec_object</span> <span class="p">(</span><span class="s">&quot;stream&quot;</span><span class="p">,</span>
+<a name="line-156"></a> <span class="s">&quot;Stream&quot;</span><span class="p">,</span>
+<a name="line-157"></a> <span class="s">&quot;MateMixer stream&quot;</span><span class="p">,</span>
+<a name="line-158"></a> <span class="n">MATE_MIXER_TYPE_STREAM</span><span class="p">,</span>
+<a name="line-159"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-160"></a> <span class="n">G_PARAM_CONSTRUCT_ONLY</span> <span class="o">|</span>
+<a name="line-161"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-162"></a>
+<a name="line-163"></a> <span class="n">g_object_class_install_properties</span> <span class="p">(</span><span class="n">object_class</span><span class="p">,</span> <span class="n">N_PROPERTIES</span><span class="p">,</span> <span class="n">properties</span><span class="p">);</span>
+<a name="line-164"></a><span class="p">}</span>
+<a name="line-165"></a>
+<a name="line-166"></a><span class="k">static</span> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span>
+<a name="line-167"></a><span class="nf">sound_name</span> <span class="p">(</span><span class="n">MateMixerChannelPosition</span> <span class="n">position</span><span class="p">)</span>
+<a name="line-168"></a><span class="p">{</span>
+<a name="line-169"></a> <span class="k">switch</span> <span class="p">(</span><span class="n">position</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-170"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_FRONT_LEFT</span><span class="p">:</span>
+<a name="line-171"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-front-left&quot;</span><span class="p">;</span>
+<a name="line-172"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_FRONT_RIGHT</span><span class="p">:</span>
+<a name="line-173"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-front-right&quot;</span><span class="p">;</span>
+<a name="line-174"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_FRONT_CENTER</span><span class="p">:</span>
+<a name="line-175"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-front-center&quot;</span><span class="p">;</span>
+<a name="line-176"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_BACK_LEFT</span><span class="p">:</span>
+<a name="line-177"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-rear-left&quot;</span><span class="p">;</span>
+<a name="line-178"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_BACK_RIGHT</span><span class="p">:</span>
+<a name="line-179"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-rear-right&quot;</span><span class="p">;</span>
+<a name="line-180"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_BACK_CENTER</span><span class="p">:</span>
+<a name="line-181"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-rear-center&quot;</span><span class="p">;</span>
+<a name="line-182"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_LFE</span><span class="p">:</span>
+<a name="line-183"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-lfe&quot;</span><span class="p">;</span>
+<a name="line-184"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_SIDE_LEFT</span><span class="p">:</span>
+<a name="line-185"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-side-left&quot;</span><span class="p">;</span>
+<a name="line-186"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_SIDE_RIGHT</span><span class="p">:</span>
+<a name="line-187"></a> <span class="k">return</span> <span class="s">&quot;audio-channel-side-right&quot;</span><span class="p">;</span>
+<a name="line-188"></a> <span class="k">default</span><span class="o">:</span>
+<a name="line-189"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-190"></a> <span class="p">}</span>
+<a name="line-191"></a><span class="p">}</span>
+<a name="line-192"></a>
+<a name="line-193"></a><span class="k">static</span> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span>
+<a name="line-194"></a><span class="nf">icon_name</span> <span class="p">(</span><span class="n">MateMixerChannelPosition</span> <span class="n">position</span><span class="p">,</span> <span class="n">gboolean</span> <span class="n">playing</span><span class="p">)</span>
+<a name="line-195"></a><span class="p">{</span>
+<a name="line-196"></a> <span class="k">switch</span> <span class="p">(</span><span class="n">position</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-197"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_FRONT_LEFT</span><span class="p">:</span>
+<a name="line-198"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-199"></a> <span class="o">?</span> <span class="s">&quot;audio-speaker-left-testing&quot;</span>
+<a name="line-200"></a> <span class="o">:</span> <span class="s">&quot;audio-speaker-left&quot;</span><span class="p">;</span>
+<a name="line-201"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_FRONT_RIGHT</span><span class="p">:</span>
+<a name="line-202"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-203"></a> <span class="o">?</span> <span class="s">&quot;audio-speaker-right-testing&quot;</span>
+<a name="line-204"></a> <span class="o">:</span> <span class="s">&quot;audio-speaker-right&quot;</span><span class="p">;</span>
+<a name="line-205"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_FRONT_CENTER</span><span class="p">:</span>
+<a name="line-206"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-207"></a> <span class="o">?</span> <span class="s">&quot;audio-speaker-center-testing&quot;</span>
+<a name="line-208"></a> <span class="o">:</span> <span class="s">&quot;audio-speaker-center&quot;</span><span class="p">;</span>
+<a name="line-209"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_BACK_LEFT</span><span class="p">:</span>
+<a name="line-210"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-211"></a> <span class="o">?</span> <span class="s">&quot;audio-speaker-left-back-testing&quot;</span>
+<a name="line-212"></a> <span class="o">:</span> <span class="s">&quot;audio-speaker-left-back&quot;</span><span class="p">;</span>
+<a name="line-213"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_BACK_RIGHT</span><span class="p">:</span>
+<a name="line-214"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-215"></a> <span class="o">?</span> <span class="s">&quot;audio-speaker-right-back-testing&quot;</span>
+<a name="line-216"></a> <span class="o">:</span> <span class="s">&quot;audio-speaker-right-back&quot;</span><span class="p">;</span>
+<a name="line-217"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_BACK_CENTER</span><span class="p">:</span>
+<a name="line-218"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-219"></a> <span class="o">?</span> <span class="s">&quot;audio-speaker-center-back-testing&quot;</span>
+<a name="line-220"></a> <span class="o">:</span> <span class="s">&quot;audio-speaker-center-back&quot;</span><span class="p">;</span>
+<a name="line-221"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_LFE</span><span class="p">:</span>
+<a name="line-222"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-223"></a> <span class="o">?</span> <span class="s">&quot;audio-subwoofer-testing&quot;</span>
+<a name="line-224"></a> <span class="o">:</span> <span class="s">&quot;audio-subwoofer&quot;</span><span class="p">;</span>
+<a name="line-225"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_SIDE_LEFT</span><span class="p">:</span>
+<a name="line-226"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-227"></a> <span class="o">?</span> <span class="s">&quot;audio-speaker-left-side-testing&quot;</span>
+<a name="line-228"></a> <span class="o">:</span> <span class="s">&quot;audio-speaker-left-side&quot;</span><span class="p">;</span>
+<a name="line-229"></a> <span class="k">case</span> <span class="nl">MATE_MIXER_CHANNEL_SIDE_RIGHT</span><span class="p">:</span>
+<a name="line-230"></a> <span class="k">return</span> <span class="n">playing</span>
+<a name="line-231"></a> <span class="o">?</span> <span class="s">&quot;audio-speaker-right-side-testing&quot;</span>
+<a name="line-232"></a> <span class="o">:</span> <span class="s">&quot;audio-speaker-right-side&quot;</span><span class="p">;</span>
+<a name="line-233"></a> <span class="k">default</span><span class="o">:</span>
+<a name="line-234"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-235"></a> <span class="p">}</span>
+<a name="line-236"></a><span class="p">}</span>
+<a name="line-237"></a>
+<a name="line-238"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-239"></a><span class="nf">update_button</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">control</span><span class="p">)</span>
+<a name="line-240"></a><span class="p">{</span>
+<a name="line-241"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">button</span><span class="p">;</span>
+<a name="line-242"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">image</span><span class="p">;</span>
+<a name="line-243"></a> <span class="n">gboolean</span> <span class="n">playing</span><span class="p">;</span>
+<a name="line-244"></a> <span class="n">MateMixerChannelPosition</span> <span class="n">position</span><span class="p">;</span>
+<a name="line-245"></a>
+<a name="line-246"></a> <span class="n">button</span> <span class="o">=</span> <span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;button&quot;</span><span class="p">);</span>
+<a name="line-247"></a> <span class="n">image</span> <span class="o">=</span> <span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;image&quot;</span><span class="p">);</span>
+<a name="line-248"></a>
+<a name="line-249"></a> <span class="n">position</span> <span class="o">=</span> <span class="n">GPOINTER_TO_INT</span> <span class="p">(</span><span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;position&quot;</span><span class="p">));</span>
+<a name="line-250"></a> <span class="n">playing</span> <span class="o">=</span> <span class="n">GPOINTER_TO_INT</span> <span class="p">(</span><span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;playing&quot;</span><span class="p">));</span>
+<a name="line-251"></a>
+<a name="line-252"></a> <span class="n">gtk_button_set_label</span> <span class="p">(</span><span class="n">GTK_BUTTON</span> <span class="p">(</span><span class="n">button</span><span class="p">),</span> <span class="n">playing</span> <span class="o">?</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Stop&quot;</span><span class="p">)</span> <span class="o">:</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Test&quot;</span><span class="p">));</span>
+<a name="line-253"></a>
+<a name="line-254"></a> <span class="n">gtk_image_set_from_icon_name</span> <span class="p">(</span><span class="n">GTK_IMAGE</span> <span class="p">(</span><span class="n">image</span><span class="p">),</span>
+<a name="line-255"></a> <span class="n">icon_name</span> <span class="p">(</span><span class="n">position</span><span class="p">,</span> <span class="n">playing</span><span class="p">),</span>
+<a name="line-256"></a> <span class="n">GTK_ICON_SIZE_DIALOG</span><span class="p">);</span>
+<a name="line-257"></a><span class="p">}</span>
+<a name="line-258"></a>
+<a name="line-259"></a><span class="k">static</span> <span class="n">gboolean</span>
+<a name="line-260"></a><span class="nf">idle_cb</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">control</span><span class="p">)</span>
+<a name="line-261"></a><span class="p">{</span>
+<a name="line-262"></a> <span class="k">if</span> <span class="p">(</span><span class="n">control</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-263"></a> <span class="cm">/* This is called in the background thread, hence forward to main thread</span>
+<a name="line-264"></a><span class="cm"> * via idle callback */</span>
+<a name="line-265"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;playing&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="n">FALSE</span><span class="p">));</span>
+<a name="line-266"></a>
+<a name="line-267"></a> <span class="n">update_button</span> <span class="p">(</span><span class="n">control</span><span class="p">);</span>
+<a name="line-268"></a> <span class="p">}</span>
+<a name="line-269"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-270"></a><span class="p">}</span>
+<a name="line-271"></a>
+<a name="line-272"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-273"></a><span class="nf">finish_cb</span> <span class="p">(</span><span class="n">ca_context</span> <span class="o">*</span><span class="n">c</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">id</span><span class="p">,</span> <span class="kt">int</span> <span class="n">error_code</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">userdata</span><span class="p">)</span>
+<a name="line-274"></a><span class="p">{</span>
+<a name="line-275"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">control</span> <span class="o">=</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="p">)</span> <span class="n">userdata</span><span class="p">;</span>
+<a name="line-276"></a>
+<a name="line-277"></a> <span class="k">if</span> <span class="p">(</span><span class="n">error_code</span> <span class="o">==</span> <span class="n">CA_ERROR_DESTROYED</span> <span class="o">||</span> <span class="n">control</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-278"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-279"></a>
+<a name="line-280"></a> <span class="n">g_idle_add</span> <span class="p">((</span><span class="n">GSourceFunc</span><span class="p">)</span> <span class="n">idle_cb</span><span class="p">,</span> <span class="n">control</span><span class="p">);</span>
+<a name="line-281"></a><span class="p">}</span>
+<a name="line-282"></a>
+<a name="line-283"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-284"></a><span class="nf">on_test_button_clicked</span> <span class="p">(</span><span class="n">GtkButton</span> <span class="o">*</span><span class="n">button</span><span class="p">,</span> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">control</span><span class="p">)</span>
+<a name="line-285"></a><span class="p">{</span>
+<a name="line-286"></a> <span class="n">gboolean</span> <span class="n">playing</span><span class="p">;</span>
+<a name="line-287"></a> <span class="n">ca_context</span> <span class="o">*</span><span class="n">canberra</span><span class="p">;</span>
+<a name="line-288"></a>
+<a name="line-289"></a> <span class="n">canberra</span> <span class="o">=</span> <span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;canberra&quot;</span><span class="p">);</span>
+<a name="line-290"></a>
+<a name="line-291"></a> <span class="n">ca_context_cancel</span> <span class="p">(</span><span class="n">canberra</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
+<a name="line-292"></a>
+<a name="line-293"></a> <span class="n">playing</span> <span class="o">=</span> <span class="n">GPOINTER_TO_INT</span> <span class="p">(</span><span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;playing&quot;</span><span class="p">));</span>
+<a name="line-294"></a>
+<a name="line-295"></a> <span class="k">if</span> <span class="p">(</span><span class="n">playing</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-296"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;playing&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="n">FALSE</span><span class="p">));</span>
+<a name="line-297"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-298"></a> <span class="n">MateMixerChannelPosition</span> <span class="n">position</span><span class="p">;</span>
+<a name="line-299"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-300"></a> <span class="n">ca_proplist</span> <span class="o">*</span><span class="n">proplist</span><span class="p">;</span>
+<a name="line-301"></a>
+<a name="line-302"></a> <span class="n">position</span> <span class="o">=</span> <span class="n">GPOINTER_TO_INT</span> <span class="p">(</span><span class="n">g_object_get_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;position&quot;</span><span class="p">));</span>
+<a name="line-303"></a>
+<a name="line-304"></a> <span class="n">ca_proplist_create</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">proplist</span><span class="p">);</span>
+<a name="line-305"></a> <span class="n">ca_proplist_sets</span> <span class="p">(</span><span class="n">proplist</span><span class="p">,</span>
+<a name="line-306"></a> <span class="n">CA_PROP_MEDIA_ROLE</span><span class="p">,</span> <span class="s">&quot;test&quot;</span><span class="p">);</span>
+<a name="line-307"></a> <span class="n">ca_proplist_sets</span> <span class="p">(</span><span class="n">proplist</span><span class="p">,</span>
+<a name="line-308"></a> <span class="n">CA_PROP_MEDIA_NAME</span><span class="p">,</span>
+<a name="line-309"></a> <span class="n">gvc_channel_position_to_pretty_string</span> <span class="p">(</span><span class="n">position</span><span class="p">));</span>
+<a name="line-310"></a> <span class="n">ca_proplist_sets</span> <span class="p">(</span><span class="n">proplist</span><span class="p">,</span>
+<a name="line-311"></a> <span class="n">CA_PROP_CANBERRA_FORCE_CHANNEL</span><span class="p">,</span>
+<a name="line-312"></a> <span class="n">gvc_channel_position_to_pulse_string</span> <span class="p">(</span><span class="n">position</span><span class="p">));</span>
+<a name="line-313"></a>
+<a name="line-314"></a> <span class="n">ca_proplist_sets</span> <span class="p">(</span><span class="n">proplist</span><span class="p">,</span> <span class="n">CA_PROP_CANBERRA_ENABLE</span><span class="p">,</span> <span class="s">&quot;1&quot;</span><span class="p">);</span>
+<a name="line-315"></a>
+<a name="line-316"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">sound_name</span> <span class="p">(</span><span class="n">position</span><span class="p">);</span>
+<a name="line-317"></a> <span class="k">if</span> <span class="p">(</span><span class="n">name</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-318"></a> <span class="n">ca_proplist_sets</span> <span class="p">(</span><span class="n">proplist</span><span class="p">,</span> <span class="n">CA_PROP_EVENT_ID</span><span class="p">,</span> <span class="n">name</span><span class="p">);</span>
+<a name="line-319"></a> <span class="n">playing</span> <span class="o">=</span> <span class="n">ca_context_play_full</span> <span class="p">(</span><span class="n">canberra</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">proplist</span><span class="p">,</span> <span class="n">finish_cb</span><span class="p">,</span> <span class="n">control</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-320"></a> <span class="p">}</span>
+<a name="line-321"></a>
+<a name="line-322"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">playing</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-323"></a> <span class="n">ca_proplist_sets</span> <span class="p">(</span><span class="n">proplist</span><span class="p">,</span> <span class="n">CA_PROP_EVENT_ID</span><span class="p">,</span> <span class="s">&quot;audio-test-signal&quot;</span><span class="p">);</span>
+<a name="line-324"></a> <span class="n">playing</span> <span class="o">=</span> <span class="n">ca_context_play_full</span> <span class="p">(</span><span class="n">canberra</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">proplist</span><span class="p">,</span> <span class="n">finish_cb</span><span class="p">,</span> <span class="n">control</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-325"></a> <span class="p">}</span>
+<a name="line-326"></a>
+<a name="line-327"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">playing</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-328"></a> <span class="n">ca_proplist_sets</span><span class="p">(</span><span class="n">proplist</span><span class="p">,</span> <span class="n">CA_PROP_EVENT_ID</span><span class="p">,</span> <span class="s">&quot;bell-window-system&quot;</span><span class="p">);</span>
+<a name="line-329"></a> <span class="n">playing</span> <span class="o">=</span> <span class="n">ca_context_play_full</span> <span class="p">(</span><span class="n">canberra</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">proplist</span><span class="p">,</span> <span class="n">finish_cb</span><span class="p">,</span> <span class="n">control</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-330"></a> <span class="p">}</span>
+<a name="line-331"></a>
+<a name="line-332"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;playing&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="n">playing</span><span class="p">));</span>
+<a name="line-333"></a> <span class="p">}</span>
+<a name="line-334"></a>
+<a name="line-335"></a> <span class="n">update_button</span> <span class="p">(</span><span class="n">control</span><span class="p">);</span>
+<a name="line-336"></a><span class="p">}</span>
+<a name="line-337"></a>
+<a name="line-338"></a><span class="k">static</span> <span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-339"></a><span class="nf">create_control</span> <span class="p">(</span><span class="n">ca_context</span> <span class="o">*</span><span class="n">canberra</span><span class="p">,</span> <span class="n">MateMixerChannelPosition</span> <span class="n">position</span><span class="p">)</span>
+<a name="line-340"></a><span class="p">{</span>
+<a name="line-341"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">control</span><span class="p">;</span>
+<a name="line-342"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">box</span><span class="p">;</span>
+<a name="line-343"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">label</span><span class="p">;</span>
+<a name="line-344"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">image</span><span class="p">;</span>
+<a name="line-345"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">test_button</span><span class="p">;</span>
+<a name="line-346"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-347"></a>
+<a name="line-348"></a> <span class="n">control</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_VERTICAL</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-349"></a> <span class="n">box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-350"></a>
+<a name="line-351"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;playing&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="n">FALSE</span><span class="p">));</span>
+<a name="line-352"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;position&quot;</span><span class="p">,</span> <span class="n">GINT_TO_POINTER</span> <span class="p">(</span><span class="n">position</span><span class="p">));</span>
+<a name="line-353"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;canberra&quot;</span><span class="p">,</span> <span class="n">canberra</span><span class="p">);</span>
+<a name="line-354"></a>
+<a name="line-355"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">icon_name</span> <span class="p">(</span><span class="n">position</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-356"></a> <span class="k">if</span> <span class="p">(</span><span class="n">name</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-357"></a> <span class="n">name</span> <span class="o">=</span> <span class="s">&quot;audio-volume-medium&quot;</span><span class="p">;</span>
+<a name="line-358"></a>
+<a name="line-359"></a> <span class="n">image</span> <span class="o">=</span> <span class="n">gtk_image_new_from_icon_name</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">GTK_ICON_SIZE_DIALOG</span><span class="p">);</span>
+<a name="line-360"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;image&quot;</span><span class="p">,</span> <span class="n">image</span><span class="p">);</span>
+<a name="line-361"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="n">image</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-362"></a>
+<a name="line-363"></a> <span class="n">label</span> <span class="o">=</span> <span class="n">gtk_label_new</span> <span class="p">(</span><span class="n">gvc_channel_position_to_pretty_string</span> <span class="p">(</span><span class="n">position</span><span class="p">));</span>
+<a name="line-364"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="n">label</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-365"></a>
+<a name="line-366"></a> <span class="n">test_button</span> <span class="o">=</span> <span class="n">gtk_button_new_with_label</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Test&quot;</span><span class="p">));</span>
+<a name="line-367"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">test_button</span><span class="p">),</span>
+<a name="line-368"></a> <span class="s">&quot;clicked&quot;</span><span class="p">,</span>
+<a name="line-369"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_test_button_clicked</span><span class="p">),</span>
+<a name="line-370"></a> <span class="n">control</span><span class="p">);</span>
+<a name="line-371"></a>
+<a name="line-372"></a> <span class="n">g_object_set_data</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="s">&quot;button&quot;</span><span class="p">,</span> <span class="n">test_button</span><span class="p">);</span>
+<a name="line-373"></a>
+<a name="line-374"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">box</span><span class="p">),</span> <span class="n">test_button</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-375"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">control</span><span class="p">),</span> <span class="n">box</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-376"></a>
+<a name="line-377"></a> <span class="n">gtk_widget_show_all</span> <span class="p">(</span><span class="n">control</span><span class="p">);</span>
+<a name="line-378"></a>
+<a name="line-379"></a> <span class="k">return</span> <span class="n">control</span><span class="p">;</span>
+<a name="line-380"></a><span class="p">}</span>
+<a name="line-381"></a>
+<a name="line-382"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-383"></a><span class="nf">create_controls</span> <span class="p">(</span><span class="n">GvcSpeakerTest</span> <span class="o">*</span><span class="n">test</span><span class="p">)</span>
+<a name="line-384"></a><span class="p">{</span>
+<a name="line-385"></a> <span class="n">guint</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-386"></a>
+<a name="line-387"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">G_N_ELEMENTS</span> <span class="p">(</span><span class="n">positions</span><span class="p">);</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-388"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">control</span> <span class="o">=</span> <span class="n">create_control</span> <span class="p">(</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">canberra</span><span class="p">,</span> <span class="n">positions</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">position</span><span class="p">);</span>
+<a name="line-389"></a>
+<a name="line-390"></a> <span class="n">gtk_grid_attach</span> <span class="p">(</span><span class="n">GTK_GRID</span> <span class="p">(</span><span class="n">test</span><span class="p">),</span>
+<a name="line-391"></a> <span class="n">control</span><span class="p">,</span>
+<a name="line-392"></a> <span class="n">positions</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">left</span><span class="p">,</span>
+<a name="line-393"></a> <span class="n">positions</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">top</span><span class="p">,</span>
+<a name="line-394"></a> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
+<a name="line-395"></a> <span class="n">g_array_insert_val</span> <span class="p">(</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">controls</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span> <span class="n">control</span><span class="p">);</span>
+<a name="line-396"></a> <span class="p">}</span>
+<a name="line-397"></a><span class="p">}</span>
+<a name="line-398"></a>
+<a name="line-399"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-400"></a><span class="nf">gvc_speaker_test_init</span> <span class="p">(</span><span class="n">GvcSpeakerTest</span> <span class="o">*</span><span class="n">test</span><span class="p">)</span>
+<a name="line-401"></a><span class="p">{</span>
+<a name="line-402"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">face</span><span class="p">;</span>
+<a name="line-403"></a>
+<a name="line-404"></a> <span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span> <span class="o">=</span> <span class="n">gvc_speaker_test_get_instance_private</span> <span class="p">(</span><span class="n">test</span><span class="p">);</span>
+<a name="line-405"></a>
+<a name="line-406"></a> <span class="n">gtk_container_set_border_width</span> <span class="p">(</span><span class="n">GTK_CONTAINER</span> <span class="p">(</span><span class="n">test</span><span class="p">),</span> <span class="mi">12</span><span class="p">);</span>
+<a name="line-407"></a>
+<a name="line-408"></a> <span class="n">face</span> <span class="o">=</span> <span class="n">gtk_image_new_from_icon_name</span> <span class="p">(</span><span class="s">&quot;face-smile&quot;</span><span class="p">,</span> <span class="n">GTK_ICON_SIZE_DIALOG</span><span class="p">);</span>
+<a name="line-409"></a>
+<a name="line-410"></a> <span class="n">gtk_grid_attach</span> <span class="p">(</span><span class="n">GTK_GRID</span> <span class="p">(</span><span class="n">test</span><span class="p">),</span>
+<a name="line-411"></a> <span class="n">face</span><span class="p">,</span>
+<a name="line-412"></a> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span>
+<a name="line-413"></a> <span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
+<a name="line-414"></a>
+<a name="line-415"></a>
+<a name="line-416"></a> <span class="n">gtk_grid_set_baseline_row</span> <span class="p">(</span><span class="n">GTK_GRID</span> <span class="p">(</span><span class="n">test</span><span class="p">),</span> <span class="mi">1</span><span class="p">);</span>
+<a name="line-417"></a> <span class="n">gtk_widget_show</span> <span class="p">(</span><span class="n">face</span><span class="p">);</span>
+<a name="line-418"></a>
+<a name="line-419"></a> <span class="n">ca_context_create</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">canberra</span><span class="p">);</span>
+<a name="line-420"></a>
+<a name="line-421"></a> <span class="cm">/* The test sounds are played for a single channel, set up using the</span>
+<a name="line-422"></a><span class="cm"> * FORCE_CHANNEL property of libcanberra; this property is only supported</span>
+<a name="line-423"></a><span class="cm"> * in the PulseAudio backend, so avoid other backends completely */</span>
+<a name="line-424"></a> <span class="n">ca_context_set_driver</span> <span class="p">(</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">canberra</span><span class="p">,</span> <span class="s">&quot;pulse&quot;</span><span class="p">);</span>
+<a name="line-425"></a>
+<a name="line-426"></a> <span class="n">ca_context_change_props</span> <span class="p">(</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">canberra</span><span class="p">,</span>
+<a name="line-427"></a> <span class="n">CA_PROP_APPLICATION_ID</span><span class="p">,</span> <span class="s">&quot;org.mate.VolumeControl&quot;</span><span class="p">,</span>
+<a name="line-428"></a> <span class="n">CA_PROP_APPLICATION_NAME</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Volume Control&quot;</span><span class="p">),</span>
+<a name="line-429"></a> <span class="n">CA_PROP_APPLICATION_VERSION</span><span class="p">,</span> <span class="n">VERSION</span><span class="p">,</span>
+<a name="line-430"></a> <span class="n">CA_PROP_APPLICATION_ICON_NAME</span><span class="p">,</span> <span class="s">&quot;multimedia-volume-control&quot;</span><span class="p">,</span>
+<a name="line-431"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-432"></a>
+<a name="line-433"></a> <span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">controls</span> <span class="o">=</span> <span class="n">g_array_new</span> <span class="p">(</span><span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="k">sizeof</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="p">));</span>
+<a name="line-434"></a>
+<a name="line-435"></a> <span class="n">create_controls</span> <span class="p">(</span><span class="n">test</span><span class="p">);</span>
+<a name="line-436"></a><span class="p">}</span>
+<a name="line-437"></a>
+<a name="line-438"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-439"></a><span class="nf">gvc_speaker_test_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">)</span>
+<a name="line-440"></a><span class="p">{</span>
+<a name="line-441"></a> <span class="n">GvcSpeakerTest</span> <span class="o">*</span><span class="n">test</span><span class="p">;</span>
+<a name="line-442"></a>
+<a name="line-443"></a> <span class="n">test</span> <span class="o">=</span> <span class="n">GVC_SPEAKER_TEST</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-444"></a>
+<a name="line-445"></a> <span class="n">g_clear_object</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">stream</span><span class="p">);</span>
+<a name="line-446"></a>
+<a name="line-447"></a> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">gvc_speaker_test_parent_class</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-448"></a><span class="p">}</span>
+<a name="line-449"></a>
+<a name="line-450"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-451"></a><span class="nf">gvc_speaker_test_finalize</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">)</span>
+<a name="line-452"></a><span class="p">{</span>
+<a name="line-453"></a> <span class="n">GvcSpeakerTest</span> <span class="o">*</span><span class="n">test</span><span class="p">;</span>
+<a name="line-454"></a>
+<a name="line-455"></a> <span class="n">test</span> <span class="o">=</span> <span class="n">GVC_SPEAKER_TEST</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-456"></a>
+<a name="line-457"></a> <span class="n">ca_context_destroy</span> <span class="p">(</span><span class="n">test</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">canberra</span><span class="p">);</span>
+<a name="line-458"></a>
+<a name="line-459"></a> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">gvc_speaker_test_parent_class</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">finalize</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-460"></a><span class="p">}</span>
+<a name="line-461"></a>
+<a name="line-462"></a><span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-463"></a><span class="nf">gvc_speaker_test_new</span> <span class="p">(</span><span class="n">MateMixerStream</span> <span class="o">*</span><span class="n">stream</span><span class="p">)</span>
+<a name="line-464"></a><span class="p">{</span>
+<a name="line-465"></a> <span class="n">GObject</span> <span class="o">*</span><span class="n">test</span><span class="p">;</span>
+<a name="line-466"></a>
+<a name="line-467"></a> <span class="n">g_return_val_if_fail</span> <span class="p">(</span><span class="n">MATE_MIXER_IS_STREAM</span> <span class="p">(</span><span class="n">stream</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-468"></a>
+<a name="line-469"></a> <span class="n">test</span> <span class="o">=</span> <span class="n">g_object_new</span> <span class="p">(</span><span class="n">GVC_TYPE_SPEAKER_TEST</span><span class="p">,</span>
+<a name="line-470"></a> <span class="s">&quot;row-spacing&quot;</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span>
+<a name="line-471"></a> <span class="s">&quot;column-spacing&quot;</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span>
+<a name="line-472"></a> <span class="s">&quot;row-homogeneous&quot;</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span>
+<a name="line-473"></a> <span class="s">&quot;column-homogeneous&quot;</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span>
+<a name="line-474"></a> <span class="s">&quot;stream&quot;</span><span class="p">,</span> <span class="n">stream</span><span class="p">,</span>
+<a name="line-475"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-476"></a>
+<a name="line-477"></a> <span class="k">return</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">test</span><span class="p">);</span>
+<a name="line-478"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck 1.90 - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/[email protected]_master/index.html b/[email protected]_master/index.html
new file mode 100644
index 0000000..59baeb0
--- /dev/null
+++ b/[email protected]_master/index.html
@@ -0,0 +1,108 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-media</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ function toggle_all(){
+ var elts = document.getElementsByTagName("input");
+ for (var i = 1; i < elts.length; i++) {
+ var el = elts[i];
+ el.checked ? el.checked=false : el.checked=true;
+ toggle_class_visibility(el.id);
+ }
+ }
+
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - mate-media: </h1>
+ </div>
+ <div id="menu_index">
+ <p id="filename"><a href="index.html">Defect summary;</a> </p>
+
+ <label><input type="checkbox" onclick="toggle_all()" checked> Toggle all</label>
+ <table>
+ <tr><th>Show</th><th>#</th><th>Defect ID</th></tr>
+ <tr><td><input type='checkbox' onclick='toggle_class_visibility(this.id)' id='ConfigurationNotChecked' name='ConfigurationNotChecked' checked></td><td>3</td><td>ConfigurationNotChecked</td></tr>
+ <tr><td><input type='checkbox' onclick='toggle_class_visibility(this.id)' id='unknownMacro' name='unknownMacro' checked></td><td>2</td><td>unknownMacro</td></tr>
+ <tr><td><input type='checkbox' onclick='toggle_class_visibility(this.id)' id='missingInclude' name='missingInclude' checked></td><td>1</td><td>missingInclude</td></tr>
+ <tr><td></td><td>6</td><td>total</td></tr>
+ </table>
+ <p><a href="stats.html">Statistics</a></p>
+ </div>
+ <div id="content_index">
+
+ <table>
+ <tr><th>Line</th><th>Id</th><th>CWE</th><th>Severity</th><th>Message</th></tr>
+ <tr><td colspan='5'><a href='3.html'></a></td></tr>
+ <tr class="missingInclude"><td></td><td>missingInclude</td><td></td><td>information</td><td>Cppcheck cannot find all the include files (use --check-config for details)</td></tr>
+ <tr><td colspan='5'><a href='0.html'>mate-volume-control/gvc-combo-box.c</a></td></tr>
+ <tr class="unknownMacro"><td><a href="0.html#line-70">70</a></td><td>unknownMacro</td><td></td><td>error</td><td class="error">There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.</td></tr>
+ <tr><td colspan='5'><a href='1.html'>mate-volume-control/gvc-sound-theme-chooser.c</a></td></tr>
+ <tr class="ConfigurationNotChecked"><td><a href="1.html#line-735">735</a></td><td>ConfigurationNotChecked</td><td></td><td>information</td><td >Skipping configuration &apos;CA_PROP_CANBERRA_ENABLE&apos; since the value of &apos;CA_PROP_CANBERRA_ENABLE&apos; is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</td></tr>
+ <tr class="ConfigurationNotChecked"><td><a href="1.html#line-746">746</a></td><td>ConfigurationNotChecked</td><td></td><td>information</td><td >Skipping configuration &apos;CA_PROP_CANBERRA_ENABLE&apos; since the value of &apos;CA_PROP_CANBERRA_ENABLE&apos; is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</td></tr>
+ <tr class="ConfigurationNotChecked"><td><a href="1.html#line-758">758</a></td><td>ConfigurationNotChecked</td><td></td><td>information</td><td >Skipping configuration &apos;CA_PROP_CANBERRA_ENABLE&apos; since the value of &apos;CA_PROP_CANBERRA_ENABLE&apos; is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</td></tr>
+ <tr><td colspan='5'><a href='2.html'>mate-volume-control/gvc-speaker-test.c</a></td></tr>
+ <tr class="unknownMacro"><td><a href="2.html#line-53">53</a></td><td>unknownMacro</td><td></td><td>error</td><td class="error">There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.</td></tr>
+ </table>
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck 1.90 - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/[email protected]_master/stats.html b/[email protected]_master/stats.html
new file mode 100644
index 0000000..3fb6add
--- /dev/null
+++ b/[email protected]_master/stats.html
@@ -0,0 +1,93 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-media</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ function toggle_all(){
+ var elts = document.getElementsByTagName("input");
+ for (var i = 1; i < elts.length; i++) {
+ var el = elts[i];
+ el.checked ? el.checked=false : el.checked=true;
+ toggle_class_visibility(el.id);
+ }
+ }
+
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - mate-media: Statistics </h1>
+ </div>
+ <div id="menu_index">
+ <p id="filename"><a href="index.html">Back to summary</a> </p>
+
+ </div>
+ <div id="content_index">
+<p>Top 10 files for error severity, total findings: 2</br>
+&#160;&#160;&#160;1&#160;<a href="2.html"> mate-volume-control/gvc-speaker-test.c</a></br>
+&#160;&#160;&#160;1&#160;<a href="0.html"> mate-volume-control/gvc-combo-box.c</a></br>
+</p>
+<p>Top 10 files for information severity, total findings: 3</br>
+&#160;&#160;&#160;3&#160;<a href="1.html"> mate-volume-control/gvc-sound-theme-chooser.c</a></br>
+</p>
+
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck 1.90 - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/[email protected]_master/style.css b/[email protected]_master/style.css
new file mode 100644
index 0000000..c39571c
--- /dev/null
+++ b/[email protected]_master/style.css
@@ -0,0 +1,149 @@
+
+body {
+ font: 13px Arial, Verdana, Sans-Serif;
+ margin: 0;
+ width: auto;
+}
+
+h1 {
+ margin: 10px;
+}
+
+#footer > p {
+ margin: 4px;
+}
+
+.error {
+ background-color: #ffb7b7;
+}
+
+.error2 {
+ background-color: #faa;
+ border: 1px dotted black;
+ display: inline-block;
+ margin-left: 4px;
+}
+
+.inconclusive {
+ background-color: #B6B6B4;
+}
+
+.inconclusive2 {
+ background-color: #B6B6B4;
+ border: 1px dotted black;
+ display: inline-block;
+ margin-left: 4px;
+}
+
+div.verbose {
+ display: inline-block;
+ vertical-align: top;
+ cursor: help;
+}
+
+div.verbose div.content {
+ display: none;
+ position: absolute;
+ padding: 10px;
+ margin: 4px;
+ max-width: 40%;
+ white-space: pre-wrap;
+ border: 1px solid black;
+ background-color: #FFFFCC;
+ cursor: auto;
+}
+
+.highlight .hll {
+ padding: 1px;
+}
+
+#header {
+ border-bottom: thin solid #aaa;
+}
+
+#menu {
+ float: left;
+ margin-top: 5px;
+ text-align: left;
+ width: 150px;
+ /*height: 75%;*/
+ position: fixed;
+ overflow: auto;
+ z-index: 1;
+}
+
+#menu_index {
+ float: left;
+ margin-top: 5px;
+ padding-left: 5px;
+ text-align: left;
+ width: 300px;
+ /*height: 75%;*/
+ position: fixed;
+ overflow: auto;
+ z-index: 1;
+}
+
+#menu > a {
+ display: block;
+ margin-left: 10px;
+ font: 12px;
+ z-index: 1;
+}
+
+#filename {
+ margin-left: 10px;
+ font: 12px;
+ z-index: 1;
+}
+
+.highlighttable {
+ background-color:white;
+ z-index: 10;
+ position: relative;
+ margin: -10 px;
+}
+
+#content {
+ background-color: white;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ float: left;
+ margin: 5px;
+ margin-left: 10px;
+ padding: 0 10px 10px 10px;
+ width: 80%;
+ padding-left: 150px;
+}
+
+#content_index {
+ background-color: white;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ float: left;
+ margin: 5px;
+ margin-left: 10px;
+ padding: 0 10px 10px 10px;
+ width: 80%;
+ padding-left: 300px;
+}
+
+.linenos {
+ border-right: thin solid #aaa;
+ color: lightgray;
+ padding-right: 6px;
+}
+
+#footer {
+ border-top: thin solid #aaa;
+ clear: both;
+ font-size: 90%;
+ margin-top: 5px;
+}
+
+#footer ul {
+ list-style-type: none;
+ padding-left: 0;
+}
diff --git a/[email protected]_enum-conversion/0.html b/[email protected]_enum-conversion/0.html
new file mode 100644
index 0000000..e262ed0
--- /dev/null
+++ b/[email protected]_enum-conversion/0.html
@@ -0,0 +1,1038 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-media</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ function toggle_all(){
+ var elts = document.getElementsByTagName("input");
+ for (var i = 1; i < elts.length; i++) {
+ var el = elts[i];
+ el.checked ? el.checked=false : el.checked=true;
+ toggle_class_visibility(el.id);
+ }
+ }
+
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - mate-media: mate-volume-control/gvc-combo-box.c </h1>
+ </div>
+ <div id="menu" dir="rtl">
+ <p id="filename"><a href="index.html">Defects:</a> gvc-combo-box.c</p>
+<a href='0.html#line-70'> unknownMacro 70</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 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</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span>
+<a name="line-2"></a><span class="cm"> *</span>
+<a name="line-3"></a><span class="cm"> * Copyright (C) 2009 Bastien Nocera</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2014 Michal Ratajsky &lt;[email protected]&gt;</span>
+<a name="line-5"></a><span class="cm"> *</span>
+<a name="line-6"></a><span class="cm"> * This program is free software; you can redistribute it and/or modify</span>
+<a name="line-7"></a><span class="cm"> * it under the terms of the GNU General Public License as published by</span>
+<a name="line-8"></a><span class="cm"> * the Free Software Foundation; either version 2 of the License, or</span>
+<a name="line-9"></a><span class="cm"> * (at your option) any later version.</span>
+<a name="line-10"></a><span class="cm"> *</span>
+<a name="line-11"></a><span class="cm"> * This program is distributed in the hope that it will be useful,</span>
+<a name="line-12"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-13"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
+<a name="line-14"></a><span class="cm"> * GNU General Public License for more details.</span>
+<a name="line-15"></a><span class="cm"> *</span>
+<a name="line-16"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-17"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-18"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-19"></a><span class="cm"> *</span>
+<a name="line-20"></a><span class="cm"> */</span>
+<a name="line-21"></a>
+<a name="line-22"></a><span class="cp">#include</span> <span class="cpf">&lt;glib.h&gt;</span><span class="cp"></span>
+<a name="line-23"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-24"></a><span class="cp">#include</span> <span class="cpf">&lt;glib-object.h&gt;</span><span class="cp"></span>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-26"></a>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;libmatemixer/matemixer.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a>
+<a name="line-29"></a><span class="cp">#include</span> <span class="cpf">&quot;gvc-combo-box.h&quot;</span><span class="cp"></span>
+<a name="line-30"></a>
+<a name="line-31"></a><span class="k">struct</span> <span class="n">_GvcComboBoxPrivate</span>
+<a name="line-32"></a><span class="p">{</span>
+<a name="line-33"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">drop_box</span><span class="p">;</span>
+<a name="line-34"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">start_box</span><span class="p">;</span>
+<a name="line-35"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">end_box</span><span class="p">;</span>
+<a name="line-36"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">label</span><span class="p">;</span>
+<a name="line-37"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">button</span><span class="p">;</span>
+<a name="line-38"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-39"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">combobox</span><span class="p">;</span>
+<a name="line-40"></a> <span class="n">MateMixerSwitch</span> <span class="o">*</span><span class="n">swtch</span><span class="p">;</span>
+<a name="line-41"></a><span class="p">};</span>
+<a name="line-42"></a>
+<a name="line-43"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-44"></a> <span class="n">COL_NAME</span><span class="p">,</span>
+<a name="line-45"></a> <span class="n">COL_HUMAN_NAME</span><span class="p">,</span>
+<a name="line-46"></a> <span class="n">NUM_COLS</span>
+<a name="line-47"></a><span class="p">};</span>
+<a name="line-48"></a>
+<a name="line-49"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-50"></a> <span class="n">CHANGING</span><span class="p">,</span>
+<a name="line-51"></a> <span class="n">BUTTON_CLICKED</span><span class="p">,</span>
+<a name="line-52"></a> <span class="n">LAST_SIGNAL</span>
+<a name="line-53"></a><span class="p">};</span>
+<a name="line-54"></a>
+<a name="line-55"></a><span class="k">static</span> <span class="n">guint</span> <span class="n">signals</span><span class="p">[</span><span class="n">LAST_SIGNAL</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> <span class="mi">0</span><span class="p">,</span> <span class="p">};</span>
+<a name="line-56"></a>
+<a name="line-57"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-58"></a> <span class="n">PROP_0</span><span class="p">,</span>
+<a name="line-59"></a> <span class="n">PROP_SWITCH</span><span class="p">,</span>
+<a name="line-60"></a> <span class="n">PROP_LABEL</span><span class="p">,</span>
+<a name="line-61"></a> <span class="n">PROP_SHOW_BUTTON</span><span class="p">,</span>
+<a name="line-62"></a> <span class="n">PROP_BUTTON_LABEL</span><span class="p">,</span>
+<a name="line-63"></a> <span class="n">N_PROPERTIES</span>
+<a name="line-64"></a><span class="p">};</span>
+<a name="line-65"></a>
+<a name="line-66"></a><span class="k">static</span> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">properties</span><span class="p">[</span><span class="n">N_PROPERTIES</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> <span class="nb">NULL</span><span class="p">,</span> <span class="p">};</span>
+<a name="line-67"></a>
+<a name="line-68"></a><span class="k">static</span> <span class="kt">void</span> <span class="nf">gvc_combo_box_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">);</span>
+<a name="line-69"></a>
+<a name="line-70"></a><span class="hll"><span class="n">G_DEFINE_TYPE_WITH_PRIVATE</span> <span class="p">(</span><span class="n">GvcComboBox</span><span class="p">,</span> <span class="n">gvc_combo_box</span><span class="p">,</span> <span class="n">GTK_TYPE_BOX</span><span class="p">)</span><span class='error2'>&lt;--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.</span>
+</span><a name="line-71"></a>
+<a name="line-72"></a><span class="n">MateMixerSwitch</span> <span class="o">*</span>
+<a name="line-73"></a><span class="n">gvc_combo_box_get_switch</span> <span class="p">(</span><span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-74"></a><span class="p">{</span>
+<a name="line-75"></a> <span class="n">g_return_val_if_fail</span> <span class="p">(</span><span class="n">GVC_IS_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-76"></a>
+<a name="line-77"></a> <span class="k">return</span> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">;</span>
+<a name="line-78"></a><span class="p">}</span>
+<a name="line-79"></a>
+<a name="line-80"></a><span class="kt">void</span>
+<a name="line-81"></a><span class="n">gvc_combo_box_set_size_group</span> <span class="p">(</span><span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">,</span>
+<a name="line-82"></a> <span class="n">GtkSizeGroup</span> <span class="o">*</span><span class="n">group</span><span class="p">,</span>
+<a name="line-83"></a> <span class="n">gboolean</span> <span class="n">symmetric</span><span class="p">)</span>
+<a name="line-84"></a><span class="p">{</span>
+<a name="line-85"></a> <span class="n">g_return_if_fail</span> <span class="p">(</span><span class="n">GVC_IS_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="p">));</span>
+<a name="line-86"></a> <span class="n">g_return_if_fail</span> <span class="p">(</span><span class="n">GTK_IS_SIZE_GROUP</span> <span class="p">(</span><span class="n">group</span><span class="p">));</span>
+<a name="line-87"></a>
+<a name="line-88"></a> <span class="k">if</span> <span class="p">(</span><span class="n">group</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-89"></a> <span class="n">gtk_size_group_add_widget</span> <span class="p">(</span><span class="n">group</span><span class="p">,</span> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">start_box</span><span class="p">);</span>
+<a name="line-90"></a> <span class="k">if</span> <span class="p">(</span><span class="n">symmetric</span> <span class="o">==</span> <span class="n">TRUE</span><span class="p">)</span>
+<a name="line-91"></a> <span class="n">gtk_size_group_add_widget</span> <span class="p">(</span><span class="n">group</span><span class="p">,</span> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">end_box</span><span class="p">);</span>
+<a name="line-92"></a> <span class="p">}</span>
+<a name="line-93"></a> <span class="n">gtk_widget_queue_draw</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">combobox</span><span class="p">));</span>
+<a name="line-94"></a><span class="p">}</span>
+<a name="line-95"></a>
+<a name="line-96"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-97"></a><span class="n">on_switch_active_option_notify</span> <span class="p">(</span><span class="n">MateMixerSwitch</span> <span class="o">*</span><span class="n">swtch</span><span class="p">,</span>
+<a name="line-98"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">,</span>
+<a name="line-99"></a> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-100"></a><span class="p">{</span>
+<a name="line-101"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-102"></a> <span class="n">MateMixerSwitchOption</span> <span class="o">*</span><span class="n">active</span><span class="p">;</span>
+<a name="line-103"></a> <span class="n">gboolean</span> <span class="n">cont</span><span class="p">;</span>
+<a name="line-104"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-105"></a>
+<a name="line-106"></a> <span class="n">active</span> <span class="o">=</span> <span class="n">mate_mixer_switch_get_active_option</span> <span class="p">(</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-107"></a> <span class="k">if</span> <span class="p">(</span><span class="n">G_UNLIKELY</span> <span class="p">(</span><span class="n">active</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-108"></a> <span class="n">g_warn_if_reached</span> <span class="p">();</span>
+<a name="line-109"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-110"></a> <span class="p">}</span>
+<a name="line-111"></a>
+<a name="line-112"></a> <span class="cm">/* Select the newly activated switch option in the combo box */</span>
+<a name="line-113"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">mate_mixer_switch_option_get_name</span> <span class="p">(</span><span class="n">active</span><span class="p">);</span>
+<a name="line-114"></a> <span class="n">cont</span> <span class="o">=</span> <span class="n">gtk_tree_model_get_iter_first</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-115"></a> <span class="k">while</span> <span class="p">(</span><span class="n">cont</span> <span class="o">==</span> <span class="n">TRUE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-116"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">current</span><span class="p">;</span>
+<a name="line-117"></a>
+<a name="line-118"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-119"></a> <span class="n">COL_NAME</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">current</span><span class="p">,</span>
+<a name="line-120"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-121"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_strcmp0</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">current</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-122"></a> <span class="n">gtk_combo_box_set_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-123"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">current</span><span class="p">);</span>
+<a name="line-124"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-125"></a> <span class="p">}</span>
+<a name="line-126"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">current</span><span class="p">);</span>
+<a name="line-127"></a>
+<a name="line-128"></a> <span class="n">cont</span> <span class="o">=</span> <span class="n">gtk_tree_model_iter_next</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-129"></a> <span class="p">}</span>
+<a name="line-130"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Could not find switch option &#39;%s&#39; in combo box&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">);</span>
+<a name="line-131"></a><span class="p">}</span>
+<a name="line-132"></a>
+<a name="line-133"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-134"></a><span class="n">gvc_combo_box_set_switch</span> <span class="p">(</span><span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">,</span> <span class="n">MateMixerSwitch</span> <span class="o">*</span><span class="n">swtch</span><span class="p">)</span>
+<a name="line-135"></a><span class="p">{</span>
+<a name="line-136"></a> <span class="n">MateMixerSwitchOption</span> <span class="o">*</span><span class="n">active</span><span class="p">;</span>
+<a name="line-137"></a> <span class="k">const</span> <span class="n">GList</span> <span class="o">*</span><span class="n">options</span><span class="p">;</span>
+<a name="line-138"></a>
+<a name="line-139"></a> <span class="n">g_return_if_fail</span> <span class="p">(</span><span class="n">GVC_IS_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="p">));</span>
+<a name="line-140"></a> <span class="n">g_return_if_fail</span> <span class="p">(</span><span class="n">MATE_MIXER_IS_SWITCH</span> <span class="p">(</span><span class="n">swtch</span><span class="p">));</span>
+<a name="line-141"></a>
+<a name="line-142"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span> <span class="o">=</span> <span class="n">g_object_ref</span> <span class="p">(</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-143"></a>
+<a name="line-144"></a> <span class="n">active</span> <span class="o">=</span> <span class="n">mate_mixer_switch_get_active_option</span> <span class="p">(</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-145"></a> <span class="n">options</span> <span class="o">=</span> <span class="n">mate_mixer_switch_list_options</span> <span class="p">(</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-146"></a> <span class="k">while</span> <span class="p">(</span><span class="n">options</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-147"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-148"></a> <span class="n">MateMixerSwitchOption</span> <span class="o">*</span><span class="n">option</span> <span class="o">=</span> <span class="n">MATE_MIXER_SWITCH_OPTION</span> <span class="p">(</span><span class="n">options</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">);</span>
+<a name="line-149"></a>
+<a name="line-150"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">),</span>
+<a name="line-151"></a> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-152"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-153"></a> <span class="n">COL_NAME</span><span class="p">,</span>
+<a name="line-154"></a> <span class="n">mate_mixer_switch_option_get_name</span> <span class="p">(</span><span class="n">option</span><span class="p">),</span>
+<a name="line-155"></a> <span class="n">COL_HUMAN_NAME</span><span class="p">,</span>
+<a name="line-156"></a> <span class="n">mate_mixer_switch_option_get_label</span> <span class="p">(</span><span class="n">option</span><span class="p">),</span>
+<a name="line-157"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-158"></a>
+<a name="line-159"></a> <span class="cm">/* Select the currently active option of the switch */</span>
+<a name="line-160"></a> <span class="k">if</span> <span class="p">(</span><span class="n">option</span> <span class="o">==</span> <span class="n">active</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-161"></a> <span class="n">gtk_combo_box_set_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-162"></a> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-163"></a> <span class="p">}</span>
+<a name="line-164"></a> <span class="n">options</span> <span class="o">=</span> <span class="n">options</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
+<a name="line-165"></a> <span class="p">}</span>
+<a name="line-166"></a>
+<a name="line-167"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">swtch</span><span class="p">),</span>
+<a name="line-168"></a> <span class="s">&quot;notify::active-option&quot;</span><span class="p">,</span>
+<a name="line-169"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_switch_active_option_notify</span><span class="p">),</span>
+<a name="line-170"></a> <span class="n">combobox</span><span class="p">);</span>
+<a name="line-171"></a><span class="p">}</span>
+<a name="line-172"></a>
+<a name="line-173"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-174"></a><span class="n">gvc_combo_box_set_property</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">,</span>
+<a name="line-175"></a> <span class="n">guint</span> <span class="n">prop_id</span><span class="p">,</span>
+<a name="line-176"></a> <span class="k">const</span> <span class="n">GValue</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span>
+<a name="line-177"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">)</span>
+<a name="line-178"></a><span class="p">{</span>
+<a name="line-179"></a> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">self</span> <span class="o">=</span> <span class="n">GVC_COMBO_BOX</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-180"></a>
+<a name="line-181"></a> <span class="k">switch</span> <span class="p">(</span><span class="n">prop_id</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-182"></a> <span class="k">case</span> <span class="nl">PROP_SWITCH</span><span class="p">:</span>
+<a name="line-183"></a> <span class="n">gvc_combo_box_set_switch</span> <span class="p">(</span><span class="n">self</span><span class="p">,</span> <span class="n">g_value_get_object</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-184"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-185"></a> <span class="k">case</span> <span class="nl">PROP_LABEL</span><span class="p">:</span>
+<a name="line-186"></a> <span class="n">gtk_label_set_text_with_mnemonic</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">),</span> <span class="n">g_value_get_string</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-187"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-188"></a> <span class="k">case</span> <span class="nl">PROP_BUTTON_LABEL</span><span class="p">:</span>
+<a name="line-189"></a> <span class="n">gtk_button_set_label</span> <span class="p">(</span><span class="n">GTK_BUTTON</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">),</span> <span class="n">g_value_get_string</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-190"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-191"></a> <span class="k">case</span> <span class="nl">PROP_SHOW_BUTTON</span><span class="p">:</span>
+<a name="line-192"></a> <span class="n">gtk_widget_set_visible</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">,</span> <span class="n">g_value_get_boolean</span> <span class="p">(</span><span class="n">value</span><span class="p">));</span>
+<a name="line-193"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-194"></a> <span class="k">default</span><span class="o">:</span>
+<a name="line-195"></a> <span class="n">G_OBJECT_WARN_INVALID_PROPERTY_ID</span> <span class="p">(</span><span class="n">object</span><span class="p">,</span> <span class="n">prop_id</span><span class="p">,</span> <span class="n">pspec</span><span class="p">);</span>
+<a name="line-196"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-197"></a> <span class="p">}</span>
+<a name="line-198"></a><span class="p">}</span>
+<a name="line-199"></a>
+<a name="line-200"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-201"></a><span class="n">gvc_combo_box_get_property</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">,</span>
+<a name="line-202"></a> <span class="n">guint</span> <span class="n">prop_id</span><span class="p">,</span>
+<a name="line-203"></a> <span class="n">GValue</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span>
+<a name="line-204"></a> <span class="n">GParamSpec</span> <span class="o">*</span><span class="n">pspec</span><span class="p">)</span>
+<a name="line-205"></a><span class="p">{</span>
+<a name="line-206"></a> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">self</span> <span class="o">=</span> <span class="n">GVC_COMBO_BOX</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-207"></a>
+<a name="line-208"></a> <span class="k">switch</span> <span class="p">(</span><span class="n">prop_id</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-209"></a> <span class="k">case</span> <span class="nl">PROP_SWITCH</span><span class="p">:</span>
+<a name="line-210"></a> <span class="n">g_value_set_object</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-211"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-212"></a> <span class="k">case</span> <span class="nl">PROP_LABEL</span><span class="p">:</span>
+<a name="line-213"></a> <span class="n">g_value_set_string</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">gtk_label_get_text</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">)));</span>
+<a name="line-214"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-215"></a> <span class="k">case</span> <span class="nl">PROP_BUTTON_LABEL</span><span class="p">:</span>
+<a name="line-216"></a> <span class="n">g_value_set_string</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">gtk_button_get_label</span> <span class="p">(</span><span class="n">GTK_BUTTON</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">)));</span>
+<a name="line-217"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-218"></a> <span class="k">case</span> <span class="nl">PROP_SHOW_BUTTON</span><span class="p">:</span>
+<a name="line-219"></a> <span class="n">g_value_set_boolean</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">gtk_widget_get_visible</span> <span class="p">(</span><span class="n">self</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">));</span>
+<a name="line-220"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-221"></a> <span class="k">default</span><span class="o">:</span>
+<a name="line-222"></a> <span class="n">G_OBJECT_WARN_INVALID_PROPERTY_ID</span> <span class="p">(</span><span class="n">object</span><span class="p">,</span> <span class="n">prop_id</span><span class="p">,</span> <span class="n">pspec</span><span class="p">);</span>
+<a name="line-223"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-224"></a> <span class="p">}</span>
+<a name="line-225"></a><span class="p">}</span>
+<a name="line-226"></a>
+<a name="line-227"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-228"></a><span class="n">gvc_combo_box_class_init</span> <span class="p">(</span><span class="n">GvcComboBoxClass</span> <span class="o">*</span><span class="n">klass</span><span class="p">)</span>
+<a name="line-229"></a><span class="p">{</span>
+<a name="line-230"></a> <span class="n">GObjectClass</span> <span class="o">*</span><span class="n">object_class</span> <span class="o">=</span> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">);</span>
+<a name="line-231"></a>
+<a name="line-232"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="o">=</span> <span class="n">gvc_combo_box_dispose</span><span class="p">;</span>
+<a name="line-233"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">set_property</span> <span class="o">=</span> <span class="n">gvc_combo_box_set_property</span><span class="p">;</span>
+<a name="line-234"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">get_property</span> <span class="o">=</span> <span class="n">gvc_combo_box_get_property</span><span class="p">;</span>
+<a name="line-235"></a>
+<a name="line-236"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_SWITCH</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-237"></a> <span class="n">g_param_spec_object</span> <span class="p">(</span><span class="s">&quot;switch&quot;</span><span class="p">,</span>
+<a name="line-238"></a> <span class="s">&quot;switch&quot;</span><span class="p">,</span>
+<a name="line-239"></a> <span class="s">&quot;The MateMixerSwitch&quot;</span><span class="p">,</span>
+<a name="line-240"></a> <span class="n">MATE_MIXER_TYPE_SWITCH</span><span class="p">,</span>
+<a name="line-241"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-242"></a> <span class="n">G_PARAM_CONSTRUCT_ONLY</span> <span class="o">|</span>
+<a name="line-243"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-244"></a>
+<a name="line-245"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_LABEL</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-246"></a> <span class="n">g_param_spec_string</span> <span class="p">(</span><span class="s">&quot;label&quot;</span><span class="p">,</span>
+<a name="line-247"></a> <span class="s">&quot;label&quot;</span><span class="p">,</span>
+<a name="line-248"></a> <span class="s">&quot;The combo box label&quot;</span><span class="p">,</span>
+<a name="line-249"></a> <span class="n">_</span><span class="p">(</span><span class="s">&quot;_Profile:&quot;</span><span class="p">),</span>
+<a name="line-250"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-251"></a> <span class="n">G_PARAM_CONSTRUCT</span> <span class="o">|</span>
+<a name="line-252"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-253"></a>
+<a name="line-254"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_SHOW_BUTTON</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-255"></a> <span class="n">g_param_spec_boolean</span> <span class="p">(</span><span class="s">&quot;show-button&quot;</span><span class="p">,</span>
+<a name="line-256"></a> <span class="s">&quot;show-button&quot;</span><span class="p">,</span>
+<a name="line-257"></a> <span class="s">&quot;Whether to show the button&quot;</span><span class="p">,</span>
+<a name="line-258"></a> <span class="n">FALSE</span><span class="p">,</span>
+<a name="line-259"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-260"></a> <span class="n">G_PARAM_CONSTRUCT</span> <span class="o">|</span>
+<a name="line-261"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-262"></a>
+<a name="line-263"></a> <span class="n">properties</span><span class="p">[</span><span class="n">PROP_BUTTON_LABEL</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-264"></a> <span class="n">g_param_spec_string</span> <span class="p">(</span><span class="s">&quot;button-label&quot;</span><span class="p">,</span>
+<a name="line-265"></a> <span class="s">&quot;button-label&quot;</span><span class="p">,</span>
+<a name="line-266"></a> <span class="s">&quot;The button&#39;s label&quot;</span><span class="p">,</span>
+<a name="line-267"></a> <span class="s">&quot;&quot;</span><span class="p">,</span>
+<a name="line-268"></a> <span class="n">G_PARAM_READWRITE</span> <span class="o">|</span>
+<a name="line-269"></a> <span class="n">G_PARAM_CONSTRUCT</span> <span class="o">|</span>
+<a name="line-270"></a> <span class="n">G_PARAM_STATIC_STRINGS</span><span class="p">);</span>
+<a name="line-271"></a>
+<a name="line-272"></a> <span class="n">g_object_class_install_properties</span> <span class="p">(</span><span class="n">object_class</span><span class="p">,</span> <span class="n">N_PROPERTIES</span><span class="p">,</span> <span class="n">properties</span><span class="p">);</span>
+<a name="line-273"></a>
+<a name="line-274"></a> <span class="n">signals</span><span class="p">[</span><span class="n">CHANGING</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-275"></a> <span class="n">g_signal_new</span> <span class="p">(</span><span class="s">&quot;changing&quot;</span><span class="p">,</span>
+<a name="line-276"></a> <span class="n">G_TYPE_FROM_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">),</span>
+<a name="line-277"></a> <span class="n">G_SIGNAL_RUN_LAST</span><span class="p">,</span>
+<a name="line-278"></a> <span class="n">G_STRUCT_OFFSET</span> <span class="p">(</span><span class="n">GvcComboBoxClass</span><span class="p">,</span> <span class="n">changing</span><span class="p">),</span>
+<a name="line-279"></a> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-280"></a> <span class="n">g_cclosure_marshal_VOID__OBJECT</span><span class="p">,</span>
+<a name="line-281"></a> <span class="n">G_TYPE_NONE</span><span class="p">,</span>
+<a name="line-282"></a> <span class="mi">1</span><span class="p">,</span>
+<a name="line-283"></a> <span class="n">MATE_MIXER_TYPE_SWITCH_OPTION</span><span class="p">);</span>
+<a name="line-284"></a>
+<a name="line-285"></a> <span class="n">signals</span><span class="p">[</span><span class="n">BUTTON_CLICKED</span><span class="p">]</span> <span class="o">=</span>
+<a name="line-286"></a> <span class="n">g_signal_new</span> <span class="p">(</span><span class="s">&quot;button-clicked&quot;</span><span class="p">,</span>
+<a name="line-287"></a> <span class="n">G_TYPE_FROM_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">),</span>
+<a name="line-288"></a> <span class="n">G_SIGNAL_RUN_LAST</span><span class="p">,</span>
+<a name="line-289"></a> <span class="n">G_STRUCT_OFFSET</span> <span class="p">(</span><span class="n">GvcComboBoxClass</span><span class="p">,</span> <span class="n">button_clicked</span><span class="p">),</span>
+<a name="line-290"></a> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-291"></a> <span class="n">g_cclosure_marshal_VOID__VOID</span><span class="p">,</span>
+<a name="line-292"></a> <span class="n">G_TYPE_NONE</span><span class="p">,</span>
+<a name="line-293"></a> <span class="mi">0</span><span class="p">);</span>
+<a name="line-294"></a><span class="p">}</span>
+<a name="line-295"></a>
+<a name="line-296"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-297"></a><span class="n">on_combo_box_changed</span> <span class="p">(</span><span class="n">GtkComboBox</span> <span class="o">*</span><span class="n">widget</span><span class="p">,</span> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-298"></a><span class="p">{</span>
+<a name="line-299"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-300"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-301"></a> <span class="n">MateMixerSwitchOption</span> <span class="o">*</span><span class="n">option</span><span class="p">;</span>
+<a name="line-302"></a>
+<a name="line-303"></a> <span class="k">if</span> <span class="p">(</span><span class="n">G_UNLIKELY</span> <span class="p">(</span><span class="n">gtk_combo_box_get_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">widget</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">))</span>
+<a name="line-304"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-305"></a>
+<a name="line-306"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-307"></a> <span class="n">COL_NAME</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">name</span><span class="p">,</span>
+<a name="line-308"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-309"></a>
+<a name="line-310"></a> <span class="n">option</span> <span class="o">=</span> <span class="n">mate_mixer_switch_get_option</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">,</span> <span class="n">name</span><span class="p">);</span>
+<a name="line-311"></a> <span class="k">if</span> <span class="p">(</span><span class="n">G_UNLIKELY</span> <span class="p">(</span><span class="n">option</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-312"></a> <span class="n">g_warn_if_reached</span> <span class="p">();</span>
+<a name="line-313"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-314"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-315"></a> <span class="p">}</span>
+<a name="line-316"></a>
+<a name="line-317"></a> <span class="cm">/* Inform that we are about to change the active option of the switch */</span>
+<a name="line-318"></a> <span class="n">g_signal_emit</span> <span class="p">(</span><span class="n">combobox</span><span class="p">,</span> <span class="n">signals</span><span class="p">[</span><span class="n">CHANGING</span><span class="p">],</span> <span class="mi">0</span><span class="p">,</span> <span class="n">option</span><span class="p">);</span>
+<a name="line-319"></a>
+<a name="line-320"></a> <span class="n">mate_mixer_switch_set_active_option</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">,</span> <span class="n">option</span><span class="p">);</span>
+<a name="line-321"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-322"></a><span class="p">}</span>
+<a name="line-323"></a>
+<a name="line-324"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-325"></a><span class="n">on_combo_box_button_clicked</span> <span class="p">(</span><span class="n">GtkButton</span> <span class="o">*</span><span class="n">button</span><span class="p">,</span> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-326"></a><span class="p">{</span>
+<a name="line-327"></a> <span class="cm">/* The meaning of the button is defined by the owner, so only notify</span>
+<a name="line-328"></a><span class="cm"> * when it is clicked on */</span>
+<a name="line-329"></a> <span class="n">g_signal_emit</span> <span class="p">(</span><span class="n">combobox</span><span class="p">,</span> <span class="n">signals</span><span class="p">[</span><span class="n">BUTTON_CLICKED</span><span class="p">],</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-330"></a><span class="p">}</span>
+<a name="line-331"></a>
+<a name="line-332"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-333"></a><span class="n">gvc_combo_box_init</span> <span class="p">(</span><span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">)</span>
+<a name="line-334"></a><span class="p">{</span>
+<a name="line-335"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">frame</span><span class="p">;</span>
+<a name="line-336"></a> <span class="n">GtkCellRenderer</span> <span class="o">*</span><span class="n">renderer</span><span class="p">;</span>
+<a name="line-337"></a>
+<a name="line-338"></a> <span class="n">frame</span> <span class="o">=</span> <span class="n">gtk_frame_new</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
+<a name="line-339"></a> <span class="n">gtk_frame_set_shadow_type</span> <span class="p">(</span><span class="n">GTK_FRAME</span> <span class="p">(</span><span class="n">frame</span><span class="p">),</span> <span class="n">GTK_SHADOW_NONE</span><span class="p">);</span>
+<a name="line-340"></a>
+<a name="line-341"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span> <span class="o">=</span> <span class="n">gvc_combo_box_get_instance_private</span> <span class="p">(</span><span class="n">combobox</span><span class="p">);</span>
+<a name="line-342"></a>
+<a name="line-343"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span> <span class="o">=</span> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="n">NUM_COLS</span><span class="p">,</span>
+<a name="line-344"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-345"></a> <span class="n">G_TYPE_STRING</span><span class="p">));</span>
+<a name="line-346"></a>
+<a name="line-347"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span> <span class="o">=</span> <span class="n">gtk_combo_box_new_with_model</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">);</span>
+<a name="line-348"></a>
+<a name="line-349"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span> <span class="o">=</span> <span class="n">gtk_label_new</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
+<a name="line-350"></a>
+<a name="line-351"></a> <span class="n">gtk_label_set_xalign</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">),</span> <span class="mf">0.0</span><span class="p">);</span>
+<a name="line-352"></a> <span class="n">gtk_label_set_yalign</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">),</span> <span class="mf">0.5</span><span class="p">);</span>
+<a name="line-353"></a> <span class="n">gtk_label_set_mnemonic_widget</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">),</span>
+<a name="line-354"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">);</span>
+<a name="line-355"></a>
+<a name="line-356"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-357"></a> <span class="n">gtk_cell_layout_pack_start</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-358"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-359"></a> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-360"></a> <span class="n">gtk_cell_layout_add_attribute</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-361"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-362"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span>
+<a name="line-363"></a> <span class="n">COL_HUMAN_NAME</span><span class="p">);</span>
+<a name="line-364"></a>
+<a name="line-365"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-366"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">start_box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-367"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">end_box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-368"></a>
+<a name="line-369"></a> <span class="cm">/* Make sure the combo box does not get too long on long profile names */</span>
+<a name="line-370"></a> <span class="n">g_object_set</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">renderer</span><span class="p">),</span>
+<a name="line-371"></a> <span class="s">&quot;ellipsize&quot;</span><span class="p">,</span>
+<a name="line-372"></a> <span class="n">PANGO_ELLIPSIZE_END</span><span class="p">,</span>
+<a name="line-373"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-374"></a>
+<a name="line-375"></a> <span class="n">gtk_combo_box_set_popup_fixed_width</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-376"></a>
+<a name="line-377"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-378"></a> <span class="n">frame</span><span class="p">,</span>
+<a name="line-379"></a> <span class="n">TRUE</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-380"></a>
+<a name="line-381"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">),</span>
+<a name="line-382"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">start_box</span><span class="p">,</span>
+<a name="line-383"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-384"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">start_box</span><span class="p">),</span>
+<a name="line-385"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">label</span><span class="p">,</span>
+<a name="line-386"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-387"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">),</span>
+<a name="line-388"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">,</span>
+<a name="line-389"></a> <span class="n">TRUE</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-390"></a>
+<a name="line-391"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span> <span class="o">=</span> <span class="n">gtk_button_new_with_label</span> <span class="p">(</span><span class="s">&quot;&quot;</span><span class="p">);</span>
+<a name="line-392"></a>
+<a name="line-393"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">),</span>
+<a name="line-394"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">,</span>
+<a name="line-395"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-396"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">),</span>
+<a name="line-397"></a> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">end_box</span><span class="p">,</span>
+<a name="line-398"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-399"></a>
+<a name="line-400"></a> <span class="n">gtk_container_add</span> <span class="p">(</span><span class="n">GTK_CONTAINER</span> <span class="p">(</span><span class="n">frame</span><span class="p">),</span> <span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">drop_box</span><span class="p">);</span>
+<a name="line-401"></a>
+<a name="line-402"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combobox</span><span class="p">),</span>
+<a name="line-403"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span>
+<a name="line-404"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_combo_box_changed</span><span class="p">),</span>
+<a name="line-405"></a> <span class="n">combobox</span><span class="p">);</span>
+<a name="line-406"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">),</span>
+<a name="line-407"></a> <span class="s">&quot;clicked&quot;</span><span class="p">,</span>
+<a name="line-408"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_combo_box_button_clicked</span><span class="p">),</span>
+<a name="line-409"></a> <span class="n">combobox</span><span class="p">);</span>
+<a name="line-410"></a>
+<a name="line-411"></a> <span class="n">gtk_widget_set_no_show_all</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">button</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-412"></a> <span class="n">gtk_widget_show_all</span> <span class="p">(</span><span class="n">frame</span><span class="p">);</span>
+<a name="line-413"></a><span class="p">}</span>
+<a name="line-414"></a>
+<a name="line-415"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-416"></a><span class="n">gvc_combo_box_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">)</span>
+<a name="line-417"></a><span class="p">{</span>
+<a name="line-418"></a> <span class="n">GvcComboBox</span> <span class="o">*</span><span class="n">combobox</span><span class="p">;</span>
+<a name="line-419"></a>
+<a name="line-420"></a> <span class="n">combobox</span> <span class="o">=</span> <span class="n">GVC_COMBO_BOX</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-421"></a>
+<a name="line-422"></a> <span class="k">if</span> <span class="p">(</span><span class="n">G_LIKELY</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-423"></a> <span class="n">g_signal_handlers_disconnect_by_func</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">),</span>
+<a name="line-424"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_switch_active_option_notify</span><span class="p">),</span>
+<a name="line-425"></a> <span class="n">combobox</span><span class="p">);</span>
+<a name="line-426"></a> <span class="n">g_clear_object</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">swtch</span><span class="p">);</span>
+<a name="line-427"></a> <span class="p">}</span>
+<a name="line-428"></a>
+<a name="line-429"></a> <span class="n">g_clear_object</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">combobox</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">model</span><span class="p">);</span>
+<a name="line-430"></a>
+<a name="line-431"></a> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">gvc_combo_box_parent_class</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-432"></a><span class="p">}</span>
+<a name="line-433"></a>
+<a name="line-434"></a><span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-435"></a><span class="n">gvc_combo_box_new</span> <span class="p">(</span><span class="n">MateMixerSwitch</span> <span class="o">*</span><span class="n">swtch</span><span class="p">,</span> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">label</span><span class="p">)</span>
+<a name="line-436"></a><span class="p">{</span>
+<a name="line-437"></a> <span class="k">return</span> <span class="n">g_object_new</span> <span class="p">(</span><span class="n">GVC_TYPE_COMBO_BOX</span><span class="p">,</span>
+<a name="line-438"></a> <span class="s">&quot;switch&quot;</span><span class="p">,</span> <span class="n">swtch</span><span class="p">,</span>
+<a name="line-439"></a> <span class="s">&quot;label&quot;</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span>
+<a name="line-440"></a> <span class="s">&quot;orientation&quot;</span><span class="p">,</span> <span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span>
+<a name="line-441"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-442"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck 1.90 - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/[email protected]_enum-conversion/1.html b/[email protected]_enum-conversion/1.html
new file mode 100644
index 0000000..67179f2
--- /dev/null
+++ b/[email protected]_enum-conversion/1.html
@@ -0,0 +1,2368 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-media</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ function toggle_all(){
+ var elts = document.getElementsByTagName("input");
+ for (var i = 1; i < elts.length; i++) {
+ var el = elts[i];
+ el.checked ? el.checked=false : el.checked=true;
+ toggle_class_visibility(el.id);
+ }
+ }
+
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - mate-media: mate-volume-control/gvc-sound-theme-chooser.c </h1>
+ </div>
+ <div id="menu" dir="rtl">
+ <p id="filename"><a href="index.html">Defects:</a> gvc-sound-theme-chooser.c</p>
+<a href='1.html#line-735'> ConfigurationNotChecked 735</a><a href='1.html#line-746'> ConfigurationNotChecked 746</a><a href='1.html#line-758'> ConfigurationNotChecked 758</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 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
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107</pre></div></td><td class="code"><div class="highlight"><pre><span></span><a name="line-1"></a><span class="cm">/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-</span>
+<a name="line-2"></a><span class="cm"> *</span>
+<a name="line-3"></a><span class="cm"> * Copyright (C) 2008 Bastien Nocera &lt;[email protected]&gt;</span>
+<a name="line-4"></a><span class="cm"> * Copyright (C) 2008 William Jon McCann</span>
+<a name="line-5"></a><span class="cm"> *</span>
+<a name="line-6"></a><span class="cm"> * This program is free software; you can redistribute it and/or modify</span>
+<a name="line-7"></a><span class="cm"> * it under the terms of the GNU General Public License as published by</span>
+<a name="line-8"></a><span class="cm"> * the Free Software Foundation; either version 2 of the License, or</span>
+<a name="line-9"></a><span class="cm"> * (at your option) any later version.</span>
+<a name="line-10"></a><span class="cm"> *</span>
+<a name="line-11"></a><span class="cm"> * This program is distributed in the hope that it will be useful,</span>
+<a name="line-12"></a><span class="cm"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
+<a name="line-13"></a><span class="cm"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
+<a name="line-14"></a><span class="cm"> * GNU General Public License for more details.</span>
+<a name="line-15"></a><span class="cm"> *</span>
+<a name="line-16"></a><span class="cm"> * You should have received a copy of the GNU General Public License</span>
+<a name="line-17"></a><span class="cm"> * along with this program; if not, write to the Free Software</span>
+<a name="line-18"></a><span class="cm"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.</span>
+<a name="line-19"></a><span class="cm"> *</span>
+<a name="line-20"></a><span class="cm"> */</span>
+<a name="line-21"></a>
+<a name="line-22"></a><span class="cp">#include</span> <span class="cpf">&quot;config.h&quot;</span><span class="cp"></span>
+<a name="line-23"></a>
+<a name="line-24"></a><span class="cp">#include</span> <span class="cpf">&lt;stdlib.h&gt;</span><span class="cp"></span>
+<a name="line-25"></a><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp"></span>
+<a name="line-26"></a><span class="cp">#include</span> <span class="cpf">&lt;unistd.h&gt;</span><span class="cp"></span>
+<a name="line-27"></a><span class="cp">#include</span> <span class="cpf">&lt;utime.h&gt;</span><span class="cp"></span>
+<a name="line-28"></a><span class="cp">#include</span> <span class="cpf">&lt;errno.h&gt;</span><span class="cp"></span>
+<a name="line-29"></a>
+<a name="line-30"></a><span class="cp">#include</span> <span class="cpf">&lt;glib.h&gt;</span><span class="cp"></span>
+<a name="line-31"></a><span class="cp">#include</span> <span class="cpf">&lt;glib/gi18n.h&gt;</span><span class="cp"></span>
+<a name="line-32"></a><span class="cp">#include</span> <span class="cpf">&lt;glib-object.h&gt;</span><span class="cp"></span>
+<a name="line-33"></a><span class="cp">#include</span> <span class="cpf">&lt;gio/gio.h&gt;</span><span class="cp"></span>
+<a name="line-34"></a><span class="cp">#include</span> <span class="cpf">&lt;gtk/gtk.h&gt;</span><span class="cp"></span>
+<a name="line-35"></a><span class="cp">#include</span> <span class="cpf">&lt;canberra-gtk.h&gt;</span><span class="cp"></span>
+<a name="line-36"></a><span class="cp">#include</span> <span class="cpf">&lt;libxml/tree.h&gt;</span><span class="cp"></span>
+<a name="line-37"></a>
+<a name="line-38"></a><span class="cp">#include</span> <span class="cpf">&quot;gvc-sound-theme-chooser.h&quot;</span><span class="cp"></span>
+<a name="line-39"></a><span class="cp">#include</span> <span class="cpf">&quot;sound-theme-file-utils.h&quot;</span><span class="cp"></span>
+<a name="line-40"></a>
+<a name="line-41"></a><span class="k">struct</span> <span class="n">GvcSoundThemeChooserPrivate</span>
+<a name="line-42"></a><span class="p">{</span>
+<a name="line-43"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">combo_box</span><span class="p">;</span>
+<a name="line-44"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">treeview</span><span class="p">;</span>
+<a name="line-45"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">theme_box</span><span class="p">;</span>
+<a name="line-46"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">selection_box</span><span class="p">;</span>
+<a name="line-47"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">click_feedback_button</span><span class="p">;</span>
+<a name="line-48"></a> <span class="n">GSettings</span> <span class="o">*</span><span class="n">sound_settings</span><span class="p">;</span>
+<a name="line-49"></a><span class="p">};</span>
+<a name="line-50"></a>
+<a name="line-51"></a><span class="k">static</span> <span class="kt">void</span> <span class="nf">gvc_sound_theme_chooser_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">);</span>
+<a name="line-52"></a>
+<a name="line-53"></a><span class="n">G_DEFINE_TYPE_WITH_PRIVATE</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span><span class="p">,</span> <span class="n">gvc_sound_theme_chooser</span><span class="p">,</span> <span class="n">GTK_TYPE_BOX</span><span class="p">)</span>
+<a name="line-54"></a>
+<a name="line-55"></a><span class="cp">#define KEY_SOUNDS_SCHEMA &quot;org.mate.sound&quot;</span>
+<a name="line-56"></a><span class="cp">#define EVENT_SOUNDS_KEY &quot;event-sounds&quot;</span>
+<a name="line-57"></a><span class="cp">#define INPUT_SOUNDS_KEY &quot;input-feedback-sounds&quot;</span>
+<a name="line-58"></a><span class="cp">#define SOUND_THEME_KEY &quot;theme-name&quot;</span>
+<a name="line-59"></a>
+<a name="line-60"></a><span class="cp">#define DEFAULT_ALERT_ID &quot;__default&quot;</span>
+<a name="line-61"></a><span class="cp">#define CUSTOM_THEME_NAME &quot;__custom&quot;</span>
+<a name="line-62"></a><span class="cp">#define NO_SOUNDS_THEME_NAME &quot;__no_sounds&quot;</span>
+<a name="line-63"></a>
+<a name="line-64"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-65"></a> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span>
+<a name="line-66"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span>
+<a name="line-67"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span>
+<a name="line-68"></a> <span class="n">THEME_NUM_COLS</span>
+<a name="line-69"></a><span class="p">};</span>
+<a name="line-70"></a>
+<a name="line-71"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-72"></a> <span class="n">ALERT_DISPLAY_COL</span><span class="p">,</span>
+<a name="line-73"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span>
+<a name="line-74"></a> <span class="n">ALERT_SOUND_TYPE_COL</span><span class="p">,</span>
+<a name="line-75"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span>
+<a name="line-76"></a> <span class="n">ALERT_NUM_COLS</span>
+<a name="line-77"></a><span class="p">};</span>
+<a name="line-78"></a>
+<a name="line-79"></a><span class="k">enum</span> <span class="p">{</span>
+<a name="line-80"></a> <span class="n">SOUND_TYPE_UNSET</span><span class="p">,</span>
+<a name="line-81"></a> <span class="n">SOUND_TYPE_OFF</span><span class="p">,</span>
+<a name="line-82"></a> <span class="n">SOUND_TYPE_DEFAULT_FROM_THEME</span><span class="p">,</span>
+<a name="line-83"></a> <span class="n">SOUND_TYPE_BUILTIN</span><span class="p">,</span>
+<a name="line-84"></a> <span class="n">SOUND_TYPE_CUSTOM</span>
+<a name="line-85"></a><span class="p">};</span>
+<a name="line-86"></a>
+<a name="line-87"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-88"></a><span class="nf">on_combobox_changed</span> <span class="p">(</span><span class="n">GtkComboBox</span> <span class="o">*</span><span class="n">widget</span><span class="p">,</span>
+<a name="line-89"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-90"></a><span class="p">{</span>
+<a name="line-91"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-92"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-93"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">theme_name</span><span class="p">;</span>
+<a name="line-94"></a>
+<a name="line-95"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_combo_box_get_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-96"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-97"></a> <span class="p">}</span>
+<a name="line-98"></a>
+<a name="line-99"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">));</span>
+<a name="line-100"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">theme_name</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-101"></a>
+<a name="line-102"></a> <span class="n">g_assert</span> <span class="p">(</span><span class="n">theme_name</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-103"></a>
+<a name="line-104"></a> <span class="cm">/* It is necessary to update the theme name before any other setting as</span>
+<a name="line-105"></a><span class="cm"> * the &quot;changed&quot; notification will reload the contents of the widget */</span>
+<a name="line-106"></a> <span class="n">g_settings_set_string</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">SOUND_THEME_KEY</span><span class="p">,</span> <span class="n">theme_name</span><span class="p">);</span>
+<a name="line-107"></a>
+<a name="line-108"></a> <span class="cm">/* special case for no sounds */</span>
+<a name="line-109"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">theme_name</span><span class="p">,</span> <span class="n">NO_SOUNDS_THEME_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-110"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">EVENT_SOUNDS_KEY</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-111"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-112"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-113"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">EVENT_SOUNDS_KEY</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-114"></a> <span class="p">}</span>
+<a name="line-115"></a>
+<a name="line-116"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">theme_name</span><span class="p">);</span>
+<a name="line-117"></a>
+<a name="line-118"></a> <span class="cm">/* FIXME: reset alert model */</span>
+<a name="line-119"></a><span class="p">}</span>
+<a name="line-120"></a>
+<a name="line-121"></a><span class="k">static</span> <span class="kt">char</span> <span class="o">*</span>
+<a name="line-122"></a><span class="nf">load_index_theme_name</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">index</span><span class="p">,</span>
+<a name="line-123"></a> <span class="kt">char</span> <span class="o">**</span><span class="n">parent</span><span class="p">)</span>
+<a name="line-124"></a><span class="p">{</span>
+<a name="line-125"></a> <span class="n">GKeyFile</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+<a name="line-126"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">indexname</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-127"></a> <span class="n">gboolean</span> <span class="n">hidden</span><span class="p">;</span>
+<a name="line-128"></a>
+<a name="line-129"></a> <span class="n">file</span> <span class="o">=</span> <span class="n">g_key_file_new</span> <span class="p">();</span>
+<a name="line-130"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_key_file_load_from_file</span> <span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">G_KEY_FILE_KEEP_TRANSLATIONS</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-131"></a> <span class="n">g_key_file_free</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-132"></a> <span class="k">return</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-133"></a> <span class="p">}</span>
+<a name="line-134"></a> <span class="cm">/* Don&#39;t add hidden themes to the list */</span>
+<a name="line-135"></a> <span class="n">hidden</span> <span class="o">=</span> <span class="n">g_key_file_get_boolean</span> <span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="s">&quot;Sound Theme&quot;</span><span class="p">,</span> <span class="s">&quot;Hidden&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-136"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">hidden</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-137"></a> <span class="n">indexname</span> <span class="o">=</span> <span class="n">g_key_file_get_locale_string</span> <span class="p">(</span><span class="n">file</span><span class="p">,</span>
+<a name="line-138"></a> <span class="s">&quot;Sound Theme&quot;</span><span class="p">,</span>
+<a name="line-139"></a> <span class="s">&quot;Name&quot;</span><span class="p">,</span>
+<a name="line-140"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-141"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-142"></a>
+<a name="line-143"></a> <span class="cm">/* Save the parent theme, if there&#39;s one */</span>
+<a name="line-144"></a> <span class="k">if</span> <span class="p">(</span><span class="n">parent</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-145"></a> <span class="o">*</span><span class="n">parent</span> <span class="o">=</span> <span class="n">g_key_file_get_string</span> <span class="p">(</span><span class="n">file</span><span class="p">,</span>
+<a name="line-146"></a> <span class="s">&quot;Sound Theme&quot;</span><span class="p">,</span>
+<a name="line-147"></a> <span class="s">&quot;Inherits&quot;</span><span class="p">,</span>
+<a name="line-148"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-149"></a> <span class="p">}</span>
+<a name="line-150"></a> <span class="p">}</span>
+<a name="line-151"></a>
+<a name="line-152"></a> <span class="n">g_key_file_free</span> <span class="p">(</span><span class="n">file</span><span class="p">);</span>
+<a name="line-153"></a> <span class="k">return</span> <span class="n">indexname</span><span class="p">;</span>
+<a name="line-154"></a><span class="p">}</span>
+<a name="line-155"></a>
+<a name="line-156"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-157"></a><span class="nf">sound_theme_in_dir</span> <span class="p">(</span><span class="n">GHashTable</span> <span class="o">*</span><span class="n">hash</span><span class="p">,</span>
+<a name="line-158"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">dir</span><span class="p">)</span>
+<a name="line-159"></a><span class="p">{</span>
+<a name="line-160"></a> <span class="n">GDir</span> <span class="o">*</span><span class="n">d</span><span class="p">;</span>
+<a name="line-161"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-162"></a>
+<a name="line-163"></a> <span class="n">d</span> <span class="o">=</span> <span class="n">g_dir_open</span> <span class="p">(</span><span class="n">dir</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-164"></a> <span class="k">if</span> <span class="p">(</span><span class="n">d</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-165"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-166"></a> <span class="p">}</span>
+<a name="line-167"></a>
+<a name="line-168"></a> <span class="k">while</span> <span class="p">((</span><span class="n">name</span> <span class="o">=</span> <span class="n">g_dir_read_name</span> <span class="p">(</span><span class="n">d</span><span class="p">))</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-169"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">dirname</span><span class="p">,</span> <span class="o">*</span><span class="n">index</span><span class="p">,</span> <span class="o">*</span><span class="n">indexname</span><span class="p">;</span>
+<a name="line-170"></a>
+<a name="line-171"></a> <span class="cm">/* Look for directories */</span>
+<a name="line-172"></a> <span class="n">dirname</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">dir</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-173"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="n">G_FILE_TEST_IS_DIR</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-174"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dirname</span><span class="p">);</span>
+<a name="line-175"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-176"></a> <span class="p">}</span>
+<a name="line-177"></a>
+<a name="line-178"></a> <span class="cm">/* Look for index files */</span>
+<a name="line-179"></a> <span class="n">index</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="s">&quot;index.theme&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-180"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dirname</span><span class="p">);</span>
+<a name="line-181"></a>
+<a name="line-182"></a> <span class="cm">/* Check the name of the theme in the index.theme file */</span>
+<a name="line-183"></a> <span class="n">indexname</span> <span class="o">=</span> <span class="n">load_index_theme_name</span> <span class="p">(</span><span class="n">index</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-184"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">index</span><span class="p">);</span>
+<a name="line-185"></a> <span class="k">if</span> <span class="p">(</span><span class="n">indexname</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-186"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-187"></a> <span class="p">}</span>
+<a name="line-188"></a>
+<a name="line-189"></a> <span class="n">g_hash_table_insert</span> <span class="p">(</span><span class="n">hash</span><span class="p">,</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">name</span><span class="p">),</span> <span class="n">indexname</span><span class="p">);</span>
+<a name="line-190"></a> <span class="p">}</span>
+<a name="line-191"></a>
+<a name="line-192"></a> <span class="n">g_dir_close</span> <span class="p">(</span><span class="n">d</span><span class="p">);</span>
+<a name="line-193"></a><span class="p">}</span>
+<a name="line-194"></a>
+<a name="line-195"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-196"></a><span class="nf">add_theme_to_store</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span>
+<a name="line-197"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span>
+<a name="line-198"></a> <span class="n">GtkListStore</span> <span class="o">*</span><span class="n">store</span><span class="p">)</span>
+<a name="line-199"></a><span class="p">{</span>
+<a name="line-200"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">parent</span><span class="p">;</span>
+<a name="line-201"></a>
+<a name="line-202"></a> <span class="n">parent</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-203"></a>
+<a name="line-204"></a> <span class="cm">/* Get the parent, if we&#39;re checking the custom theme */</span>
+<a name="line-205"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-206"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">,</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-207"></a>
+<a name="line-208"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">custom_theme_dir_path</span> <span class="p">(</span><span class="s">&quot;index.theme&quot;</span><span class="p">);</span>
+<a name="line-209"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">load_index_theme_name</span> <span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-210"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-211"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
+<a name="line-212"></a> <span class="p">}</span>
+<a name="line-213"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-214"></a> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span>
+<a name="line-215"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span>
+<a name="line-216"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span>
+<a name="line-217"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-218"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-219"></a><span class="p">}</span>
+<a name="line-220"></a>
+<a name="line-221"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-222"></a><span class="nf">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-223"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">)</span>
+<a name="line-224"></a><span class="p">{</span>
+<a name="line-225"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-226"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-227"></a> <span class="n">gboolean</span> <span class="n">found</span><span class="p">;</span>
+<a name="line-228"></a>
+<a name="line-229"></a> <span class="cm">/* If the name is empty, use &quot;freedesktop&quot; */</span>
+<a name="line-230"></a> <span class="k">if</span> <span class="p">(</span><span class="n">name</span> <span class="o">==</span> <span class="nb">NULL</span> <span class="o">||</span> <span class="o">*</span><span class="n">name</span> <span class="o">==</span> <span class="sc">&#39;\0&#39;</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-231"></a> <span class="n">name</span> <span class="o">=</span> <span class="s">&quot;freedesktop&quot;</span><span class="p">;</span>
+<a name="line-232"></a> <span class="p">}</span>
+<a name="line-233"></a>
+<a name="line-234"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">));</span>
+<a name="line-235"></a>
+<a name="line-236"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_tree_model_get_iter_first</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-237"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-238"></a> <span class="p">}</span>
+<a name="line-239"></a>
+<a name="line-240"></a> <span class="k">do</span> <span class="p">{</span>
+<a name="line-241"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">value</span><span class="p">;</span>
+<a name="line-242"></a>
+<a name="line-243"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">value</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-244"></a> <span class="n">found</span> <span class="o">=</span> <span class="p">(</span><span class="n">value</span> <span class="o">!=</span> <span class="nb">NULL</span> <span class="o">&amp;&amp;</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-245"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">value</span><span class="p">);</span>
+<a name="line-246"></a>
+<a name="line-247"></a> <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">found</span> <span class="o">&amp;&amp;</span> <span class="n">gtk_tree_model_iter_next</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">));</span>
+<a name="line-248"></a>
+<a name="line-249"></a> <span class="cm">/* When we can&#39;t find the theme we need to set, try to set the default</span>
+<a name="line-250"></a><span class="cm"> * one &quot;freedesktop&quot; */</span>
+<a name="line-251"></a> <span class="k">if</span> <span class="p">(</span><span class="n">found</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-252"></a> <span class="n">gtk_combo_box_set_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-253"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="s">&quot;freedesktop&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-254"></a> <span class="n">g_debug</span> <span class="p">(</span><span class="s">&quot;not found, falling back to fdo&quot;</span><span class="p">);</span>
+<a name="line-255"></a> <span class="n">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="s">&quot;freedesktop&quot;</span><span class="p">);</span>
+<a name="line-256"></a> <span class="p">}</span>
+<a name="line-257"></a><span class="p">}</span>
+<a name="line-258"></a>
+<a name="line-259"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-260"></a><span class="nf">set_input_feedback_enabled</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-261"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">)</span>
+<a name="line-262"></a><span class="p">{</span>
+<a name="line-263"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">),</span>
+<a name="line-264"></a> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-265"></a><span class="p">}</span>
+<a name="line-266"></a>
+<a name="line-267"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-268"></a><span class="nf">setup_theme_selector</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-269"></a><span class="p">{</span>
+<a name="line-270"></a> <span class="n">GHashTable</span> <span class="o">*</span><span class="n">hash</span><span class="p">;</span>
+<a name="line-271"></a> <span class="n">GtkListStore</span> <span class="o">*</span><span class="n">store</span><span class="p">;</span>
+<a name="line-272"></a> <span class="n">GtkCellRenderer</span> <span class="o">*</span><span class="n">renderer</span><span class="p">;</span>
+<a name="line-273"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="k">const</span> <span class="o">*</span><span class="n">data_dirs</span><span class="p">;</span>
+<a name="line-274"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">data_dir</span><span class="p">;</span>
+<a name="line-275"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">dir</span><span class="p">;</span>
+<a name="line-276"></a> <span class="n">guint</span> <span class="n">i</span><span class="p">;</span>
+<a name="line-277"></a>
+<a name="line-278"></a> <span class="cm">/* Add the theme names and their display name to a hash table,</span>
+<a name="line-279"></a><span class="cm"> * makes it easy to avoid duplicate themes */</span>
+<a name="line-280"></a> <span class="n">hash</span> <span class="o">=</span> <span class="n">g_hash_table_new_full</span> <span class="p">(</span><span class="n">g_str_hash</span><span class="p">,</span> <span class="n">g_str_equal</span><span class="p">,</span> <span class="n">g_free</span><span class="p">,</span> <span class="n">g_free</span><span class="p">);</span>
+<a name="line-281"></a>
+<a name="line-282"></a> <span class="n">data_dirs</span> <span class="o">=</span> <span class="n">g_get_system_data_dirs</span> <span class="p">();</span>
+<a name="line-283"></a> <span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">data_dirs</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-284"></a> <span class="n">dir</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">data_dirs</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="s">&quot;sounds&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-285"></a> <span class="n">sound_theme_in_dir</span> <span class="p">(</span><span class="n">hash</span><span class="p">,</span> <span class="n">dir</span><span class="p">);</span>
+<a name="line-286"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dir</span><span class="p">);</span>
+<a name="line-287"></a> <span class="p">}</span>
+<a name="line-288"></a>
+<a name="line-289"></a> <span class="n">data_dir</span> <span class="o">=</span> <span class="n">g_get_user_data_dir</span> <span class="p">();</span>
+<a name="line-290"></a> <span class="n">dir</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">data_dir</span><span class="p">,</span> <span class="s">&quot;sounds&quot;</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-291"></a> <span class="n">sound_theme_in_dir</span> <span class="p">(</span><span class="n">hash</span><span class="p">,</span> <span class="n">dir</span><span class="p">);</span>
+<a name="line-292"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">dir</span><span class="p">);</span>
+<a name="line-293"></a>
+<a name="line-294"></a> <span class="cm">/* If there isn&#39;t at least one theme, make everything</span>
+<a name="line-295"></a><span class="cm"> * insensitive, LAME! */</span>
+<a name="line-296"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_hash_table_size</span> <span class="p">(</span><span class="n">hash</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-297"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-298"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Bad setup, install the freedesktop sound theme&quot;</span><span class="p">);</span>
+<a name="line-299"></a> <span class="n">g_hash_table_destroy</span> <span class="p">(</span><span class="n">hash</span><span class="p">);</span>
+<a name="line-300"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-301"></a> <span class="p">}</span>
+<a name="line-302"></a>
+<a name="line-303"></a> <span class="cm">/* Setup the tree model, 3 columns:</span>
+<a name="line-304"></a><span class="cm"> * - internal theme name/directory</span>
+<a name="line-305"></a><span class="cm"> * - display theme name</span>
+<a name="line-306"></a><span class="cm"> * - the internal id for the parent theme, used for the custom theme */</span>
+<a name="line-307"></a> <span class="n">store</span> <span class="o">=</span> <span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="n">THEME_NUM_COLS</span><span class="p">,</span>
+<a name="line-308"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-309"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-310"></a> <span class="n">G_TYPE_STRING</span><span class="p">);</span>
+<a name="line-311"></a>
+<a name="line-312"></a> <span class="cm">/* Add the themes to a combobox */</span>
+<a name="line-313"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span>
+<a name="line-314"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-315"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-316"></a> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;No sounds&quot;</span><span class="p">),</span>
+<a name="line-317"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="s">&quot;__no_sounds&quot;</span><span class="p">,</span>
+<a name="line-318"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-319"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-320"></a> <span class="n">g_hash_table_foreach</span> <span class="p">(</span><span class="n">hash</span><span class="p">,</span> <span class="p">(</span><span class="n">GHFunc</span><span class="p">)</span> <span class="n">add_theme_to_store</span><span class="p">,</span> <span class="n">store</span><span class="p">);</span>
+<a name="line-321"></a> <span class="n">g_hash_table_destroy</span> <span class="p">(</span><span class="n">hash</span><span class="p">);</span>
+<a name="line-322"></a>
+<a name="line-323"></a> <span class="cm">/* Set the display */</span>
+<a name="line-324"></a> <span class="n">gtk_combo_box_set_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span>
+<a name="line-325"></a> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">store</span><span class="p">));</span>
+<a name="line-326"></a>
+<a name="line-327"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-328"></a> <span class="n">gtk_cell_layout_pack_start</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span>
+<a name="line-329"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-330"></a> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-331"></a> <span class="n">gtk_cell_layout_set_attributes</span> <span class="p">(</span><span class="n">GTK_CELL_LAYOUT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span>
+<a name="line-332"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-333"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span>
+<a name="line-334"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-335"></a>
+<a name="line-336"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span>
+<a name="line-337"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span>
+<a name="line-338"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_combobox_changed</span><span class="p">),</span>
+<a name="line-339"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-340"></a><span class="p">}</span>
+<a name="line-341"></a>
+<a name="line-342"></a><span class="cp">#define GVC_SOUND_SOUND (xmlChar *) &quot;sound&quot;</span>
+<a name="line-343"></a><span class="cp">#define GVC_SOUND_NAME (xmlChar *) &quot;name&quot;</span>
+<a name="line-344"></a><span class="cp">#define GVC_SOUND_FILENAME (xmlChar *) &quot;filename&quot;</span>
+<a name="line-345"></a>
+<a name="line-346"></a><span class="cm">/* Adapted from yelp-toc-pager.c */</span>
+<a name="line-347"></a><span class="k">static</span> <span class="n">xmlChar</span> <span class="o">*</span>
+<a name="line-348"></a><span class="nf">xml_get_and_trim_names</span> <span class="p">(</span><span class="n">xmlNodePtr</span> <span class="n">node</span><span class="p">)</span>
+<a name="line-349"></a><span class="p">{</span>
+<a name="line-350"></a> <span class="n">xmlNodePtr</span> <span class="n">cur</span><span class="p">;</span>
+<a name="line-351"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">keep_lang</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-352"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">value</span><span class="p">;</span>
+<a name="line-353"></a> <span class="kt">int</span> <span class="n">j</span><span class="p">,</span> <span class="n">keep_pri</span> <span class="o">=</span> <span class="n">INT_MAX</span><span class="p">;</span>
+<a name="line-354"></a>
+<a name="line-355"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span> <span class="k">const</span> <span class="o">*</span> <span class="n">langs</span> <span class="o">=</span> <span class="n">g_get_language_names</span> <span class="p">();</span>
+<a name="line-356"></a>
+<a name="line-357"></a> <span class="n">value</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-358"></a>
+<a name="line-359"></a> <span class="k">for</span> <span class="p">(</span><span class="n">cur</span> <span class="o">=</span> <span class="n">node</span><span class="o">-&gt;</span><span class="n">children</span><span class="p">;</span> <span class="n">cur</span><span class="p">;</span> <span class="n">cur</span> <span class="o">=</span> <span class="n">cur</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-360"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">cur</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_NAME</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-361"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">cur_lang</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-362"></a> <span class="kt">int</span> <span class="n">cur_pri</span> <span class="o">=</span> <span class="n">INT_MAX</span><span class="p">;</span>
+<a name="line-363"></a>
+<a name="line-364"></a> <span class="n">cur_lang</span> <span class="o">=</span> <span class="n">xmlNodeGetLang</span> <span class="p">(</span><span class="n">cur</span><span class="p">);</span>
+<a name="line-365"></a>
+<a name="line-366"></a> <span class="k">if</span> <span class="p">(</span><span class="n">cur_lang</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-367"></a> <span class="k">for</span> <span class="p">(</span><span class="n">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">langs</span><span class="p">[</span><span class="n">j</span><span class="p">];</span> <span class="n">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-368"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_str_equal</span> <span class="p">(</span><span class="n">cur_lang</span><span class="p">,</span> <span class="n">langs</span><span class="p">[</span><span class="n">j</span><span class="p">]))</span> <span class="p">{</span>
+<a name="line-369"></a> <span class="n">cur_pri</span> <span class="o">=</span> <span class="n">j</span><span class="p">;</span>
+<a name="line-370"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-371"></a> <span class="p">}</span>
+<a name="line-372"></a> <span class="p">}</span>
+<a name="line-373"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-374"></a> <span class="n">cur_pri</span> <span class="o">=</span> <span class="n">INT_MAX</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-375"></a> <span class="p">}</span>
+<a name="line-376"></a>
+<a name="line-377"></a> <span class="k">if</span> <span class="p">(</span><span class="n">cur_pri</span> <span class="o">&lt;=</span> <span class="n">keep_pri</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-378"></a> <span class="k">if</span> <span class="p">(</span><span class="n">keep_lang</span><span class="p">)</span>
+<a name="line-379"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">keep_lang</span><span class="p">);</span>
+<a name="line-380"></a> <span class="k">if</span> <span class="p">(</span><span class="n">value</span><span class="p">)</span>
+<a name="line-381"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">value</span><span class="p">);</span>
+<a name="line-382"></a>
+<a name="line-383"></a> <span class="n">value</span> <span class="o">=</span> <span class="n">xmlNodeGetContent</span> <span class="p">(</span><span class="n">cur</span><span class="p">);</span>
+<a name="line-384"></a>
+<a name="line-385"></a> <span class="n">keep_lang</span> <span class="o">=</span> <span class="n">cur_lang</span><span class="p">;</span>
+<a name="line-386"></a> <span class="n">keep_pri</span> <span class="o">=</span> <span class="n">cur_pri</span><span class="p">;</span>
+<a name="line-387"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-388"></a> <span class="k">if</span> <span class="p">(</span><span class="n">cur_lang</span><span class="p">)</span>
+<a name="line-389"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">cur_lang</span><span class="p">);</span>
+<a name="line-390"></a> <span class="p">}</span>
+<a name="line-391"></a> <span class="p">}</span>
+<a name="line-392"></a> <span class="p">}</span>
+<a name="line-393"></a>
+<a name="line-394"></a> <span class="cm">/* Delete all GVC_SOUND_NAME nodes */</span>
+<a name="line-395"></a> <span class="n">cur</span> <span class="o">=</span> <span class="n">node</span><span class="o">-&gt;</span><span class="n">children</span><span class="p">;</span>
+<a name="line-396"></a> <span class="k">while</span> <span class="p">(</span><span class="n">cur</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-397"></a> <span class="n">xmlNodePtr</span> <span class="n">this</span> <span class="o">=</span> <span class="n">cur</span><span class="p">;</span>
+<a name="line-398"></a> <span class="n">cur</span> <span class="o">=</span> <span class="n">cur</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">;</span>
+<a name="line-399"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">this</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_NAME</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-400"></a> <span class="n">xmlUnlinkNode</span> <span class="p">(</span><span class="n">this</span><span class="p">);</span>
+<a name="line-401"></a> <span class="n">xmlFreeNode</span> <span class="p">(</span><span class="n">this</span><span class="p">);</span>
+<a name="line-402"></a> <span class="p">}</span>
+<a name="line-403"></a> <span class="p">}</span>
+<a name="line-404"></a>
+<a name="line-405"></a> <span class="k">return</span> <span class="n">value</span><span class="p">;</span>
+<a name="line-406"></a><span class="p">}</span>
+<a name="line-407"></a>
+<a name="line-408"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-409"></a><span class="nf">populate_model_from_node</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-410"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">,</span>
+<a name="line-411"></a> <span class="n">xmlNodePtr</span> <span class="n">node</span><span class="p">)</span>
+<a name="line-412"></a><span class="p">{</span>
+<a name="line-413"></a> <span class="n">xmlNodePtr</span> <span class="n">child</span><span class="p">;</span>
+<a name="line-414"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">filename</span><span class="p">;</span>
+<a name="line-415"></a> <span class="n">xmlChar</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-416"></a>
+<a name="line-417"></a> <span class="n">filename</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-418"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">xml_get_and_trim_names</span> <span class="p">(</span><span class="n">node</span><span class="p">);</span>
+<a name="line-419"></a> <span class="k">for</span> <span class="p">(</span><span class="n">child</span> <span class="o">=</span> <span class="n">node</span><span class="o">-&gt;</span><span class="n">children</span><span class="p">;</span> <span class="n">child</span><span class="p">;</span> <span class="n">child</span> <span class="o">=</span> <span class="n">child</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-420"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xmlNodeIsText</span> <span class="p">(</span><span class="n">child</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-421"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-422"></a> <span class="p">}</span>
+<a name="line-423"></a>
+<a name="line-424"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">child</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_FILENAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-425"></a> <span class="n">filename</span> <span class="o">=</span> <span class="n">xmlNodeGetContent</span> <span class="p">(</span><span class="n">child</span><span class="p">);</span>
+<a name="line-426"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">child</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-427"></a> <span class="cm">/* EH? should have been trimmed */</span>
+<a name="line-428"></a> <span class="p">}</span>
+<a name="line-429"></a> <span class="p">}</span>
+<a name="line-430"></a>
+<a name="line-431"></a> <span class="k">if</span> <span class="p">(</span><span class="n">filename</span> <span class="o">!=</span> <span class="nb">NULL</span> <span class="o">&amp;&amp;</span> <span class="n">name</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-432"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">model</span><span class="p">),</span>
+<a name="line-433"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-434"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-435"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="n">filename</span><span class="p">,</span>
+<a name="line-436"></a> <span class="n">ALERT_DISPLAY_COL</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span>
+<a name="line-437"></a> <span class="n">ALERT_SOUND_TYPE_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Built-in&quot;</span><span class="p">),</span>
+<a name="line-438"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span>
+<a name="line-439"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-440"></a> <span class="p">}</span>
+<a name="line-441"></a>
+<a name="line-442"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-443"></a> <span class="n">xmlFree</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-444"></a><span class="p">}</span>
+<a name="line-445"></a>
+<a name="line-446"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-447"></a><span class="nf">populate_model_from_file</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-448"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">,</span>
+<a name="line-449"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">filename</span><span class="p">)</span>
+<a name="line-450"></a><span class="p">{</span>
+<a name="line-451"></a> <span class="n">xmlDocPtr</span> <span class="n">doc</span><span class="p">;</span>
+<a name="line-452"></a> <span class="n">xmlNodePtr</span> <span class="n">root</span><span class="p">;</span>
+<a name="line-453"></a> <span class="n">xmlNodePtr</span> <span class="n">child</span><span class="p">;</span>
+<a name="line-454"></a> <span class="n">gboolean</span> <span class="n">exists</span><span class="p">;</span>
+<a name="line-455"></a>
+<a name="line-456"></a> <span class="n">exists</span> <span class="o">=</span> <span class="n">g_file_test</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">G_FILE_TEST_EXISTS</span><span class="p">);</span>
+<a name="line-457"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">exists</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-458"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-459"></a> <span class="p">}</span>
+<a name="line-460"></a>
+<a name="line-461"></a> <span class="n">doc</span> <span class="o">=</span> <span class="n">xmlParseFile</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-462"></a> <span class="k">if</span> <span class="p">(</span><span class="n">doc</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-463"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-464"></a> <span class="p">}</span>
+<a name="line-465"></a>
+<a name="line-466"></a> <span class="n">root</span> <span class="o">=</span> <span class="n">xmlDocGetRootElement</span> <span class="p">(</span><span class="n">doc</span><span class="p">);</span>
+<a name="line-467"></a>
+<a name="line-468"></a> <span class="k">for</span> <span class="p">(</span><span class="n">child</span> <span class="o">=</span> <span class="n">root</span><span class="o">-&gt;</span><span class="n">children</span><span class="p">;</span> <span class="n">child</span><span class="p">;</span> <span class="n">child</span> <span class="o">=</span> <span class="n">child</span><span class="o">-&gt;</span><span class="n">next</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-469"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xmlNodeIsText</span> <span class="p">(</span><span class="n">child</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-470"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-471"></a> <span class="p">}</span>
+<a name="line-472"></a> <span class="k">if</span> <span class="p">(</span><span class="n">xmlStrcmp</span> <span class="p">(</span><span class="n">child</span><span class="o">-&gt;</span><span class="n">name</span><span class="p">,</span> <span class="n">GVC_SOUND_SOUND</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-473"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-474"></a> <span class="p">}</span>
+<a name="line-475"></a>
+<a name="line-476"></a> <span class="n">populate_model_from_node</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">model</span><span class="p">,</span> <span class="n">child</span><span class="p">);</span>
+<a name="line-477"></a> <span class="p">}</span>
+<a name="line-478"></a>
+<a name="line-479"></a> <span class="n">xmlFreeDoc</span> <span class="p">(</span><span class="n">doc</span><span class="p">);</span>
+<a name="line-480"></a><span class="p">}</span>
+<a name="line-481"></a>
+<a name="line-482"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-483"></a><span class="nf">populate_model_from_dir</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-484"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">,</span>
+<a name="line-485"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">dirname</span><span class="p">)</span>
+<a name="line-486"></a><span class="p">{</span>
+<a name="line-487"></a> <span class="n">GDir</span> <span class="o">*</span><span class="n">d</span><span class="p">;</span>
+<a name="line-488"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">;</span>
+<a name="line-489"></a>
+<a name="line-490"></a> <span class="n">d</span> <span class="o">=</span> <span class="n">g_dir_open</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-491"></a> <span class="k">if</span> <span class="p">(</span><span class="n">d</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-492"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-493"></a> <span class="p">}</span>
+<a name="line-494"></a>
+<a name="line-495"></a> <span class="k">while</span> <span class="p">((</span><span class="n">name</span> <span class="o">=</span> <span class="n">g_dir_read_name</span> <span class="p">(</span><span class="n">d</span><span class="p">))</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-496"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-497"></a>
+<a name="line-498"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">g_str_has_suffix</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="s">&quot;.xml&quot;</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-499"></a> <span class="k">continue</span><span class="p">;</span>
+<a name="line-500"></a> <span class="p">}</span>
+<a name="line-501"></a>
+<a name="line-502"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">g_build_filename</span> <span class="p">(</span><span class="n">dirname</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-503"></a> <span class="n">populate_model_from_file</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">model</span><span class="p">,</span> <span class="n">path</span><span class="p">);</span>
+<a name="line-504"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
+<a name="line-505"></a> <span class="p">}</span>
+<a name="line-506"></a>
+<a name="line-507"></a> <span class="n">g_dir_close</span> <span class="p">(</span><span class="n">d</span><span class="p">);</span>
+<a name="line-508"></a><span class="p">}</span>
+<a name="line-509"></a>
+<a name="line-510"></a><span class="k">static</span> <span class="n">gboolean</span>
+<a name="line-511"></a><span class="nf">save_alert_sounds</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-512"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">id</span><span class="p">)</span>
+<a name="line-513"></a><span class="p">{</span>
+<a name="line-514"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">sounds</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> <span class="s">&quot;bell-terminal&quot;</span><span class="p">,</span> <span class="s">&quot;bell-window-system&quot;</span><span class="p">,</span> <span class="nb">NULL</span> <span class="p">};</span>
+<a name="line-515"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-516"></a>
+<a name="line-517"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">id</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-518"></a> <span class="n">delete_old_files</span> <span class="p">(</span><span class="n">sounds</span><span class="p">);</span>
+<a name="line-519"></a> <span class="n">delete_disabled_files</span> <span class="p">(</span><span class="n">sounds</span><span class="p">);</span>
+<a name="line-520"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-521"></a> <span class="n">delete_old_files</span> <span class="p">(</span><span class="n">sounds</span><span class="p">);</span>
+<a name="line-522"></a> <span class="n">delete_disabled_files</span> <span class="p">(</span><span class="n">sounds</span><span class="p">);</span>
+<a name="line-523"></a> <span class="n">add_custom_file</span> <span class="p">(</span><span class="n">sounds</span><span class="p">,</span> <span class="n">id</span><span class="p">);</span>
+<a name="line-524"></a> <span class="p">}</span>
+<a name="line-525"></a>
+<a name="line-526"></a> <span class="cm">/* And poke the directory so the theme gets updated */</span>
+<a name="line-527"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">custom_theme_dir_path</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
+<a name="line-528"></a> <span class="k">if</span> <span class="p">(</span><span class="n">utime</span> <span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-529"></a> <span class="n">g_warning</span> <span class="p">(</span><span class="s">&quot;Failed to update mtime for directory &#39;%s&#39;: %s&quot;</span><span class="p">,</span>
+<a name="line-530"></a> <span class="n">path</span><span class="p">,</span> <span class="n">g_strerror</span> <span class="p">(</span><span class="n">errno</span><span class="p">));</span>
+<a name="line-531"></a> <span class="p">}</span>
+<a name="line-532"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
+<a name="line-533"></a>
+<a name="line-534"></a> <span class="k">return</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-535"></a><span class="p">}</span>
+<a name="line-536"></a>
+<a name="line-537"></a>
+<a name="line-538"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-539"></a><span class="nf">update_alert_model</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-540"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">id</span><span class="p">)</span>
+<a name="line-541"></a><span class="p">{</span>
+<a name="line-542"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-543"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-544"></a>
+<a name="line-545"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-546"></a> <span class="n">gtk_tree_model_get_iter_first</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-547"></a> <span class="k">do</span> <span class="p">{</span>
+<a name="line-548"></a> <span class="n">gboolean</span> <span class="n">toggled</span><span class="p">;</span>
+<a name="line-549"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">this_id</span><span class="p">;</span>
+<a name="line-550"></a>
+<a name="line-551"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-552"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">this_id</span><span class="p">,</span>
+<a name="line-553"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-554"></a>
+<a name="line-555"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">this_id</span><span class="p">,</span> <span class="n">id</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-556"></a> <span class="n">toggled</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-557"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-558"></a> <span class="n">toggled</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-559"></a> <span class="p">}</span>
+<a name="line-560"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">this_id</span><span class="p">);</span>
+<a name="line-561"></a>
+<a name="line-562"></a> <span class="n">gtk_list_store_set</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">model</span><span class="p">),</span>
+<a name="line-563"></a> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-564"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span> <span class="n">toggled</span><span class="p">,</span>
+<a name="line-565"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-566"></a> <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">gtk_tree_model_iter_next</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">));</span>
+<a name="line-567"></a><span class="p">}</span>
+<a name="line-568"></a>
+<a name="line-569"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-570"></a><span class="nf">update_alert</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-571"></a> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">alert_id</span><span class="p">)</span>
+<a name="line-572"></a><span class="p">{</span>
+<a name="line-573"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">theme_model</span><span class="p">;</span>
+<a name="line-574"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-575"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">theme</span><span class="p">;</span>
+<a name="line-576"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">parent</span><span class="p">;</span>
+<a name="line-577"></a> <span class="n">gboolean</span> <span class="n">is_custom</span><span class="p">;</span>
+<a name="line-578"></a> <span class="n">gboolean</span> <span class="n">is_default</span><span class="p">;</span>
+<a name="line-579"></a> <span class="n">gboolean</span> <span class="n">add_custom</span><span class="p">;</span>
+<a name="line-580"></a> <span class="n">gboolean</span> <span class="n">remove_custom</span><span class="p">;</span>
+<a name="line-581"></a>
+<a name="line-582"></a> <span class="n">theme_model</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">));</span>
+<a name="line-583"></a> <span class="cm">/* Get the current theme&#39;s name, and set the parent */</span>
+<a name="line-584"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_combo_box_get_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-585"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-586"></a> <span class="p">}</span>
+<a name="line-587"></a>
+<a name="line-588"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-589"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">theme</span><span class="p">,</span>
+<a name="line-590"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">parent</span><span class="p">,</span>
+<a name="line-591"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-592"></a> <span class="n">is_custom</span> <span class="o">=</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">theme</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-593"></a> <span class="n">is_default</span> <span class="o">=</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">alert_id</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">;</span>
+<a name="line-594"></a>
+<a name="line-595"></a> <span class="cm">/* So a few possibilities:</span>
+<a name="line-596"></a><span class="cm"> * 1. Named theme, default alert selected: noop</span>
+<a name="line-597"></a><span class="cm"> * 2. Named theme, alternate alert selected: create new custom with sound</span>
+<a name="line-598"></a><span class="cm"> * 3. Custom theme, default alert selected: remove sound and possibly custom</span>
+<a name="line-599"></a><span class="cm"> * 4. Custom theme, alternate alert selected: update custom sound</span>
+<a name="line-600"></a><span class="cm"> */</span>
+<a name="line-601"></a> <span class="n">add_custom</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-602"></a> <span class="n">remove_custom</span> <span class="o">=</span> <span class="n">FALSE</span><span class="p">;</span>
+<a name="line-603"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">is_custom</span> <span class="o">&amp;&amp;</span> <span class="n">is_default</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-604"></a> <span class="cm">/* remove custom just in case */</span>
+<a name="line-605"></a> <span class="n">remove_custom</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-606"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="n">is_custom</span> <span class="o">&amp;&amp;</span> <span class="o">!</span> <span class="n">is_default</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-607"></a> <span class="n">create_custom_theme</span> <span class="p">(</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-608"></a> <span class="n">save_alert_sounds</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">alert_id</span><span class="p">);</span>
+<a name="line-609"></a> <span class="n">add_custom</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-610"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">is_custom</span> <span class="o">&amp;&amp;</span> <span class="n">is_default</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-611"></a> <span class="n">save_alert_sounds</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">alert_id</span><span class="p">);</span>
+<a name="line-612"></a> <span class="cm">/* after removing files check if it is empty */</span>
+<a name="line-613"></a> <span class="k">if</span> <span class="p">(</span><span class="n">custom_theme_dir_is_empty</span> <span class="p">())</span> <span class="p">{</span>
+<a name="line-614"></a> <span class="n">remove_custom</span> <span class="o">=</span> <span class="n">TRUE</span><span class="p">;</span>
+<a name="line-615"></a> <span class="p">}</span>
+<a name="line-616"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">is_custom</span> <span class="o">&amp;&amp;</span> <span class="o">!</span> <span class="n">is_default</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-617"></a> <span class="n">save_alert_sounds</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">alert_id</span><span class="p">);</span>
+<a name="line-618"></a> <span class="p">}</span>
+<a name="line-619"></a>
+<a name="line-620"></a> <span class="k">if</span> <span class="p">(</span><span class="n">add_custom</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-621"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">),</span>
+<a name="line-622"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-623"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-624"></a> <span class="n">THEME_DISPLAY_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Custom&quot;</span><span class="p">),</span>
+<a name="line-625"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">,</span>
+<a name="line-626"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="n">theme</span><span class="p">,</span>
+<a name="line-627"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-628"></a> <span class="n">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">);</span>
+<a name="line-629"></a> <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">remove_custom</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-630"></a> <span class="n">gtk_tree_model_get_iter_first</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-631"></a> <span class="k">do</span> <span class="p">{</span>
+<a name="line-632"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">this_parent</span><span class="p">;</span>
+<a name="line-633"></a>
+<a name="line-634"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-635"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">this_parent</span><span class="p">,</span>
+<a name="line-636"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-637"></a> <span class="k">if</span> <span class="p">(</span><span class="n">this_parent</span> <span class="o">!=</span> <span class="nb">NULL</span> <span class="o">&amp;&amp;</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">this_parent</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-638"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">this_parent</span><span class="p">);</span>
+<a name="line-639"></a> <span class="n">gtk_list_store_remove</span> <span class="p">(</span><span class="n">GTK_LIST_STORE</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">);</span>
+<a name="line-640"></a> <span class="k">break</span><span class="p">;</span>
+<a name="line-641"></a> <span class="p">}</span>
+<a name="line-642"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">this_parent</span><span class="p">);</span>
+<a name="line-643"></a> <span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="n">gtk_tree_model_iter_next</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">));</span>
+<a name="line-644"></a>
+<a name="line-645"></a> <span class="n">delete_custom_theme_dir</span> <span class="p">();</span>
+<a name="line-646"></a>
+<a name="line-647"></a> <span class="n">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">parent</span><span class="p">);</span>
+<a name="line-648"></a> <span class="p">}</span>
+<a name="line-649"></a>
+<a name="line-650"></a> <span class="n">update_alert_model</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">alert_id</span><span class="p">);</span>
+<a name="line-651"></a>
+<a name="line-652"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">theme</span><span class="p">);</span>
+<a name="line-653"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent</span><span class="p">);</span>
+<a name="line-654"></a><span class="p">}</span>
+<a name="line-655"></a>
+<a name="line-656"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-657"></a><span class="nf">on_alert_toggled</span> <span class="p">(</span><span class="n">GtkCellRendererToggle</span> <span class="o">*</span><span class="n">renderer</span><span class="p">,</span>
+<a name="line-658"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">path_str</span><span class="p">,</span>
+<a name="line-659"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-660"></a><span class="p">{</span>
+<a name="line-661"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-662"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-663"></a> <span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-664"></a> <span class="n">gboolean</span> <span class="n">toggled</span><span class="p">;</span>
+<a name="line-665"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">id</span><span class="p">;</span>
+<a name="line-666"></a>
+<a name="line-667"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-668"></a>
+<a name="line-669"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">gtk_tree_path_new_from_string</span> <span class="p">(</span><span class="n">path_str</span><span class="p">);</span>
+<a name="line-670"></a> <span class="n">gtk_tree_model_get_iter</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="n">path</span><span class="p">);</span>
+<a name="line-671"></a> <span class="n">gtk_tree_path_free</span> <span class="p">(</span><span class="n">path</span><span class="p">);</span>
+<a name="line-672"></a>
+<a name="line-673"></a> <span class="n">id</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-674"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-675"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">id</span><span class="p">,</span>
+<a name="line-676"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">toggled</span><span class="p">,</span>
+<a name="line-677"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-678"></a>
+<a name="line-679"></a> <span class="n">toggled</span> <span class="o">^=</span> <span class="mi">1</span><span class="p">;</span>
+<a name="line-680"></a> <span class="k">if</span> <span class="p">(</span><span class="n">toggled</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-681"></a> <span class="n">update_alert</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">id</span><span class="p">);</span>
+<a name="line-682"></a> <span class="p">}</span>
+<a name="line-683"></a>
+<a name="line-684"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">id</span><span class="p">);</span>
+<a name="line-685"></a><span class="p">}</span>
+<a name="line-686"></a>
+<a name="line-687"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-688"></a><span class="nf">play_preview_for_path</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span> <span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">)</span>
+<a name="line-689"></a><span class="p">{</span>
+<a name="line-690"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-691"></a> <span class="n">GtkTreeIter</span> <span class="n">iter</span><span class="p">;</span>
+<a name="line-692"></a> <span class="n">GtkTreeIter</span> <span class="n">theme_iter</span><span class="p">;</span>
+<a name="line-693"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">id</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-694"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">parent_theme</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-695"></a>
+<a name="line-696"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-697"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_tree_model_get_iter</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span> <span class="n">path</span><span class="p">)</span> <span class="o">==</span> <span class="n">FALSE</span><span class="p">)</span>
+<a name="line-698"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-699"></a>
+<a name="line-700"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">iter</span><span class="p">,</span>
+<a name="line-701"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">id</span><span class="p">,</span>
+<a name="line-702"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-703"></a> <span class="k">if</span> <span class="p">(</span><span class="n">id</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-704"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-705"></a>
+<a name="line-706"></a> <span class="k">if</span> <span class="p">(</span><span class="n">gtk_combo_box_get_active_iter</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">),</span> <span class="o">&amp;</span><span class="n">theme_iter</span><span class="p">))</span> <span class="p">{</span>
+<a name="line-707"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">theme_model</span><span class="p">;</span>
+<a name="line-708"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">theme_id</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-709"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">parent_id</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-710"></a>
+<a name="line-711"></a> <span class="n">theme_model</span> <span class="o">=</span> <span class="n">gtk_combo_box_get_model</span> <span class="p">(</span><span class="n">GTK_COMBO_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">));</span>
+<a name="line-712"></a>
+<a name="line-713"></a> <span class="n">gtk_tree_model_get</span> <span class="p">(</span><span class="n">theme_model</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">theme_iter</span><span class="p">,</span>
+<a name="line-714"></a> <span class="n">THEME_IDENTIFIER_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">theme_id</span><span class="p">,</span>
+<a name="line-715"></a> <span class="n">THEME_PARENT_ID_COL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">parent_id</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-716"></a> <span class="k">if</span> <span class="p">(</span><span class="n">theme_id</span> <span class="o">&amp;&amp;</span> <span class="n">strcmp</span> <span class="p">(</span><span class="n">theme_id</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+<a name="line-717"></a> <span class="n">parent_theme</span> <span class="o">=</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">parent_id</span><span class="p">);</span>
+<a name="line-718"></a>
+<a name="line-719"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">theme_id</span><span class="p">);</span>
+<a name="line-720"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent_id</span><span class="p">);</span>
+<a name="line-721"></a> <span class="p">}</span>
+<a name="line-722"></a>
+<a name="line-723"></a> <span class="cm">/* special case: for the default item on custom themes</span>
+<a name="line-724"></a><span class="cm"> * play the alert for the parent theme */</span>
+<a name="line-725"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">id</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-726"></a> <span class="k">if</span> <span class="p">(</span><span class="n">parent_theme</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-727"></a> <span class="n">ca_gtk_play_for_widget</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-728"></a> <span class="n">CA_PROP_APPLICATION_NAME</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Sound Preferences&quot;</span><span class="p">),</span>
+<a name="line-729"></a> <span class="n">CA_PROP_EVENT_ID</span><span class="p">,</span> <span class="s">&quot;bell-window-system&quot;</span><span class="p">,</span>
+<a name="line-730"></a> <span class="n">CA_PROP_CANBERRA_XDG_THEME_NAME</span><span class="p">,</span> <span class="n">parent_theme</span><span class="p">,</span>
+<a name="line-731"></a> <span class="n">CA_PROP_EVENT_DESCRIPTION</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Testing event sound&quot;</span><span class="p">),</span>
+<a name="line-732"></a> <span class="n">CA_PROP_CANBERRA_CACHE_CONTROL</span><span class="p">,</span> <span class="s">&quot;never&quot;</span><span class="p">,</span>
+<a name="line-733"></a> <span class="n">CA_PROP_APPLICATION_ID</span><span class="p">,</span> <span class="s">&quot;org.mate.VolumeControl&quot;</span><span class="p">,</span>
+<a name="line-734"></a><span class="cp">#ifdef CA_PROP_CANBERRA_ENABLE</span>
+<a name="line-735"></a><span class="hll"> <span class="n">CA_PROP_CANBERRA_ENABLE</span><span class="p">,</span> <span class="s">&quot;1&quot;</span><span class="p">,</span><span class='error2'>&lt;--- Skipping configuration 'CA_PROP_CANBERRA_ENABLE' since the value of 'CA_PROP_CANBERRA_ENABLE' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</span>
+</span><a name="line-736"></a><span class="cp">#endif</span>
+<a name="line-737"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-738"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-739"></a> <span class="n">ca_gtk_play_for_widget</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-740"></a> <span class="n">CA_PROP_APPLICATION_NAME</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Sound Preferences&quot;</span><span class="p">),</span>
+<a name="line-741"></a> <span class="n">CA_PROP_EVENT_ID</span><span class="p">,</span> <span class="s">&quot;bell-window-system&quot;</span><span class="p">,</span>
+<a name="line-742"></a> <span class="n">CA_PROP_EVENT_DESCRIPTION</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Testing event sound&quot;</span><span class="p">),</span>
+<a name="line-743"></a> <span class="n">CA_PROP_CANBERRA_CACHE_CONTROL</span><span class="p">,</span> <span class="s">&quot;never&quot;</span><span class="p">,</span>
+<a name="line-744"></a> <span class="n">CA_PROP_APPLICATION_ID</span><span class="p">,</span> <span class="s">&quot;org.mate.VolumeControl&quot;</span><span class="p">,</span>
+<a name="line-745"></a><span class="cp">#ifdef CA_PROP_CANBERRA_ENABLE</span>
+<a name="line-746"></a><span class="hll"> <span class="n">CA_PROP_CANBERRA_ENABLE</span><span class="p">,</span> <span class="s">&quot;1&quot;</span><span class="p">,</span><span class='error2'>&lt;--- Skipping configuration 'CA_PROP_CANBERRA_ENABLE' since the value of 'CA_PROP_CANBERRA_ENABLE' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</span>
+</span><a name="line-747"></a><span class="cp">#endif</span>
+<a name="line-748"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-749"></a> <span class="p">}</span>
+<a name="line-750"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-751"></a> <span class="n">ca_gtk_play_for_widget</span> <span class="p">(</span><span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span>
+<a name="line-752"></a> <span class="n">CA_PROP_APPLICATION_NAME</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Sound Preferences&quot;</span><span class="p">),</span>
+<a name="line-753"></a> <span class="n">CA_PROP_MEDIA_FILENAME</span><span class="p">,</span> <span class="n">id</span><span class="p">,</span>
+<a name="line-754"></a> <span class="n">CA_PROP_EVENT_DESCRIPTION</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Testing event sound&quot;</span><span class="p">),</span>
+<a name="line-755"></a> <span class="n">CA_PROP_CANBERRA_CACHE_CONTROL</span><span class="p">,</span> <span class="s">&quot;never&quot;</span><span class="p">,</span>
+<a name="line-756"></a> <span class="n">CA_PROP_APPLICATION_ID</span><span class="p">,</span> <span class="s">&quot;org.mate.VolumeControl&quot;</span><span class="p">,</span>
+<a name="line-757"></a><span class="cp">#ifdef CA_PROP_CANBERRA_ENABLE</span>
+<a name="line-758"></a><span class="hll"> <span class="n">CA_PROP_CANBERRA_ENABLE</span><span class="p">,</span> <span class="s">&quot;1&quot;</span><span class="p">,</span><span class='error2'>&lt;--- Skipping configuration 'CA_PROP_CANBERRA_ENABLE' since the value of 'CA_PROP_CANBERRA_ENABLE' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.</span>
+</span><a name="line-759"></a><span class="cp">#endif</span>
+<a name="line-760"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-761"></a>
+<a name="line-762"></a> <span class="p">}</span>
+<a name="line-763"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">parent_theme</span><span class="p">);</span>
+<a name="line-764"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">id</span><span class="p">);</span>
+<a name="line-765"></a><span class="p">}</span>
+<a name="line-766"></a>
+<a name="line-767"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-768"></a><span class="nf">on_treeview_row_activated</span> <span class="p">(</span><span class="n">GtkTreeView</span> <span class="o">*</span><span class="n">treeview</span><span class="p">,</span>
+<a name="line-769"></a> <span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">,</span>
+<a name="line-770"></a> <span class="n">GtkTreeViewColumn</span> <span class="o">*</span><span class="n">column</span><span class="p">,</span>
+<a name="line-771"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-772"></a><span class="p">{</span>
+<a name="line-773"></a> <span class="n">play_preview_for_path</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">path</span><span class="p">);</span>
+<a name="line-774"></a><span class="p">}</span>
+<a name="line-775"></a>
+<a name="line-776"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-777"></a><span class="nf">on_treeview_selection_changed</span> <span class="p">(</span><span class="n">GtkTreeSelection</span> <span class="o">*</span><span class="n">selection</span><span class="p">,</span>
+<a name="line-778"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-779"></a><span class="p">{</span>
+<a name="line-780"></a> <span class="n">GList</span> <span class="o">*</span><span class="n">paths</span><span class="p">;</span>
+<a name="line-781"></a> <span class="n">GtkTreeModel</span> <span class="o">*</span><span class="n">model</span><span class="p">;</span>
+<a name="line-782"></a> <span class="n">GtkTreePath</span> <span class="o">*</span><span class="n">path</span><span class="p">;</span>
+<a name="line-783"></a>
+<a name="line-784"></a> <span class="k">if</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-785"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-786"></a>
+<a name="line-787"></a> <span class="n">model</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-788"></a>
+<a name="line-789"></a> <span class="n">paths</span> <span class="o">=</span> <span class="n">gtk_tree_selection_get_selected_rows</span> <span class="p">(</span><span class="n">selection</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">model</span><span class="p">);</span>
+<a name="line-790"></a> <span class="k">if</span> <span class="p">(</span><span class="n">paths</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span>
+<a name="line-791"></a> <span class="k">return</span><span class="p">;</span>
+<a name="line-792"></a>
+<a name="line-793"></a> <span class="n">path</span> <span class="o">=</span> <span class="n">paths</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">;</span>
+<a name="line-794"></a> <span class="n">play_preview_for_path</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">path</span><span class="p">);</span>
+<a name="line-795"></a>
+<a name="line-796"></a> <span class="n">g_list_foreach</span> <span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="p">(</span><span class="n">GFunc</span><span class="p">)</span><span class="n">gtk_tree_path_free</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-797"></a> <span class="n">g_list_free</span> <span class="p">(</span><span class="n">paths</span><span class="p">);</span>
+<a name="line-798"></a><span class="p">}</span>
+<a name="line-799"></a>
+<a name="line-800"></a><span class="k">static</span> <span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-801"></a><span class="nf">create_alert_treeview</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-802"></a><span class="p">{</span>
+<a name="line-803"></a> <span class="n">GtkListStore</span> <span class="o">*</span><span class="n">store</span><span class="p">;</span>
+<a name="line-804"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">treeview</span><span class="p">;</span>
+<a name="line-805"></a> <span class="n">GtkCellRenderer</span> <span class="o">*</span><span class="n">renderer</span><span class="p">;</span>
+<a name="line-806"></a> <span class="n">GtkTreeViewColumn</span> <span class="o">*</span><span class="n">column</span><span class="p">;</span>
+<a name="line-807"></a> <span class="n">GtkTreeSelection</span> <span class="o">*</span><span class="n">selection</span><span class="p">;</span>
+<a name="line-808"></a>
+<a name="line-809"></a> <span class="n">treeview</span> <span class="o">=</span> <span class="n">gtk_tree_view_new</span> <span class="p">();</span>
+<a name="line-810"></a>
+<a name="line-811"></a> <span class="n">gtk_tree_view_set_headers_visible</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span> <span class="n">FALSE</span><span class="p">);</span>
+<a name="line-812"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span>
+<a name="line-813"></a> <span class="s">&quot;row-activated&quot;</span><span class="p">,</span>
+<a name="line-814"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_treeview_row_activated</span><span class="p">),</span>
+<a name="line-815"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-816"></a>
+<a name="line-817"></a> <span class="n">selection</span> <span class="o">=</span> <span class="n">gtk_tree_view_get_selection</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">));</span>
+<a name="line-818"></a>
+<a name="line-819"></a> <span class="n">gtk_tree_selection_set_mode</span> <span class="p">(</span><span class="n">selection</span><span class="p">,</span> <span class="n">GTK_SELECTION_SINGLE</span><span class="p">);</span>
+<a name="line-820"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">selection</span><span class="p">),</span>
+<a name="line-821"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span>
+<a name="line-822"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_treeview_selection_changed</span><span class="p">),</span>
+<a name="line-823"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-824"></a>
+<a name="line-825"></a> <span class="cm">/* Setup the tree model, 3 columns:</span>
+<a name="line-826"></a><span class="cm"> * - display name</span>
+<a name="line-827"></a><span class="cm"> * - sound id</span>
+<a name="line-828"></a><span class="cm"> * - sound type</span>
+<a name="line-829"></a><span class="cm"> */</span>
+<a name="line-830"></a> <span class="n">store</span> <span class="o">=</span> <span class="n">gtk_list_store_new</span> <span class="p">(</span><span class="n">ALERT_NUM_COLS</span><span class="p">,</span>
+<a name="line-831"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-832"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-833"></a> <span class="n">G_TYPE_STRING</span><span class="p">,</span>
+<a name="line-834"></a> <span class="n">G_TYPE_BOOLEAN</span><span class="p">);</span>
+<a name="line-835"></a>
+<a name="line-836"></a> <span class="n">gtk_list_store_insert_with_values</span> <span class="p">(</span><span class="n">store</span><span class="p">,</span>
+<a name="line-837"></a> <span class="nb">NULL</span><span class="p">,</span>
+<a name="line-838"></a> <span class="n">G_MAXINT</span><span class="p">,</span>
+<a name="line-839"></a> <span class="n">ALERT_IDENTIFIER_COL</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">,</span>
+<a name="line-840"></a> <span class="n">ALERT_DISPLAY_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;Default&quot;</span><span class="p">),</span>
+<a name="line-841"></a> <span class="n">ALERT_SOUND_TYPE_COL</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;From theme&quot;</span><span class="p">),</span>
+<a name="line-842"></a> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span>
+<a name="line-843"></a> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+<a name="line-844"></a>
+<a name="line-845"></a> <span class="n">populate_model_from_dir</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">store</span><span class="p">),</span> <span class="n">SOUND_SET_DIR</span><span class="p">);</span>
+<a name="line-846"></a>
+<a name="line-847"></a> <span class="n">gtk_tree_view_set_model</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span>
+<a name="line-848"></a> <span class="n">GTK_TREE_MODEL</span> <span class="p">(</span><span class="n">store</span><span class="p">));</span>
+<a name="line-849"></a>
+<a name="line-850"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_toggle_new</span> <span class="p">();</span>
+<a name="line-851"></a> <span class="n">gtk_cell_renderer_toggle_set_radio</span> <span class="p">(</span><span class="n">GTK_CELL_RENDERER_TOGGLE</span> <span class="p">(</span><span class="n">renderer</span><span class="p">),</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-852"></a>
+<a name="line-853"></a> <span class="n">column</span> <span class="o">=</span> <span class="n">gtk_tree_view_column_new_with_attributes</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">,</span>
+<a name="line-854"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-855"></a> <span class="s">&quot;active&quot;</span><span class="p">,</span> <span class="n">ALERT_ACTIVE_COL</span><span class="p">,</span>
+<a name="line-856"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-857"></a> <span class="n">gtk_tree_view_append_column</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span> <span class="n">column</span><span class="p">);</span>
+<a name="line-858"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">renderer</span><span class="p">,</span>
+<a name="line-859"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span>
+<a name="line-860"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_alert_toggled</span><span class="p">),</span>
+<a name="line-861"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-862"></a>
+<a name="line-863"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-864"></a> <span class="n">column</span> <span class="o">=</span> <span class="n">gtk_tree_view_column_new_with_attributes</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Name&quot;</span><span class="p">),</span>
+<a name="line-865"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-866"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span> <span class="n">ALERT_DISPLAY_COL</span><span class="p">,</span>
+<a name="line-867"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-868"></a> <span class="n">gtk_tree_view_append_column</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span> <span class="n">column</span><span class="p">);</span>
+<a name="line-869"></a>
+<a name="line-870"></a> <span class="n">renderer</span> <span class="o">=</span> <span class="n">gtk_cell_renderer_text_new</span> <span class="p">();</span>
+<a name="line-871"></a> <span class="n">column</span> <span class="o">=</span> <span class="n">gtk_tree_view_column_new_with_attributes</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Type&quot;</span><span class="p">),</span>
+<a name="line-872"></a> <span class="n">renderer</span><span class="p">,</span>
+<a name="line-873"></a> <span class="s">&quot;text&quot;</span><span class="p">,</span> <span class="n">ALERT_SOUND_TYPE_COL</span><span class="p">,</span>
+<a name="line-874"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-875"></a>
+<a name="line-876"></a> <span class="n">gtk_tree_view_append_column</span> <span class="p">(</span><span class="n">GTK_TREE_VIEW</span> <span class="p">(</span><span class="n">treeview</span><span class="p">),</span> <span class="n">column</span><span class="p">);</span>
+<a name="line-877"></a>
+<a name="line-878"></a> <span class="k">return</span> <span class="n">treeview</span><span class="p">;</span>
+<a name="line-879"></a><span class="p">}</span>
+<a name="line-880"></a>
+<a name="line-881"></a><span class="k">static</span> <span class="kt">int</span>
+<a name="line-882"></a><span class="nf">get_file_type</span> <span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">sound_name</span><span class="p">,</span>
+<a name="line-883"></a> <span class="kt">char</span> <span class="o">**</span><span class="n">linked_name</span><span class="p">)</span>
+<a name="line-884"></a><span class="p">{</span>
+<a name="line-885"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">name</span><span class="p">,</span> <span class="o">*</span><span class="n">filename</span><span class="p">;</span>
+<a name="line-886"></a>
+<a name="line-887"></a> <span class="o">*</span><span class="n">linked_name</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-888"></a>
+<a name="line-889"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;%s.disabled&quot;</span><span class="p">,</span> <span class="n">sound_name</span><span class="p">);</span>
+<a name="line-890"></a> <span class="n">filename</span> <span class="o">=</span> <span class="n">custom_theme_dir_path</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-891"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-892"></a>
+<a name="line-893"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">G_FILE_TEST_IS_REGULAR</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-894"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-895"></a> <span class="k">return</span> <span class="n">SOUND_TYPE_OFF</span><span class="p">;</span>
+<a name="line-896"></a> <span class="p">}</span>
+<a name="line-897"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-898"></a>
+<a name="line-899"></a> <span class="cm">/* We only check for .ogg files because those are the</span>
+<a name="line-900"></a><span class="cm"> * only ones we create */</span>
+<a name="line-901"></a> <span class="n">name</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;%s.ogg&quot;</span><span class="p">,</span> <span class="n">sound_name</span><span class="p">);</span>
+<a name="line-902"></a> <span class="n">filename</span> <span class="o">=</span> <span class="n">custom_theme_dir_path</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-903"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">name</span><span class="p">);</span>
+<a name="line-904"></a>
+<a name="line-905"></a> <span class="k">if</span> <span class="p">(</span><span class="n">g_file_test</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">G_FILE_TEST_IS_SYMLINK</span><span class="p">)</span> <span class="o">!=</span> <span class="n">FALSE</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-906"></a> <span class="o">*</span><span class="n">linked_name</span> <span class="o">=</span> <span class="n">g_file_read_link</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-907"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-908"></a> <span class="k">return</span> <span class="n">SOUND_TYPE_CUSTOM</span><span class="p">;</span>
+<a name="line-909"></a> <span class="p">}</span>
+<a name="line-910"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
+<a name="line-911"></a>
+<a name="line-912"></a> <span class="k">return</span> <span class="n">SOUND_TYPE_BUILTIN</span><span class="p">;</span>
+<a name="line-913"></a><span class="p">}</span>
+<a name="line-914"></a>
+<a name="line-915"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-916"></a><span class="nf">update_alerts_from_theme_name</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span>
+<a name="line-917"></a> <span class="k">const</span> <span class="n">gchar</span> <span class="o">*</span><span class="n">name</span><span class="p">)</span>
+<a name="line-918"></a><span class="p">{</span>
+<a name="line-919"></a> <span class="k">if</span> <span class="p">(</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">CUSTOM_THEME_NAME</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-920"></a> <span class="cm">/* reset alert to default */</span>
+<a name="line-921"></a> <span class="n">update_alert</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">DEFAULT_ALERT_ID</span><span class="p">);</span>
+<a name="line-922"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-923"></a> <span class="kt">int</span> <span class="n">sound_type</span><span class="p">;</span>
+<a name="line-924"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">linkname</span><span class="p">;</span>
+<a name="line-925"></a>
+<a name="line-926"></a> <span class="n">linkname</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<a name="line-927"></a> <span class="n">sound_type</span> <span class="o">=</span> <span class="n">get_file_type</span> <span class="p">(</span><span class="s">&quot;bell-terminal&quot;</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">linkname</span><span class="p">);</span>
+<a name="line-928"></a> <span class="n">g_debug</span> <span class="p">(</span><span class="s">&quot;Found link: %s&quot;</span><span class="p">,</span> <span class="n">linkname</span><span class="p">);</span>
+<a name="line-929"></a> <span class="k">if</span> <span class="p">(</span><span class="n">sound_type</span> <span class="o">==</span> <span class="n">SOUND_TYPE_CUSTOM</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-930"></a> <span class="n">update_alert</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">linkname</span><span class="p">);</span>
+<a name="line-931"></a> <span class="p">}</span>
+<a name="line-932"></a> <span class="p">}</span>
+<a name="line-933"></a><span class="p">}</span>
+<a name="line-934"></a>
+<a name="line-935"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-936"></a><span class="nf">update_theme</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-937"></a><span class="p">{</span>
+<a name="line-938"></a> <span class="kt">char</span> <span class="o">*</span><span class="n">theme_name</span><span class="p">;</span>
+<a name="line-939"></a> <span class="n">gboolean</span> <span class="n">events_enabled</span><span class="p">;</span>
+<a name="line-940"></a> <span class="n">gboolean</span> <span class="n">feedback_enabled</span><span class="p">;</span>
+<a name="line-941"></a>
+<a name="line-942"></a> <span class="n">feedback_enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">INPUT_SOUNDS_KEY</span><span class="p">);</span>
+<a name="line-943"></a> <span class="n">set_input_feedback_enabled</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">feedback_enabled</span><span class="p">);</span>
+<a name="line-944"></a>
+<a name="line-945"></a> <span class="n">events_enabled</span> <span class="o">=</span> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">EVENT_SOUNDS_KEY</span><span class="p">);</span>
+<a name="line-946"></a> <span class="k">if</span> <span class="p">(</span><span class="n">events_enabled</span><span class="p">)</span> <span class="p">{</span>
+<a name="line-947"></a> <span class="n">theme_name</span> <span class="o">=</span> <span class="n">g_settings_get_string</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">SOUND_THEME_KEY</span><span class="p">);</span>
+<a name="line-948"></a> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+<a name="line-949"></a> <span class="n">theme_name</span> <span class="o">=</span> <span class="n">g_strdup</span> <span class="p">(</span><span class="n">NO_SOUNDS_THEME_NAME</span><span class="p">);</span>
+<a name="line-950"></a> <span class="p">}</span>
+<a name="line-951"></a>
+<a name="line-952"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">selection_box</span><span class="p">,</span> <span class="n">events_enabled</span><span class="p">);</span>
+<a name="line-953"></a> <span class="n">gtk_widget_set_sensitive</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">,</span> <span class="n">events_enabled</span><span class="p">);</span>
+<a name="line-954"></a>
+<a name="line-955"></a> <span class="n">set_combox_for_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">theme_name</span><span class="p">);</span>
+<a name="line-956"></a>
+<a name="line-957"></a> <span class="n">update_alerts_from_theme_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">theme_name</span><span class="p">);</span>
+<a name="line-958"></a>
+<a name="line-959"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">theme_name</span><span class="p">);</span>
+<a name="line-960"></a><span class="p">}</span>
+<a name="line-961"></a>
+<a name="line-962"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-963"></a><span class="nf">gvc_sound_theme_chooser_class_init</span> <span class="p">(</span><span class="n">GvcSoundThemeChooserClass</span> <span class="o">*</span><span class="n">klass</span><span class="p">)</span>
+<a name="line-964"></a><span class="p">{</span>
+<a name="line-965"></a> <span class="n">GObjectClass</span> <span class="o">*</span><span class="n">object_class</span> <span class="o">=</span> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">klass</span><span class="p">);</span>
+<a name="line-966"></a>
+<a name="line-967"></a> <span class="n">object_class</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="o">=</span> <span class="n">gvc_sound_theme_chooser_dispose</span><span class="p">;</span>
+<a name="line-968"></a><span class="p">}</span>
+<a name="line-969"></a>
+<a name="line-970"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-971"></a><span class="nf">on_click_feedback_toggled</span> <span class="p">(</span><span class="n">GtkToggleButton</span> <span class="o">*</span><span class="n">button</span><span class="p">,</span>
+<a name="line-972"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-973"></a><span class="p">{</span>
+<a name="line-974"></a> <span class="n">gboolean</span> <span class="n">enabled</span><span class="p">;</span>
+<a name="line-975"></a>
+<a name="line-976"></a> <span class="n">enabled</span> <span class="o">=</span> <span class="n">gtk_toggle_button_get_active</span> <span class="p">(</span><span class="n">button</span><span class="p">);</span>
+<a name="line-977"></a>
+<a name="line-978"></a> <span class="n">g_settings_set_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">INPUT_SOUNDS_KEY</span><span class="p">,</span> <span class="n">enabled</span><span class="p">);</span>
+<a name="line-979"></a><span class="p">}</span>
+<a name="line-980"></a>
+<a name="line-981"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-982"></a><span class="nf">on_key_changed</span> <span class="p">(</span><span class="n">GSettings</span> <span class="o">*</span><span class="n">settings</span><span class="p">,</span>
+<a name="line-983"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">key</span><span class="p">,</span>
+<a name="line-984"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-985"></a><span class="p">{</span>
+<a name="line-986"></a> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">EVENT_SOUNDS_KEY</span><span class="p">)</span> <span class="o">||</span>
+<a name="line-987"></a> <span class="o">!</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">SOUND_THEME_KEY</span><span class="p">)</span> <span class="o">||</span>
+<a name="line-988"></a> <span class="o">!</span><span class="n">strcmp</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">INPUT_SOUNDS_KEY</span><span class="p">))</span>
+<a name="line-989"></a> <span class="n">update_theme</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-990"></a><span class="p">}</span>
+<a name="line-991"></a>
+<a name="line-992"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-993"></a><span class="nf">setup_list_size_constraint</span> <span class="p">(</span><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">widget</span><span class="p">,</span>
+<a name="line-994"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">to_size</span><span class="p">)</span>
+<a name="line-995"></a><span class="p">{</span>
+<a name="line-996"></a> <span class="n">GtkRequisition</span> <span class="n">req</span><span class="p">;</span>
+<a name="line-997"></a> <span class="n">gint</span> <span class="n">sc_height</span><span class="p">;</span>
+<a name="line-998"></a> <span class="kt">int</span> <span class="n">max_height</span><span class="p">;</span>
+<a name="line-999"></a>
+<a name="line-1000"></a> <span class="cm">/* Constrain height to be the tree height up to a max */</span>
+<a name="line-1001"></a> <span class="n">gdk_window_get_geometry</span> <span class="p">(</span><span class="n">gdk_screen_get_root_window</span> <span class="p">(</span><span class="n">gtk_widget_get_screen</span> <span class="p">(</span><span class="n">widget</span><span class="p">)),</span>
+<a name="line-1002"></a> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">sc_height</span><span class="p">);</span>
+<a name="line-1003"></a>
+<a name="line-1004"></a> <span class="n">max_height</span> <span class="o">=</span> <span class="n">sc_height</span> <span class="o">/</span> <span class="mi">4</span><span class="p">;</span>
+<a name="line-1005"></a>
+<a name="line-1006"></a> <span class="c1">// XXX this doesn&#39;t work</span>
+<a name="line-1007"></a> <span class="n">gtk_widget_get_preferred_size</span> <span class="p">(</span><span class="n">to_size</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">);</span>
+<a name="line-1008"></a>
+<a name="line-1009"></a> <span class="n">gtk_scrolled_window_set_min_content_height</span> <span class="p">(</span><span class="n">GTK_SCROLLED_WINDOW</span> <span class="p">(</span><span class="n">widget</span><span class="p">),</span>
+<a name="line-1010"></a> <span class="n">MIN</span> <span class="p">(</span><span class="n">req</span><span class="p">.</span><span class="n">height</span><span class="p">,</span> <span class="n">max_height</span><span class="p">));</span>
+<a name="line-1011"></a><span class="p">}</span>
+<a name="line-1012"></a>
+<a name="line-1013"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-1014"></a><span class="nf">gvc_sound_theme_chooser_init</span> <span class="p">(</span><span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">)</span>
+<a name="line-1015"></a><span class="p">{</span>
+<a name="line-1016"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">box</span><span class="p">;</span>
+<a name="line-1017"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">label</span><span class="p">;</span>
+<a name="line-1018"></a> <span class="n">GtkWidget</span> <span class="o">*</span><span class="n">scrolled_window</span><span class="p">;</span>
+<a name="line-1019"></a> <span class="n">gchar</span> <span class="o">*</span><span class="n">str</span><span class="p">;</span>
+<a name="line-1020"></a>
+<a name="line-1021"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span> <span class="o">=</span> <span class="n">gvc_sound_theme_chooser_get_instance_private</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-1022"></a>
+<a name="line-1023"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">theme_box</span> <span class="o">=</span> <span class="n">gtk_box_new</span> <span class="p">(</span><span class="n">GTK_ORIENTATION_HORIZONTAL</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-1024"></a>
+<a name="line-1025"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span>
+<a name="line-1026"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">theme_box</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-1027"></a>
+<a name="line-1028"></a> <span class="n">label</span> <span class="o">=</span> <span class="n">gtk_label_new_with_mnemonic</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Sound _theme:&quot;</span><span class="p">));</span>
+<a name="line-1029"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">theme_box</span><span class="p">),</span> <span class="n">label</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-1030"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span> <span class="o">=</span> <span class="n">gtk_combo_box_new</span> <span class="p">();</span>
+<a name="line-1031"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">theme_box</span><span class="p">),</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-1032"></a> <span class="n">gtk_label_set_mnemonic_widget</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">combo_box</span><span class="p">);</span>
+<a name="line-1033"></a>
+<a name="line-1034"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span> <span class="o">=</span> <span class="n">g_settings_new</span> <span class="p">(</span><span class="n">KEY_SOUNDS_SCHEMA</span><span class="p">);</span>
+<a name="line-1035"></a>
+<a name="line-1036"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">),</span>
+<a name="line-1037"></a> <span class="s">&quot;changed&quot;</span><span class="p">,</span>
+<a name="line-1038"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_key_changed</span><span class="p">),</span>
+<a name="line-1039"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-1040"></a>
+<a name="line-1041"></a> <span class="n">str</span> <span class="o">=</span> <span class="n">g_strdup_printf</span> <span class="p">(</span><span class="s">&quot;&lt;b&gt;%s&lt;/b&gt;&quot;</span><span class="p">,</span> <span class="n">_</span><span class="p">(</span><span class="s">&quot;C_hoose an alert sound:&quot;</span><span class="p">));</span>
+<a name="line-1042"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">selection_box</span> <span class="o">=</span> <span class="n">box</span> <span class="o">=</span> <span class="n">gtk_frame_new</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-1043"></a> <span class="n">g_free</span> <span class="p">(</span><span class="n">str</span><span class="p">);</span>
+<a name="line-1044"></a>
+<a name="line-1045"></a> <span class="n">label</span> <span class="o">=</span> <span class="n">gtk_frame_get_label_widget</span> <span class="p">(</span><span class="n">GTK_FRAME</span> <span class="p">(</span><span class="n">box</span><span class="p">));</span>
+<a name="line-1046"></a> <span class="n">gtk_label_set_use_underline</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-1047"></a> <span class="n">gtk_label_set_use_markup</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-1048"></a> <span class="n">gtk_frame_set_shadow_type</span> <span class="p">(</span><span class="n">GTK_FRAME</span> <span class="p">(</span><span class="n">box</span><span class="p">),</span> <span class="n">GTK_SHADOW_NONE</span><span class="p">);</span>
+<a name="line-1049"></a>
+<a name="line-1050"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span> <span class="n">box</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-1051"></a>
+<a name="line-1052"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span> <span class="o">=</span> <span class="n">create_alert_treeview</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-1053"></a> <span class="n">gtk_label_set_mnemonic_widget</span> <span class="p">(</span><span class="n">GTK_LABEL</span> <span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">);</span>
+<a name="line-1054"></a>
+<a name="line-1055"></a> <span class="n">scrolled_window</span> <span class="o">=</span> <span class="n">gtk_scrolled_window_new</span> <span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-1056"></a> <span class="n">gtk_widget_set_hexpand</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-1057"></a> <span class="n">gtk_widget_set_vexpand</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">,</span> <span class="n">TRUE</span><span class="p">);</span>
+<a name="line-1058"></a> <span class="n">gtk_widget_set_margin_top</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">,</span> <span class="mi">6</span><span class="p">);</span>
+<a name="line-1059"></a>
+<a name="line-1060"></a> <span class="n">gtk_scrolled_window_set_policy</span> <span class="p">(</span><span class="n">GTK_SCROLLED_WINDOW</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">),</span>
+<a name="line-1061"></a> <span class="n">GTK_POLICY_NEVER</span><span class="p">,</span>
+<a name="line-1062"></a> <span class="n">GTK_POLICY_AUTOMATIC</span><span class="p">);</span>
+<a name="line-1063"></a> <span class="n">gtk_scrolled_window_set_shadow_type</span> <span class="p">(</span><span class="n">GTK_SCROLLED_WINDOW</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">),</span>
+<a name="line-1064"></a> <span class="n">GTK_SHADOW_IN</span><span class="p">);</span>
+<a name="line-1065"></a>
+<a name="line-1066"></a> <span class="n">gtk_container_add</span> <span class="p">(</span><span class="n">GTK_CONTAINER</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">),</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">);</span>
+<a name="line-1067"></a> <span class="n">gtk_container_add</span> <span class="p">(</span><span class="n">GTK_CONTAINER</span> <span class="p">(</span><span class="n">box</span><span class="p">),</span> <span class="n">scrolled_window</span><span class="p">);</span>
+<a name="line-1068"></a>
+<a name="line-1069"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span> <span class="o">=</span> <span class="n">gtk_check_button_new_with_mnemonic</span> <span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Enable _window and button sounds&quot;</span><span class="p">));</span>
+<a name="line-1070"></a> <span class="n">gtk_toggle_button_set_active</span> <span class="p">(</span><span class="n">GTK_TOGGLE_BUTTON</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">),</span>
+<a name="line-1071"></a> <span class="n">g_settings_get_boolean</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">,</span> <span class="n">INPUT_SOUNDS_KEY</span><span class="p">));</span>
+<a name="line-1072"></a>
+<a name="line-1073"></a> <span class="n">gtk_box_pack_start</span> <span class="p">(</span><span class="n">GTK_BOX</span> <span class="p">(</span><span class="n">chooser</span><span class="p">),</span>
+<a name="line-1074"></a> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">,</span>
+<a name="line-1075"></a> <span class="n">FALSE</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+<a name="line-1076"></a>
+<a name="line-1077"></a> <span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">G_OBJECT</span> <span class="p">(</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">click_feedback_button</span><span class="p">),</span>
+<a name="line-1078"></a> <span class="s">&quot;toggled&quot;</span><span class="p">,</span>
+<a name="line-1079"></a> <span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">on_click_feedback_toggled</span><span class="p">),</span>
+<a name="line-1080"></a> <span class="n">chooser</span><span class="p">);</span>
+<a name="line-1081"></a>
+<a name="line-1082"></a> <span class="n">setup_theme_selector</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-1083"></a> <span class="n">update_theme</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
+<a name="line-1084"></a>
+<a name="line-1085"></a> <span class="n">setup_list_size_constraint</span> <span class="p">(</span><span class="n">scrolled_window</span><span class="p">,</span> <span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">treeview</span><span class="p">);</span>
+<a name="line-1086"></a><span class="p">}</span>
+<a name="line-1087"></a>
+<a name="line-1088"></a><span class="k">static</span> <span class="kt">void</span>
+<a name="line-1089"></a><span class="nf">gvc_sound_theme_chooser_dispose</span> <span class="p">(</span><span class="n">GObject</span> <span class="o">*</span><span class="n">object</span><span class="p">)</span>
+<a name="line-1090"></a><span class="p">{</span>
+<a name="line-1091"></a> <span class="n">GvcSoundThemeChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">;</span>
+<a name="line-1092"></a>
+<a name="line-1093"></a> <span class="n">chooser</span> <span class="o">=</span> <span class="n">GVC_SOUND_THEME_CHOOSER</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-1094"></a>
+<a name="line-1095"></a> <span class="n">g_clear_object</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">chooser</span><span class="o">-&gt;</span><span class="n">priv</span><span class="o">-&gt;</span><span class="n">sound_settings</span><span class="p">);</span>
+<a name="line-1096"></a>
+<a name="line-1097"></a> <span class="n">G_OBJECT_CLASS</span> <span class="p">(</span><span class="n">gvc_sound_theme_chooser_parent_class</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">dispose</span> <span class="p">(</span><span class="n">object</span><span class="p">);</span>
+<a name="line-1098"></a><span class="p">}</span>
+<a name="line-1099"></a>
+<a name="line-1100"></a><span class="n">GtkWidget</span> <span class="o">*</span>
+<a name="line-1101"></a><span class="nf">gvc_sound_theme_chooser_new</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span>
+<a name="line-1102"></a><span class="p">{</span>
+<a name="line-1103"></a> <span class="k">return</span> <span class="n">g_object_new</span> <span class="p">(</span><span class="n">GVC_TYPE_SOUND_THEME_CHOOSER</span><span class="p">,</span>
+<a name="line-1104"></a> <span class="s">&quot;spacing&quot;</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span>
+<a name="line-1105"></a> <span class="s">&quot;orientation&quot;</span><span class="p">,</span> <span class="n">GTK_ORIENTATION_VERTICAL</span><span class="p">,</span>
+<a name="line-1106"></a> <span class="nb">NULL</span><span class="p">);</span>
+<a name="line-1107"></a><span class="p">}</span>
+</pre></div>
+</td></tr></table>
+ </div>
+ <div id="footer">
+ <p>
+ Cppcheck 1.90 - a tool for static C/C++ code analysis</br>
+ </br>
+ Internet: <a href="http://cppcheck.net">http://cppcheck.net</a></br>
+ IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/[email protected]_enum-conversion/2.html b/[email protected]_enum-conversion/2.html
new file mode 100644
index 0000000..bacfabb
--- /dev/null
+++ b/[email protected]_enum-conversion/2.html
@@ -0,0 +1,1110 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cppcheck - HTML report - mate-media</title>
+ <link rel="stylesheet" href="style.css">
+ <style>
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #ffffff; }
+.highlight .c { color: #888888 } /* Comment */
+.highlight .err { color: #FF0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #008800; font-weight: bold } /* Keyword */
+.highlight .o { color: #333333 } /* Operator */
+.highlight .ch { color: #888888 } /* Comment.Hashbang */
+.highlight .cm { color: #888888 } /* Comment.Multiline */
+.highlight .cp { color: #557799 } /* Comment.Preproc */
+.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
+.highlight .c1 { color: #888888 } /* Comment.Single */
+.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #003388; font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #333399; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #6600EE; font-weight: bold } /* Literal.Number */
+.highlight .s { background-color: #fff0f0 } /* Literal.String */
+.highlight .na { color: #0000CC } /* Name.Attribute */
+.highlight .nb { color: #007020 } /* Name.Builtin */
+.highlight .nc { color: #BB0066; font-weight: bold } /* Name.Class */
+.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
+.highlight .ni { color: #880000; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0066BB; font-weight: bold } /* Name.Function */
+.highlight .nl { color: #997700; font-weight: bold } /* Name.Label */
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #007700 } /* Name.Tag */
+.highlight .nv { color: #996633 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mb { color: #6600EE; font-weight: bold } /* Literal.Number.Bin */
+.highlight .mf { color: #6600EE; font-weight: bold } /* Literal.Number.Float */
+.highlight .mh { color: #005588; font-weight: bold } /* Literal.Number.Hex */
+.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
+.highlight .mo { color: #4400EE; font-weight: bold } /* Literal.Number.Oct */
+.highlight .sa { background-color: #fff0f0 } /* Literal.String.Affix */
+.highlight .sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.highlight .sc { color: #0044DD } /* Literal.String.Char */
+.highlight .dl { background-color: #fff0f0 } /* Literal.String.Delimiter */
+.highlight .sd { color: #DD4422 } /* Literal.String.Doc */
+.highlight .s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.highlight .se { color: #666666; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.highlight .sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.highlight .si { background-color: #eeeeee } /* Literal.String.Interpol */
+.highlight .sx { color: #DD2200; background-color: #fff0f0 } /* Literal.String.Other */
+.highlight .sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.highlight .s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.highlight .ss { color: #AA6600 } /* Literal.String.Symbol */
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
+.highlight .fm { color: #0066BB; font-weight: bold } /* Name.Function.Magic */
+.highlight .vc { color: #336699 } /* Name.Variable.Class */
+.highlight .vg { color: #dd7700; font-weight: bold } /* Name.Variable.Global */
+.highlight .vi { color: #3333BB } /* Name.Variable.Instance */
+.highlight .vm { color: #996633 } /* Name.Variable.Magic */
+.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
+ </style>
+ <script language="javascript">
+ function getStyle(el,styleProp) {
+ if (el.currentStyle)
+ var y = el.currentStyle[styleProp];
+ else if (window.getComputedStyle)
+ var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
+ return y;
+ }
+ function toggle() {
+ var el = this.expandable_content;
+ var mark = this.expandable_marker;
+ if (el.style.display == "block") {
+ el.style.display = "none";
+ mark.innerHTML = "[+]";
+ } else {
+ el.style.display = "block";
+ mark.innerHTML = "[-]";
+ }
+ }
+ function init_expandables() {
+ var elts = document.getElementsByClassName("expandable");
+ for (var i = 0; i < elts.length; i++) {
+ var el = elts[i];
+ var clickable = el.getElementsByTagName("span")[0];
+ var marker = clickable.getElementsByClassName("marker")[0];
+ var content = el.getElementsByClassName("content")[0];
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
+ content.style.width = width + "px";
+ clickable.expandable_content = content;
+ clickable.expandable_marker = marker;
+ clickable.onclick = toggle;
+ }
+ }
+ function set_class_display(c, st) {
+ var elements = document.querySelectorAll('.' + c),
+ len = elements.length;
+ for (i = 0; i < len; i++) {
+ elements[i].style.display = st;
+ }
+ }
+ function toggle_class_visibility(id) {
+ var box = document.getElementById(id);
+ set_class_display(id, box.checked ? '' : 'none');
+ }
+ function toggle_all(){
+ var elts = document.getElementsByTagName("input");
+ for (var i = 1; i < elts.length; i++) {
+ var el = elts[i];
+ el.checked ? el.checked=false : el.checked=true;
+ toggle_class_visibility(el.id);
+ }
+ }
+
+ </script>
+ </head>
+ <body onload="init_expandables()">
+ <div id="header">
+ <h1>Cppcheck report - mate-media: mate-volume-control/gvc-speaker-test.c </h1>
+ </div>
+ <div id="menu" dir="rtl">
+ <p id="filename"><a href="index.html">Defects:</a> gvc-speaker-test.c</p>
+<a href='2.html#line-53'> unknownMacro 53</a>
+ </div>
+ <div id="content">
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 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