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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
(*********************************************************************************)
(* *)
(* lablgtksourceview, OCaml binding for the GtkSourceView text widget *)
(* *)
(* Copyright (C) 2005 Stefano Zacchiroli <zack@cs.unibo.it> *)
(* Copyright (C) 2006 Stefano Zacchiroli <zack@cs.unibo.it> *)
(* Maxence Guesdon <maxence.guesdon@inria.fr> *)
(* *)
(* 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. *)
(* *)
(* 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 *)
(* Lesser General Public License for more details. *)
(* *)
(* 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 *)
(* *)
(*********************************************************************************)
prefix "Gtk"
initializer "ml_gtk_source_view_init"
header {
open GtkSourceView3_types
open SourceView3Enums
}
boxed {
GdkEvent "GdkEvent.any"
GdkRGBA "Gdk.rgba"
}
classes {
GdkPixbuf "GdkPixbuf.pixbuf"
}
class SourceStyleScheme type "source_style_scheme obj" set wrapsig : GObject {
}
class SourceStyleSchemeManager type "source_style_scheme_manager obj" wrap : GObject {
(* "scheme-ids" GStrv : Read *)
(* "search-path" GStrv : Read / Write *)
method get_search_path : "string list"
method set_search_path : "string list -> unit"
method get_scheme_ids : "string list"
method append_search_path : "string -> unit" / Wrap
method prepend_search_path : "string -> unit" / Wrap
method get_scheme : "string -> source_style_scheme obj option"
method force_rescan : "unit -> unit" / Wrap
}
class SourceCompletionInfo type "source_completion_info obj" wrap wrapsig : GtkWidget {
"max-height" gint : Read / Write / Construct
"max-width" gint : Read / Write / Construct
"shrink-height" gboolean : Read / Write / Construct
"shrink-width" gboolean : Read / Write / Construct
method move_to_iter : "Gtk.text_view obj -> Gtk.text_iter -> unit"
(*
method set_sizing :
"width:int -> height:int -> shrink_width:bool -> shrink_height:bool -> unit" / Wrap
*)
method set_widget : "Gtk.widget obj -> unit"
method get_widget : "Gtk.widget obj"
(* method process_resize : "unit" / Wrap*)
signal before_show
}
class SourceCompletionProposal type "source_completion_proposal obj" wrap wrapsig : GObject {
"icon" GdkPixbuf : Read
"info" string : Read
"label" string : Read
"markup" string : Read
"text" string : Read
signal changed
}
class SourceCompletionItem type "source_completion_proposal obj" tag "sourcecompletionproposal" wrap wrapsig : GObject {
"icon" GdkPixbuf : Read / Write
"info" string : Read / Write
"label" string : Read / Write
"markup" string : Read / Write
"text" string : Read / Write
signal changed
}
class SourceCompletionProvider type "source_completion_provider obj" abstract wrap wrapsig : GObject {
method get_name : "string"
method get_icon : "GdkPixbuf.pixbuf option"
method populate : "source_completion_context obj -> unit"
method get_activation : "source_completion_activation_flags list"
(* method match : "source_completion_context obj -> bool" *)
method get_info_widget : "source_completion_proposal obj -> Gtk.widget obj option"
method update_info : "source_completion_proposal obj -> source_completion_info obj -> unit"
method get_start_iter : "source_completion_context obj -> source_completion_proposal obj -> Gtk.text_iter"
method activate_proposal : "source_completion_proposal obj -> Gtk.text_iter -> bool"
method get_interactive_delay : "int"
method get_priority : "int"
}
class SourceCompletionContext type "source_completion_context obj" wrap wrapsig : GObject {
"completion" GtkSourceCompletion : Read / Write / Construct Only / NoWrap
"iter" GtkTextIter : Read / Write / NoWrap
method get_activation : "source_completion_activation_flags list"
method set_activation : "source_completion_activation_flags list -> unit" / Wrap
method add_proposals : "source_completion_provider obj -> source_completion_proposal obj list -> bool -> unit"
signal cancelled
}
class SourceCompletion type "source_completion obj" wrap wrapsig : GObject {
"accelerators" guint : Read / Write / Construct
"auto-complete-delay" guint : Read / Write / Construct
"proposal-page-size" guint : Read / Write / Construct
"provider-page-size" guint : Read / Write / Construct
"remember-info-visibility" gboolean : Read / Write / Construct
"select-on-show" gboolean : Read / Write / Construct
"show-headers" gboolean : Read / Write / Construct
"show-icons" gboolean : Read / Write / Construct
"view" GtkSourceView : Read / Write / Construct Only / NoWrap
method add_provider : "source_completion_provider obj -> bool"
method remove_provider : "source_completion_provider obj -> bool"
method block_interactive : "unit" / Wrap
method get_providers : "source_completion_provider obj list"
method create_context : "Gtk.text_iter -> source_completion_context obj"
method hide : "unit" / Wrap
method move_window : "Gtk.text_iter -> unit"
method show : "source_completion_provider obj list -> source_completion_context obj -> bool"
method unblock_interactive : "unit" / Wrap
signal activate_proposal
signal hide
signal move_cursor: GtkScrollStep gint
signal move_page: GtkScrollStep gint
signal populate_context : GtkSourceCompletionContext / NoWrap
signal show
}
class SourceLanguage type "source_language obj" set wrap wrapsig : GObject {
(* Property access is broken in gtkSourceView 2.4.1 (see Bugzilla #564142),
so we use methods instead: *)
}
class SourceLanguageManager type "source_language_manager obj" set wrapsig : GObject {
(* "search-path" GStrv : Read / Write
"language-ids" GStrv : Read / Write
*)
}
class SourceMark type "source_mark obj" set wrap wrapsig : GObject {
"category" gchararray_opt : Read / Write / Construct Only
}
class SourceMarkAttributes type "source_mark_attributes obj" set wrap wrapsig: GObject {
"background" GdkRGBA : Read / Write
(* "icon" GIcon does not seem to have been ported in lablgtk *)
"icon-name" string : Read / Write
"pixbuf" GdkPixbuf : Read / Write
}
class SourceUndoManager type "source_undo_manager obj" set wrap wrapsig : GObject {
method can_undo : "bool" / Wrap
method can_redo : "bool" / Wrap
method undo : "unit" / Wrap
method redo : "unit" / Wrap
method begin_not_undoable_action : "unit" / Wrap
method end_not_undoable_action : "unit" / Wrap
method can_undo_changed : "unit" / Wrap
method can_redo_changed : "unit" / Wrap
signal can_redo_changed
signal can_undo_changed
}
class SourceBuffer type "source_buffer obj" set wrap wrapsig : GObject {
"can-redo" gboolean : Read
"can-undo" gboolean : Read
"highlight-matching-brackets" gboolean : Read / Write
"highlight-syntax" gboolean : Read / Write
"language" GtkSourceLanguage_opt: Read / Write / NoWrap
"max-undo-levels" gint : Read / Write
"style-scheme" GtkSourceStyleScheme_opt : Read / Write / NoWrap
"undo-manager" GtkSourceUndoManager : Read / Write / Construct / NoWrap
signal highlight_updated: GtkTextIter GtkTextIter
signal source_mark_updated: GtkSourceMark
}
class SourceView type "source_view obj" set wrap wrapsig : Widget {
"auto-indent" gboolean : Read / Write
"highlight-current-line" gboolean : Read / Write
"indent-on-tab" gboolean : Read / Write
"indent-width" gint : Read / Write
"insert-spaces-instead-of-tabs" gboolean : Read / Write
"right-margin-position" guint : Read / Write
"show-line-marks" gboolean : Read / Write
"show-line-numbers" gboolean : Read / Write
"show-right-margin" gboolean : Read / Write
"smart-home-end" Gtk3SourceSmartHomeEndType : Read / Write
"tab-width" guint : Read / Write
method get_completion : "source_completion obj"
method get_draw_spaces : "source_draw_spaces_flags list"
method set_draw_spaces : "source_draw_spaces_flags list -> unit"
method set_mark_attributes:
"category:string -> source_mark_attributes obj -> int -> unit"
(*
method get_mark_category_priority :
"category:string -> int" / Wrap
method set_mark_category_priority:
"category:string -> int -> unit" / Wrap
method get_mark_category_pixbuf:
"category:string -> GdkPixbuf.pixbuf option" / Wrap
method set_mark_category_pixbuf:
"category:string -> GdkPixbuf.pixbuf option -> unit" / Wrap
method get_mark_category_background:
"category:string -> Gdk.color option" / Wrap
method set_mark_category_background:
"category:string -> Gdk.color option -> unit" / Wrap
*)
signal line_mark_activated : GtkTextIter GdkEvent
signal move_lines : gboolean gint
signal move_words : gint
signal redo
signal show_completion
signal smart_home_end : GtkTextIter gint
signal undo
}
|