1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
85
  
86
  
87
  
88
  
89
  
90
  
91
  
92
  
93
  
94
  
95
  
96
  
97
  
98
  
99
  
100
  
101
  
102
  
103
  
104
  
105
  
106
  
107
  
108
  
109
  
110
  
/* -*- C -*- */ 
require gtk22; 
 
class GTK2.Clipboard; 
inherit G.Object; 
 
//! Clipboard implementation. 
 
/* 
void create() 
//! Constructor. 
{ 
  pgtk2_verify_setup(); 
  pgtk2_verify_not_inited(); 
  THIS->obj=g_malloc(sizeof(GtkClipboard)); 
  if (THIS->obj==NULL) 
    SIMPLE_OUT_OF_MEMORY_ERROR("create",sizeof(GtkClipboard)); 
  pgtk2_pop_n_elems(args); 
  pgtk2__init_this_object(); 
} 
*/ 
 
void destroy() 
//! Destructor. 
{ 
/* 
  if (THIS->obj) 
    g_free(THIS->obj); 
*/ 
  THIS->obj=0; 
  pgtk2_pop_n_elems(args); 
  push_int(0); 
} 
 
GTK2.Clipboard get(GDK2.Atom selection) 
//! Returns the clipboard object for the given selection. 
{ 
  pgtk2_verify_inited(); 
  { 
    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. 
{ 
  pgtk2_verify_inited(); 
  { 
    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. 
 
void set_text(string text, int len); 
//! Sets the contents of the clipboard to the given UTF-8 string. 
 
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(); 
//! Requests the contents of the clipboard as text and converts the result 
//! to UTF-8 if necessary. 
 
require gtk26; 
GDK2.Pixbuf wait_for_image(); 
//! Requests the contents of the clipboard as image and converts the result 
//! to a GDK2.Pixbuf. 
endrequire; 
 
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; 
 
endrequire;