-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpretty.mli
91 lines (82 loc) · 2.77 KB
/
pretty.mli
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
open Pretty_types
(* Set foreground and background colours.
*
* Available colours:
* BLACK;
* RED;
* GREEN;
* YELLOW;
* BLUE;
* MAGENTA;
* CYAN;
* WHITE
*)
val set_fg : colour -> unit
val set_bg : colour -> unit
(* Reset text attributes and foreground/background colours to defaults.
*)
val reset_attrs : unit -> unit
(* Functions to clear areas of the screen.
*
* NOTE:
* clear_to_eol -> clear to end of line
* clear_to_sol -> clear to start of line
*)
val clear_screen : unit -> unit
val clear_to_eol : unit -> unit
val clear_to_sol : unit -> unit
val clear_line : unit -> unit
val clear_down : unit -> unit
val clear_up : unit -> unit
(* Functions for scrolling the terminal; scroll_screen allows a region to be
* set as scrollable if no argument is given then the screen is set else it
* starts from (column, row)
*)
val scroll_screen : ?pos:(int * int) -> unit -> unit
val scroll_down : unit -> unit
val scroll_up : unit -> unit
(* Functions for cursor movement and positioning.
*)
val move_xy : ?x:int -> ?y:int -> unit -> unit
val move_up : ?amount:int -> unit -> unit
val move_down : ?amount:int -> unit -> unit
val move_forward : ?amount:int -> unit -> unit
val move_backward : ?amount:int -> unit-> unit
val move_save : unit -> unit
val move_unsave : unit -> unit
val move_save_attr : unit -> unit
val move_restore_attr : unit -> unit
(* Print a string with given attributes - the attributes are reverted to
* default values upon return.
*
* WARNING:
* String constructor should not be used in the attribute list given to
* this function, doing so will cause an Invalid_argument exception to be
* raised.
*)
val print_string_attrs : ?attrs:attribute list -> string -> unit
(* Print a list of attribute type values; strings are printed as given;
* available constructors are:
* Attribute -> text attribute
* Background -> text background colour
* Foreground -> text foreground colour
* String -> plain string
*)
val print_custom : attribute list -> unit
(* Print a string to the screen using a wrapper around print_string.
*
* OPTIONS:
* Supports printing text to a specific region;
* Supports printing text with specific background/foreground colour;
* Supports printing text with decorative attributes applied.
*)
val print_string : ?attrs:attribute list -> ?x:int -> ?y:int -> string -> unit
(* Turn of echoing whilst reading input.
*
* NOTE:
* Restores echoing after completion.
*)
val noecho_aux : Unix.file_descr -> (Unix.file_descr -> 'a) -> 'a
val noecho_read_line : unit -> string
val noecho_read_int : unit -> int
val noecho_read_float : unit -> float