From 73d6e2233b247899c9eef89cc67bc59cd774c477 Mon Sep 17 00:00:00 2001 From: cqc Date: Fri, 2 Aug 2024 22:07:07 -0500 Subject: [PATCH] basic --- ogui.ml | 29 +++++++++++++++-------------- oplevel.ml | 3 --- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/ogui.ml b/ogui.ml index fda06c3..703a059 100644 --- a/ogui.ml +++ b/ogui.ml @@ -1475,7 +1475,7 @@ module WindowManager = struct ] |> pack Fun.id; ]); - + let i = ref 0 in Lwd.map_s (Lwd.get t) ~f:(fun (t : t) -> let rec fold dir (t : tt) : Layout.frame Lwd.t Lwt.t = let size = @@ -1494,14 +1494,16 @@ module WindowManager = struct fst trest | `T (_, []) -> Layout.none |> Lwd.return |> Lwt.return | `Frame f' -> - frame_of_window 314 cursor style size (Lwd.return f') + i := !i + 1; + frame_of_window !i cursor style size (Lwd.return f') |> Lwt.return | `TextEdit t' -> Layout.textedit ~size:(`Ratio 1.0, `Fun (fun b -> Gg.Box2.h b -. 30.)) t' >>= fun tt -> - frame_of_window 314 cursor style size tt |> Lwt.return + i := !i + 1; + frame_of_window !i cursor style size tt |> Lwt.return in fold `X { t; dim = `Ratio 1.; bindings = [] }) >>= fun d -> Lwd.join d |> Lwt.return @@ -1541,7 +1543,7 @@ module Painter = struct let string ?(style = Style.default) (t : Gv.t) (rect : box2) ((contents, format) : string * TextLayout.format) : box2 Lwt.t = (* draw_box t ~box:rect ~style; *) - F.epr "string"; + (* F.epr "string"; *) set_text_format t format; let rect' = Margin.inner style.margin rect in V2.v @@ -1636,13 +1638,13 @@ module Painter = struct | `Fun f -> f box)) in let box' = Margin.inner style.margin box in - F.epr "@[%a " pp_box2 box; + (* F.epr "@[%a " pp_box2 box; *) draw_box ui.gv ~box ~style; (match t with | `Join (dir, (a, b)) -> - F.epr "`Join %a @,(@[" pp_dir dir; + (* F.epr "`Join %a @,(@[" pp_dir dir; *) layout box' ui a >>= fun ra -> - F.epr ",@ "; + (* F.epr ",@ "; *) let c' = Box2.( match dir with @@ -1651,21 +1653,20 @@ module Painter = struct | `Z -> box') in layout c' ui b >>= fun rb -> - F.epr "@])"; + (* F.epr "@])"; *) Gg.Box2.union ra rb |> Lwt.return | `TextEdit tt -> - F.epr "`TextEdit"; + (* F.epr "`TextEdit"; *) text_layout ui.gv box' tt >>= fun _ -> Lwt.return box' | `None -> - F.epr "`None"; + (* F.epr "`None"; *) Lwt.return Gg.Box2.(v (o box') Gg.V2.zero) | `String s -> string ui.gv box' s | _ -> F.epr "_ !!Unimplemented!!"; Lwt.return Gg.Box2.zero) >>= fun r -> - F.epr "@]"; - + (* F.epr "@]"; *) let r' = Margin.outer style.margin r in (*F.epr "layout: box=%a box'=%a r=%a r'=%a@." Gg.Box2.pp box @@ -1673,8 +1674,8 @@ module Painter = struct Lwt.return r' let layout box ui frame = - F.epr "layout:@ @[%a@]@.as:@.@[" Layout.pp_frame_rec frame; + (* F.epr "layout:@ @[%a@]@.as:@.@[" Layout.pp_frame_rec frame; *) let r = layout box ui frame in - F.epr "@]@."; + (* F.epr "@]@."; *) r end diff --git a/oplevel.ml b/oplevel.ml index 8b14eb2..233dc62 100644 --- a/oplevel.ml +++ b/oplevel.ml @@ -64,9 +64,6 @@ let main = let min_fps = ref Float.max_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 - let rootrepo = Store.init_default (F.str "%s/console/rootstore.git" Secrets.giturl)