| 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 |
let osx = GosxApplication.osxapplication () |
| 12 |
|
| 13 |
let () = |
| 14 |
let _ = osx#connect#ns_application_open_file |
| 15 |
~callback:(fun x -> Rocqide.do_load x; true) |
| 16 |
in |
| 17 |
let _ = osx#connect#ns_application_block_termination |
| 18 |
~callback:Rocqide.forbid_quit |
| 19 |
in |
| 20 |
let _ = osx#connect#ns_application_will_terminate |
| 21 |
~callback:Rocqide.close_and_quit |
| 22 |
in () |
| 23 |
|
| 24 |
let init () = |
| 25 |
let () = GtkosxApplication.Application.set_menu_bar osx#as_osxapplication |
| 26 |
(GtkMenu.MenuShell.cast |
| 27 |
(Rocqide_ui.ui_m#get_widget "/RocqIDE MenuBar")#as_widget) |
| 28 |
in |
| 29 |
let () = GtkosxApplication.Application.insert_app_menu_item |
| 30 |
osx#as_osxapplication |
| 31 |
(Rocqide_ui.ui_m#get_widget "/RocqIDE MenuBar/Edit/Prefs")#as_widget 1 |
| 32 |
in |
| 33 |
let () = GtkosxApplication.Application.set_help_menu osx#as_osxapplication |
| 34 |
(Some (GtkMenu.MenuItem.cast |
| 35 |
(Rocqide_ui.ui_m#get_widget "/RocqIDE MenuBar/Help")#as_widget)) |
| 36 |
in |
| 37 |
osx#ready () |