1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>HudSettings</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7
<link rel="home" href="index.html" title="hud-service Hacking Guide">
8
<link rel="up" href="ch05.html" title="Utility API">
9
<link rel="prev" href="ch05.html" title="Utility API">
10
<link rel="next" href="HudAppMenuRegistrar.html" title="HudAppMenuRegistrar">
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="ch05.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="ch05.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">hud-service Hacking Guide</th>
21
<td><a accesskey="n" href="HudAppMenuRegistrar.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#hud-HudSettings.synopsis" class="shortcut">Top</a>
26
<a href="#hud-HudSettings.description" class="shortcut">Description</a>
29
<div class="refentry">
30
<a name="hud-HudSettings"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle"><a name="hud-HudSettings.top_of_page"></a>HudSettings</span></h2>
34
<p>HudSettings — tunable parameters</p>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv">
39
<a name="hud-HudSettings.synopsis"></a><h2>Synopsis</h2>
40
<pre class="synopsis">struct <a class="link" href="hud-HudSettings.html#HudSettings" title="struct HudSettings">HudSettings</a>;
41
extern HudSettings <a class="link" href="hud-HudSettings.html#hud-settings" title="hud_settings">hud_settings</a>;
42
<span class="returnvalue">void</span> <a class="link" href="hud-HudSettings.html#hud-settings-init" title="hud_settings_init ()">hud_settings_init</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
45
<div class="refsect1">
46
<a name="hud-HudSettings.description"></a><h2>Description</h2>
48
<a class="link" href="hud-HudSettings.html#HudSettings" title="struct HudSettings"><span class="type">HudSettings</span></a> is a structure that contains the value of several
49
tunable parameters that affect the behaviour of various components of
53
This structure exists for two reasons.
56
The first reason is that caching these values in local variables
57
eliminates the need to look them up from <a href="http://library.gnome.org/devel/gio/unstable/GSettings.html"><span class="type">GSettings</span></a> on each use.
58
This vastly improves the performance of the matching algorithms (as
59
many of these values are used quite a lot from within them).
62
The second reason is to improve testability. The testcases are able
63
to hardcode sane values for the settings without worrying about
64
changes that the user may have made to their local configuration
65
(which could otherwise cause spurious test failures).
68
<div class="refsect1">
69
<a name="hud-HudSettings.details"></a><h2>Details</h2>
70
<div class="refsect2">
71
<a name="HudSettings"></a><h3>struct HudSettings</h3>
72
<pre class="programlisting">struct HudSettings {
73
gboolean store_usage_data;
75
guint indicator_penalty;
80
guint end_drop_penalty;
85
This structure contains the value of several tunable parameters that
86
affect the behaviour of various components of the HUD.
88
<div class="variablelist"><table border="0">
89
<col align="left" valign="top">
92
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="HudSettings.store-usage-data"></a>store_usage_data</code></em>;</span></p></td>
93
<td>if usage tracking should be performed</td>
96
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="HudSettings.indicator-penalty"></a>indicator_penalty</code></em>;</span></p></td>
97
<td>the percentage by which to increase the distance
98
of indicators when sorting the results list</td>
101
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="HudSettings.max-distance"></a>max_distance</code></em>;</span></p></td>
102
<td>the maximum distance value we consider as being a
106
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="HudSettings.add-penalty"></a>add_penalty</code></em>;</span></p></td>
107
<td>the penalty incurred by a character in the search term
108
that does not exist in the item being matched</td>
111
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="HudSettings.drop-penalty"></a>drop_penalty</code></em>;</span></p></td>
112
<td>the penalty incurred by a character missing from the
113
search string as compared to the item being matched</td>
116
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="HudSettings.end-drop-penalty"></a>end_drop_penalty</code></em>;</span></p></td>
117
<td>the penalty incurred by a character missing from
118
the search string as compared to the item being matched when the
119
character is at the end of the item (ie: the search term is a
120
prefix of the item)</td>
123
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="HudSettings.swap-penalty"></a>swap_penalty</code></em>;</span></p></td>
124
<td>the penalty incurred for the substitution of one
125
character for another</td>
131
<div class="refsect2">
132
<a name="hud-settings"></a><h3>hud_settings</h3>
133
<pre class="programlisting">extern HudSettings hud_settings;
136
The <a class="link" href="hud-HudSettings.html#HudSettings" title="struct HudSettings"><span class="type">HudSettings</span></a> in effect.
139
<a class="link" href="hud-HudSettings.html#hud-settings-init" title="hud_settings_init ()"><code class="function">hud_settings_init()</code></a> can be used to keep these values in sync with
140
<a href="http://library.gnome.org/devel/gio/unstable/GSettings.html"><span class="type">GSettings</span></a>. For testing, it may make sense to set these values
145
<div class="refsect2">
146
<a name="hud-settings-init"></a><h3>hud_settings_init ()</h3>
147
<pre class="programlisting"><span class="returnvalue">void</span> hud_settings_init (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
149
Initialises the <a class="link" href="hud-HudSettings.html#HudSettings" title="struct HudSettings"><span class="type">HudSettings</span></a> using <a href="http://library.gnome.org/devel/gio/unstable/GSettings.html"><span class="type">GSettings</span></a> and keeps it in sync.
152
If <a href="http://library.gnome.org/devel/gio/unstable/GSettings.html"><span class="type">GSettings</span></a> indicates that the settings have changed, they will be
160
Generated by GTK-Doc V1.18</div>
b'\\ No newline at end of file'