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