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://cs.unibo.it/helm/.
30 let add_trailing_slash =
31 let rex = Pcre.regexp "/$" in
33 if Pcre.pmatch ~rex s then s
37 let rex = Pcre.regexp "^\\s*([^\\s]*)\\s*$" in
39 (Pcre.extract ~rex s).(1)
41 (** inherit from this class if you want to access current script *)
42 class scriptAccessor =
44 method private script = MatitaScript.instance ()
47 let cicBrowsers = ref []
48 let gui_instance = ref None
49 let set_gui gui = gui_instance := Some gui
51 match !gui_instance with
52 | None -> assert false
55 let default_font_size () =
56 Helm_registry.get_opt_default Helm_registry.int
57 ~default:BuildTimeConf.default_font_size "matita.font_size"
58 let current_font_size = ref ~-1
59 let increase_font_size () = incr current_font_size
60 let decrease_font_size () = decr current_font_size
61 let reset_font_size () = current_font_size := default_font_size ()
63 (* is there any lablgtk2 constant corresponding to the left mouse button??? *)
66 let near (x1, y1) (x2, y2) =
67 let distance = sqrt (((x2 -. x1) ** 2.) +. ((y2 -. y1) ** 2.)) in
70 let href_ds = Gdome.domString "href"
71 let xref_ds = Gdome.domString "xref"
73 class clickableMathView obj =
74 let text_width = 80 in
76 inherit GMathViewAux.multi_selection_math_view obj
78 val mutable href_callback: (string -> unit) option = None
79 method set_href_callback f = href_callback <- f
81 val mutable _cic_info = None
82 method private set_cic_info info = _cic_info <- info
83 method private cic_info =
86 | None -> assert false
89 self#set_font_size !current_font_size;
90 ignore (self#connect#selection_changed self#choose_selection);
91 ignore (self#event#connect#button_press self#button_press);
92 ignore (self#event#connect#button_release self#button_release);
93 (* ignore (self#connect#click (fun (gdome_elt, _, _, _) ->
95 | Some elt |+ element is an hyperlink, use href_callback on it +|
96 when elt#hasAttributeNS ~namespaceURI:DomMisc.xlink_ns ~localName:href ->
97 (match href_callback with
101 elt#getAttributeNS ~namespaceURI:DomMisc.xlink_ns ~localName:href
104 | Some elt -> ignore (self#action_toggle elt)
107 val mutable button_press_x = -1.
108 val mutable button_press_y = -1.
109 val mutable selection_changed = false
111 method private button_press gdk_button =
112 if GdkEvent.Button.button gdk_button = left_button then begin
113 button_press_x <- GdkEvent.Button.x gdk_button;
114 button_press_y <- GdkEvent.Button.y gdk_button;
115 selection_changed <- false
119 method private button_release gdk_button =
120 if GdkEvent.Button.button gdk_button = left_button then begin
121 let button_release_x = GdkEvent.Button.x gdk_button in
122 let button_release_y = GdkEvent.Button.y gdk_button in
123 (if near (button_press_x, button_press_y)
124 (button_release_x, button_release_y)
125 && not selection_changed
127 let x = int_of_float button_press_x in
128 let y = int_of_float button_press_y in
129 (match self#get_element_at x y with
132 let namespaceURI = DomMisc.xlink_ns in
133 let localName = href_ds in
134 if elt#hasAttributeNS ~namespaceURI ~localName then
135 self#invoke_href_callback
136 (elt#getAttributeNS ~namespaceURI ~localName)#to_string
139 ignore (self#action_toggle elt)));
143 method private invoke_href_callback href_value gdk_button =
144 let button = GdkEvent.Button.button gdk_button in
145 if button = left_button then
146 let time = GdkEvent.Button.time gdk_button in
147 match href_callback with
150 (match MatitaMisc.split href_value with
153 let menu = GMenu.menu () in
157 GMenu.menu_item ~label:uri ~packing:menu#append ()
159 ignore (menu_item#connect#activate (fun () -> f uri)))
161 menu#popup ~button ~time)
163 method private choose_selection gdome_elt =
165 if (elt#getAttributeNS ~namespaceURI:DomMisc.helm_ns
166 ~localName:xref_ds)#to_string <> ""
167 (* if elt#hasAttributeNS ~namespaceURI:DomMisc.helm_ns ~localName:xref_ds
168 && (elt#getAttributeNS ~namespaceURI:DomMisc.helm_ns
169 ~localName:xref_ds)#to_string <> "" *)
171 self#set_selection (Some elt)
174 (match elt#get_parentNode with
175 | None -> assert false
176 | Some p -> aux (new Gdome.element_of_node p))
177 with GdomeInit.DOMCastException _ -> ()
178 (* debug_print "trying to select above the document root" *)
180 (match gdome_elt with
181 | Some elt -> aux elt
182 | None -> self#set_selection None);
183 selection_changed <- true
185 method update_font_size =
186 self#set_font_size !current_font_size
188 method private get_term_by_id context id =
189 let ids_to_terms, ids_to_hypotheses = self#cic_info in
191 `Term (Hashtbl.find ids_to_terms id)
194 let hyp = Hashtbl.find ids_to_hypotheses id in
195 let context' = MatitaMisc.list_tl_at hyp context in
197 with Not_found -> assert false
199 method string_of_selected_terms =
200 let get_id (node: Gdome.element) =
202 node#getAttributeNS ~namespaceURI:DomMisc.helm_ns ~localName:xref_ds
206 let script = MatitaScript.instance () in
207 let metasenv = script#proofMetasenv in
208 let context = script#proofContext in
209 let conclusion = script#proofConclusion in
212 (fun node -> self#get_term_by_id context (get_id node))
215 (* TODO: code for patterns
216 let conclusion = (MatitaScript.instance ())#proofConclusion in
217 let conclusion_pattern =
218 ProofEngineHelpers.pattern_of ~term:conclusion cic_terms
221 let dummy_goal = ~-1 in
227 ProofEngineHelpers.locate_in_conjecture t
228 (dummy_goal, context, conclusion)
230 dummy_goal, context', t
231 | `Hyp context :: _ -> dummy_goal, context, Cic.Rel 1
233 (* TODO: code for patterns
234 (* TODO context shouldn't be empty *)
235 let cic_sequent = ~-1, [], conclusion_pattern in
237 let acic_sequent, _, _, ids_to_inner_sorts, _ =
238 Cic2acic.asequent_of_sequent metasenv cic_sequent
240 let _, _, _, annterm = acic_sequent in
241 let ast, ids_to_uris =
242 CicNotationRew.ast_of_acic ids_to_inner_sorts annterm
244 let pped_ast = CicNotationRew.pp_ast ast in
245 let markup = CicNotationPres.render ids_to_uris pped_ast in
246 BoxPp.render_to_string text_width markup
250 let clickableMathView ?hadjustment ?vadjustment ?font_size ?log_verbosity =
251 GtkBase.Widget.size_params
252 ~cont:(OgtkMathViewProps.pack_return (fun p ->
253 OgtkMathViewProps.set_params
254 (new clickableMathView (GtkMathViewProps.MathView_GMetaDOM.create p))
255 ~font_size:None ~log_verbosity:None))
258 class sequentViewer obj =
260 inherit clickableMathView obj
262 method load_sequent metasenv metano =
263 let sequent = CicUtil.lookup_meta metano metasenv in
264 let (mathml, (_, (ids_to_terms, _, ids_to_hypotheses,_ ))) =
265 ApplyTransformation.mml_of_cic_sequent metasenv sequent
267 self#set_cic_info (Some (ids_to_terms, ids_to_hypotheses));
268 let name = "sequent_viewer.xml" in
269 prerr_endline ("load_sequent: dumping MathML to ./" ^ name);
270 ignore (DomMisc.domImpl#saveDocumentToFile ~name ~doc:mathml ());
271 self#load_root ~root:mathml#get_documentElement
274 class sequentsViewer ~(notebook:GPack.notebook)
275 ~(sequentViewer:sequentViewer) ()
278 inherit scriptAccessor
280 val mutable pages = 0
281 val mutable switch_page_callback = None
282 val mutable page2goal = [] (* associative list: page no -> goal no *)
283 val mutable goal2page = [] (* the other way round *)
284 val mutable goal2win = [] (* associative list: goal no -> scrolled win *)
285 val mutable _metasenv = []
286 val mutable scrolledWin: GBin.scrolled_window option = None
287 (* scrolled window to which the sequentViewer is currently attached *)
289 method private tab_label metano =
290 (GMisc.label ~text:(sprintf "?%d" metano) ~show:true ())#coerce
293 (match scrolledWin with
295 (* removing page from the notebook will destroy all contained widget,
296 * we do not want the sequentViewer to be destroyed as well *)
297 w#remove sequentViewer#coerce;
300 for i = 1 to pages do notebook#remove_page 0 done;
306 self#script#setGoal ~-1;
307 (match switch_page_callback with
309 GtkSignal.disconnect notebook#as_widget id;
310 switch_page_callback <- None
313 method load_sequents (status: ProofEngineTypes.status) =
314 let ((_, metasenv, _, _), goal) = status in
315 let sequents_no = List.length metasenv in
316 _metasenv <- metasenv;
317 pages <- sequents_no;
318 self#script#setGoal goal;
321 GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC
322 ~shadow_type:`IN ~show:true ()
325 scrolledWin <- Some w;
326 match sequentViewer#misc#parent with
327 | None -> w#add sequentViewer#coerce
330 match sequentViewer#misc#parent with
332 | Some p -> GContainer.cast_container p
334 parent#remove sequentViewer#coerce;
335 w#add sequentViewer#coerce
337 goal2win <- (metano, reparent) :: goal2win;
342 (fun (metano, _, _) ->
343 page2goal <- (!page, metano) :: page2goal;
344 goal2page <- (metano, !page) :: goal2page;
346 notebook#append_page ~tab_label:(self#tab_label metano) (win metano))
348 switch_page_callback <-
349 Some (notebook#connect#switch_page ~callback:(fun page ->
352 List.assoc page page2goal
353 with Not_found -> assert false
355 self#script#setGoal goal;
356 self#render_page ~page ~goal))
358 method private render_page ~page ~goal =
359 sequentViewer#load_sequent _metasenv goal;
361 List.assoc goal goal2win ();
362 sequentViewer#set_selection None
363 with Not_found -> assert false
365 method goto_sequent goal =
368 List.assoc goal goal2page
369 with Not_found -> assert false
371 notebook#goto_page page;
372 self#render_page page goal
378 type 'widget constructor =
379 ?hadjustment:GData.adjustment ->
380 ?vadjustment:GData.adjustment ->
382 ?log_verbosity:int ->
385 ?packing:(GObj.widget -> unit) ->
390 let sequentViewer ?hadjustment ?vadjustment ?font_size ?log_verbosity =
391 GtkBase.Widget.size_params
392 ~cont:(OgtkMathViewProps.pack_return (fun p ->
393 OgtkMathViewProps.set_params
394 (new sequentViewer (GtkMathViewProps.MathView_GMetaDOM.create p))
395 ~font_size ~log_verbosity))
398 let blank_uri = BuildTimeConf.blank_uri
399 let current_proof_uri = BuildTimeConf.current_proof_uri
402 [ `Ast of DisambiguateTypes.term
403 | `Cic of Cic.term * Cic.metasenv
407 class type cicBrowser =
409 method load: MatitaTypes.mathViewer_entry -> unit
410 (* method loadList: string list -> MatitaTypes.mathViewer_entry-> unit *)
411 method loadInput: string -> unit
414 let reloadable = function
415 | `About `Current_proof
420 class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history)
423 let term_RE = Pcre.regexp "^term:(.*)" in
424 let whelp_RE = Pcre.regexp "^\\s*whelp" in
427 "^cic:/([^/]+/)*[^/]+\\.(con|ind|var)(#xpointer\\(\\d+(/\\d+)+\\))?$"
429 let dir_RE = Pcre.regexp "^cic:((/([^/]+/)*[^/]+(/)?)|/|)$" in
430 let whelp_query_RE = Pcre.regexp "^\\s*whelp\\s+([^\\s]+)\\s+(.*)$" in
431 let trailing_slash_RE = Pcre.regexp "/$" in
432 let has_xpointer_RE = Pcre.regexp "#xpointer\\(\\d+/\\d+(/\\d+)?\\)$" in
433 let is_whelp txt = Pcre.pmatch ~rex:whelp_RE txt in
434 let is_uri txt = Pcre.pmatch ~rex:uri_RE txt in
435 let is_dir txt = Pcre.pmatch ~rex:dir_RE txt in
436 let gui = get_gui () in
437 let (win: MatitaGuiTypes.browserWin) = gui#newBrowserWin () in
438 let queries = ["Locate";"Hint";"Match";"Elim";"Instance"] in
439 let combo,_ = GEdit.combo_box_text ~strings:queries () in
440 let activate_combo_query input q =
441 let q' = String.lowercase q in
442 let rec aux i = function
443 | [] -> failwith ("Whelp query '" ^ q ^ "' not found")
444 | h::_ when String.lowercase h = q' -> i
445 | _::tl -> aux (i+1) tl
447 combo#set_active (aux 0 queries);
448 win#queryInputText#set_text input
450 let set_whelp_query txt =
453 let q = Pcre.extract ~rex:whelp_query_RE txt in
455 with Invalid_argument _ -> failwith "Malformed Whelp query"
457 activate_combo_query arg query
459 let toplevel = win#toplevel in
460 let mathView = sequentViewer ~packing:win#scrolledBrowser#add () in
462 MatitaGtkMisc.report_error ~title:"Cic browser" ~message
466 [ "dir", GdkPixbuf.from_file (MatitaMisc.image_path "matita-folder.png");
467 "obj", GdkPixbuf.from_file (MatitaMisc.image_path "matita-object.png") ]
472 with exn -> fail (MatitaExcPp.to_string exn)
474 let handle_error' f = (fun () -> handle_error (fun () -> f ())) in
476 inherit scriptAccessor
478 (* Whelp bar queries *)
481 activate_combo_query "" "locate";
482 win#whelpBarComboVbox#add combo#coerce;
484 let query = String.lowercase (List.nth queries combo#active) in
485 let input = win#queryInputText#text in
486 let statement = "whelp " ^ query ^ " " ^ input ^ "." in
487 (MatitaScript.instance ())#advance ~statement ()
489 ignore(win#queryInputText#connect#activate ~callback:start_query);
490 ignore(combo#connect#changed ~callback:start_query);
491 win#whelpBarImage#set_file (MatitaMisc.image_path "whelp.png");
492 win#mathOrListNotebook#set_show_tabs false;
494 win#browserForwardButton#misc#set_sensitive false;
495 win#browserBackButton#misc#set_sensitive false;
496 ignore (win#browserUri#entry#connect#activate (handle_error' (fun () ->
497 self#loadInput win#browserUri#entry#text)));
498 ignore (win#browserHomeButton#connect#clicked (handle_error' (fun () ->
499 self#load (`About `Current_proof))));
500 ignore (win#browserRefreshButton#connect#clicked
501 (handle_error' self#refresh));
502 ignore (win#browserBackButton#connect#clicked (handle_error' self#back));
503 ignore (win#browserForwardButton#connect#clicked
504 (handle_error' self#forward));
505 ignore (win#toplevel#event#connect#delete (fun _ ->
506 let my_id = Oo.id self in
507 cicBrowsers := List.filter (fun b -> Oo.id b <> my_id) !cicBrowsers;
508 if !cicBrowsers = [] &&
509 Helm_registry.get "matita.mode" = "cicbrowser"
513 ignore(win#whelpResultTreeview#connect#row_activated
514 ~callback:(fun _ _ ->
515 handle_error (fun () -> self#loadInput (self#_getSelectedUri ()))));
516 mathView#set_href_callback (Some (fun uri ->
517 handle_error (fun () ->
518 self#load (`Uri (UriManager.uri_of_string uri)))));
519 self#_load (`About `Blank);
522 val mutable current_entry = `About `Blank
523 val mutable current_infos = None
524 val mutable current_mathml = None
527 new MatitaGtkMisc.taggedStringListModel tags win#whelpResultTreeview
529 val mutable lastDir = "" (* last loaded "directory" *)
531 method private _getSelectedUri () =
532 match model#easy_selection () with
533 | [sel] when is_uri sel -> sel (* absolute URI selected *)
534 (* | [sel] -> win#browserUri#entry#text ^ sel |+ relative URI selected +| *)
535 | [sel] -> lastDir ^ sel
538 (** history RATIONALE
540 * All operations about history are done using _historyFoo.
541 * Only toplevel functions (ATM load and loadInput) call _historyAdd.
544 method private _historyAdd item =
546 win#browserBackButton#misc#set_sensitive true;
547 win#browserForwardButton#misc#set_sensitive false
549 method private _historyPrev () =
550 let item = history#previous in
551 if history#is_begin then win#browserBackButton#misc#set_sensitive false;
552 win#browserForwardButton#misc#set_sensitive true;
555 method private _historyNext () =
556 let item = history#next in
557 if history#is_end then win#browserForwardButton#misc#set_sensitive false;
558 win#browserBackButton#misc#set_sensitive true;
561 (** notebook RATIONALE
563 * Use only these functions to switch between the tabs
565 method private _showList = win#mathOrListNotebook#goto_page 1
566 method private _showMath = win#mathOrListNotebook#goto_page 0
568 method private back () =
570 self#_load (self#_historyPrev ())
571 with MatitaMisc.History_failure -> ()
573 method private forward () =
575 self#_load (self#_historyNext ())
576 with MatitaMisc.History_failure -> ()
578 (* loads a uri which can be a cic uri or an about:* uri
579 * @param uri string *)
580 method private _load entry =
582 if entry <> current_entry || reloadable entry then begin
584 | `About `Current_proof -> self#home ()
585 | `About `Blank -> self#blank ()
586 | `About `Us -> () (* TODO implement easter egg here :-] *)
587 | `Check term -> self#_loadCheck term
588 | `Cic (term, metasenv) -> self#_loadTermCic term metasenv
589 | `Dir dir -> self#_loadDir dir
590 | `Uri uri -> self#_loadUriManagerUri uri
591 | `Whelp (query, results) ->
592 set_whelp_query query;
593 self#_loadList (List.map (fun r -> "obj",
594 UriManager.string_of_uri r) results));
597 with exn -> fail (MatitaExcPp.to_string exn)
599 method private blank () =
601 mathView#load_root (MatitaMisc.empty_mathml ())#get_documentElement
603 method private _loadCheck term =
604 failwith "not implemented _loadCheck";
607 method private home () =
609 match self#script#status.proof_status with
610 | Proof (uri, metasenv, bo, ty) ->
611 let name = UriManager.name_of_uri (MatitaMisc.unopt uri) in
612 let obj = Cic.CurrentProof (name, metasenv, bo, ty, [], []) in
614 | Incomplete_proof ((uri, metasenv, bo, ty), _) ->
615 let name = UriManager.name_of_uri (MatitaMisc.unopt uri) in
616 let obj = Cic.CurrentProof (name, metasenv, bo, ty, [], []) in
620 (** loads a cic uri from the environment
621 * @param uri UriManager.uri *)
622 method private _loadUriManagerUri uri =
623 let uri = UriManager.strip_xpointer uri in
624 let (obj, _) = CicEnvironment.get_obj CicUniv.empty_ugraph uri in
627 method private _loadDir dir =
628 let content = Http_getter.ls dir in
634 | Http_getter_types.Ls_section s -> "dir", s
635 | Http_getter_types.Ls_object o -> "obj", o.Http_getter_types.uri)
641 method private setEntry entry =
642 win#browserUri#entry#set_text (string_of_entry entry);
643 current_entry <- entry
645 method private _loadObj obj =
647 (* this must be _before_ loading the document, since
648 * if the widget is not mapped (hidden by the notebook)
649 * the document is not rendered *)
650 let use_diff = false in (* ZACK TODO use XmlDiff when re-rendering? *)
651 let (mathml, (_,((ids_to_terms, ids_to_father_ids, ids_to_conjectures,
652 ids_to_hypotheses, ids_to_inner_sorts, ids_to_inner_types) as info)))
654 ApplyTransformation.mml_of_cic_object obj
656 current_infos <- Some info;
657 (match current_mathml with
658 | Some current_mathml when use_diff ->
660 XmlDiff.update_dom ~from:current_mathml mathml;
663 let name = "cic_browser.xml" in
664 prerr_endline ("cic_browser: dumping MathML to ./" ^ name);
665 ignore (DomMisc.domImpl#saveDocumentToFile ~name ~doc:mathml ());
666 mathView#load_root ~root:mathml#get_documentElement;
667 current_mathml <- Some mathml);
669 method private _loadTermCic term metasenv =
670 let context = self#script#proofContext in
671 let dummyno = CicMkImplicit.new_meta metasenv [] in
672 let sequent = (dummyno, context, term) in
673 mathView#load_sequent (sequent :: metasenv) dummyno;
676 method private _loadList l =
677 model#list_store#clear ();
678 List.iter (fun (tag, s) -> model#easy_append ~tag s) l;
681 (** { public methods, all must call _load!! } *)
684 handle_error (fun () -> self#_load entry; self#_historyAdd entry)
686 (** this is what the browser does when you enter a string an hit enter *)
687 method loadInput txt =
688 let txt = strip_blanks txt in
690 UriManager.string_of_uri
691 (UriManager.strip_xpointer (UriManager.uri_of_string txt))
693 if is_whelp txt then begin
695 (MatitaScript.instance ())#advance ~statement:(txt ^ ".") ()
699 | txt when is_uri txt -> `Uri (UriManager.uri_of_string (fix_uri txt))
700 | txt when is_dir txt -> `Dir (add_trailing_slash txt)
704 with Invalid_argument _ ->
705 command_error (sprintf "unsupported uri: %s" txt))
708 self#_historyAdd entry
711 (** {2 methods accessing underlying GtkMathView} *)
713 method updateFontSize = mathView#set_font_size !current_font_size
715 (** {2 methods used by constructor only} *)
718 method history = history
719 method currentEntry = current_entry
721 if reloadable current_entry then self#_load current_entry
725 let sequentsViewer ~(notebook:GPack.notebook)
726 ~(sequentViewer:sequentViewer) ()
728 new sequentsViewer ~notebook ~sequentViewer ()
731 let size = BuildTimeConf.browser_history_size in
732 let rec aux history =
733 let browser = new cicBrowser_impl ~history () in
734 let win = browser#win in
735 ignore (win#browserNewButton#connect#clicked (fun () ->
737 new MatitaMisc.browser_history ~memento:history#save size
740 let newBrowser = aux history in
741 newBrowser#load browser#currentEntry));
743 (* attempt (failed) to close windows on CTRL-W ... *)
744 MatitaGtkMisc.connect_key win#browserWinEventBox#event ~modifiers:[`CONTROL]
745 GdkKeysyms._W (fun () -> win#toplevel#destroy ());
747 cicBrowsers := browser :: !cicBrowsers;
748 (browser :> cicBrowser)
750 let history = new MatitaMisc.browser_history size (`About `Blank) in
753 let default_sequentViewer () = sequentViewer ~show:true ()
754 let sequentViewer_instance = MatitaMisc.singleton default_sequentViewer
756 let default_sequentsViewer () =
757 let gui = get_gui () in
758 let sequentViewer = sequentViewer_instance () in
759 sequentsViewer ~notebook:gui#main#sequentsNotebook ~sequentViewer ()
760 let sequentsViewer_instance = MatitaMisc.singleton default_sequentsViewer
764 method private get_browser reuse =
766 (match !cicBrowsers with
767 | [] -> cicBrowser ()
768 | b :: _ -> (b :> cicBrowser))
772 method show_entry ?(reuse=false) t = (self#get_browser reuse)#load t
774 method show_uri_list ?(reuse=false) ~entry l =
775 (self#get_browser reuse)#load entry
778 let refresh_all_browsers () = List.iter (fun b -> b#refresh ()) !cicBrowsers
780 let update_font_sizes () =
781 List.iter (fun b -> b#updateFontSize) !cicBrowsers;
782 (sequentViewer_instance ())#update_font_size