📄 gcancellable.html
字号:
</td></tr><tr><td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> to append error state to.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>cancellable</code></em> was cancelled, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if it was not.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3145363"></a><h3><a name="g-cancellable-get-fd"></a>g_cancellable_get_fd ()</h3><a class="indexterm" name="id3145374"></a><pre class="programlisting">int g_cancellable_get_fd (<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable);</pre><p>Gets the file descriptor for a cancellable job. This can be used toimplement cancellable operations on Unix systems. The returned fd willturn readable when <em class="parameter"><code>cancellable</code></em> is cancelled.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> A valid file descriptor. <code class="literal">-1</code> if the file descriptor is not supported, or on errors. </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3145460"></a><h3><a name="g-cancellable-get-current"></a>g_cancellable_get_current ()</h3><a class="indexterm" name="id3145471"></a><pre class="programlisting"><a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a>* g_cancellable_get_current (void);</pre><p>Gets the top cancellable from the stack.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> from the top of the stack, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>if the stack is empty. </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103558"></a><h3><a name="g-cancellable-pop-current"></a>g_cancellable_pop_current ()</h3><a class="indexterm" name="id3103569"></a><pre class="programlisting">void g_cancellable_pop_current (<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable);</pre><p>Pops <em class="parameter"><code>cancellable</code></em> off the cancellable stack (verifying that <em class="parameter"><code>cancellable</code></em> is on the top of the stack).</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103647"></a><h3><a name="g-cancellable-push-current"></a>g_cancellable_push_current ()</h3><a class="indexterm" name="id3103658"></a><pre class="programlisting">void g_cancellable_push_current (<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable);</pre><p>Pushes <em class="parameter"><code>cancellable</code></em> onto the cancellable stack. The currentcancllable can then be recieved using <a class="link" href="GCancellable.html#g-cancellable-get-current"><code class="function">g_cancellable_get_current()</code></a>.</p><p>This is useful when implementing cancellable operations incode that does not allow you to pass down the cancellable object.</p><p>This is typically called automatically by e.g. <a class="link" href="GFile.html" title="GFile"><span class="type">GFile</span></a> operations,so you rarely have to call this yourself.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103759"></a><h3><a name="g-cancellable-reset"></a>g_cancellable_reset ()</h3><a class="indexterm" name="id3103771"></a><pre class="programlisting">void g_cancellable_reset (<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable);</pre><p>Resets <em class="parameter"><code>cancellable</code></em> to its uncancelled state.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3103834"></a><h3><a name="g-cancellable-cancel"></a>g_cancellable_cancel ()</h3><a class="indexterm" name="id3103845"></a><pre class="programlisting">void g_cancellable_cancel (<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable);</pre><p>Will set <em class="parameter"><code>cancellable</code></em> to cancelled, and will emit the CANCELLEDsignal.</p><p>This function is thread-safe. In other words, you can safely call it fromanother thread than the one running an operation that was passedthe <em class="parameter"><code>cancellable</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3103923"></a><h2>Signal Details</h2><div class="refsect2" lang="en"><a name="id3103934"></a><h3><a name="GCancellable-cancelled"></a>The <code class="literal">"cancelled"</code> signal</h3><a class="indexterm" name="id3103947"></a><pre class="programlisting">void user_function (<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data) : Run Last</pre><p>Emitted when the operation has been cancelled from another thread.</p><p>Can be used by implementations of cancellable operations. This willbe emitted in the thread that tried to cancel the operation, not thethread the is running the operation.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td><td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td><td>user data set when the signal handler was connected.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3104035"></a><div class="refsect2" lang="en"><a name="id3104036"></a></div><hr><div class="refsect2" lang="en"><a name="id3104037"></a></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -