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
  
/* -*- C -*- */ 
class GTK2.IconSize; 
 
//! Iconsize. 
 
string get_name(int size) 
//! Gets the canonical name of the given icon size. 
{ 
  INT_TYPE size; 
  const gchar *res; 
  get_all_args(NULL,args,"%i",&size); 
  res=gtk_icon_size_get_name(size); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_GCHAR(res); 
} 
 
int from_name(string name) 
//! Looks up the icon size associated with name. 
{ 
  char *name; 
  int res; 
  get_all_args(NULL,args,"%s",&name); 
  res=gtk_icon_size_from_name(name); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_INT(res); 
} 
 
void register_alias(string alias, int target) 
//! Registers alias as another name for target. So calling  
//! GTK2.IconSize->from_name() with alias will return target. 
{ 
  char *alias; 
  INT_TYPE target; 
  get_all_args(NULL,args,"%s%i",&alias,&target); 
  gtk_icon_size_register_alias(alias,target); 
  RETURN_THIS(); 
} 
 
int register(string name, int width, int height) 
//! Registers a new icon size, along the same lines as GTK2.ICON_SIZE_MENU, etc. 
//! Returns the integer value for the size. 
{ 
  char *name; 
  INT_TYPE width,height; 
  int res; 
  get_all_args(NULL,args,"%s%i%i",&name,&width,&height); 
  res=gtk_icon_size_register(name,width,height); 
  pgtk2_pop_n_elems(args); 
  PGTK_PUSH_INT(res); 
}