gtk-sharp 2.12.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. GLib.Object An object that stores clipboard data.

The 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 . (Conversion to and from strings can be done with and .) 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.

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 (eg, via the property), or you can supply a callback to be called at a later time when the data is needed (via or .) Providing a callback also avoids having to make copies of the data when it is not needed.

and 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 clear_func 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 (As an example, for the PRIMARY clipboard, when an entry widget provides the contents for the clipboar the contents are simply the text within the selected region.) If the contents change, the entry widget can call to update the timestamp for clipboard ownership, without having to worry about clear_func being called.

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, takes a callback that will be called when the contents are received (or when the request fails.) If you do not want to deal with providing a separate callback, you can also use . 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.

Along with the functions to get the clipboard contents as an arbitrary data chunk, there are also functions to retrieve it as text, and . 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#.)

- Constructor
  2.12.0.0
  Proctected constructor.
- Constructor
  2.12.0.0
  System.Obsolete
  a
  Protected Constructor.
  Chain to this constructor if you have manually registered a native value for your subclass.
- Constructor
  2.12.0.0
  Pointer to the C object.
  Internal constructor

  This is an internal constructor, and should not be used by user code.

- Method
  2.12.0.0
  System.Void Clears the contents of the clipboard. Generally this should only be called between the time you call or , and when the clear_func you supplied is called. Otherwise, the clipboard may be owned by someone else.
- Property
  2.12.0.0
  Gdk.Display The associated with the clipboard. a
- Method
  2.12.0.0
  Gtk.Clipboard `` an object of type Returns the clipboard object for the given selection. an object of type See for complete details.
- Method
  2.12.0.0
  Gtk.Clipboard `` `` a a Returns the clipboard object for the given selection. a

  Cut/copy/paste menu items and keyboard shortcuts should use the default clipboard, returned by passing GDK_SELECTION_CLIPBOARD for selection. (GDK_NONE is supported as a synonym for GDK_SELECTION_CLIPBOARD for backwards compatibility reasons.) The currently-selected object or text should be provided on the clipboard identified by GDK_SELECTION_PRIMARY. Cut/copy/paste menu items conceptually copy the contents of the GDK_SELECTION_PRIMARY clipboard to the default clipboard, i.e. they copy the selection to what the user sees as the clipboard.

  (Passing GDK_NONE is the same as using gdk_atom_intern ("CLIPBOARD", ). See http://www.freedesktop.org/standards/clipboards.txt for a detailed discussion of the "CLIPBOARD" vs. "PRIMARY" selections under the X window system. On Win32 the GDK_SELECTION_PRIMARY clipboard is essentially ignored.)

  It is 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 might call it "_FOO_SPECIAL_CLIPBOARD".

- Property
  2.12.0.0
  GLib.GType GType Property. a Returns the native value for .
- Property
  2.12.0.0
  Gdk.Pixbuf To be added a To be added
- Method
  2.12.0.0
  GLib.DefaultSignalHandler(ConnectionMethod="OverrideOwnerChange", Type=typeof(Gtk.Clipboard))
  System.Void `` An event describing the owner change. Default handler for the event. Override this method in a subclass to provide a default handler for the event.
- Property
  2.12.0.0
  GLib.Object The owner of the clipboard, if any; otherwise . an object of type If the clipboard contents callbacks were set with , and the or has not been subsequently called, it will return the owner set by .
- Event
  2.12.0.0
  GLib.Signal("owner_change")
  Gtk.OwnerChangeHandler To be added To be added
- Method
  2.12.0.0
  System.Void `` `` a representing the form into which the clipboard-owning program should convert the selection. a , a function to call when the clipboard results are received. Requests the contents of clipboard as the given target. When the results of the result are later received the supplied callback will be called.
- Method
  2.12.0.0
  System.Void `` a To be added To be added
- Method
  2.12.0.0
  System.Void `` `` a . callback to invoke when data is prepared. Requests the contents as Rich Text asynchronously.
- Method
  2.12.0.0
  System.Void `` a Requests the contents of the clipboard as list of supported targets. When the list is later received, will be called. The "targets" parameter to will contain the resulting targets if the request succeeded, or if it failed. Added in GTK 2.4.
- Method
  2.12.0.0
  System.Void `` a Fetch the clipboard's text and fire the function on it.
- Method
  2.12.0.0
  System.Void `` `` a a To be added To be added
- Method
  2.12.0.0
  System.Obsolete("Replaced by Text property.")
  System.Void `` an object of type Deprecated method to set the contents of the clipboard. Replaced by the property.
- Method
  2.12.0.0
  System.Boolean `` `` `` a a a 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. a
- Method
  2.12.0.0
  System.Boolean `` `` `` `` a a a a 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. a The difference between this function and is that a is passed in.
- Method
  2.12.0.0
  System.Void To be added To be added
- Property
  2.12.0.0
  System.String Sets the contents of the clipboard to the given UTF-8 string. a 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.
- Method
  2.12.0.0
  Gtk.SelectionData `` an object of type Requests the contents of the clipboard using the given target. an object of type This function waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait.
- Method
  2.12.0.0
  Gdk.Pixbuf To be added a To be added
- Method
  2.12.0.0
  System.Byte[] `` `` To be added. To be added. Requests contents as Rich Text. a byte array holding the contents. Uses the main loop, so events and timeouts may be dispatched during the wait.
- Method
  2.12.0.0
  System.Boolean `` `` a a Returns a list of targets that are present on the clipboard, or if there aren't any targets available. a ,TRUE if any targets are present on the clipboard, otherwise FALSE.

  This function waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait.

- Method
  2.12.0.0
  System.String Requests the contents of the clipboard as text and converts the result to UTF-8 if necessary. an object of type This function waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait.
- Method
  2.12.0.0
  System.Boolean To be added a To be added
- Method
  2.12.0.0
  System.Boolean `` a . Tests if Rich Text is available for pasting. if , rich text is available. This method is slightly faster that since it doesn't retrieve the actual text. Uses the main loop, so events and timeouts may be dispatched during the wait.
- Method
  2.12.0.0
  System.Boolean `` a To be added a To be added
- Method
  2.12.0.0
  System.Boolean Test to see if there is text available to be pasted. an object of type

  This is done by requesting the TARGETS atom and checking if it contains any of the names: STRING, TEXT, COMPOUND_TEXT, UTF8_STRING. This function waits for the data to be received using the main loop, so events, timeouts, etc, may be dispatched during the wait.

  This function is a little faster than calling since it does not need to retrieve the actual text.