1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
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="ch03.html" title="Queries, Results, Items">
9
<link rel="prev" href="ch03.html" title="Queries, Results, Items">
10
<link rel="next" href="HudResult.html" title="HudResult">
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="ch03.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="ch03.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="HudResult.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="#HudItem.synopsis" class="shortcut">Top</a>
26
<a href="#HudItem.description" class="shortcut">Description</a>
28
<a href="#HudItem.object-hierarchy" class="shortcut">Object Hierarchy</a>
31
<div class="refentry">
32
<a name="HudItem"></a><div class="titlepage"></div>
33
<div class="refnamediv"><table width="100%"><tr>
35
<h2><span class="refentrytitle"><a name="HudItem.top_of_page"></a>HudItem</span></h2>
36
<p>HudItem — a user-interesting item that can be activated</p>
38
<td valign="top" align="right"></td>
40
<div class="refsynopsisdiv">
41
<a name="HudItem.synopsis"></a><h2>Synopsis</h2>
42
<pre class="synopsis"> <a class="link" href="HudItem.html#HudItem-struct" title="HudItem">HudItem</a>;
43
struct <a class="link" href="HudItem.html#HudItemClass" title="struct HudItemClass">HudItemClass</a>;
44
<span class="returnvalue">void</span> <a class="link" href="HudItem.html#hud-item-activate" title="hud_item_activate ()">hud_item_activate</a> (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>,
45
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *platform_data</code></em>);
46
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> <a class="link" href="HudItem.html#hud-item-construct" title="hud_item_construct ()">hud_item_construct</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> g_type</code></em>,
47
<em class="parameter"><code><a class="link" href="hud-HudStringList.html#HudStringList" title="HudStringList"><span class="type">HudStringList</span></a> *tokens</code></em>,
48
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *desktop_file</code></em>,
49
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *app_icon</code></em>,
50
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> enabled</code></em>);
51
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="HudItem.html#hud-item-get-app-icon" title="hud_item_get_app_icon ()">hud_item_get_app_icon</a> (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);
52
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="HudItem.html#hud-item-get-enabled" title="hud_item_get_enabled ()">hud_item_get_enabled</a> (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);
53
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="HudItem.html#hud-item-get-item-icon" title="hud_item_get_item_icon ()">hud_item_get_item_icon</a> (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);
54
<a class="link" href="hud-HudStringList.html#HudStringList" title="HudStringList"><span class="returnvalue">HudStringList</span></a> * <a class="link" href="HudItem.html#hud-item-get-tokens" title="hud_item_get_tokens ()">hud_item_get_tokens</a> (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);
55
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="HudItem.html#hud-item-get-usage" title="hud_item_get_usage ()">hud_item_get_usage</a> (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);
56
<a class="link" href="HudItem.html" title="HudItem"><span class="returnvalue">HudItem</span></a> * <a class="link" href="HudItem.html#hud-item-new" title="hud_item_new ()">hud_item_new</a> (<em class="parameter"><code><a class="link" href="hud-HudStringList.html#HudStringList" title="HudStringList"><span class="type">HudStringList</span></a> *tokens</code></em>,
57
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *desktop_file</code></em>,
58
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *app_icon</code></em>,
59
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> enabled</code></em>);
62
<div class="refsect1">
63
<a name="HudItem.object-hierarchy"></a><h2>Object Hierarchy</h2>
64
<pre class="synopsis">
65
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
69
<div class="refsect1">
70
<a name="HudItem.description"></a><h2>Description</h2>
72
A <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> represents a user-interesting action that can be activated
73
from the Hud user interface.
76
<div class="refsect1">
77
<a name="HudItem.details"></a><h2>Details</h2>
78
<div class="refsect2">
79
<a name="HudItem-struct"></a><h3>HudItem</h3>
80
<pre class="programlisting">typedef struct _HudItem HudItem;</pre>
82
This is an opaque structure type.
86
<div class="refsect2">
87
<a name="HudItemClass"></a><h3>struct HudItemClass</h3>
88
<pre class="programlisting">struct HudItemClass {
89
GObjectClass parent_class;
91
void (* activate) (HudItem *item,
92
GVariant *platform_data);
96
This is the class vtable for <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>.
98
<div class="variablelist"><table border="0">
99
<col align="left" valign="top">
102
<td><p><span class="term"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass"><span class="type">GObjectClass</span></a> <em class="structfield"><code><a name="HudItemClass.parent-class"></a>parent_class</code></em>;</span></p></td>
103
<td>the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass"><span class="type">GObjectClass</span></a>
107
<td><p><span class="term"><em class="structfield"><code><a name="HudItemClass.activate"></a>activate</code></em> ()</span></p></td>
108
<td>virtual function pointer for <a class="link" href="HudItem.html#hud-item-activate" title="hud_item_activate ()"><code class="function">hud_item_activate()</code></a>
115
<div class="refsect2">
116
<a name="hud-item-activate"></a><h3>hud_item_activate ()</h3>
117
<pre class="programlisting"><span class="returnvalue">void</span> hud_item_activate (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>,
118
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *platform_data</code></em>);</pre>
120
Activates <em class="parameter"><code>item</code></em>.
123
<em class="parameter"><code>platform_data</code></em> is platform data in the <a href="http://library.gnome.org/devel/gio/unstable/GApplication.html"><span class="type">GApplication</span></a> or
124
<a href="http://library.gnome.org/devel/gio/unstable/GRemoteActionGroup.html"><span class="type">GRemoteActionGroup</span></a> sense. It should be a <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> with the type
125
<code class="literal">a{sv}</code>.
127
<div class="variablelist"><table border="0">
128
<col align="left" valign="top">
131
<td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td>
132
<td>a <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>
136
<td><p><span class="term"><em class="parameter"><code>platform_data</code></em> :</span></p></td>
137
<td>platform data</td>
143
<div class="refsect2">
144
<a name="hud-item-construct"></a><h3>hud_item_construct ()</h3>
145
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a> hud_item_construct (<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> g_type</code></em>,
146
<em class="parameter"><code><a class="link" href="hud-HudStringList.html#HudStringList" title="HudStringList"><span class="type">HudStringList</span></a> *tokens</code></em>,
147
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *desktop_file</code></em>,
148
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *app_icon</code></em>,
149
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> enabled</code></em>);</pre>
151
This is the Vala-style chain-up constructor corresponding to
152
<a class="link" href="HudItem.html#hud-item-new" title="hud_item_new ()"><code class="function">hud_item_new()</code></a>. <em class="parameter"><code>g_type</code></em> must be a subtype of <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>.
155
Only subclasses of <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> should call this.
157
<div class="variablelist"><table border="0">
158
<col align="left" valign="top">
161
<td><p><span class="term"><em class="parameter"><code>g_type</code></em> :</span></p></td>
162
<td>a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>
166
<td><p><span class="term"><em class="parameter"><code>tokens</code></em> :</span></p></td>
167
<td>the search tokens for the item</td>
170
<td><p><span class="term"><em class="parameter"><code>desktop_file</code></em> :</span></p></td>
171
<td>the desktop file of the provider of the item</td>
174
<td><p><span class="term"><em class="parameter"><code>app_icon</code></em> :</span></p></td>
175
<td>the icon name for the application that created this item</td>
178
<td><p><span class="term"><em class="parameter"><code>enabled</code></em> :</span></p></td>
179
<td>if the item is enabled</td>
182
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
183
<td>a new <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> or <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> subclass</td>
189
<div class="refsect2">
190
<a name="hud-item-get-app-icon"></a><h3>hud_item_get_app_icon ()</h3>
191
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * hud_item_get_app_icon (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);</pre>
193
Gets the icon of the application that <em class="parameter"><code>item</code></em> lies within.
195
<div class="variablelist"><table border="0">
196
<col align="left" valign="top">
199
<td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td>
200
<td>a <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>
204
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
205
<td>the icon name, or "" if there is no icon</td>
211
<div class="refsect2">
212
<a name="hud-item-get-enabled"></a><h3>hud_item_get_enabled ()</h3>
213
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> hud_item_get_enabled (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);</pre>
215
Checks if the item is disabled or enabled.
218
Disabled items should never appear in search results.
220
<div class="variablelist"><table border="0">
221
<col align="left" valign="top">
224
<td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td>
225
<td>a <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>
229
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
230
<td>if the item is enabled</td>
236
<div class="refsect2">
237
<a name="hud-item-get-item-icon"></a><h3>hud_item_get_item_icon ()</h3>
238
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * hud_item_get_item_icon (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);</pre>
240
Gets the icon for the action represented by <em class="parameter"><code>item</code></em>, if one exists.
242
<div class="variablelist"><table border="0">
243
<col align="left" valign="top">
246
<td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td>
247
<td>a <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>
251
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
252
<td>the icon name, or "" if there is no icon</td>
258
<div class="refsect2">
259
<a name="hud-item-get-tokens"></a><h3>hud_item_get_tokens ()</h3>
260
<pre class="programlisting"><a class="link" href="hud-HudStringList.html#HudStringList" title="HudStringList"><span class="returnvalue">HudStringList</span></a> * hud_item_get_tokens (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);</pre>
262
Gets the tokens that represent the description of <em class="parameter"><code>item</code></em>.
265
This is a <a class="link" href="hud-HudStringList.html#HudStringList" title="HudStringList"><span class="type">HudStringList</span></a> in reverse order of how the item should
266
appear in the Hud. For example, "File > Open" would be represneted
267
by the list <code class="code">['Open', 'File']</code>.
269
<div class="variablelist"><table border="0">
270
<col align="left" valign="top">
273
<td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td>
274
<td>a <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>
278
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
279
<td>the tokens. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
286
<div class="refsect2">
287
<a name="hud-item-get-usage"></a><h3>hud_item_get_usage ()</h3>
288
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> hud_item_get_usage (<em class="parameter"><code><a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a> *item</code></em>);</pre>
290
Gets the use-count of <em class="parameter"><code>item</code></em>.
293
This is the number of times the item has been activated in recent
296
<div class="variablelist"><table border="0">
297
<col align="left" valign="top">
300
<td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td>
301
<td>a <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>
305
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
306
<td>the usage count</td>
312
<div class="refsect2">
313
<a name="hud-item-new"></a><h3>hud_item_new ()</h3>
314
<pre class="programlisting"><a class="link" href="HudItem.html" title="HudItem"><span class="returnvalue">HudItem</span></a> * hud_item_new (<em class="parameter"><code><a class="link" href="hud-HudStringList.html#HudStringList" title="HudStringList"><span class="type">HudStringList</span></a> *tokens</code></em>,
315
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *desktop_file</code></em>,
316
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *app_icon</code></em>,
317
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> enabled</code></em>);</pre>
319
Creates a new <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>.
322
If <em class="parameter"><code>enabled</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> then the item will never be in the result of a
325
<div class="variablelist"><table border="0">
326
<col align="left" valign="top">
329
<td><p><span class="term"><em class="parameter"><code>tokens</code></em> :</span></p></td>
330
<td>the search tokens for the item</td>
333
<td><p><span class="term"><em class="parameter"><code>desktop_file</code></em> :</span></p></td>
334
<td>the desktop file of the provider of the item</td>
337
<td><p><span class="term"><em class="parameter"><code>app_icon</code></em> :</span></p></td>
338
<td>the icon name for the application that created this item</td>
341
<td><p><span class="term"><em class="parameter"><code>enabled</code></em> :</span></p></td>
342
<td>if the item is enabled</td>
345
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
346
<td>a new <a class="link" href="HudItem.html" title="HudItem"><span class="type">HudItem</span></a>
356
Generated by GTK-Doc V1.18</div>
b'\\ No newline at end of file'