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
  
/* -*- C -*- */ 
class GTK2.IconFactory; 
inherit G.Object; 
 
//! Icon factory, for holding icon sets. 
 
void create(); 
//! Creates a new GTK2.IconFactory.  An icon factory manages a collection of 
//! GTK2.IconSets; a GTK2.IconSet manages a set of variants of a particular icon 
//! (i.e. a GTK2.IconSet contains variants for different sizes and widget 
//! states).  Icons in an icon factory are named by a stock ID, which is a 
//! simple string identifying the icon.  Each GTK2.Style has a list of 
//! GTK2.IconFactorys derived from the current theme; those icon factories are 
//! consulted first when searching for an icon.  If the theme doesn't set a 
//! particular icon, GTK2+ looks for the icon in a list of default icon 
//! factories, maintained by add_default() and remove_default().  Applications 
//! with icons should add a default icon factory with their icons, which will 
//! allow themes to override the icons for the application. 
 
void add(string stock_id, GTK2.IconSet icon_set) 
//! Adds the given icon_set to the icon factory, under the name of stock_id. 
//! stock_id should be namespaced for your application, e.g.  
//! "myapp-whatever-icon".  Normally applications create a GTK2.IconFactory, 
//! then add it to the list of default factories with add_default().  Then they 
//! pass the stock_id to widgets such as GTK2.Image to display the icon.  Themes 
//! can provide an icon with the same name (such as "myapp-whatever-icon") to 
//! override your application's default icons.  If an icon already existed in 
//! this factory for stock_id, it is unreferenced and replaced with the new 
//! icon_set. 
{ 
  pgtk2_verify_inited(); 
  { 
    char *stock_id; 
    struct object *o1; 
    get_all_args(NULL,args,"%s%o",&stock_id,&o1); 
    gtk_icon_factory_add(GTK_ICON_FACTORY(THIS->obj),stock_id, 
                        (GtkIconSet *)get_pg2object(o1,pgtk2_icon_set_program)); 
  } 
  RETURN_THIS(); 
} 
 
void add_default(); 
//! Adds an icon factory to the list of icon factories search by  
//! GTK2.Style->lookup_icon_set().  This means that, for example,  
//! GTK2.Image->create("stock-id") will be able to find icons in factory.  There 
//! will normally be an icon factory added for each library or application that 
//! comes with icons.  The default icon factories can be overridden by themes. 
 
GTK2.IconSet lookup(string stock_id) 
//! Looks up stock_id in the icon factory, returning an icon set if found, 
//! otherwise 0.  For display to the user, you should use  
//! GTK2.Style->lookup_icon_set() on the GTK2.Style for the widget that will  
//! display the icon, instead of using this function directly, so that themes 
//! are taken into account. 
{ 
  pgtk2_verify_inited(); 
  { 
    char *stock_id; 
    GtkIconSet *gis; 
    get_all_args(NULL,args,"%s",&stock_id); 
    gis=gtk_icon_factory_lookup(GTK_ICON_FACTORY(THIS->obj),stock_id); 
    pgtk2_pop_n_elems(args); 
    push_gobjectclass(gis,pgtk2_icon_set_program); 
  } 
} 
 
GTK2.IconSet lookup_default(string stock_id) 
//! Looks for an icon in the list of default icon factories.  For display to 
//! the user, you should use GTK2.Style->lookup_icon_set() on the GTK2.Style for 
//! the widget that will display the icon, instead of using this function 
//! directly, so that themes are taken into account. 
{ 
  pgtk2_verify_inited(); 
  { 
    char *stock_id; 
    GtkIconSet *gis; 
    get_all_args(NULL,args,"%s",&stock_id); 
    gis=gtk_icon_factory_lookup_default(stock_id); 
    pgtk2_pop_n_elems(args); 
    push_gobjectclass(gis,pgtk2_icon_set_program); 
  } 
} 
 
void remove_default(); 
//! Removes an icon factory from the list of default icon factories. 
 
/* 
void GTK2.IconSet->add_source(GTK2.IconSource source); 
*/