Compare commits
8 Commits
b117b6916b
...
graphv_egu
| Author | SHA1 | Date | |
|---|---|---|---|
| 73d6e2233b | |||
| c604345886 | |||
| f8525ac35f | |||
| 7ed07061aa | |||
| 686d868a94 | |||
| d3dc3d091b | |||
| c065a0423b | |||
| 0193c3e7f0 |
14
dune
14
dune
@ -29,12 +29,16 @@
|
|||||||
irmin-git
|
irmin-git
|
||||||
compiler-libs.toplevel
|
compiler-libs.toplevel
|
||||||
re
|
re
|
||||||
lwd
|
lwt_react
|
||||||
)
|
)
|
||||||
(link_flags (-linkall))
|
|
||||||
(ocamlopt_flags (:standard -O3 -unboxed-types))
|
;; none of this makes backtraces work
|
||||||
(ocamlc_flags (:standard -verbose))
|
;;(flags (-g))
|
||||||
(modes byte_complete)
|
;;(link_flags (-linkall -g))
|
||||||
|
;;(ocamlopt_flags (:standard -O3 -unboxed-types))
|
||||||
|
;;(ocamlc_flags (:standard -verbose -g))
|
||||||
|
|
||||||
|
;;(modes byte_complete) ;; this causes backtraces to not work, but somehow includes the implementation of Toploop
|
||||||
(preprocess
|
(preprocess
|
||||||
(pps ppx_irmin))
|
(pps ppx_irmin))
|
||||||
)
|
)
|
||||||
|
|||||||
275
opam_switch
Normal file
275
opam_switch
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
opam-version: "2.0"
|
||||||
|
compiler: ["ocaml-variants.5.1.1+options"]
|
||||||
|
roots: [
|
||||||
|
"camlp5.8.03.00"
|
||||||
|
"gg.1.0.0"
|
||||||
|
"glfw-ocaml.3.3.1-2"
|
||||||
|
"graphv_gles2_native.0.1.1"
|
||||||
|
"irmin-git.3.9.0"
|
||||||
|
"lablgtk3.3.1.4"
|
||||||
|
"lablgtk3-sourceview3.3.1.4"
|
||||||
|
"lwd.0.3"
|
||||||
|
"lwt_glib.1.1.1"
|
||||||
|
"memtrace.0.2.3"
|
||||||
|
"merlin.4.14-501"
|
||||||
|
"ocamlformat.0.26.2"
|
||||||
|
"odig.0.0.9"
|
||||||
|
"stb_image.0.5"
|
||||||
|
"tgls.0.8.6"
|
||||||
|
"tuareg.3.0.1"
|
||||||
|
"user-setup.0.7"
|
||||||
|
"utop.2.14.0"
|
||||||
|
]
|
||||||
|
installed: [
|
||||||
|
"angstrom.0.16.0"
|
||||||
|
"arp.3.1.1"
|
||||||
|
"asn1-combinators.0.2.6"
|
||||||
|
"astring.0.8.5"
|
||||||
|
"awa.0.3.0"
|
||||||
|
"awa-mirage.0.3.0"
|
||||||
|
"b0.0.0.5"
|
||||||
|
"base.v0.16.3"
|
||||||
|
"base-bigarray.base"
|
||||||
|
"base-bytes.base"
|
||||||
|
"base-domains.base"
|
||||||
|
"base-nnp.base"
|
||||||
|
"base-threads.base"
|
||||||
|
"base-unix.base"
|
||||||
|
"base64.3.5.1"
|
||||||
|
"bheap.2.0.0"
|
||||||
|
"bigarray-compat.1.1.0"
|
||||||
|
"bigstringaf.0.9.1"
|
||||||
|
"biniou.1.2.2"
|
||||||
|
"bos.0.2.1"
|
||||||
|
"ca-certs.0.2.3"
|
||||||
|
"ca-certs-nss.3.98"
|
||||||
|
"cairo2.0.6.4"
|
||||||
|
"camlp-streams.5.0.1"
|
||||||
|
"camlp5.8.03.00"
|
||||||
|
"camlp5-buildscripts.0.03"
|
||||||
|
"carton.0.7.1"
|
||||||
|
"carton-git.0.7.1"
|
||||||
|
"carton-lwt.0.7.1"
|
||||||
|
"cf.0.5.0"
|
||||||
|
"cf-lwt.0.5.0"
|
||||||
|
"checkseum.0.5.2"
|
||||||
|
"cmdliner.1.2.0"
|
||||||
|
"cohttp.5.3.1"
|
||||||
|
"cohttp-lwt.5.3.0"
|
||||||
|
"cohttp-lwt-unix.5.3.0"
|
||||||
|
"conduit.6.2.2"
|
||||||
|
"conduit-lwt.6.2.2"
|
||||||
|
"conduit-lwt-unix.6.2.2"
|
||||||
|
"conf-bash.1"
|
||||||
|
"conf-cairo.1"
|
||||||
|
"conf-emacs.1"
|
||||||
|
"conf-gles2.1"
|
||||||
|
"conf-glfw3.2"
|
||||||
|
"conf-glib-2.1"
|
||||||
|
"conf-gmp.4"
|
||||||
|
"conf-gmp-powm-sec.3"
|
||||||
|
"conf-gtk3.18"
|
||||||
|
"conf-gtksourceview3.0+2"
|
||||||
|
"conf-libffi.2.0.0"
|
||||||
|
"conf-m4.1"
|
||||||
|
"conf-perl.2"
|
||||||
|
"conf-pkg-config.3"
|
||||||
|
"conf-which.1"
|
||||||
|
"cppo.1.6.9"
|
||||||
|
"crunch.3.3.1"
|
||||||
|
"csexp.1.5.2"
|
||||||
|
"cstruct.6.2.0"
|
||||||
|
"cstruct-lwt.6.2.0"
|
||||||
|
"cstruct-unix.6.2.0"
|
||||||
|
"ctypes.0.20.2"
|
||||||
|
"ctypes-foreign.0.18.0"
|
||||||
|
"decompress.1.5.3"
|
||||||
|
"digestif.1.2.0"
|
||||||
|
"dispatch.0.5.0"
|
||||||
|
"dns.7.0.3"
|
||||||
|
"dns-client.7.0.3"
|
||||||
|
"dns-client-lwt.7.0.3"
|
||||||
|
"dns-client-mirage.7.0.3"
|
||||||
|
"domain-name.0.4.0"
|
||||||
|
"dot-merlin-reader.4.9"
|
||||||
|
"duff.0.5"
|
||||||
|
"dune.3.15.2"
|
||||||
|
"dune-build-info.3.15.2"
|
||||||
|
"dune-configurator.3.15.2"
|
||||||
|
"duration.0.2.1"
|
||||||
|
"easy-format.1.3.4"
|
||||||
|
"either.1.0.0"
|
||||||
|
"emile.1.1"
|
||||||
|
"encore.0.8"
|
||||||
|
"eqaf.0.9"
|
||||||
|
"ethernet.3.2.0"
|
||||||
|
"faraday.0.8.2"
|
||||||
|
"fix.20230505"
|
||||||
|
"fmt.0.9.0"
|
||||||
|
"fpath.0.7.3"
|
||||||
|
"fsevents.0.3.0"
|
||||||
|
"fsevents-lwt.0.3.0"
|
||||||
|
"functoria-runtime.4.4.2"
|
||||||
|
"gg.1.0.0"
|
||||||
|
"git.3.15.0"
|
||||||
|
"git-mirage.3.15.0"
|
||||||
|
"git-paf.3.15.0"
|
||||||
|
"git-unix.3.15.0"
|
||||||
|
"glfw-ocaml.3.3.1-2"
|
||||||
|
"gmap.0.3.0"
|
||||||
|
"graphql.0.14.0"
|
||||||
|
"graphql-cohttp.0.14.0"
|
||||||
|
"graphql-lwt.0.14.0"
|
||||||
|
"graphql_parser.0.14.0"
|
||||||
|
"graphv_core.0.1.1"
|
||||||
|
"graphv_core_lib.0.1.1"
|
||||||
|
"graphv_font.0.1.1"
|
||||||
|
"graphv_font_stb_truetype.0.1.1"
|
||||||
|
"graphv_gles2.0.1.1"
|
||||||
|
"graphv_gles2_native.0.1.1"
|
||||||
|
"graphv_gles2_native_impl.0.1.1"
|
||||||
|
"h2.0.11.0"
|
||||||
|
"happy-eyeballs.0.6.0"
|
||||||
|
"happy-eyeballs-lwt.0.6.0"
|
||||||
|
"happy-eyeballs-mirage.0.6.0"
|
||||||
|
"hashcons.1.4.0"
|
||||||
|
"hex.1.5.0"
|
||||||
|
"hkdf.1.0.4"
|
||||||
|
"hpack.0.11.0"
|
||||||
|
"httpaf.0.7.1"
|
||||||
|
"hxd.0.3.2"
|
||||||
|
"index.1.6.2"
|
||||||
|
"inotify.2.5"
|
||||||
|
"integers.0.7.0"
|
||||||
|
"ipaddr.5.5.0"
|
||||||
|
"ipaddr-cstruct.5.5.0"
|
||||||
|
"ipaddr-sexp.5.5.0"
|
||||||
|
"irmin.3.9.0"
|
||||||
|
"irmin-fs.3.9.0"
|
||||||
|
"irmin-git.3.9.0"
|
||||||
|
"irmin-graphql.3.9.0"
|
||||||
|
"irmin-pack.3.9.0"
|
||||||
|
"irmin-tezos.3.9.0"
|
||||||
|
"irmin-watcher.0.5.0"
|
||||||
|
"jsonm.1.0.2"
|
||||||
|
"ke.0.6"
|
||||||
|
"lablgtk3.3.1.4"
|
||||||
|
"lablgtk3-sourceview3.3.1.4"
|
||||||
|
"lambda-term.3.3.2"
|
||||||
|
"logs.0.7.0"
|
||||||
|
"lru.0.3.1"
|
||||||
|
"lwd.0.3"
|
||||||
|
"lwt.5.7.0"
|
||||||
|
"lwt-dllist.1.0.1"
|
||||||
|
"lwt_glib.1.1.1"
|
||||||
|
"lwt_react.1.2.0"
|
||||||
|
"macaddr.5.5.0"
|
||||||
|
"macaddr-cstruct.5.5.0"
|
||||||
|
"magic-mime.1.3.1"
|
||||||
|
"memtrace.0.2.3"
|
||||||
|
"menhir.20231231"
|
||||||
|
"menhirCST.20231231"
|
||||||
|
"menhirLib.20231231"
|
||||||
|
"menhirSdk.20231231"
|
||||||
|
"merlin.4.14-501"
|
||||||
|
"merlin-lib.4.14-501"
|
||||||
|
"metrics.0.4.1"
|
||||||
|
"metrics-lwt.0.4.1"
|
||||||
|
"mew.0.1.0"
|
||||||
|
"mew_vi.0.5.0"
|
||||||
|
"mimic.0.0.6"
|
||||||
|
"mimic-happy-eyeballs.0.0.6"
|
||||||
|
"mirage-clock.4.2.0"
|
||||||
|
"mirage-clock-unix.4.2.0"
|
||||||
|
"mirage-crypto.0.11.3"
|
||||||
|
"mirage-crypto-ec.0.11.3"
|
||||||
|
"mirage-crypto-pk.0.11.3"
|
||||||
|
"mirage-crypto-rng.0.11.3"
|
||||||
|
"mirage-crypto-rng-lwt.0.11.3"
|
||||||
|
"mirage-device.2.0.0"
|
||||||
|
"mirage-flow.3.0.0"
|
||||||
|
"mirage-kv.6.1.1"
|
||||||
|
"mirage-net.4.0.0"
|
||||||
|
"mirage-no-solo5.1"
|
||||||
|
"mirage-random.3.0.0"
|
||||||
|
"mirage-runtime.4.5.1"
|
||||||
|
"mirage-time.3.0.0"
|
||||||
|
"mirage-unix.5.0.1"
|
||||||
|
"mtime.2.0.0"
|
||||||
|
"not-ocamlfind.0.13"
|
||||||
|
"num.1.5"
|
||||||
|
"ocaml.5.1.1"
|
||||||
|
"ocaml-compiler-libs.v0.12.4"
|
||||||
|
"ocaml-config.3"
|
||||||
|
"ocaml-syntax-shims.1.0.0"
|
||||||
|
"ocaml-variants.5.1.1+options"
|
||||||
|
"ocaml-version.3.6.7"
|
||||||
|
"ocamlbuild.0.14.3"
|
||||||
|
"ocamlfind.1.9.6"
|
||||||
|
"ocamlformat.0.26.2"
|
||||||
|
"ocamlformat-lib.0.26.2"
|
||||||
|
"ocamlgraph.2.1.0"
|
||||||
|
"ocp-indent.1.8.1"
|
||||||
|
"ocplib-endian.1.2"
|
||||||
|
"odig.0.0.9"
|
||||||
|
"odoc.2.4.2"
|
||||||
|
"odoc-parser.2.4.2"
|
||||||
|
"optint.0.3.0"
|
||||||
|
"paf.0.5.0"
|
||||||
|
"parsexp.v0.16.0"
|
||||||
|
"pbkdf.1.2.0"
|
||||||
|
"pecu.0.7"
|
||||||
|
"ppx_derivers.1.2.1"
|
||||||
|
"ppx_deriving.5.2.1"
|
||||||
|
"ppx_enumerate.v0.16.0"
|
||||||
|
"ppx_irmin.3.9.0"
|
||||||
|
"ppx_repr.0.7.0"
|
||||||
|
"ppx_sexp_conv.v0.16.0"
|
||||||
|
"ppxlib.0.32.1"
|
||||||
|
"progress.0.4.0"
|
||||||
|
"psq.0.2.1"
|
||||||
|
"ptime.1.1.0"
|
||||||
|
"randomconv.0.1.3"
|
||||||
|
"re.1.11.0"
|
||||||
|
"react.1.2.2"
|
||||||
|
"repr.0.7.0"
|
||||||
|
"result.1.5"
|
||||||
|
"rresult.0.7.0"
|
||||||
|
"rusage.1.0.0"
|
||||||
|
"semaphore-compat.1.0.1"
|
||||||
|
"seq.base"
|
||||||
|
"sexplib.v0.16.0"
|
||||||
|
"sexplib0.v0.16.0"
|
||||||
|
"stb_image.0.5"
|
||||||
|
"stb_truetype.0.7"
|
||||||
|
"stdio.v0.16.0"
|
||||||
|
"stdlib-shims.0.3.0"
|
||||||
|
"stringext.1.6.0"
|
||||||
|
"tcpip.8.0.0"
|
||||||
|
"terminal.0.4.0"
|
||||||
|
"tezos-base58.1.0.0"
|
||||||
|
"tgls.0.8.6"
|
||||||
|
"tls.0.17.3"
|
||||||
|
"tls-lwt.0.17.3"
|
||||||
|
"tls-mirage.0.17.3"
|
||||||
|
"topkg.1.0.7"
|
||||||
|
"trie.1.0.0"
|
||||||
|
"tuareg.3.0.1"
|
||||||
|
"tyxml.4.6.0"
|
||||||
|
"uchar.0.0.2"
|
||||||
|
"uri.4.4.0"
|
||||||
|
"uri-sexp.4.4.0"
|
||||||
|
"user-setup.0.7"
|
||||||
|
"utop.2.14.0"
|
||||||
|
"uucp.15.1.0"
|
||||||
|
"uuseg.15.1.0"
|
||||||
|
"uutf.1.0.3"
|
||||||
|
"vector.1.0.0"
|
||||||
|
"webmachine.0.7.0"
|
||||||
|
"x509.0.16.5"
|
||||||
|
"xdg.3.15.2"
|
||||||
|
"yaml.3.2.0"
|
||||||
|
"yojson.2.1.2"
|
||||||
|
"zarith.1.13"
|
||||||
|
"zed.3.2.3"
|
||||||
|
]
|
||||||
92
oplevel.ml
92
oplevel.ml
@ -64,24 +64,18 @@ let main =
|
|||||||
let min_fps = ref Float.max_float in
|
let min_fps = ref Float.max_float in
|
||||||
let max_fps = ref Float.min_float in
|
let max_fps = ref Float.min_float in
|
||||||
|
|
||||||
(* Thread which is woken up when the main window is closed. *)
|
|
||||||
let _waiter, _wakener = Lwt.wait () in
|
|
||||||
|
|
||||||
F.pr "oplevel.ml: Toploop.initialize_toplevel_env@.";
|
|
||||||
Toploop.initialize_toplevel_env ();
|
|
||||||
|
|
||||||
let rootrepo =
|
let rootrepo =
|
||||||
Store.init_default
|
Store.init_default
|
||||||
(F.str "%s/console/rootstore.git" Secrets.giturl)
|
(F.str "%s/console/rootstore.git" Secrets.giturl)
|
||||||
in
|
in
|
||||||
|
|
||||||
let ui =
|
let ui =
|
||||||
Ogui.Ui.window ctx ~window
|
Ogui.Ui.window ctx ~window Gg.(Box2.v P2.o (P2.v 500. 500.))
|
||||||
(Lwd.var Gg.(Box2.v P2.o (P2.v 500. 500.)))
|
|
||||||
in
|
in
|
||||||
|
|
||||||
load_fonts ui.gv;
|
load_fonts ui.gv;
|
||||||
|
|
||||||
|
(* Format.safe_set_geometry ~max_indent:(500 - 1) ~margin:500; *)
|
||||||
let event_stream, event_push = Lwt_stream.create () in
|
let event_stream, event_push = Lwt_stream.create () in
|
||||||
Ogui.Ui.process_events ui event_stream;
|
Ogui.Ui.process_events ui event_stream;
|
||||||
GLFW.setKeyCallback ~window
|
GLFW.setKeyCallback ~window
|
||||||
@ -129,7 +123,7 @@ let main =
|
|||||||
(String.concat "/" initial_path))
|
(String.concat "/" initial_path))
|
||||||
|> Lwt.return
|
|> Lwt.return
|
||||||
>>= fun to_init ->
|
>>= fun to_init ->
|
||||||
let out_ppf =
|
let _out_ppf =
|
||||||
let insert s =
|
let insert s =
|
||||||
Lwt.async (fun () ->
|
Lwt.async (fun () ->
|
||||||
TextBuffer.length to_init >>= fun len ->
|
TextBuffer.length to_init >>= fun len ->
|
||||||
@ -147,15 +141,20 @@ let main =
|
|||||||
}
|
}
|
||||||
in
|
in
|
||||||
|
|
||||||
|
(*F.pr "oplevel.ml: Toploop.initialize_toplevel_env@.";
|
||||||
|
Toploop.initialize_toplevel_env ();
|
||||||
|
Clflags.debug := true;
|
||||||
ignore
|
ignore
|
||||||
(Toploop.use_input out_ppf
|
(Toploop.use_input out_ppf
|
||||||
(String "#use \"topfind\";;\n#list;;#require \"lwt\";;"));
|
(String "#use \"topfind\";;\n#list;;#require \"lwt\";;")); *)
|
||||||
(* toplevel execution binding *)
|
(* toplevel execution binding *)
|
||||||
Ui.(
|
Ui.(
|
||||||
update_bindings ui
|
append_bindings ui
|
||||||
Event.(
|
(Lwd.return
|
||||||
fun a ->
|
Event.
|
||||||
a
|
[
|
||||||
|
pack Fun.id
|
||||||
|
(empty
|
||||||
|> adds
|
|> adds
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
@ -167,38 +166,41 @@ let main =
|
|||||||
Custom
|
Custom
|
||||||
( "toplevel_execute",
|
( "toplevel_execute",
|
||||||
fun () ->
|
fun () ->
|
||||||
TextBuffer.peek tb_init >>= fun str ->
|
TextBuffer.peek tb_init >>= fun _str ->
|
||||||
Toploop.use_input out_ppf (String str)
|
(*Toploop.use_input out_ppf (String str)
|
||||||
|> F.epr "Toploop.use_input=%b@.";
|
|> F.epr "Toploop.use_input=%b@."; *)
|
||||||
Lwt.return_unit );
|
Lwt.return_unit );
|
||||||
|
]);
|
||||||
]));
|
]));
|
||||||
|
|
||||||
Layout.(
|
WindowManager.make ui
|
||||||
system ui `Y
|
|
||||||
~style:
|
|
||||||
Style.{ default with margin = Margin.symmetric 10.0 10.0 }
|
|
||||||
(Lwd.var
|
(Lwd.var
|
||||||
|
(`T
|
||||||
|
( `Y,
|
||||||
|
WindowManager.
|
||||||
[
|
[
|
||||||
TextEdit.multiline ui tb_init;
|
{
|
||||||
TextEdit.multiline ui to_init;
|
t = `TextEdit (TextEdit.multiline ui to_init);
|
||||||
]))
|
dim = `Ratio 0.333;
|
||||||
|
bindings = [];
|
||||||
|
};
|
||||||
|
{
|
||||||
|
t = `TextEdit (TextEdit.multiline ui tb_init);
|
||||||
|
dim = `Ratio 0.5;
|
||||||
|
bindings = [];
|
||||||
|
};
|
||||||
|
{
|
||||||
|
t = `TextEdit (TextEdit.multiline ui to_init);
|
||||||
|
dim = `Ratio 1.0;
|
||||||
|
bindings = [];
|
||||||
|
};
|
||||||
|
] )))
|
||||||
>>= fun page ->
|
>>= fun page ->
|
||||||
let page_root = Lwd.observe page in
|
let page_root = Lwd.observe page in
|
||||||
|
|
||||||
let open GLFW in
|
let bindings = ui.bindings |> Lwd.observe |> Lwd.quick_sample in
|
||||||
let open Event in
|
F.epr "Bindings:@.";
|
||||||
Ui.update_bindings ui
|
List.iter (fun bs -> F.epr "%a" Ui.pp_pack bs) bindings;
|
||||||
Ui.(
|
|
||||||
adds
|
|
||||||
[
|
|
||||||
[ Key (Press, X, [ Control ]); Key (Press, E, [ Control ]) ];
|
|
||||||
]
|
|
||||||
[ Custom ("toplevel_execute", fun () -> Lwt.return ()) ]);
|
|
||||||
|
|
||||||
let bindings =
|
|
||||||
ui.bindings |> Lwd.get |> Lwd.observe |> Lwd.quick_sample
|
|
||||||
in
|
|
||||||
F.epr "Bindings:@.%a" Ui.pp_bindings bindings;
|
|
||||||
|
|
||||||
F.pr "oplevel.ml: entering drawing loop@.";
|
F.pr "oplevel.ml: entering drawing loop@.";
|
||||||
let period_min = 1.0 /. 30. in
|
let period_min = 1.0 /. 30. in
|
||||||
@ -244,9 +246,19 @@ let main =
|
|||||||
if not GLFW.(windowShouldClose ~window) then draw_loop ()
|
if not GLFW.(windowShouldClose ~window) then draw_loop ()
|
||||||
else Lwt.return_unit
|
else Lwt.return_unit
|
||||||
in
|
in
|
||||||
draw_loop () >>= fun () ->
|
(try draw_loop ()
|
||||||
|
with e ->
|
||||||
|
F.epr "draw_loop Exception: %s@.Backtrace:@.%s@."
|
||||||
|
(Printexc.to_string e)
|
||||||
|
(Printexc.get_backtrace ())
|
||||||
|
|> Lwt.return)
|
||||||
|
>>= fun () ->
|
||||||
Printf.printf "MIN %.2f\n" !min_fps;
|
Printf.printf "MIN %.2f\n" !min_fps;
|
||||||
Printf.printf "MAX %.2f\n%!" !max_fps;
|
Printf.printf "MAX %.2f\n%!" !max_fps;
|
||||||
Lwt.return_unit
|
Lwt.return_unit
|
||||||
|
|
||||||
let () = Lwt_main.run main
|
let () =
|
||||||
|
try Lwt_main.run main
|
||||||
|
with e ->
|
||||||
|
F.epr "Exception: %s@.Backtrace:@.%s@." (Printexc.to_string e)
|
||||||
|
(Printexc.get_backtrace ())
|
||||||
|
|||||||
Reference in New Issue
Block a user