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
  
111
  
112
  
113
  
114
  
115
  
116
  
117
  
118
  
119
  
120
  
121
  
122
  
123
  
124
  
125
  
126
  
127
  
128
  
129
  
130
  
131
  
132
  
133
  
134
  
135
  
136
  
137
  
138
  
139
  
140
  
141
  
142
  
143
  
144
  
145
  
146
  
147
  
148
  
149
  
150
  
151
  
152
  
153
  
154
  
155
  
156
  
157
  
158
  
159
  
160
  
161
  
162
  
163
  
164
  
165
  
166
  
167
  
168
  
169
  
170
  
171
  
172
  
173
  
174
  
175
  
176
  
177
  
178
  
179
  
180
  
181
  
182
  
183
  
184
  
185
  
186
  
187
  
188
  
189
  
190
  
191
  
192
  
193
  
194
  
195
  
196
  
197
  
198
  
199
  
200
  
201
  
202
  
203
  
204
  
205
  
206
  
207
  
208
  
209
  
210
  
211
  
212
  
213
  
214
  
215
  
216
  
217
  
218
  
219
  
220
  
221
  
222
  
223
  
224
  
225
  
226
  
227
  
228
  
229
  
230
  
231
  
232
  
233
  
234
  
235
  
236
  
237
  
238
  
239
  
240
  
241
  
242
  
243
  
244
  
245
  
246
  
247
  
248
  
249
  
250
  
251
  
252
  
253
  
254
  
255
  
256
  
257
  
258
  
259
  
/* -*- C -*- */ 
class GTK2.IconSource; 
 
//! Iconsource. 
 
void create() 
//! Creates a new GTK2.IconSource.  A GTK2.IconSource contains a GDK2.Pixbuf (or 
//! image filename) that serves as the base image for one or more of the icons 
//! in a GTK2.IconSet, along with a specification for which icons in the icon 
//! set will be based on that pixbuf or image file.  An icon set contains a set 
//! of icons that represent "the same" logical concept in different states, 
//! different global text directions, and different sizes. 
//! <p> 
//! So for example a web browser's "Back to Previous Page" icon might point in 
//! a different direction in Hebrew and in English; it might look different 
//! when insensitive; and it might change size depending on toolbar mode 
//! small/large icons).  So a single icon set would contain all those variants 
//! of the icon.  GTK2.IconSet contains a list of GTK2.IconSource from which it 
//! can derive specific icon variants in the set. 
//! <p> 
//! In the simplest case, GTK2.IconSet contains one source pixbuf from which it 
//! derives all variants.  The convenience function GTK2.IconSet->create(pixbuf) 
//! handles this case; if you only have one source pixbuf, just use that 
//! function. 
//! <p> 
//! If you want to use a different base pixbuf for different icon variants, you 
//! create multiple icon sources, mark which variants they'll be used to 
//! create, and add them to the icon set with GTK2.IconSet->add_source(). 
//! <p> 
//! By default, the icon source has all parameters wildcarded.  That is, the 
//! icon source will be used as the base icon for any desired text direction, 
//! widget state, or icon size. 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  THIS->obj=(void *)gtk_icon_source_new(); 
  pgtk2_pop_n_elems(args); 
  pgtk2__init_this_object(); 
} 
 
int get_state_wildcarded() 
//! Gets the value set by set_state_wildcarded(). 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_INT(gtk_icon_source_get_state_wildcarded((GtkIconSource *)THIS->obj)); 
} 
 
int get_state() 
//! Obtains the widget state this icon source applies to.  The return value is 
//! only useful/meaningful if the widget state is not wildcarded. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_INT(gtk_icon_source_get_state((GtkIconSource *)THIS->obj)); 
} 
 
int get_size_wildcarded() 
//! Gets the value set by set_size_wildcarded(). 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_INT(gtk_icon_source_get_size_wildcarded((GtkIconSource *)THIS->obj)); 
} 
 
int get_size() 
//! Obtains the icon size this source applies to.  The return value is only 
//! useful/meaningful if the icon size is not wildcarded. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_INT(gtk_icon_source_get_size((GtkIconSource *)THIS->obj)); 
} 
 
require gtk24; 
string get_icon_name() 
//! Retrieves the source icon name, or empty. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    const gchar *s=gtk_icon_source_get_icon_name((GtkIconSource *)THIS->obj); 
    PGTK_PUSH_GCHAR(s); 
  } 
} 
endrequire; 
 
GDK2.Pixbuf get_pixbuf() 
//! Retrieves the source pixbuf, or 0.  In addition, if a filename source is in 
//! use, this function in some cases will return the pixbuf loaded from the 
//! filename.  This is, for example, true for the GTK2.IconSource passed to the 
//! GTK2.Style->render_icon() virtual function. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    GdkPixbuf *pixbuf=gtk_icon_source_get_pixbuf((GtkIconSource *)THIS->obj); 
    g_object_ref(pixbuf); 
    push_gobject(pixbuf); 
  } 
} 
 
