org.gnu.gtk

Class Clipboard


public class Clipboard
extends Boxed

The Clipboard object represents a clipboard of data shared between different processes or between different widgets in the same process.

TODO: This requires gdk.Selections

TODO: callback functions

Field Summary

Fields inherited from class org.gnu.glib.Boxed

handle

Constructor Summary

Clipboard(Handle handle)

Method Summary

void
clear()
Clear the contents of the clipboard.
static Clipboard
get(Atom atom)
Returns the clipboard object for the given selection.
SelectionData
getContents(Atom atom)
Requests the contents of the clipboard as SelectionData
Display
getDisplay()
Gets the Display associated with clipboard.
static Clipboard
getForDisplay(Display display, Atom atom)
Pixbuf
getImage()
String
getText()
Requests the contents of the clipboard as text.
protected static void
gtk_clipboard_clear(Handle clipboard)
protected static Handle
gtk_clipboard_get(Handle selection)
protected static Handle
gtk_clipboard_get_display(Handle clipboard)
protected static Handle
gtk_clipboard_get_owner(Handle clipboard)
protected static void
gtk_clipboard_set_can_store(Handle clipboard, Handle[] targets)
protected static void
gtk_clipboard_set_image(Handle clipboard, Handle pixbuf)
protected static void
gtk_clipboard_set_text(Handle clipboard, String text, int len)
protected static void
gtk_clipboard_store(Handle clipboard)
protected static Handle
gtk_clipboard_wait_for_image(Handle clipboard)
protected static String
gtk_clipboard_wait_for_text(Handle clipboard)
protected static boolean
gtk_clipboard_wait_is_image_available(Handle clipboard)
protected static boolean
gtk_clipboard_wait_is_target_available(Handle clipboard, Handle target)
protected static boolean
gtk_clipboard_wait_is_text_available(Handle clipboard)
boolean
isImageAvailable()
boolean
isTextAvailable()
void
setCanStore(TargetEntry[] targets)
void
setImage(Pixbuf pixbuf)
void
setText(String text)
Set the contents of the clipboard.
void
store()

Methods inherited from class org.gnu.glib.Boxed

equals, getHandle, hashCode, setHandle

Constructor Details

Clipboard

protected Clipboard(Handle handle)

Method Details

clear

public void clear()
Clear the contents of the clipboard.


get

public static Clipboard get(Atom atom)
Returns the clipboard object for the given selection. See getForDisplay(Display,Atom) for complete details.

Parameters:
atom - a Atom which identifies the clipboard to use

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 for all time and cannot be freed.


getContents

public SelectionData getContents(Atom atom)
Requests the contents of the clipboard as SelectionData

Parameters:
atom - an Atom representing the form into which the clipboard owner should convert the selection

Returns:
a newly-allocated SelectionData object or NULL if retrieving the given target failed TODO: write the JNI


getDisplay

public Display getDisplay()
Gets the Display associated with clipboard.

Returns:
the Display associated with clipboard


getForDisplay

public static Clipboard getForDisplay(Display display,
                                      Atom atom)

Parameters:
display - the display for which the clipboard is to be retrieved or created
atom - a Atom which identifies the clipboard to use

Returns:
he appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time and cannot be freed. TODO: write JNI


getImage

public Pixbuf getImage()


getText

public String getText()
Requests the contents of the clipboard as text.


gtk_clipboard_clear

protected static final void gtk_clipboard_clear(Handle clipboard)


gtk_clipboard_get

protected static final Handle gtk_clipboard_get(Handle selection)


gtk_clipboard_get_display

protected static final Handle gtk_clipboard_get_display(Handle clipboard)


gtk_clipboard_get_owner

protected static final Handle gtk_clipboard_get_owner(Handle clipboard)


gtk_clipboard_set_can_store

protected static final void gtk_clipboard_set_can_store(Handle clipboard,
                                                        Handle[] targets)


gtk_clipboard_set_image

protected static final void gtk_clipboard_set_image(Handle clipboard,
                                                    Handle pixbuf)


gtk_clipboard_set_text

protected static final void gtk_clipboard_set_text(Handle clipboard,
                                                   String text,
                                                   int len)


gtk_clipboard_store

protected static final void gtk_clipboard_store(Handle clipboard)


gtk_clipboard_wait_for_image

protected static final Handle gtk_clipboard_wait_for_image(Handle clipboard)


gtk_clipboard_wait_for_text

protected static final String gtk_clipboard_wait_for_text(Handle clipboard)


gtk_clipboard_wait_is_image_available

protected static final boolean gtk_clipboard_wait_is_image_available(Handle clipboard)


gtk_clipboard_wait_is_target_available

protected static final boolean gtk_clipboard_wait_is_target_available(Handle clipboard,
                                                                      Handle target)


gtk_clipboard_wait_is_text_available

protected static final boolean gtk_clipboard_wait_is_text_available(Handle clipboard)


isImageAvailable

public boolean isImageAvailable()


isTextAvailable

public boolean isTextAvailable()


setCanStore

public void setCanStore(TargetEntry[] targets)


setImage

public void setImage(Pixbuf pixbuf)


setText

public void setText(String text)
Set the contents of the clipboard.


store

public void store()