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
  
/* -*- C -*- */ 
require gtk24; 
class GTK2.CellLayout; 
mixin_for G.Object; 
 
//! An interface for packing cells. 
 
%{ 
int pgtk2_cell_layout_data_callback(GtkCellLayout *cell_layout, 
                                    GtkCellRenderer *cell, 
                                    GtkTreeModel *tree_model, 
                                    GtkTreeIter *iter, 
                                    struct signal_data *d) { 
  int res; 
  push_gobject(cell_layout); 
  push_gobject(cell); 
  push_gobject(tree_model); 
  push_pgdk2object(iter,pgtk2_tree_iter_program,0); 
  push_svalue(&d->args); 
  safe_apply_svalue(&d->cb, 5, 1); 
  res=Pike_sp[-1].u.integer; 
  pop_stack(); 
  return res; 
} 
%} 
 
void pack_start(GTK2.CellRenderer cell, int expand); 
//! Packs the cell into the beginning.  If expand is false, then the cell is 
//! allocated no more space than it needs.  Any unused space is divied evenly 
//! between the cells for which expand is true. 
 
void pack_end(GTK2.CellRenderer cell, int expand); 
//! See pack_start(). 
 
void reorder(GTK2.CellRenderer cell, int position); 
//! Re-inserts cell at position. 
 
void clear(); 
//! Unsets all the mappings on all renderers and removes all renderers. 
 
void add_attribute(GTK2.CellRenderer cell, string attribute, int column); 
//! Adds an attribute mapping. 
 
void set_cell_data_func(GTK2.CellRenderer cell, function f, mixed user_data) 
//! Sets the callback to use for this cell layout.  This function is used 
//! instead of the standard attributes mapping for setting the column 
//! value, and should set the value of the cell layout's cell renderer(s) 
//! as appropriate.  f may be 0 to remove an older one. 
{ 
  pgtk2_verify_inited(); 
  { 
    struct svalue *sv1,*sv2; 
    struct object *o1; 
    struct signal_data *sd; 
 
    get_all_args(NULL,args,"%o%*%*",&o1,&sv1,&sv2); 
    sd=(struct signal_data *)g_malloc(sizeof(struct signal_data)); 
    if (sd==NULL) 
      SIMPLE_OUT_OF_MEMORY_ERROR("set_cell_data_func",sizeof(struct signal_data)); 
    assign_svalue_no_free(&sd->cb,sv1); 
    assign_svalue_no_free(&sd->args,sv2); 
    gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(THIS->obj), 
                        GTK_CELL_RENDERER(get_gobject(o1)), 
                        (GtkCellLayoutDataFunc)pgtk2_cell_layout_data_callback, 
                        sd,(GtkDestroyNotify)pgtk2_free_signal_data); 
  } 
  RETURN_THIS(); 
} 
 
void clear_attributes(GTK2.CellRenderer cell); 
//! Clears all existing attributes. 
 
endrequire;