string get_filename() 
//! Retrieves the source filename, or empty. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_GCHAR(gtk_icon_source_get_filename((GtkIconSource *)THIS->obj)); 
} 
 
int get_direction_wildcarded() 
//! Gets the value set by set_direction_wildcarded(). 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_INT(gtk_icon_source_get_direction_wildcarded( 
                        (GtkIconSource *)THIS->obj)); 
} 
 
int get_direction() 
//! Obtains the text direction this icon source applies to.  The return value 
//! is only useful/meaningful if the text direction is not wildcarded. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_INT(gtk_icon_source_get_direction((GtkIconSource *)THIS->obj)); 
} 
 
void set_direction(int dir) 
//! Sets the text direction this icon source is intended to be used with. 
//! <p> 
//! Setting the text direction on an icon source makes no difference if the 
//! text direction is wildcarded.  Therefore, you should usually call 
//! set_direction_wildcarded() to un-wildcard it in addition to calling this 
//! function. 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE dir; 
    get_all_args(NULL,args,"%i",&dir); 
    gtk_icon_source_set_direction((GtkIconSource *)THIS->obj,dir); 
  } 
  RETURN_THIS(); 
} 
 
void set_direction_wildcarded(int setting) 
//! If the text direction is wildcarded, this source can be used as the base 
//! image for an icon in any text direction.  If the text direction is not 
//! wildcarded, then the text direction the icon source applies to should be 
//! set with set_direction(), and the icon source will only be used with that 
//! text direction. 
//! <p> 
//! GTK2.IconSet prefers non-wildcarded sources (exact matches) over wildcarded 
//! sources, and will use an exact match when possible. 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE set; 
    get_all_args(NULL,args,"%i",&set); 
    gtk_icon_source_set_direction_wildcarded((GtkIconSource *)THIS->obj,set); 
  } 
  RETURN_THIS(); 
} 
 
void set_filename(string filename) 
//! Sets the name of an image file to use as a base image when creating icon 
//! variants for GTK2.IconSet.  The filename must be absolute. 
{ 
  pgtk2_verify_inited(); 
  { 
    char *file; 
    get_all_args(NULL,args,"%s",&file); 
    gtk_icon_source_set_filename((GtkIconSource *)THIS->obj,file); 
  } 
  RETURN_THIS(); 
} 
 
void set_pixbuf(GDK2.Pixbuf pixbuf) 
//! Sets a pixbuf to use as a base image. 
{ 
  pgtk2_verify_inited(); 
  { 
    struct object *o1; 
    get_all_args(NULL,args,"%o",&o1); 
    gtk_icon_source_set_pixbuf((GtkIconSource *)THIS->obj, 
                        GDK_PIXBUF(get_gobject(o1))); 
  } 
  RETURN_THIS(); 
} 
 
require gtk24; 
void set_icon_name(string name) 
//! Sets the name of an icon to look up in the current icon theme to use as a 
//! base image. 
{ 
  pgtk2_verify_inited(); 
  { 
    char *name; 
    get_all_args(NULL,args,"%s",&name); 
    gtk_icon_source_set_icon_name((GtkIconSource *)THIS->obj,name); 
  } 
  RETURN_THIS(); 
} 
endrequire; 
 
void set_size(int size) 
//! Sets the icon size this icon source is intended to be with. 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE size; 
    get_all_args(NULL,args,"%i",&size); 
    gtk_icon_source_set_size((GtkIconSource *)THIS->obj,size); 
  } 
  RETURN_THIS(); 
} 
 
void set_size_wildcarded(int setting) 
//! If the icon size is wildcarded, this source can be used as the base image 
//! for an icon of any size.  If the size is not wildcarded, then the size the 
//! source applies to should be set with set_size() and the icon source will 
//! only be used with that specific size. 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE set; 
    get_all_args(NULL,args,"%i",&set); 
    gtk_icon_source_set_size_wildcarded((GtkIconSource *)THIS->obj,set); 
  } 
  RETURN_THIS(); 
} 
 
void set_state(int state) 
//! Sets the widget state this icon source is intended to be used with. 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE state; 
    get_all_args(NULL,args,"%i",&state); 
    gtk_icon_source_set_state((GtkIconSource *)THIS->obj,state); 
  } 
  RETURN_THIS(); 
} 
 
void set_state_wildcarded(int setting) 
//! If the widget state is wildcarded, this source can be used as the base 
//! image for an icon in any state.  If the widget state is not wildcarded, 
//! then the state the source applies to should be set with set_state() and 
//! the icon source will only be used with that specific state. 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE set; 
    get_all_args(NULL,args,"%i",&set); 
    gtk_icon_source_set_state_wildcarded((GtkIconSource *)THIS->obj,set); 
  } 
  RETURN_THIS(); 
}