⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gtk-clipboards.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 5 页
字号:
href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a>*          <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-for-image">gtk_clipboard_wait_for_image</a>        (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8">guint8</a>*             <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-for-rich-text">gtk_clipboard_wait_for_rich_text</a>    (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard,                                                         <a class="link" href="GtkTextBuffer.html" title="GtkTextBuffer">GtkTextBuffer</a> *buffer,                                                         <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> *format,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize">gsize</a> *length);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-is-text-available">gtk_clipboard_wait_is_text_available</a>                                                        (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-is-image-available">gtk_clipboard_wait_is_image_available</a>                                                        (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-is-rich-text-available">gtk_clipboard_wait_is_rich_text_available</a>                                                        (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard,                                                         <a class="link" href="GtkTextBuffer.html" title="GtkTextBuffer">GtkTextBuffer</a> *buffer);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-for-targets">gtk_clipboard_wait_for_targets</a>      (<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> **targets,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> *n_targets);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-is-target-available">gtk_clipboard_wait_is_target_available</a>                                                        (<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);void                <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-can-store">gtk_clipboard_set_can_store</a>         (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard,                                                         const <a class="link" href="gtk-Selections.html#GtkTargetEntry">GtkTargetEntry</a> *targets,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint">gint</a> n_targets);void                <a class="link" href="gtk-Clipboards.html#gtk-clipboard-store">gtk_clipboard_store</a>                 (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard);</pre></div><div class="refsect1" lang="en"><a name="id3171657"></a><h2>Object Hierarchy</h2><pre class="synopsis">  <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>   +----GtkClipboard</pre></div><div class="refsect1" lang="en"><a name="id3171682"></a><h2>Signals</h2><pre class="synopsis">  "<a class="link" href="gtk-Clipboards.html#GtkClipboard-owner-change">owner-change</a>"                                   : Run First</pre></div><div class="refsect1" lang="en"><a name="id3171710"></a><h2>Description</h2><p>    The <a class="link" href="gtk-Clipboards.html#GtkClipboard"><span class="type">GtkClipboard</span></a> object represents a clipboard of data shared    between different processes or between different widgets in    the same process. Each clipboard is identified by a name encoded as a    <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#GdkAtom"><span class="type">GdkAtom</span></a>. (Conversion to and from strings can be done with    <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#gdk-atom-intern"><code class="function">gdk_atom_intern()</code></a> and <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#gdk-atom-name"><code class="function">gdk_atom_name()</code></a>.) The default clipboard    corresponds to the "CLIPBOARD" atom; another commonly used clipboard    is the "PRIMARY" clipboard, which, in X, traditionally contains    the currently selected text.  </p><p>    To support having a number of different formats on the clipboard    at the same time, the clipboard mechanism allows providing    callbacks instead of the actual data.  When you set the contents    of the clipboard, you can either supply the data directly (via    functions like <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-text"><code class="function">gtk_clipboard_set_text()</code></a>), or you can supply a    callback to be called at a later time when the data is needed (via    <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-set-with-owner"><code class="function">gtk_clipboard_set_with_owner()</code></a>.)    Providing a callback also avoids having to make copies of the data    when it is not needed.  </p><p>    <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-data"><code class="function">gtk_clipboard_set_with_data()</code></a> and <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-owner"><code class="function">gtk_clipboard_set_with_owner()</code></a>    are quite similar; the choice between the two depends mostly on    which is more convenient in a particular situation.    The former is most useful when you want to have a blob of data    with callbacks to convert it into the various data types that you    advertise. When the <em class="parameter"><code>clear_func</code></em> you provided is called, you    simply free the data blob. The latter is more useful when the    contents of clipboard reflect the internal state of a <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>    (As an example, for the PRIMARY clipboard, when an entry widget    provides the clipboard's contents the contents are simply the    text within the selected region.) If the contents change, the    entry widget can call <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-owner"><code class="function">gtk_clipboard_set_with_owner()</code></a> to update    the timestamp for clipboard ownership, without having to worry    about <em class="parameter"><code>clear_func</code></em> being called.  </p><p>    Requesting the data from the clipboard is essentially    asynchronous. If the contents of the clipboard are provided within    the same process, then a direct function call will be made to    retrieve the data, but if they are provided by another process,    then the data needs to be retrieved from the other process, which    may take some time. To avoid blocking the user interface, the call    to request the selection, <a class="link" href="gtk-Clipboards.html#gtk-clipboard-request-contents"><code class="function">gtk_clipboard_request_contents()</code></a> takes a    callback that will be called when the contents are received (or    when the request fails.) If you don't want to deal with providing    a separate callback, you can also use <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-for-contents"><code class="function">gtk_clipboard_wait_for_contents()</code></a>.    What this does is run the GLib main loop recursively waiting for    the contents. This can simplify the code flow, but you still have    to be aware that other callbacks in your program can be called    while this recursive mainloop is running.  </p><p>    Along with the functions to get the clipboard contents as an    arbitrary data chunk, there are also functions to retrieve    it as text, <a class="link" href="gtk-Clipboards.html#gtk-clipboard-request-text"><code class="function">gtk_clipboard_request_text()</code></a> and    <a class="link" href="gtk-Clipboards.html#gtk-clipboard-wait-for-text"><code class="function">gtk_clipboard_wait_for_text()</code></a>. These functions take care of    determining which formats are advertised by the clipboard    provider, asking for the clipboard in the best available format    and converting the results into the UTF-8 encoding. (The standard    form for representing strings in GTK+.)  </p></div><div class="refsect1" lang="en"><a name="id3171959"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3171969"></a><h3><a name="GtkClipboard-struct"></a>GtkClipboard</h3><a class="indexterm" name="id3171981"></a><pre class="programlisting">typedef struct _GtkClipboard GtkClipboard;</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id3171997"></a><h3><a name="GtkClipboardReceivedFunc"></a>GtkClipboardReceivedFunc ()</h3><a class="indexterm" name="id3172010"></a><pre class="programlisting">void                (*GtkClipboardReceivedFunc)         (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard,                                                         <a class="link" href="GtkWidget.html#GtkSelectionData">GtkSelectionData</a> *selection_data,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> data);</pre><p>    A function to be called when the results of <a class="link" href="gtk-Clipboards.html#gtk-clipboard-request-contents"><code class="function">gtk_clipboard_request_contents()</code></a>    are received, or when the request fails.</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>&#160;:</span></p></td><td>the <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>selection_data</code></em>&#160;:</span></p></td><td>a <a class="link" href="GtkWidget.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> containing the data was received.                 If retrieving the data failed, then then 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>data</code></em>&#160;:</span></p></td><td>the <em class="parameter"><code>user_data</code></em> supplied to <a class="link" href="gtk-Clipboards.html#gtk-clipboard-request-contents"><code class="function">gtk_clipboard_request_contents()</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3172156"></a><h3><a name="GtkClipboardTextReceivedFunc"></a>GtkClipboardTextReceivedFunc ()</h3><a class="indexterm" name="id3172169"></a><pre class="programlisting">void                (*GtkClipboardTextReceivedFunc)     (<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#gpointer">gpointer</a> data);</pre><p>    A function to be called when the results of <a class="link" href="gtk-Clipboards.html#gtk-clipboard-request-text"><code class="function">gtk_clipboard_request_text()</code></a>    are received, or when the request fails.</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>&#160;:</span></p></td><td>the <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>text</code></em>&#160;:</span></p></td><td>the text received, as a UTF-8 encoded string, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>            if retrieving the data failed.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td><td>the <em class="parameter"><code>user_data</code></em> supplied to <a class="link" href="gtk-Clipboards.html#gtk-clipboard-request-text"><code class="function">gtk_clipboard_request_text()</code></a>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3172310"></a><h3><a name="GtkClipboardImageReceivedFunc"></a>GtkClipboardImageReceivedFunc ()</h3><a class="indexterm" name="id3172326"></a><pre class="programlisting">void                (*GtkClipboardImageReceivedFunc)    (<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,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -