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

📄 gtk-clipboards.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<tbody><tr><td><p><span class="term"><em class="parameter"><code>selection</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#GdkAtom"><span class="type">GdkAtom</span></a> which identifies the clipboard            to use.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> the appropriate clipboard object. If no            clipboard already exists, a new one will            be created. Once a clipboard object has            been created, it is persistent and, since            it is owned by GTK+, must not be freed or            unrefd.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3173300"></a><h3><a name="gtk-clipboard-get-for-display"></a>gtk_clipboard_get_for_display ()</h3><a class="indexterm" name="id3173315"></a><pre class="programlisting"><a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a>*       gtk_clipboard_get_for_display       (<ahref="/usr/share/gtk-doc/html/gdk/GdkDisplay.html">GdkDisplay</a> *display,                                                         <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> selection);</pre><p>Returns the clipboard object for the given selection.Cut/copy/paste menu items and keyboard shortcuts should usethe default clipboard, returned by passing <ahref="/usr/share/gtk-doc/html/gdk/gdk-Selections.html#GDK-SELECTION-CLIPBOARD:CAPS"><code class="literal">GDK_SELECTION_CLIPBOARD</code></a> for <em class="parameter"><code>selection</code></em>.(<ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#GDK-NONE:CAPS"><code class="literal">GDK_NONE</code></a> is supported as a synonym for GDK_SELECTION_CLIPBOARDfor backwards compatibility reasons.)The currently-selected object or text should be provided on the clipboardidentified by <ahref="/usr/share/gtk-doc/html/gdk/gdk-Selections.html#GDK-SELECTION-PRIMARY:CAPS"><span class="type">GDK_SELECTION_PRIMARY</span></a>. Cut/copy/paste menu itemsconceptually copy the contents of the <ahref="/usr/share/gtk-doc/html/gdk/gdk-Selections.html#GDK-SELECTION-PRIMARY:CAPS"><span class="type">GDK_SELECTION_PRIMARY</span></a> clipboardto the default clipboard, i.e. they copy the selection to what theuser sees as the clipboard.</p><p>(Passing <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#GDK-NONE:CAPS"><span class="type">GDK_NONE</span></a> is the same as using <code class="literal">gdk_atom_intern("CLIPBOARD", FALSE)</code>. See <a class="ulink" href="http://www.freedesktop.org/Standards/clipboards-spec" target="_top">http://www.freedesktop.org/Standards/clipboards-spec</a>for a detailed discussion of the "CLIPBOARD" vs. "PRIMARY"selections under the X window system. On Win32 the<ahref="/usr/share/gtk-doc/html/gdk/gdk-Selections.html#GDK-SELECTION-PRIMARY:CAPS"><span class="type">GDK_SELECTION_PRIMARY</span></a> clipboard is essentially ignored.)</p><p>It's possible to have arbitrary named clipboards; if you do inventnew clipboards, you should prefix the selection name with anunderscore (because the ICCCM requires that nonstandard atoms areunderscore-prefixed), and namespace it as well. For example,if your application called "Foo" has a special-purposeclipboard, you might call it "_FOO_SPECIAL_CLIPBOARD".</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>display</code></em>&#160;:</span></p></td><td> the display for which the clipboard is to be retrieved or created</td></tr><tr><td><p><span class="term"><em class="parameter"><code>selection</code></em>&#160;:</span></p></td><td> a <ahref="/usr/share/gtk-doc/html/gdk/gdk-Properties-and-Atoms.html#GdkAtom"><span class="type">GdkAtom</span></a> which identifies the clipboard            to use.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td> the appropriate clipboard object. If no            clipboard already exists, a new one will            be created. Once a clipboard object has            been created, it is persistent and, since            it is owned by GTK+, must not be freed or            unrefd.</td></tr></tbody></table></div><p class="since">Since  2.2</p></div><hr><div class="refsect2" lang="en"><a name="id3173523"></a><h3><a name="gtk-clipboard-get-display"></a>gtk_clipboard_get_display ()</h3><a class="indexterm" name="id3173538"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/gdk/GdkDisplay.html">GdkDisplay</a>*         gtk_clipboard_get_display           (<a class="link" href="gtk-Clipboards.html#GtkClipboard">GtkClipboard</a> *clipboard);</pre><p>Gets the <ahref="/usr/share/gtk-doc/html/gdk/GdkDisplay.html"><span class="type">GdkDisplay</span></a> associated with <em class="parameter"><code>clipboard</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>clipboard</code></em>&#160;:</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>&#160;:</span></p></td><td> the <ahref="/usr/share/gtk-doc/html/gdk/GdkDisplay.html"><span class="type">GdkDisplay</span></a> associated with <em class="parameter"><code>clipboard</code></em></td></tr></tbody></table></div><p class="since">Since  2.2</p></div><hr><div class="refsect2" lang="en"><a name="id3173640"></a><h3><a name="gtk-clipboard-set-with-data"></a>gtk_clipboard_set_with_data ()</h3><a class="indexterm" name="id3173654"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gtk_clipboard_set_with_data         (<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#guint">guint</a> n_targets,                                                         <a class="link" href="gtk-Clipboards.html#GtkClipboardGetFunc">GtkClipboardGetFunc</a> get_func,                                                         <a class="link" href="gtk-Clipboards.html#GtkClipboardClearFunc">GtkClipboardClearFunc</a> clear_func,                                                         <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre><p>Virtually sets the contents of the specified clipboard by providinga list of supported formats for the clipboard data and a functionto call to get the actual data when it is requested.</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>&#160;:</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>&#160;:</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>&#160;:</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>&#160;:</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>&#160;:</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>user_data</code></em>&#160;:</span></p></td><td>  user data to pass to <em class="parameter"><code>get_func</code></em> and <em class="parameter"><code>clear_func</code></em>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</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="id3173876"></a><h3><a name="gtk-clipboard-set-with-owner"></a>gtk_clipboard_set_with_owner ()</h3><a class="indexterm" name="id3173889"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a>            gtk_clipboard_set_with_owner        (<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#guint">guint</a> n_targets,                                                         <a class="link" href="gtk-Clipboards.html#GtkClipboardGetFunc">GtkClipboardGetFunc</a> get_func,                                                         <a class="link" href="gtk-Clipboards.html#GtkClipboardClearFunc">GtkClipboardClearFunc</a> clear_func,                                                         <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a> *owner);</pre><p>Virtually sets the contents of the specified clipboard by providinga list of supported formats for the clipboard data and a functionto call to get the actual data when it is requested.</p><p>The difference between this function and <a class="link" href="gtk-Clipboards.html#gtk-clipboard-set-with-data"><code class="function">gtk_clipboard_set_with_data()</code></a>is that instead of an generic <em class="parameter"><code>user_data</code></em> pointer, a <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> is passedin.</p><p>

⌨️ 快捷键说明

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