Debian Codegraph @

ide/rocqide/ideutils.mli

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 val warn_image : unit -> GMisc.image
12 val warning : string -> unit
13
14 val cb : GData.clipboard
15
16 val browse : (string -> unit) -> string -> unit
17 val browse_keyword : (string -> unit) -> string -> unit
18
19 val byte_offset_to_char_offset : string -> int -> int
20 val byte_off_to_buffer_off : GText.buffer -> int -> int
21 val buffer_off_to_byte_off : GText.buffer -> int -> int
22 val get_iter_at_byte : GText.buffer -> line:int -> int -> GText.iter
23
24 val ulen : int -> int
25
26 type timer = { run : ms:int -> callback:(unit->bool) -> unit;
27 kill : unit -> unit }
28 val mktimer : unit -> timer
29
30 val do_convert : string -> string
31 val find_tag_limits : GText.tag -> GText.iter -> GText.iter * GText.iter
32 val find_tag_start : GText.tag -> GText.iter -> GText.iter
33 val find_tag_stop : GText.tag -> GText.iter -> GText.iter
34
35 val select_file_for_open :
36 title:string -> ?filter:bool -> ?multiple:bool -> ?parent:GWindow.window -> ?filename:string -> unit -> string list
37 val select_file_for_save :
38 title:string -> ?parent:GWindow.window -> ?filename:string -> unit -> string option
39 val try_convert : string -> string
40 val try_export : string -> string -> bool
41 val stock_to_widget :
42 ?size:[`CUSTOM of int * int | Gtk.Tags.icon_size] ->
43 GtkStock.id -> GObj.widget
44
45 val custom_rocqtop : string option ref
46 (* @return command to call rocqtop
47 - custom_rocqtop if set
48 - from the prefs is set
49 - try to infer it else *)
50 val rocqtop_path : unit -> string
51
52
53 val status : GMisc.statusbar
54 val push_info : string -> unit
55 val pop_info : unit -> unit
56 val clear_info : unit -> unit
57 val flash_info : ?delay:int -> string -> unit
58
59 val insert_xml : ?mark:GText.mark -> ?tags:GText.tag list ->
60 #GText.buffer_skel -> Richpp.richpp -> unit
61
62 val set_location : (string -> unit) ref
63 val display_location : GText.iter -> unit
64
65 (* In win32, when a command-line is to be executed via cmd.exe
66 (i.e. Sys.command, Unix.open_process, ...), it cannot contain several
67 quoted "..." zones otherwise some quotes are lost. Solution: we re-quote
68 everything. Reference: http://ss64.com/nt/cmd.html *)
69
70 val requote : string -> string
71
72 val textview_width : #GText.view_skel -> int
73 (** Returns an approximate value of the character width of a textview *)
74
75 type logger = Feedback.level -> Pp.t -> unit
76
77 val default_logger : logger
78 (** Default logger. It logs messages that the casual user should not see. *)
79
80 (** {6 I/O operations} *)
81
82 (** A customized [stat] function. Exceptions are caught. *)
83
84 type stats = MTime of float | NoSuchFile | OtherError
85 val stat : string -> stats
86
87 (** Read the content of file [f] and add it to buffer [b].
88 I/O Exceptions are propagated. *)
89
90 val read_file : string -> Buffer.t -> unit
91
92 (** Read what is available on a gtk input channel.
93 This channel should have been set as non-blocking. *)
94
95 val io_read_all : Glib.Io.channel -> string
96
97 (** [run_command display finally cmd] allow to run a command
98 asynchronously, calling [display] on any output of this command
99 and [finally] when the command has returned. *)
100
101 val run_command :
102 (string -> unit) -> (Unix.process_status -> unit) -> string -> unit
103
104 (* Checks if an error message is printable, it not replaces it with
105 * a printable error *)
106 val validate : Pp.t -> Pp.t
107
108 (** [encode_string_list l] encodes a list of strings into a single
109 string using a "shell"-like encoding: it quotes strings
110 containing space by surrounding them with single quotes, and,
111 outside quoted strings, quotes both single quote and backslash
112 by prefixing them with backslash; the encoding tries to be
113 minimalistic. *)
114
115 val encode_string_list : string list -> string
116
117 (** [decode_string_list l] decodes the encoding of a string list as
118 a string; it fails with a Failure if a single quote is unmatched
119 or if a backslash in unquoted part is not followed by a single
120 quote or another backslash. *)
121
122 val decode_string_list : string -> string list
123
124 (** filter key event to keep only the interesting modifiers *)
125
126 val filter_key : GdkEvent.Key.t -> Gdk.keysym * Gdk.Tags.modifier list