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
  
/* -*- C -*- */ 
 
class GTK2.CellRenderer; 
inherit GTK2.Data; 
 
//! Properties: 
//! string cell-background 
//! GDK2.Color cell-background-gdk 
//! int cell-background-set 
//! int height 
//! int is-expanded 
//! int is-expander 
//! int mode CONST(GTK_CELL_RENDERER_MODE_) 
//! int sensitive 
//! int visible 
//! int width 
//! float xalign 
//! int xpad 
//! float yalign 
//! int ypad 
 
signal editing_canceled; 
require gtk26; 
signal editing_started; 
endrequire; 
 
mapping(string:int) get_size(GTK2.Widget widget, ?GDK2.Rectangle cell_area) 
//! Obtains the width and heigh needed to render the cell.  Used by widgets 
//! to determine the appropriate size for the cell_area passed to render(). 
//! If cell_area is present, fills in the x and y offset of the cell relative 
//! to this location.  Please note that the values set in width and height, 
//! as well as those in x_offset and y_offset are inclusive of the xpad and 
//! ypad properties. 
{ 
  pgtk2_verify_inited(); 
  { 
    struct object *o1,*o2=NULL; 
    gint x_offset,y_offset,width,height; 
    get_all_args(NULL,args,"%o.%o",&o1,&o2); 
#ifdef HAVE_GTK_BETA 
    gtk_cell_renderer_get_size(GTK_CELL_RENDERER(THIS->obj), 
                GTK_WIDGET(get_gobject(o1)), 
                &width,&height); 
    ref_push_string(_STR("width")); push_int(width); 
    ref_push_string(_STR("height")); push_int(height); 
    f_aggregate_mapping(4); 
#else /* !HAVE_GTK_BETA */ 
    gtk_cell_renderer_get_size(GTK_CELL_RENDERER(THIS->obj), 
                GTK_WIDGET(get_gobject(o1)), 
                o2?(GdkRectangle *)get_gdkobject(o2,rectangle):NULL, 
                &x_offset,&y_offset,&width,&height); 
    pgtk2_pop_n_elems(args); 
    ref_push_string(_STR("x_offset")); push_int(x_offset); 
    ref_push_string(_STR("y_offset")); push_int(y_offset); 
    ref_push_string(_STR("width")); push_int(width); 
    ref_push_string(_STR("height")); push_int(height); 
    f_aggregate_mapping(8); 
#endif /* HAVE_GTK_BETA */ 
  } 
} 
 
void render(GDK2.Window window, GTK2.Widget widget,  
            GDK2.Rectangle background_area, GDK2.Rectangle cell_area, 
            GDK2.Rectangle expose_area, int flags) 
//! Invokes the virtual render function of the W(CellRenderer).  The three 
//! passed-in rectangles are areas of window.  Most renderers will draw within 
//! cell_area; the xalign, yalign, xpad, and ypad fields of the W(CellRenderer) 
//! should be honored with respect to cell_area.  background_area includes the 
//! blank space around the cell, and also the area containing the tree 
//! expander; so the background_area rectangles for all cells tile to cover the 
//! entire window.  expose_area is a clip rectangle. 
//! flags is one of CONST(GTK_CELL_RENDERER_). 
{ 
  pgtk2_verify_inited(); 
  { 
    struct object *o1,*o2,*o3,*o4,*o5; 
    INT_TYPE flags; 
    get_all_args(NULL,args,"%o%o%o%o%o%i",&o1,&o2,&o3,&o4,&o5,&flags); 
    gtk_cell_renderer_render(GTK_CELL_RENDERER(THIS->obj), 
                GDK_WINDOW(get_gobject(o1)), 
                GTK_WIDGET(get_gobject(o2)), 
                (GdkRectangle *)get_gdkobject(o3,rectangle), 
                (GdkRectangle *)get_gdkobject(o4,rectangle), 
                (GdkRectangle *)get_gdkobject(o5,rectangle),flags); 
  } 
  RETURN_THIS(); 
} 
 
int activate(GDK2.Event event, GTK2.Widget widget, string path, 
             GDK2.Rectangle background_area, GDK2.Rectangle cell_area, 
             int flags) 
//! Passes an activate event to the cell renderer for possible processing. 
//! Some cell renderers may use events; for example, W(CellRendererToggle) 
//! toggles when it gets a mouse click. 
{ 
  pgtk2_verify_inited(); 
  { 
    struct object *o1,*o2,*o3,*o4; 
    const gchar *path; 
    INT_TYPE flags; 
    int res; 
    get_all_args(NULL,args,"%o%o%s%o%o%i",&o1,&o2,&path,&o3,&o4,&flags); 
    res=gtk_cell_renderer_activate(GTK_CELL_RENDERER(THIS->obj), 
                (GdkEvent *)get_gdkobject(o1,event), 
                GTK_WIDGET(get_gobject(o2)), 
                path,(GdkRectangle *)get_gdkobject(o3,rectangle), 
                (GdkRectangle *)get_gdkobject(o4,rectangle),flags); 
    pgtk2_pop_n_elems(args); 
    push_int(res); 
  } 
} 
 
void start_editing(GDK2.Event event, GTK2.Widget widget, string path, 
                   GDK2.Rectangle background_area, GDK2.Rectangle cell_area, 
                   int flags) 
//! Passes an activate event to the cell renderer for possible processing. 
{ 
  pgtk2_verify_inited(); 
  { 
    struct object *o1,*o2,*o3,*o4; 
    const gchar *path; 
    INT_TYPE flags; 
    get_all_args(NULL,args,"%o%o%s%o%o%i",&o1,&o2,&path,&o3,&o4,&flags); 
    gtk_cell_renderer_start_editing(GTK_CELL_RENDERER(THIS->obj), 
                (GdkEvent *)get_gdkobject(o1,event), 
                GTK_WIDGET(get_gobject(o2)),path, 
                (GdkRectangle *)get_gdkobject(o3,rectangle), 
                (GdkRectangle *)get_gdkobject(o4,rectangle),flags); 
  } 
  RETURN_THIS(); 
} 
   
require gtk26; 
void stop_editing(int canceled); 
//! Informs the cell renderer that the editing is stopped.  If canceled is 
//! true, the cell renderer will emit the "editing-canceled" signal.  This 
//! function should be called by cell renderer implementations in response to 
//! the "editing-done" signal of W(CellEditable). 
endrequire; 
 
mapping get_fixed_size() 
//! Fills in width and height with the appropriate size of the cell. 
{ 
  pgtk2_verify_inited(); 
  { 
    gint width,height; 
    pgtk2_pop_n_elems(args); 
    gtk_cell_renderer_get_fixed_size(GTK_CELL_RENDERER(THIS->obj), 
                        &width,&height); 
    ref_push_string(_STR("width")); push_int(width); 
    ref_push_string(_STR("height")); push_int(height); 
    f_aggregate_mapping(4); 
  } 
} 
 
void set_fixed_size(int width, int height); 
//! Sets the renderer size to be explicit, independent of the properties set.