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
  
/* -*- C -*- */ 
require gtksourceview; 
 
class GTK2.SourceIter; 
//! 
inherit GTK2.TextIter; 
 
%{ 
#include "gtksourceview/gtksourceview.h" 
#include "gtksourceview/gtksourceiter.h" 
%} 
add_global { 
#include "gtksourceview/gtksourceiter.h" 
}; 
 
constant int GTK_SOURCE_SEARCH_VISIBLE_ONLY; 
constant int GTK_SOURCE_SEARCH_TEXT_ONLY; 
constant int GTK_SOURCE_SEARCH_CASE_INSENSITIVE; 
 
array backward_search(string str, int flags, ?GTK2.TextIter limit) 
//! Same as GTK2.TextIter->backward_search(), but supports case insensitive 
//! searching. 
{ 
  pgtk2_verify_inited(); 
  { 
    GtkTextIter *match_start,*match_end,*limit=NULL; 
    GtkTextBuffer *sb; 
    char *str; 
    INT_TYPE flags; 
    struct object *o1 = NULL; 
    int res; 
 
    get_all_args(NULL,args,"%s%i.%o",&str,&flags,&o1); 
 
    match_start=g_malloc(sizeof(GtkTextIter)); 
    if (match_start==NULL) 
      SIMPLE_OUT_OF_MEMORY_ERROR("backward_search",sizeof(GtkTextIter)); 
    match_end=g_malloc(sizeof(GtkTextIter)); 
    if (match_end==NULL) 
      SIMPLE_OUT_OF_MEMORY_ERROR("backward_search",sizeof(GtkTextIter)); 
    sb=gtk_text_iter_get_buffer((GtkTextIter *)THIS->obj); 
    gtk_text_buffer_get_start_iter(sb,match_start); 
    gtk_text_buffer_get_end_iter(sb,match_end); 
 
    res=gtk_source_iter_backward_search((GtkTextIter *)THIS->obj, 
                        str,flags,match_start,match_end,limit); 
    pgtk2_pop_n_elems(args); 
    push_int(res); 
    push_pgdk2object(match_start,pgtk2_text_iter_program,1); 
    push_pgdk2object(match_end,pgtk2_text_iter_program,1); 
    f_aggregate(3); 
  } 
} 
 
array forward_search(string str, int flags, ?GTK2.TextIter limit) 
//! Same as GTK2.TextIter->backward_search(), but supports case insensitive 
//! searching. 
{ 
  pgtk2_verify_inited(); 
  { 
    GtkTextIter *match_start,*match_end,*limit=NULL; 
    GtkTextBuffer *sb; 
    char *str; 
    INT_TYPE flags; 
    struct object *o1 = NULL; 
    int res; 
 
    get_all_args(NULL,args,"%s%i.%o",&str,&flags,&o1); 
 
    match_start=g_malloc(sizeof(GtkTextIter)); 
    if (match_start==NULL) 
      SIMPLE_OUT_OF_MEMORY_ERROR("backward_search",sizeof(GtkTextIter)); 
    match_end=g_malloc(sizeof(GtkTextIter)); 
    if (match_end==NULL) 
      SIMPLE_OUT_OF_MEMORY_ERROR("backward_search",sizeof(GtkTextIter)); 
    sb=gtk_text_iter_get_buffer((GtkTextIter *)THIS->obj); 
    gtk_text_buffer_get_start_iter(sb,match_start); 
    gtk_text_buffer_get_end_iter(sb,match_end); 
 
    res=gtk_source_iter_forward_search((GtkTextIter *)THIS->obj, 
                        str,flags,match_start,match_end,limit); 
    pgtk2_pop_n_elems(args); 
    push_int(res); 
    push_pgdk2object(match_start,pgtk2_text_iter_program,1); 
    push_pgdk2object(match_end,pgtk2_text_iter_program,1); 
    f_aggregate(3); 
  } 
} 
 
not gtksourceview20; 
int find_matching_bracket() 
//! Tries to match the bracket character currently at this iter with its 
//! opening/closing counterpart, and if found moves iter to the position where 
//! it was found. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    int res; 
    res=gtk_source_iter_find_matching_bracket((GtkTextIter *)THIS->obj); 
    push_int(res); 
  } 
} 
endrequire;