eb0536 | 2005-11-05 | Henrik Grubbström (Grubba) | | /* -*- C -*- */
|
1a0554 | 2005-07-28 | Martin Nilsson | | require gtk22;
class GTK2.Clipboard;
inherit G.Object;
//! Clipboard implementation.
/*
void create()
//! Constructor.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_setup();
pgtk2_verify_not_inited();
|
1a0554 | 2005-07-28 | Martin Nilsson | | THIS->obj=g_malloc(sizeof(GtkClipboard));
if (THIS->obj==NULL)
SIMPLE_OUT_OF_MEMORY_ERROR("create",sizeof(GtkClipboard));
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_pop_n_elems(args);
pgtk2__init_this_object();
|
1a0554 | 2005-07-28 | Martin Nilsson | | }
*/
|
2edd4f | 2008-01-30 | Per Hedbor | |
|
1a0554 | 2005-07-28 | Martin Nilsson | | void destroy()
{
|
2edd4f | 2008-01-30 | Per Hedbor | | /* From API doc:
Once a clipboard object has been created, it is
persistent and, since it is owned by GTK+, must not be freed or
unrefd.
*/
|
1a0554 | 2005-07-28 | Martin Nilsson | | THIS->obj=0;
}
GTK2.Clipboard get(GDK2.Atom selection)
//! Returns the clipboard object for the given selection.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
|
1a0554 | 2005-07-28 | Martin Nilsson | | {
struct object *o1;
get_all_args("get",args,"%o",&o1);
THIS->obj=G_OBJECT(gtk_clipboard_get(get_gdkatom(o1)));
}
RETURN_THIS();
}
require gtk22;
GTK2.Clipboard get_for_display(GDK2.Display display, GDK2.Atom selection)
//! Returns the clipboard object for the given selection.
{
|
ba9e80 | 2006-02-27 | Martin Stjernholm | | pgtk2_verify_inited();
|
1a0554 | 2005-07-28 | Martin Nilsson | | {
struct object *o1,*o2;
get_all_args("get_for_display",args,"%o",&o1,&o2);
THIS->obj=G_OBJECT(gtk_clipboard_get_for_display(
(GdkDisplay *)get_gdkobject(o1,display),get_gdkatom(o2)));
}
RETURN_THIS();
}
GDK2.Display get_display();
//! Gets the GDK2.Display associated with this clipboard.
endrequire;
void clear();
//! Clears the contents of the clipboard.
|
208e09 | 2010-09-19 | Marcus Comstedt | | void set_text(string text, mixed ... fmt)
|
a91e46 | 2010-09-19 | Marcus Comstedt | | //! Sets the contents of the clipboard to the given string.
|
208e09 | 2010-09-19 | Marcus Comstedt | | //! If multiple arguments are supplied, sprintf() is called implicitly.
{
pgtk2_get_string_arg_with_sprintf(args);
pgtk2_verify_inited();
gtk_clipboard_set_text( GTK_CLIPBOARD(THIS->obj),Pike_sp[-1].u.string->str,Pike_sp[-1].u.string->len);
pgtk2_return_this(1);
}
|
1a0554 | 2005-07-28 | Martin Nilsson | |
require gtk26;
void set_image(GDK2.Pixbuf pixbuf);
//! Sets the contents of the clipboard to the given GDK2(Pixbuf).
endrequire;
/*
// TODO
string request_text();
//! Requests the contents of the clipboard.
*/
/* TODO
require gtk26;
string request_image();
//! Requests the contents of the clipboard as image.
endrequire;
*/
string wait_for_text();
|
a91e46 | 2010-09-19 | Marcus Comstedt | | //! Requests the contents of the clipboard as text
|
1a0554 | 2005-07-28 | Martin Nilsson | |
require gtk26;
GDK2.Pixbuf wait_for_image();
//! Requests the contents of the clipboard as image and converts the result
//! to a GDK2.Pixbuf.
endrequire;
|
f28449 | 2006-08-03 | Lance Dillon | | require gtk210;
string wait_for_rich_text(GTK2.TextBuffer buffer)
//! Requests the contents of the clipboard as rich text.
{
pgtk2_verify_inited();
{
struct object *o1;
GtkTextBuffer *gtb;
GdkAtom a;
gsize len;
guint8 *res;
get_all_args("wait_for_rich_text",args,"%o",&o1);
res=gtk_clipboard_wait_for_rich_text(GTK_CLIPBOARD(THIS->obj),
GTK_TEXT_BUFFER(get_gobject(o1)),&a,&len);
pgtk2_pop_n_elems(args);
if (res)
push_string(make_shared_binary_string(res,len));
else
push_string(empty_pike_string);
}
}
endrequire;
|
1a0554 | 2005-07-28 | Martin Nilsson | | int wait_is_text_available();
//! Test to see if there is text available to be pasted. This is done by
//! requesting the TARGETS atom and checking if it contains any of the
//! supported text targets.
require gtk26;
int wait_is_image_available();
//! Test to see if tehre is an image available to be pasted.
endrequire;
|
f28449 | 2006-08-03 | Lance Dillon | | require gtk210;
int wait_is_rich_text_available(GTK2.TextBuffer buffer);
//! Test to see if there is rich text available to be pasted.
endrequire;
|
1a0554 | 2005-07-28 | Martin Nilsson | | endrequire;
|