📄 gtk-clipboards.html
字号:
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>clipboard</code></em> :</span></p></td><td> a <a class="link" href="gtk-Clipboards.html#GtkClipboard"><span class="type">GtkClipboard</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>targets</code></em> :</span></p></td><td> array containing information about the available forms for the clipboard data</td></tr><tr><td><p><span class="term"><em class="parameter"><code>n_targets</code></em> :</span></p></td><td> number of elements in <em class="parameter"><code>targets</code></em></td></tr><tr><td><p><span class="term"><em class="parameter"><code>get_func</code></em> :</span></p></td><td> function to call to get the actual clipboard data</td></tr><tr><td><p><span class="term"><em class="parameter"><code>clear_func</code></em> :</span></p></td><td> when the clipboard contents are set again, this function will be called, and <em class="parameter"><code>get_func</code></em> will not be subsequently called.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>owner</code></em> :</span></p></td><td> an object that "owns" the data. This object will be passed to the callbacks when called. </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 setting the clipboard data succeeded. If setting the clipboard data failed the provided callback functions will be ignored.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3174132"></a><h3><a name="gtk-clipboard-get-owner"></a>gtk_clipboard_get_owner ()</h3><a class="indexterm" name="id3174145"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>* gtk_clipboard_get_owner (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard);</pre><p>If the clipboard contents callbacks were set with <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-owner"><code class="function">gtk_clipboard_set_with_owner()</code></a>, and the <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-data"><code class="function">gtk_clipboard_set_with_data()</code></a> or <a class="link" href="gtk-Clipboards.html#gtk-clipboard-clear"><code class="function">gtk_clipboard_clear()</code></a> has not subsequently called, returns the owner set by <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-owner"><code class="function">gtk_clipboard_set_with_owner()</code></a>.</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>clipboard</code></em> :</span></p></td><td> a <a class="link" href="gtk-Clipboards.html#GtkClipboard"><span class="type">GtkClipboard</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the owner of the clipboard, if any; otherwise <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3174271"></a><h3><a name="gtk-clipboard-clear"></a>gtk_clipboard_clear ()</h3><a class="indexterm" name="id3174284"></a><pre class="programlisting">void gtk_clipboard_clear (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard);</pre><p>Clears the contents of the clipboard. Generally this should onlybe called between the time you call <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-owner"><code class="function">gtk_clipboard_set_with_owner()</code></a>or <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-data"><code class="function">gtk_clipboard_set_with_data()</code></a>,and when the <em class="parameter"><code>clear_func</code></em> you supplied is called. Otherwise, theclipboard may be owned by someone else.</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>clipboard</code></em> :</span></p></td><td> a <a class="link" href="gtk-Clipboards.html#GtkClipboard"><span class="type">GtkClipboard</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3174374"></a><h3><a name="gtk-clipboard-set-text"></a>gtk_clipboard_set_text ()</h3><a class="indexterm" name="id3174387"></a><pre class="programlisting">void gtk_clipboard_set_text (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *text, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> len);</pre><p>Sets the contents of the clipboard to the given UTF-8 string. GTK+ willmake a copy of the text and take responsibility for respondingfor requests for the text, and for converting the text intothe requested format.</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>clipboard</code></em> :</span></p></td><td> a <a class="link" href="gtk-Clipboards.html#GtkClipboard"><span class="type">GtkClipboard</span></a> object</td></tr><tr><td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td><td> a UTF-8 string.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td><td> length of <em class="parameter"><code>text</code></em>, in bytes, or -1, in which case the length will be determined with <code class="function"><code class="function">strlen()</code></code>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3174518"></a><h3><a name="gtk-clipboard-set-image"></a>gtk_clipboard_set_image ()</h3><a class="indexterm" name="id3174533"></a><pre class="programlisting">void gtk_clipboard_set_image (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard, <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre><p>Sets the contents of the clipboard to the given <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>. GTK+ will take responsibility for responding for requests for the image, and for converting the image into the requested format.</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>clipboard</code></em> :</span></p></td><td> a <a class="link" href="gtk-Clipboards.html#GtkClipboard"><span class="type">GtkClipboard</span></a> object</td></tr><tr><td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> </td></tr></tbody></table></div><p class="since">Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3174637"></a><h3><a name="gtk-clipboard-request-contents"></a>gtk_clipboard_request_contents ()</h3><a class="indexterm" name="id3174650"></a><pre class="programlisting">void gtk_clipboard_request_contents (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard, <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> target, <a class="link" href="gtk-Clipboards.html#GtkClipboardReceivedFunc">GtkClipboardReceivedFunc</a> callback, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Requests the contents of clipboard as the given target.When the results of the result are later received the supplied callbackwill be called.</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>clipboard</code></em> :</span></p></td><td> a <a class="link" href="gtk-Clipboards.html#GtkClipboard"><span class="type">GtkClipboard</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td><td> an atom representing the form into which the clipboard owner should convert the selection.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td><td> A function to call when the results are received (or the retrieval fails). If the retrieval fails the length field of <em class="parameter"><code>selection_data</code></em> will be negative.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td><td> user data to pass to <em class="parameter"><code>callback</code></em></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3174793"></a><h3><a name="gtk-clipboard-request-text"></a>gtk_clipboard_request_text ()</h3><a class="indexterm" name="id3174807"></a><pre class="pro
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -