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
  
/* -*- C -*- */ 
require pango; 
 
class Pango.TabArray; 
inherit G.Object; 
 
//! A set of tab stops for laying out text that includes tab characters. 
 
void create(int initial_size, int position_in_pixels); 
//! Creates an array of initial_size tab stops.  Tab stops are specified in 
//! pixel units if positions_in_pixels is true, otherwise in Pango units. All 
//! stops are initially at position 0. 
 
Pango.TabArray copy() 
//! Returns a copy. 
{ 
  pgtk2_verify_inited(); 
  { 
    PangoTabArray *pta=pango_tab_array_copy((PangoTabArray *)THIS->obj); 
    pgtk2_pop_n_elems(args); 
    push_gobjectclass(pta,ppango2_tab_array_program); 
  } 
} 
 
int get_size() 
//! Gets the number of tab stops. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  push_int(pango_tab_array_get_size((PangoTabArray *)THIS->obj)); 
} 
 
void resize(int new_size) 
//! Resizes the array.  You must subsequently initialize any tabs that were 
//! added as a result of growing the array. 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE new_size; 
    get_all_args(NULL,args,"%i",&new_size); 
    pango_tab_array_resize((PangoTabArray *)THIS->obj,new_size);  
    RETURN_THIS(); 
  } 
} 
 
void set_tab(int tab_index, int alignment, int location) 
//! Sets the alignment and location of a tab stop.  Alignment must always be 
//! CONST(PANGO_TAB_). 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE tab_index,alignment,location; 
    get_all_args(NULL,args,"%i%i%i",&tab_index,&alignment,&location); 
    pango_tab_array_set_tab((PangoTabArray *)THIS->obj,tab_index,alignment, 
                        location); 
    RETURN_THIS(); 
  } 
} 
 
mapping get_tab(int tab_index) 
//! Gets the alignment and position of a tab stop. 
{ 
  pgtk2_verify_inited(); 
  { 
    INT_TYPE tab_index; 
    gint location; 
    PangoTabAlign alignment; 
    get_all_args(NULL,args,"%i",&tab_index); 
    pgtk2_pop_n_elems(args); 
    pango_tab_array_get_tab((PangoTabArray *)THIS->obj,tab_index,&alignment, 
                        &location); 
    ref_push_string(_STR("alignment")); push_int(alignment); 
    ref_push_string(_STR("location")); push_int(location); 
    f_aggregate_mapping(4); 
  } 
} 
 
array get_tabs() 
//! Gets alignments and locations of all tab stops. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    int i; 
    PangoTabAlign *alignments; 
    gint *locations; 
    pango_tab_array_get_tabs((PangoTabArray *)THIS->obj,&alignments,&locations); 
    for (i=0; i<pango_tab_array_get_size((PangoTabArray *)THIS->obj); i++) { 
      ref_push_string(_STR("alignment")); push_int(alignments[i]); 
      ref_push_string(_STR("location")); push_int(locations[i]); 
      f_aggregate_mapping(4); 
    } 
    f_aggregate(i-1); 
    g_free(alignments); 
    g_free(locations); 
  } 
} 
 
int get_positions_in_pixels() 
//! Returns true if the tab positions are in pixels, false if they are in 
//! Pango units. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  push_int(pango_tab_array_get_positions_in_pixels((PangoTabArray *)THIS->obj)); 
} 
 
endrequire;