]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/lablgtksourceview/gSourceView.mli
ocaml 3.09 transition
[helm.git] / helm / DEVEL / lablgtksourceview / gSourceView.mli
index 4b1b60be691a96e0437a7b20167f8b1312047206..746ddd77c14270ce9c8c5bea0e2c96499c5593c3 100644 (file)
-(* Copyright (C) 2005:
- *     Stefano Zacchiroli     <zack@cs.unibo.it>
- *     Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+(*
+ * lablgtksourceview, OCaml binding for the GtkSourceView text widget
  *
- * This file is part of lablgtksourceview, the OCaml binding for the
- * GtkSourceView widget.
+ * Copyright (C) 2005  Stefano Zacchiroli <zack@cs.unibo.it>
  * 
- * lablgtksourceview is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
  * License, or (at your option) any later version.
- *
- * lablgtksourceview is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * 
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with lablgtksourceview; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * Lesser General Public License for more details.
  * 
- * For details, send a mail to the authors.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
  *)
 
 open Gtk
 
-class source_view_signals :
+(** {2 GtkSourceLanguage} *)
+
+class source_language_signals:
+  ([> Gtk_sourceview.source_language ] as 'b) obj ->
+  object ('a)
+    inherit ['b] GObj.gobject_signals
+    method tag_style_changed: callback:(string -> unit) -> GtkSignal.id
+  end
+
+class source_language:
+  Gtk_sourceview.source_language obj ->
+  object
+    method as_source_language: Gtk_sourceview.source_language obj
+    method connect: source_language_signals
+    method get_escape_char: Glib.unichar
+    method get_name: string
+    method get_section: string
+    method misc: GObj.gobject_ops
+  end
+
+(** {2 GtkSourceLanguagesManager} *)
+
+class source_languages_manager:
+  Gtk_sourceview.source_languages_manager obj ->
+  object
+    method get_oid: int
+    method as_source_languages_manager:
+      Gtk_sourceview.source_languages_manager obj
+    method get_language_from_mime_type: string -> source_language option
+    method lang_files_dirs: string list
+  end
+
+val source_languages_manager:
+(*   ?lang_files_dirs:string list -> *)
+  unit ->
+    source_languages_manager
+
+val source_language_from_file:
+  ?languages_manager:source_languages_manager -> string ->
+    source_language option
+
+(** {2 GtkSourceBuffer} *)
+
+class source_buffer_signals:
+  ([> Gtk_sourceview.source_buffer ] as 'b) obj ->
+  object ('a)
+    inherit GText.buffer_signals
+    method can_redo: callback:(bool -> unit) -> GtkSignal.id
+    method can_undo: callback:(bool -> unit) -> GtkSignal.id
+    method highlight_updated:
+      callback:(Gtk.text_iter -> Gtk.text_iter -> unit) -> GtkSignal.id
+    method marker_updated: callback:(Gtk.text_iter -> unit) -> GtkSignal.id
+  end
+
+class source_buffer:
+  Gtk_sourceview.source_buffer obj ->
+  object
+    inherit GText.buffer_skel
+    method connect: source_buffer_signals
+    method misc: GObj.gobject_ops
+    method check_brackets: bool
+    method set_check_brackets: bool -> unit
+(*     method set_bracket_match_style: tag_style -> unit *)
+    method highlight: bool
+    method set_highlight: bool -> unit
+    method max_undo_levels: int
+    method set_max_undo_levels: int -> unit
+    method language: source_language option
+    method set_language: source_language -> unit
+    method escape_char: Glib.unichar
+    method set_escape_char: Glib.unichar -> unit
+    method can_undo: bool
+    method can_redo: bool
+    method undo: unit -> unit
+    method redo: unit -> unit
+    method begin_not_undoable_action: unit -> unit
+    method end_not_undoable_action: unit -> unit
+(*     method create_marker: name:char -> typ:char -> source_marker *)
+(*     method move_marker: source_marker -> Gtext.text_iter -> unit *)
+(*     method delete_marker: source_marker -> unit *)
+(*     method get_marker: name:char -> source_marker *)
+(*     method get_markers_in_region:
+      start:text_iter -> stop:text_iter -> source_marker list *)
+(*     method get_first_marker: unit -> source_marker *)
+(*     method get_last_marker: unit -> source_marker *)
+(*     method get_iter_at_marker: ... *)
+(*     method get_next_marker: unit -> source_marker *)
+(*     method get_prev_marker: unit -> source_marker *)
+  end
+
+val source_buffer:
+  ?language:source_language ->
+(*   ?tag_table:source_tag_table -> *)
+  ?text:string ->
+  ?check_brackets:bool ->
+  ?escape_char:int ->
+  ?highlight:bool ->
+  ?max_undo_levels:int ->
+  unit ->
+    source_buffer
+
+(** {2 GtkSourceView} *)
+
+class source_view_signals:
   ([> Gtk_sourceview.source_view ] as 'b) obj ->
   object ('a)
-    method after : 'a
-    method copy_clipboard : callback:(unit -> unit) -> GtkSignal.id
-    method cut_clipboard : callback:(unit -> unit) -> GtkSignal.id
-    method delete_from_cursor :
-      callback:(Gtk.Tags.delete_type -> int -> unit) -> GtkSignal.id
-    method destroy : callback:(unit -> unit) -> GtkSignal.id
-    method insert_at_cursor : callback:(string -> unit) -> GtkSignal.id
-    method move_cursor :
-      callback:(Gtk.Tags.movement_step -> int -> extend:bool -> unit) ->
-        GtkSignal.id
-    method move_focus :
-      callback:(Gtk.Tags.direction_type -> unit) -> GtkSignal.id
-    method page_horizontally :
-      callback:(int -> extend:bool -> unit) -> GtkSignal.id
-    method paste_clipboard : callback:(unit -> unit) -> GtkSignal.id
-    method populate_popup :
-      callback:(Gtk.menu Gtk.obj -> unit) -> GtkSignal.id
-    method redo : callback:(unit -> unit) -> GtkSignal.id
-    method set_anchor : callback:(unit -> unit) -> GtkSignal.id
-    method set_scroll_adjustments :
-      callback:(GData.adjustment option -> GData.adjustment option -> unit) ->        GtkSignal.id
-    method toggle_overwrite : callback:(unit -> unit) -> GtkSignal.id
-    method undo : callback:(unit -> unit) -> GtkSignal.id
+    inherit GText.view_signals
+    method redo: callback:(unit -> unit) -> GtkSignal.id
+    method undo: callback:(unit -> unit) -> GtkSignal.id
   end
 
-class source_view :
-  Gtk_sourceview.source_view Gtk.obj ->
+class source_view:
+  Gtk_sourceview.source_view obj ->
   object
-    method add_child_at_anchor : GObj.widget -> GText.child_anchor -> unit
-    method add_child_in_window :
-      child:GObj.widget ->
-      which_window:Gtk.Tags.text_window_type -> x:int -> y:int -> unit
-    method as_view : Gtk.text_view Gtk.obj
-    method as_widget : Gtk.widget Gtk.obj
-    method backward_display_line : GText.iter -> bool
-    method backward_display_line_start : GText.iter -> bool
-    method buffer : GText.buffer
-    method buffer_to_window_coords :
-      tag:Gtk.Tags.text_window_type -> x:int -> y:int -> int * int
-    method coerce : GObj.widget
-    method connect : source_view_signals
-    method cursor_visible : bool
-    method destroy : unit -> unit
-    method drag : GObj.drag_ops
-    method editable : bool
-    method event : GObj.event_ops
-    method forward_display_line : GText.iter -> bool
-    method forward_display_line_end : GText.iter -> bool
-    method get_border_window_size :
-      [ `BOTTOM | `LEFT | `RIGHT | `TOP ] -> int
-    method get_iter_at_location : x:int -> y:int -> GText.iter
-    method get_iter_location : GText.iter -> Gdk.Rectangle.t
-    method get_line_at_y : int -> GText.iter * int
-    method get_line_yrange : GText.iter -> int * int
-    method get_oid : int
-    method get_window : Gtk.Tags.text_window_type -> Gdk.window option
-    method get_window_type : Gdk.window -> Gtk.Tags.text_window_type
-    method indent : int
-    method justification : Gtk.Tags.justification
-    method left_margin : int
-    method misc : GObj.misc_ops
-    method move_child : child:GObj.widget -> x:int -> y:int -> unit
-    method move_mark_onscreen : GText.mark -> bool
-    method move_visually : GText.iter -> int -> bool
-    method pixels_above_lines : int
-    method pixels_below_lines : int
-    method pixels_inside_wrap : int
-    method place_cursor_onscreen : unit -> bool
-    method right_margin : int
-    method scroll_mark_onscreen : GText.mark -> unit
-    method scroll_to_iter :
-      ?within_margin:float ->
-      ?use_align:bool -> ?xalign:float -> ?yalign:float -> GText.iter -> bool
-    method scroll_to_mark :
-      ?within_margin:float ->
-      ?use_align:bool -> ?xalign:float -> ?yalign:float -> GText.mark -> unit
-    method set_border_window_size :
-      typ:[ `BOTTOM | `LEFT | `RIGHT | `TOP ] -> size:int -> unit
-    method set_buffer : GText.buffer -> unit
-    method set_cursor_visible : bool -> unit
-    method set_editable : bool -> unit
-    method set_indent : int -> unit
-    method set_justification : Gtk.Tags.justification -> unit
-    method set_left_margin : int -> unit
-    method set_pixels_above_lines : int -> unit
-    method set_pixels_below_lines : int -> unit
-    method set_pixels_inside_wrap : int -> unit
-    method set_right_margin : int -> unit
-    method set_show_line_numbers : bool -> unit
-    method set_wrap_mode : Gtk.Tags.wrap_mode -> unit
-    method show_line_numbers : bool
-    method starts_display_line : GText.iter -> bool
-    method visible_rect : Gdk.Rectangle.t
-    method window_to_buffer_coords :
-      tag:Gtk.Tags.text_window_type -> x:int -> y:int -> int * int
-    method wrap_mode : Gtk.Tags.wrap_mode
+    inherit GText.view_skel
+    val obj: Gtk_sourceview.source_view obj
+    method connect: source_view_signals
+    method source_buffer: source_buffer
+    method set_show_line_numbers: bool -> unit
+    method show_line_numbers: bool
+    method set_show_line_markers: bool -> unit
+    method show_line_markers: bool
+    method set_tabs_width: int -> unit
+    method tabs_width: int
+    method set_auto_indent: bool -> unit
+    method auto_indent: bool
+    method set_insert_spaces_instead_of_tabs: bool -> unit
+    method insert_spaces_instead_of_tabs: bool
+    method set_show_margin: bool -> unit
+    method show_margin: bool
+    method set_margin: int -> unit
+    method margin: int
+(*     method set_marker_pixbuf: GdkPixbuf.pixbuf -> unit *)
+(*     method marker_pixbuf: GdkPixbuf.pixbuf *)
+    method set_smart_home_end: bool -> unit
+    method smart_home_end: bool
   end
 
-val source_view :
+val source_view:
+  ?source_buffer:source_buffer ->
   ?auto_indent:bool ->
   ?insert_spaces_instead_of_tabs:bool ->
   ?margin:int ->
@@ -147,3 +181,7 @@ val source_view :
   unit ->
     source_view
 
+(** {2 Misc} *)
+
+val find_matching_bracket: GText.iter -> GText.iter option
+