]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtksourceview/gSourceView.mli
added source_view ?text constructor parameter
[helm.git] / helm / DEVEL / lablgtksourceview / gSourceView.mli
1 (* Copyright (C) 2005:
2  *      Stefano Zacchiroli     <zack@cs.unibo.it>
3  *      Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
4  *
5  * This file is part of lablgtksourceview, the OCaml binding for the
6  * GtkSourceView widget.
7  * 
8  * lablgtksourceview is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * lablgtksourceview is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with lablgtksourceview; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21  * 02111-1307, USA.
22  * 
23  * For details, send a mail to the authors.
24  *)
25
26 open Gtk
27
28 (** {2 GtkSourceBuffer} *)
29
30 class source_buffer_signals:
31   ([> Gtk_sourceview.source_buffer ] as 'b) obj ->
32   object ('a)
33     method after : 'a
34     method apply_tag :
35       callback:(GText.tag -> start:GText.iter -> stop:GText.iter -> unit) ->
36       GtkSignal.id
37     method begin_user_action : callback:(unit -> unit) -> GtkSignal.id
38     method can_redo : callback:(bool -> unit) -> GtkSignal.id
39     method can_undo : callback:(bool -> unit) -> GtkSignal.id
40     method changed : callback:(unit -> unit) -> GtkSignal.id
41     method private connect :
42       'c. ('b, 'c) GtkSignal.t -> callback:'c -> GtkSignal.id
43     method delete_range :
44       callback:(start:GText.iter -> stop:GText.iter -> unit) -> GtkSignal.id
45     method end_user_action : callback:(unit -> unit) -> GtkSignal.id
46     method highlight_updated :
47       callback:(Gtk.text_iter -> Gtk.text_iter -> unit) -> GtkSignal.id
48     method insert_child_anchor :
49       callback:(GText.iter -> Gtk.text_child_anchor -> unit) -> GtkSignal.id
50     method insert_pixbuf :
51       callback:(GText.iter -> GdkPixbuf.pixbuf -> unit) -> GtkSignal.id
52     method insert_text :
53       callback:(GText.iter -> string -> unit) -> GtkSignal.id
54     method mark_deleted : callback:(Gtk.text_mark -> unit) -> GtkSignal.id
55     method mark_set :
56       callback:(GText.iter -> Gtk.text_mark -> unit) -> GtkSignal.id
57     method marker_updated : callback:(Gtk.text_iter -> unit) -> GtkSignal.id
58     method modified_changed : callback:(unit -> unit) -> GtkSignal.id
59     method remove_tag :
60       callback:(GText.tag -> start:GText.iter -> stop:GText.iter -> unit) ->
61       GtkSignal.id
62   end
63
64 class source_buffer:
65   Gtk_sourceview.source_buffer Gtk.obj ->
66   object
67     inherit GText.buffer_skel
68     method connect: source_buffer_signals
69     method misc: GObj.gobject_ops
70     method check_brackets: bool
71     method set_check_brackets: bool -> unit
72 (*     method set_bracket_match_style: tag_style -> unit *)
73     method highlight: bool
74     method set_highlight: bool -> unit
75     method max_undo_levels: int
76     method set_max_undo_levels: int -> unit
77 (*     method language: source_language *)
78 (*     method set_language: source_language -> unit *)
79     method escape_char: Glib.unichar
80     method set_escape_char: Glib.unichar -> unit
81     method can_undo: bool
82     method can_redo: bool
83     method undo: unit -> unit
84     method redo: unit -> unit
85     method begin_not_undoable_action: unit -> unit
86     method end_not_undoable_action: unit -> unit
87 (*     method create_marker: name:char -> typ:char -> source_marker *)
88 (*     method move_marker: source_marker -> Gtext.text_iter -> unit *)
89 (*     method delete_marker: source_marker -> unit *)
90 (*     method get_marker: name:char -> source_marker *)
91 (*     method get_markers_in_region:
92       start:text_iter -> stop:text_iter -> source_marker list *)
93 (*     method get_first_marker: unit -> source_marker *)
94 (*     method get_last_marker: unit -> source_marker *)
95 (*     method get_iter_at_marker: ... *)
96 (*     method get_next_marker: unit -> source_marker *)
97 (*     method get_prev_marker: unit -> source_marker *)
98   end
99
100 val source_buffer :
101   ?text:string ->
102   ?check_brackets:bool ->
103   ?escape_char:int ->
104   ?highlight:bool ->
105   ?max_undo_levels:int ->
106 (*   ?tag_table:GText.tag_table -> *)
107   unit ->
108     source_buffer
109
110 (** {2 GtkSourceView} *)
111
112 class source_view_signals :
113   ([> Gtk_sourceview.source_view ] as 'b) obj ->
114   object ('a)
115     method after : 'a
116     method copy_clipboard : callback:(unit -> unit) -> GtkSignal.id
117     method cut_clipboard : callback:(unit -> unit) -> GtkSignal.id
118     method delete_from_cursor :
119       callback:(Gtk.Tags.delete_type -> int -> unit) -> GtkSignal.id
120     method destroy : callback:(unit -> unit) -> GtkSignal.id
121     method insert_at_cursor : callback:(string -> unit) -> GtkSignal.id
122     method move_cursor :
123       callback:(Gtk.Tags.movement_step -> int -> extend:bool -> unit) ->
124         GtkSignal.id
125     method move_focus :
126       callback:(Gtk.Tags.direction_type -> unit) -> GtkSignal.id
127     method page_horizontally :
128       callback:(int -> extend:bool -> unit) -> GtkSignal.id
129     method paste_clipboard : callback:(unit -> unit) -> GtkSignal.id
130     method populate_popup :
131       callback:(Gtk.menu Gtk.obj -> unit) -> GtkSignal.id
132     method redo : callback:(unit -> unit) -> GtkSignal.id
133     method set_anchor : callback:(unit -> unit) -> GtkSignal.id
134     method set_scroll_adjustments :
135       callback:(GData.adjustment option -> GData.adjustment option -> unit) ->        GtkSignal.id
136     method toggle_overwrite : callback:(unit -> unit) -> GtkSignal.id
137     method undo : callback:(unit -> unit) -> GtkSignal.id
138   end
139
140 class source_view :
141   Gtk_sourceview.source_view Gtk.obj ->
142   object
143     inherit GText.view_skel
144     val obj: Gtk_sourceview.source_view Gtk.obj
145     method connect: source_view_signals
146     method set_show_line_numbers : bool -> unit
147     method show_line_numbers : bool
148     method set_show_line_markers : bool -> unit
149     method show_line_markers : bool
150     method set_tabs_width: int -> unit
151     method tabs_width: int
152     method set_auto_indent: bool -> unit
153     method auto_indent: bool
154     method set_insert_spaces_instead_of_tabs: bool -> unit
155     method insert_spaces_instead_of_tabs: bool
156     method set_show_margin: bool -> unit
157     method show_margin: bool
158     method set_margin: int -> unit
159     method margin: int
160 (*     method set_marker_pixbuf: GdkPixbuf.pixbuf -> unit *)
161 (*     method marker_pixbuf: GdkPixbuf.pixbuf *)
162     method set_smart_home_end: bool -> unit
163     method smart_home_end: bool
164   end
165
166 val source_view :
167   ?source_buffer:source_buffer ->
168   ?auto_indent:bool ->
169   ?insert_spaces_instead_of_tabs:bool ->
170   ?margin:int ->
171   ?show_line_markers:bool ->
172   ?show_line_numbers:bool ->
173   ?show_margin:bool ->
174   ?smart_home_end:bool ->
175   ?tabs_width:int ->
176   ?editable:bool ->
177   ?cursor_visible:bool ->
178   ?justification:GtkEnums.justification ->
179   ?wrap_mode:GtkEnums.wrap_mode ->
180   ?border_width:int ->
181   ?width:int ->
182   ?height:int ->
183   ?packing:(GObj.widget -> unit) ->
184   ?show:bool ->
185   unit ->
186     source_view
187