4
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>AnjutaCommand</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7
7
<link rel="home" href="index.html" title="Anjuta Developers Reference Manual">
8
8
<link rel="up" href="libanjuta-api.html" title="libanjuta API">
9
9
<link rel="prev" href="libanjuta-Debugging.html" title="Debugging">
10
10
<link rel="next" href="libanjuta-AnjutaSyncCommand.html" title="AnjutaSyncCommand">
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
14
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
40
40
<div class="refsynopsisdiv">
41
41
<a name="libanjuta-AnjutaCommand.synopsis"></a><h2>Synopsis</h2>
42
42
<pre class="synopsis">struct <a class="link" href="libanjuta-AnjutaCommand.html#AnjutaCommandClass" title="struct AnjutaCommandClass">AnjutaCommandClass</a>;
43
<a class="link" href="libanjuta-AnjutaCommand.html#AnjutaCommandPriv" title="AnjutaCommandPriv">AnjutaCommandPriv</a>;
43
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-start" title="anjuta_command_start ()">anjuta_command_start</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
44
44
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-cancel" title="anjuta_command_cancel ()">anjuta_command_cancel</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
45
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-get-error-message" title="anjuta_command_get_error_message ()">anjuta_command_get_error_message</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
46
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-is-running" title="anjuta_command_is_running ()">anjuta_command_is_running</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
45
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-notify-data-arrived" title="anjuta_command_notify_data_arrived ()">anjuta_command_notify_data_arrived</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
47
46
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-notify-complete" title="anjuta_command_notify_complete ()">anjuta_command_notify_complete</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>,
48
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> return_code</code></em>);
49
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-notify-data-arrived" title="anjuta_command_notify_data_arrived ()">anjuta_command_notify_data_arrived</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
47
<em class="parameter"><code><span class="type">guint</span> return_code</code></em>);
50
48
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-notify-progress" title="anjuta_command_notify_progress ()">anjuta_command_notify_progress</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>,
51
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> progress</code></em>);
49
<em class="parameter"><code><span class="type">gfloat</span> progress</code></em>);
50
<span class="returnvalue">gboolean</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-is-running" title="anjuta_command_is_running ()">anjuta_command_is_running</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
52
51
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-set-error-message" title="anjuta_command_set_error_message ()">anjuta_command_set_error_message</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>,
53
<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> *error_message</code></em>);
54
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-start" title="anjuta_command_start ()">anjuta_command_start</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
55
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-start-automatic-monitor" title="anjuta_command_start_automatic_monitor ()">anjuta_command_start_automatic_monitor</a>
52
<em class="parameter"><code>const <span class="type">gchar</span> *error_message</code></em>);
53
<span class="returnvalue">gchar</span> * <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-get-error-message" title="anjuta_command_get_error_message ()">anjuta_command_get_error_message</a> (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
54
<span class="returnvalue">gboolean</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-start-automatic-monitor" title="anjuta_command_start_automatic_monitor ()">anjuta_command_start_automatic_monitor</a>
56
55
(<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
57
56
<span class="returnvalue">void</span> <a class="link" href="libanjuta-AnjutaCommand.html#anjuta-command-stop-automatic-monitor" title="anjuta_command_stop_automatic_monitor ()">anjuta_command_stop_automatic_monitor</a>
58
57
(<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);
58
<a class="link" href="libanjuta-AnjutaCommand.html#AnjutaCommandPriv" title="AnjutaCommandPriv">AnjutaCommandPriv</a>;
61
61
<div class="refsect1">
117
117
<div class="refsect2">
118
<a name="AnjutaCommandPriv"></a><h3>AnjutaCommandPriv</h3>
119
<pre class="programlisting">typedef struct _AnjutaCommandPriv AnjutaCommandPriv;</pre>
118
<a name="anjuta-command-start"></a><h3>anjuta_command_start ()</h3>
119
<pre class="programlisting"><span class="returnvalue">void</span> anjuta_command_start (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
121
Starts a command. Client code can handle data from the command by connecting
122
to the ::data-arrived signal.
125
<span class="type">AnjutaCommand</span> subclasses should override this method to determine how they
126
call ::run, which actually does the command's legwork.
128
<div class="variablelist"><table border="0" class="variablelist">
130
<col align="left" valign="top">
134
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
135
<td>Command object to start</td>
124
140
<div class="refsect2">
139
158
<div class="refsect2">
140
<a name="anjuta-command-get-error-message"></a><h3>anjuta_command_get_error_message ()</h3>
141
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * anjuta_command_get_error_message (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
159
<a name="anjuta-command-notify-data-arrived"></a><h3>anjuta_command_notify_data_arrived ()</h3>
160
<pre class="programlisting"><span class="returnvalue">void</span> anjuta_command_notify_data_arrived (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
143
Get the error message from the command, if there is one. This method is
144
normally used from a ::command-finished handler to report errors to the user
145
when a command finishes.
162
Used by base classes derived from <span class="type">AnjutaCommand</span> to emit the ::data-arrived
163
signal. This method should be used by both base command classes and
164
non-base classes as appropriate.
147
<div class="variablelist"><table border="0">
148
<col align="left" valign="top">
151
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
152
<td>Command object.</td>
155
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
156
<td>Error message string that must be freed when no longer needed.
157
If no error is set, return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
163
<div class="refsect2">
164
<a name="anjuta-command-is-running"></a><h3>anjuta_command_is_running ()</h3>
165
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> anjuta_command_is_running (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
166
<div class="variablelist"><table border="0">
167
<col align="left" valign="top">
170
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
171
<td>Command object.</td>
174
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
176
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the command is currently running; <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
166
<div class="variablelist"><table border="0" class="variablelist">
168
<col align="left" valign="top">
172
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
173
<td>Command object.</td>
182
178
<div class="refsect2">
183
179
<a name="anjuta-command-notify-complete"></a><h3>anjuta_command_notify_complete ()</h3>
184
180
<pre class="programlisting"><span class="returnvalue">void</span> anjuta_command_notify_complete (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>,
185
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> return_code</code></em>);</pre>
181
<em class="parameter"><code><span class="type">guint</span> return_code</code></em>);</pre>
187
183
Used by base classes derived from <span class="type">AnjutaCommand</span> to emit the
188
184
::command-finished signal. This method should not be used by client code or
189
185
<span class="type">AnjutaCommand</span> objects that are not base classes.
191
<div class="variablelist"><table border="0">
187
<div class="variablelist"><table border="0" class="variablelist">
192
189
<col align="left" valign="top">
195
194
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
206
205
<div class="refsect2">
207
<a name="anjuta-command-notify-data-arrived"></a><h3>anjuta_command_notify_data_arrived ()</h3>
208
<pre class="programlisting"><span class="returnvalue">void</span> anjuta_command_notify_data_arrived (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
210
Used by base classes derived from <span class="type">AnjutaCommand</span> to emit the ::data-arrived
211
signal. This method should be used by both base command classes and
212
non-base classes as appropriate.
214
<div class="variablelist"><table border="0">
215
<col align="left" valign="top">
217
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
218
<td>Command object.</td>
223
<div class="refsect2">
224
206
<a name="anjuta-command-notify-progress"></a><h3>anjuta_command_notify_progress ()</h3>
225
207
<pre class="programlisting"><span class="returnvalue">void</span> anjuta_command_notify_progress (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>,
226
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a> progress</code></em>);</pre>
208
<em class="parameter"><code><span class="type">gfloat</span> progress</code></em>);</pre>
228
210
Emits the ::progress signal. Can be used by both base classes and
229
211
commands as needed.
231
<div class="variablelist"><table border="0">
213
<div class="variablelist"><table border="0" class="variablelist">
232
215
<col align="left" valign="top">
235
220
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
246
231
<div class="refsect2">
232
<a name="anjuta-command-is-running"></a><h3>anjuta_command_is_running ()</h3>
233
<pre class="programlisting"><span class="returnvalue">gboolean</span> anjuta_command_is_running (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
234
<div class="variablelist"><table border="0" class="variablelist">
236
<col align="left" valign="top">
241
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
242
<td>Command object.</td>
245
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
247
<code class="literal">TRUE</code> if the command is currently running; <code class="literal">FALSE</code> otherwise.</td>
253
<div class="refsect2">
247
254
<a name="anjuta-command-set-error-message"></a><h3>anjuta_command_set_error_message ()</h3>
248
255
<pre class="programlisting"><span class="returnvalue">void</span> anjuta_command_set_error_message (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>,
249
<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> *error_message</code></em>);</pre>
256
<em class="parameter"><code>const <span class="type">gchar</span> *error_message</code></em>);</pre>
251
258
Command objects use this to set error messages when they encounter some kind
254
<div class="variablelist"><table border="0">
261
<div class="variablelist"><table border="0" class="variablelist">
255
263
<col align="left" valign="top">
258
268
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
269
279
<div class="refsect2">
270
<a name="anjuta-command-start"></a><h3>anjuta_command_start ()</h3>
271
<pre class="programlisting"><span class="returnvalue">void</span> anjuta_command_start (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
273
Starts a command. Client code can handle data from the command by connecting
274
to the ::data-arrived signal.
277
<span class="type">AnjutaCommand</span> subclasses should override this method to determine how they
278
call ::run, which actually does the command's legwork.
280
<div class="variablelist"><table border="0">
280
<a name="anjuta-command-get-error-message"></a><h3>anjuta_command_get_error_message ()</h3>
281
<pre class="programlisting"><span class="returnvalue">gchar</span> * anjuta_command_get_error_message (<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
283
Get the error message from the command, if there is one. This method is
284
normally used from a ::command-finished handler to report errors to the user
285
when a command finishes.
287
<div class="variablelist"><table border="0" class="variablelist">
281
289
<col align="left" valign="top">
283
294
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
284
<td>Command object to start</td>
295
<td>Command object.</td>
298
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
299
<td>Error message string that must
300
be freed when no longer needed. If no error is set, return <code class="literal">NULL</code>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>][<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
289
307
<div class="refsect2">
290
308
<a name="anjuta-command-start-automatic-monitor"></a><h3>anjuta_command_start_automatic_monitor ()</h3>
291
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> anjuta_command_start_automatic_monitor
309
<pre class="programlisting"><span class="returnvalue">gboolean</span> anjuta_command_start_automatic_monitor
292
310
(<em class="parameter"><code><span class="type">AnjutaCommand</span> *self</code></em>);</pre>
294
312
Sets up any monitoring needed for commands that should start themselves
295
313
automatically in response to some event.
297
<div class="variablelist"><table border="0">
315
<div class="variablelist"><table border="0" class="variablelist">
298
317
<col align="left" valign="top">
301
322
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
305
326
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
307
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if automatic starting is supported by the command and
308
no errors were encountered; <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if automatic starting is unsupported or on
328
<code class="literal">TRUE</code> if automatic starting is supported by the command and
329
no errors were encountered; <code class="literal">FALSE</code> if automatic starting is unsupported or on
320
341
Stops automatic monitoring for self executing commands. For commands that
321
342
do not support self-starting, this function does nothing.
323
<div class="variablelist"><table border="0">
344
<div class="variablelist"><table border="0" class="variablelist">
324
346
<col align="left" valign="top">
326
350
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
327
351
<td>Command object.</td>
356
<div class="refsect2">
357
<a name="AnjutaCommandPriv"></a><h3>AnjutaCommandPriv</h3>
358
<pre class="programlisting">typedef struct _AnjutaCommandPriv AnjutaCommandPriv;</pre>
332
363
<div class="refsect1">
333
364
<a name="libanjuta-AnjutaCommand.see-also"></a><h2>See Also</h2>