From: Michael D. Lowis Date: Tue, 24 Oct 2017 20:18:04 +0000 (-0400) Subject: Added functions for drawing the regions. stubs currently but will be filled out later X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=6692a94b32f02c9fb34148ea91d6e89a5cb0bcb5;p=archive%2Ftide-ocaml.git Added functions for drawing the regions. stubs currently but will be filled out later --- diff --git a/Makefile b/Makefile index 68f86da..3057d3b 100644 --- a/Makefile +++ b/Makefile @@ -29,9 +29,9 @@ LIBOBJS = \ lib/misc.$(OBJEXT) \ lib/x11.$(OBJEXT) \ lib/cfg.$(OBJEXT) \ - lib/draw.$(OBJEXT) \ lib/rope.$(OBJEXT) \ lib/buf.$(OBJEXT) \ + lib/draw.$(OBJEXT) \ lib/scrollmap.$(OBJEXT) \ lib/x11_prims.o \ lib/misc_prims.o \ diff --git a/edit.ml b/edit.ml index 541e111..c3f1250 100644 --- a/edit.ml +++ b/edit.ml @@ -85,6 +85,13 @@ let onmousebtn mods btn x y pressed = () let onmousemove mods x y = () let onupdate width height = + let csr = Draw.Cursor.make (width, height) 0 0 in + (* + Draw.status csr "UNSI> *scratch*"; + Draw.tags csr !tags_buf; + Draw.scroll csr; + Draw.edit csr !edit_buf + *) let (pos : drawpos) = { x = 0; y = 0 } in let pos = draw_status pos width "UNSI> *scratch*" in let pos = draw_tags pos width (height / font.height / 4) "Sample tags data" in diff --git a/lib/draw.ml b/lib/draw.ml index 26484ef..81e4e20 100644 --- a/lib/draw.ml +++ b/lib/draw.ml @@ -38,8 +38,12 @@ let vrule height csr = rule_bkg 1 (height - csr.y) csr; csr.x <- csr.x + 1 +let status csr str = () +let tags csr buf = () +let scroll csr = () +let edit csr buf = () + (* -type drawpos = { x: int; y: int } let draw_status pos width text = let height = (4 + font.height) in diff --git a/lib/draw.mli b/lib/draw.mli index 028d186..9a0f7f8 100644 --- a/lib/draw.mli +++ b/lib/draw.mli @@ -13,3 +13,8 @@ val rule_bkg : int -> int -> Cursor.t -> unit val string : string -> Cursor.t -> unit val hrule : int -> Cursor.t -> unit val vrule : int -> Cursor.t -> unit + +val status : Cursor.t -> string -> unit +val tags : Cursor.t -> Buf.t -> unit +val scroll : Cursor.t -> unit +val edit : Cursor.t -> Buf.t -> unit diff --git a/tests.ml b/tests.ml index c58c2f1..def58ab 100644 --- a/tests.ml +++ b/tests.ml @@ -1,3 +1,4 @@ let () = Rope.run_unit_tests (); + Scrollmap.run_unit_tests (); Test.report_results ()