<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Graphics.UI.Gtk.General.Clipboard</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ window.onload = function () {pageLoad();setSynopsis("mini_Graphics-UI-Gtk-General-Clipboard.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Graphics-UI-Gtk-General-Clipboard.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">gtk-0.12.0: Binding to the Gtk+ graphical user interface library.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable (depends on GHC)</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>gtk2hs-users@lists.sourceforge.net</td></tr></table><p class="caption">Graphics.UI.Gtk.General.Clipboard</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Detail </a></li><li><a href="#g:2">Class Hierarchy </a></li><li><a href="#g:3">Types </a></li><li><a href="#g:4">Constants </a></li><li><a href="#g:5">Methods </a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Storing data on clipboards </p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:Clipboard">Clipboard</a> </li><li class="src short"><span class="keyword">class</span> <a href="/usr/share/doc/ghc/html/libraries/glib-0.12.0/System-Glib-GObject.html#t:GObjectClass">GObjectClass</a> o => <a href="#t:ClipboardClass">ClipboardClass</a> o </li><li class="src short"><a href="#v:castToClipboard">castToClipboard</a> :: <a href="/usr/share/doc/ghc/html/libraries/glib-0.12.0/System-Glib-GObject.html#t:GObjectClass">GObjectClass</a> obj => obj -> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></li><li class="src short"><a href="#v:gTypeClipboard">gTypeClipboard</a> :: <a href="Graphics-UI-Gtk-Abstract-Widget.html#t:GType">GType</a></li><li class="src short"><a href="#v:toClipboard">toClipboard</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> o => o -> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></li><li class="src short"><a href="#v:selectionPrimary">selectionPrimary</a> :: <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a></li><li class="src short"><a href="#v:selectionSecondary">selectionSecondary</a> :: <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a></li><li class="src short"><a href="#v:selectionClipboard">selectionClipboard</a> :: <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a></li><li class="src short"><a href="#v:clipboardGet">clipboardGet</a> :: <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></li><li class="src short"><a href="#v:clipboardGetForDisplay">clipboardGetForDisplay</a> :: <a href="Graphics-UI-Gtk-Gdk-Display.html#t:Display">Display</a> -> <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></li><li class="src short"><a href="#v:clipboardGetDisplay">clipboardGetDisplay</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-Gdk-Display.html#t:Display">Display</a></li><li class="src short"><a href="#v:clipboardSetWithData">clipboardSetWithData</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> [(<a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a>, <a href="Graphics-UI-Gtk-General-Selection.html#t:InfoId">InfoId</a>)] -> (<a href="Graphics-UI-Gtk-General-Selection.html#t:InfoId">InfoId</a> -> <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionDataM">SelectionDataM</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:clipboardSetText">clipboardSetText</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:clipboardSetImage">clipboardSetImage</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> <a href="Graphics-UI-Gtk-Gdk-Pixbuf.html#t:Pixbuf">Pixbuf</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:clipboardRequestContents">clipboardRequestContents</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> <a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a> -> <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionDataM">SelectionDataM</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:clipboardRequestText">clipboardRequestText</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:clipboardRequestImage">clipboardRequestImage</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Graphics-UI-Gtk-Gdk-Pixbuf.html#t:Pixbuf">Pixbuf</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:clipboardRequestTargets">clipboardRequestTargets</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a>] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:clipboardRequestRichText">clipboardRequestRichText</a> :: (<a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self, <a href="Graphics-UI-Gtk-Multiline-TextBuffer.html#t:TextBufferClass">TextBufferClass</a> buffer) => self -> buffer -> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:clipboardSetCanStore">clipboardSetCanStore</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> [(<a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a>, <a href="Graphics-UI-Gtk-General-Selection.html#t:InfoId">InfoId</a>)] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:clipboardStore">clipboardStore</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li></ul></div><div id="interface"><h1 id="g:1">Detail </h1><div class="doc"><p>The <code><a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></code> object represents a clipboard of data shared between different processes or between different widgets in the same process. Each clipboard is identified by a <code><a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a></code> which itself is an <code><a href="Graphics-UI-Gtk-General-Selection.html#t:Atom">Atom</a></code>. The default clipboard corresponds to the <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionClipboard">selectionClipboard</a></code> tag; another commonly used clipboard is the <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionPrimary">selectionPrimary</a></code> tag, 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 <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:clipboardSetText">clipboardSetText</a></code>), or you can supply a callback to be called at a later time when the data is needed (via <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:clipboardSetWithData">clipboardSetWithData</a></code>). Providing a callback also avoids having to make copies of the data when it is not needed. </p><p>Setting clipboard data is done using <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:clipboardSetWithData">clipboardSetWithData</a></code> and <code>clipboardSetWithOwner</code>. Both functions 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 <code>clearFunc</code> 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 <code><a href="/usr/share/doc/ghc/html/libraries/glib-0.12.0/System-Glib-GObject.html#t:GObject">GObject</a></code> (As an example, for the <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionPrimary">selectionPrimary</a></code> 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 <code>clipboardSetWithOwner</code> to update the timestamp for clipboard ownership, without having to worry about <code>clearFunc</code> 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, <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:clipboardRequestContents">clipboardRequestContents</a></code> 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 <code>clipboardWaitForContents</code>. 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, <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:clipboardRequestText">clipboardRequestText</a></code> and <code>clipboardWaitForText</code>. 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 its content. </p></div><h1 id="g:2">Class Hierarchy </h1><div class="doc"><pre> | <code><a href="/usr/share/doc/ghc/html/libraries/glib-0.12.0/System-Glib-GObject.html#t:GObject">GObject</a></code> | +----Clipboard </pre></div><h1 id="g:3">Types </h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Clipboard" class="def">Clipboard</a> <a href="src/Graphics-UI-Gtk-Types.html#Clipboard" class="link">Source</a></p><div class="subs instances"><p id="control.i:Clipboard" class="caption collapser" onclick="toggleSection('i:Clipboard')">Instances</p><div id="section.i:Clipboard" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Ord.html#t:Ord">Ord</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc/html/libraries/glib-0.12.0/System-Glib-GObject.html#t:GObjectClass">GObjectClass</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="/usr/share/doc/ghc/html/libraries/glib-0.12.0/System-Glib-GObject.html#t:GObjectClass">GObjectClass</a> o => <a name="t:ClipboardClass" class="def">ClipboardClass</a> o <a href="src/Graphics-UI-Gtk-Types.html#ClipboardClass" class="link">Source</a></p><div class="subs instances"><p id="control.i:ClipboardClass" class="caption collapser" onclick="toggleSection('i:ClipboardClass')">Instances</p><div id="section.i:ClipboardClass" class="show"><table><tr><td class="src"><a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:castToClipboard" class="def">castToClipboard</a> :: <a href="/usr/share/doc/ghc/html/libraries/glib-0.12.0/System-Glib-GObject.html#t:GObjectClass">GObjectClass</a> obj => obj -> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a><a href="src/Graphics-UI-Gtk-Types.html#castToClipboard" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:gTypeClipboard" class="def">gTypeClipboard</a> :: <a href="Graphics-UI-Gtk-Abstract-Widget.html#t:GType">GType</a><a href="src/Graphics-UI-Gtk-Types.html#gTypeClipboard" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:toClipboard" class="def">toClipboard</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> o => o -> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a><a href="src/Graphics-UI-Gtk-Types.html#toClipboard" class="link">Source</a></p></div><h1 id="g:4">Constants </h1><div class="top"><p class="src"><a name="v:selectionPrimary" class="def">selectionPrimary</a> :: <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a><a href="src/Graphics-UI-Gtk-General-Structs.html#selectionPrimary" class="link">Source</a></p><div class="doc"><p>The primary selection (the currently highlighted text in X11 that can in many applications be pasted using the middle button). </p></div></div><div class="top"><p class="src"><a name="v:selectionSecondary" class="def">selectionSecondary</a> :: <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a><a href="src/Graphics-UI-Gtk-General-Structs.html#selectionSecondary" class="link">Source</a></p><div class="doc"><p>The secondary selection. Rarely used. </p></div></div><div class="top"><p class="src"><a name="v:selectionClipboard" class="def">selectionClipboard</a> :: <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a><a href="src/Graphics-UI-Gtk-General-Structs.html#selectionClipboard" class="link">Source</a></p><div class="doc"><p>The modern clipboard that is filled by copy or cut commands. </p></div></div><h1 id="g:5">Methods </h1><div class="top"><p class="src"><a name="v:clipboardGet" class="def">clipboardGet</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardGet" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a></td><td class="doc"><p><code>selection</code> - a <code><a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a></code> which identifies the clipboard to use. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></td><td class="doc"><p>returns 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. </p></td></tr></table></div><div class="doc"><p>Returns the clipboard object for the given selection. See <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:clipboardGetForDisplay">clipboardGetForDisplay</a></code> for complete details. </p></div></div><div class="top"><p class="src"><a name="v:clipboardGetForDisplay" class="def">clipboardGetForDisplay</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardGetForDisplay" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-Gdk-Display.html#t:Display">Display</a></td><td class="doc"><p><code>display</code> - the display for which the clipboard is to be retrieved or created </p></td></tr><tr><td class="src">-> <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a></td><td class="doc"><p><code>selection</code> - a <code><a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionTag">SelectionTag</a></code> which identifies the clipboard to use. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-General-Clipboard.html#t:Clipboard">Clipboard</a></td><td class="doc"><p>returns 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. </p></td></tr></table></div><div class="doc"><p>Returns the clipboard object for the given selection. Cut/copy/paste menu items and keyboard shortcuts should use the default clipboard, returned by passing <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionClipboard">selectionClipboard</a></code> for <code>selection</code>. The currently-selected object or text should be provided on the clipboard identified by <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionPrimary">selectionPrimary</a></code>. Cut/copy/paste menu items conceptually copy the contents of the <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionPrimary">selectionPrimary</a></code> clipboard to the default clipboard, i.e. they copy the selection to what the user sees as the clipboard. </p><p>See <http: discussion of the <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionClipboard">selectionClipboard</a></code> vs. <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionPrimary">selectionPrimary</a></code> selections under the X window system. On Win32 the <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:selectionPrimary">selectionPrimary</a></code> clipboard is essentially ignored. </p><p>It's possible to have arbitrary named clipboards; if you do invent new clipboards, you should prefix the selection name with an underscore (because the ICCCM requires that nonstandard atoms are underscore-prefixed), and namespace it as well. For example, if your application called "Foo" has a special-purpose clipboard, you could create it using <code>Graphics.UI.Gtk.General.Selection.atomNew</code> "_FOO_SPECIAL_CLIPBOARD". </p><ul><li> Available since Gtk+ version 2.2 </li></ul></div></div><div class="top"><p class="src"><a name="v:clipboardGetDisplay" class="def">clipboardGetDisplay</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardGetDisplay" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="Graphics-UI-Gtk-Gdk-Display.html#t:Display">Display</a></td><td class="doc"><p>returns the <code><a href="Graphics-UI-Gtk-Gdk-Display.html#t:Display">Display</a></code> associated with <code>clipboard</code> </p></td></tr></table></div><div class="doc"><p>Gets the <code><a href="Graphics-UI-Gtk-Gdk-Display.html#t:Display">Display</a></code> associated with <code>clipboard</code> </p><ul><li> Available since Gtk+ version 2.2 </li></ul></div></div><div class="top"><p class="src"><a name="v:clipboardSetWithData" class="def">clipboardSetWithData</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardSetWithData" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> [(<a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a>, <a href="Graphics-UI-Gtk-General-Selection.html#t:InfoId">InfoId</a>)]</td><td class="doc"><p><code>targets</code> - a list containing information about the available forms for the clipboard data </p></td></tr><tr><td class="src">-> (<a href="Graphics-UI-Gtk-General-Selection.html#t:InfoId">InfoId</a> -> <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionDataM">SelectionDataM</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>)</td><td class="doc"><p><code>getFunc</code> - function to call to get the actual clipboard data, should call <code>selectionDataSet</code>. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc"><p><code>clearFunc</code> - when the clipboard contents are set again, this function will be called, and <code>getFunc</code> will not be subsequently called. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>returns <code>True</code> if setting the clipboard data succeeded. </p></td></tr></table></div><div class="doc"><p>Virtually sets the contents of the specified clipboard by providing a list of supported formats for the clipboard data and a function to call to get the actual data when it is requested. </p></div></div><div class="top"><p class="src"><a name="v:clipboardSetText" class="def">clipboardSetText</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardSetText" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></td><td class="doc"><p><code>text</code> - the text to be set as clipboard content </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Sets the contents of the clipboard to the given UTF-8 string. Gtk+ will make a copy of the text and take responsibility for responding for requests for the text, and for converting the text into the requested format. </p></div></div><div class="top"><p class="src"><a name="v:clipboardSetImage" class="def">clipboardSetImage</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardSetImage" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="Graphics-UI-Gtk-Gdk-Pixbuf.html#t:Pixbuf">Pixbuf</a></td><td class="doc"><p><code>pixbuf</code> - a <code><a href="Graphics-UI-Gtk-Gdk-Pixbuf.html#t:Pixbuf">Pixbuf</a></code> </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Sets the contents of the clipboard to the given <code><a href="Graphics-UI-Gtk-Gdk-Pixbuf.html#t:Pixbuf">Pixbuf</a></code>. Gtk+ will take responsibility for responding for requests for the image, and for converting the image into the requested format. </p><ul><li> Available since Gtk+ version 2.6 </li></ul></div></div><div class="top"><p class="src"><a name="v:clipboardRequestContents" class="def">clipboardRequestContents</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardRequestContents" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a></td><td class="doc"><p><code>target</code> - an atom representing the form into which the clipboard owner should convert the selection. </p></td></tr><tr><td class="src">-> <a href="Graphics-UI-Gtk-General-Selection.html#t:SelectionDataM">SelectionDataM</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc"><p><code>callback</code> - A function to call when the results are received (or the retrieval fails). If the retrieval fails, <code>selectionDataIsValid</code> returns <code>False</code>. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Requests the contents of clipboard as the given target. When the results of the result are later received the supplied callback will be called. </p></div></div><div class="top"><p class="src"><a name="v:clipboardRequestText" class="def">clipboardRequestText</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardRequestText" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>)</td><td class="doc"><p><code>callback</code> - a function to call when the text is received, or the retrieval fails. (It will always be called one way or the other.) </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Requests the contents of the clipboard as text. When the text is later received, it will be converted if it is stored in a different character set if necessary, and <code>callback</code> will be called. </p><p>The <code>text</code> parameter to <code>callback</code> will contain the resulting text if the request succeeded, or <code>Nothing</code> if it failed. This could happen for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into text form. </p></div></div><div class="top"><p class="src"><a name="v:clipboardRequestImage" class="def">clipboardRequestImage</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardRequestImage" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Graphics-UI-Gtk-Gdk-Pixbuf.html#t:Pixbuf">Pixbuf</a> -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>)</td><td class="doc"><p><code>callback</code> - a function to call when the image is received, or the retrieval fails. (It will always be called one way or the other.) </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Requests the contents of the clipboard as image. When the image is later received, it will be converted to a <code><a href="Graphics-UI-Gtk-Gdk-Pixbuf.html#t:Pixbuf">Pixbuf</a></code>, and <code>callback</code> will be called. </p><p>The <code>pixbuf</code> parameter to <code>callback</code> will contain the resulting <code><a href="Graphics-UI-Gtk-Gdk-Pixbuf.html#t:Pixbuf">Pixbuf</a></code> if the request succeeded, or <code>Nothing</code> if it failed. This could happen for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into an image. </p><ul><li> Available since Gtk+ version 2.6 </li></ul></div></div><div class="top"><p class="src"><a name="v:clipboardRequestTargets" class="def">clipboardRequestTargets</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardRequestTargets" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> [<a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a>] -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>)</td><td class="doc"><p><code>callback</code> - a function to call when the targets are received, or the retrieval fails. (It will always be called one way or the other.) </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Requests the contents of the clipboard as list of supported targets. When the list is later received, <code>callback</code> will be called. </p><p>The <code>targets</code> parameter to <code>callback</code> will contain the resulting targets if the request succeeded, or <code>Nothing</code> if it failed. </p><ul><li> Available since Gtk+ version 2.4 </li></ul></div></div><div class="top"><p class="src"><a name="v:clipboardRequestRichText" class="def">clipboardRequestRichText</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardRequestRichText" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self, <a href="Graphics-UI-Gtk-Multiline-TextBuffer.html#t:TextBufferClass">TextBufferClass</a> buffer)</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> buffer</td><td class="doc"><p><code>buffer</code> - a <code><a href="Graphics-UI-Gtk-Multiline-TextBuffer.html#t:TextBuffer">TextBuffer</a></code> that determines the supported rich text formats </p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a>, <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a>) -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a>)</td><td class="doc"><p><code>callback</code> - a function to call when the text is received, or the retrieval fails. (It will always be called one way or the other.) </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Requests the contents of the clipboard as rich text. When the rich text is later received, <code>callback</code> will be called. </p><p>The <code>text</code> parameter to <code>callback</code> will contain the resulting rich text if the request succeeded, or <code>Nothing</code> if it failed. This function can fail for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into rich text form. </p><ul><li> Available since Gtk+ version 2.10 </li></ul></div></div><div class="top"><p class="src"><a name="v:clipboardSetCanStore" class="def">clipboardSetCanStore</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardSetCanStore" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self</td><td class="doc empty"> </td></tr><tr><td class="src">=> self</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> [(<a href="Graphics-UI-Gtk-General-Selection.html#t:TargetTag">TargetTag</a>, <a href="Graphics-UI-Gtk-General-Selection.html#t:InfoId">InfoId</a>)]</td><td class="doc"><p><code>targets</code> - list containing information about which forms should be stored or <code>Nothing</code> to indicate that all forms should be stored. </p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Hints that the clipboard data should be stored somewhere when the application exits or when <code><a href="Graphics-UI-Gtk-General-Clipboard.html#v:clipboardStore">clipboardStore</a></code> is called. </p><p>This value is reset when the clipboard owner changes. Where the clipboard data is stored is platform dependent, see <code>displayStoreClipboard</code> for more information. </p><ul><li> Available since Gtk+ version 2.6 </li></ul></div></div><div class="top"><p class="src"><a name="v:clipboardStore" class="def">clipboardStore</a> :: <a href="Graphics-UI-Gtk-General-Clipboard.html#t:ClipboardClass">ClipboardClass</a> self => self -> <a href="/usr/share/doc/ghc/html/libraries/base-4.3.1.0/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a><a href="src/Graphics-UI-Gtk-General-Clipboard.html#clipboardStore" class="link">Source</a></p><div class="doc"><p>Stores the current clipboard data somewhere so that it will stay around after the application has quit. </p><ul><li> Available since Gtk+ version 2.6 </li></ul></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>