1 (* Copyright (C) 2004-2005, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 (** {2 Gtk helpers} *)
28 (** given a window and a check menu item it links the two so that the former
29 * is only hidden on delete and the latter toggle show/hide of the former *)
30 val toggle_window_visibility:
31 window:GWindow.window -> check:GMenu.check_menu_item -> unit
33 (** given a window and a check menu item it links the two so that the former
34 * is only hidden on delete and the latter toggle show/hide of the former *)
35 val toggle_widget_visibility:
36 widget:GObj.widget -> check:GMenu.check_menu_item -> unit
39 callback:(bool -> unit) -> check:GMenu.check_menu_item -> unit
42 ?check:GMenu.check_menu_item -> GWindow.window -> unit -> unit
44 (** Connect a callback to the clicked signal of a button, ignoring its return
46 val connect_button: #GButton.button -> (unit -> unit) -> unit
49 (** Connect a callback to the toggled signal of a button, ignoring its return
51 val connect_toggle_button: #GButton.toggle_button -> (unit -> unit) -> unit
53 (** Like connect_button above, but connects a callback to the activate signal of
55 val connect_menu_item: #GMenu.menu_item -> (unit -> unit) -> unit
57 (** connect a unit -> unit callback to a particular key press event. Event can
58 * be specified using its keysym and a list of modifiers which must be in
59 * effect for the callback to be executed. Further signal processing of other
60 * key press events remains unchanged; further signal processing of the
61 * specified key press depends on the stop parameter *)
64 ?modifiers:Gdk.Tags.modifier list ->
65 ?stop:bool -> (* stop signal handling when the given key has been pressed?
66 * Defaults to false *)
67 Gdk.keysym -> (* (= int) the key, see GdkKeysyms.ml *)
68 (unit -> unit) -> (* callback *)
71 (** n-ary string column list *)
72 class multiStringListModel:
76 method list_store: GTree.list_store (** list_store forwarding *)
78 method easy_mappend: string list -> unit (** append + set *)
79 method easy_minsert: int -> string list -> unit (** insert + set *)
80 method easy_mselection: unit -> string list list
83 (** single string column list *)
84 class stringListModel:
87 inherit multiStringListModel
89 method easy_append: string -> unit (** append + set *)
90 method easy_insert: int -> string -> unit (** insert + set *)
91 method easy_selection: unit -> string list
95 (** as above with Pixbuf associated to each row. Each time an insert is
96 * performed a string tag should be specified, the corresponding pixbuf in the
97 * tags associative list will be shown on the left of the inserted row *)
98 class taggedStringListModel:
99 tags:((string * GdkPixbuf.pixbuf) list) ->
102 method list_store: GTree.list_store (** list_store forwarding *)
104 method easy_append: tag:string -> string -> unit
105 method easy_insert: int -> tag:string -> string -> unit
106 method easy_selection: unit -> string list
109 (** {2 Matita GUI components} *)
112 object (* minimal gui object requirements *)
113 method newUriDialog: unit -> MatitaGeneratedGui.uriChoiceDialog
114 method newConfirmationDialog: unit -> MatitaGeneratedGui.confirmationDialog
115 method newEmptyDialog: unit -> MatitaGeneratedGui.emptyDialog
119 * In functions below:
120 * @param title window title
121 * @param message content of the text label shown to the user *)
123 (** @param parent to center the window on it *)
124 val ask_confirmation:
125 title:string -> message:string ->
126 ?parent:#GWindow.window_skel ->
128 [`YES | `NO | `CANCEL]
130 (** @param multiline (default: false) if true a TextView widget will be used
131 * for prompting the user otherwise a TextEntry widget will be
132 * @return the string given by the user *)
135 ?title:string -> ?message:string ->
136 ?multiline:bool -> ?default:string -> unit ->
140 title:string -> message:string ->
141 ?parent:#GWindow.window_skel ->
145 (* given an utf8 string a floc returns the parsed substring and its length
147 val utf8_parsed_text: string -> Stdpp.location -> string * int
149 (* the length in characters, not bytes *)
150 val utf8_string_length: string -> int
152 val escape_pango_markup: string -> string
154 val matita_lang: GSourceView2.source_language