From 6031eeec349999f844e28cc1c2504f86a8ef40d2 Mon Sep 17 00:00:00 2001 From: malc Date: Wed, 30 May 2018 04:45:28 +0300 Subject: [PATCH] Move more externals to Ffi --- ffi.ml | 5 +++++ glutils.ml | 6 ++---- help.ml | 5 +---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ffi.ml b/ffi.ml index d002fef..00e10ff 100644 --- a/ffi.ml +++ b/ffi.ml @@ -53,3 +53,8 @@ external isexternallink : string -> bool = "ml_isexternallink";; (* copysel _will_ close the supplied descriptor *) external copysel : Unix.file_descr -> opaque -> unit = "ml_copysel";; + +external drawstr : int -> int -> int -> string -> float = "ml_draw_string";; + +external fz_version : unit -> string = "ml_fz_version";; +external llpp_version : unit -> string = "ml_llpp_version";; diff --git a/glutils.ml b/glutils.ml index 730542e..aff60b2 100644 --- a/glutils.ml +++ b/glutils.ml @@ -1,5 +1,3 @@ -external drawstr : int -> int -> int -> string -> float = "ml_draw_string";; - let traw = Raw.create_static `float ~len:8;; let vraw = Raw.create_static `float ~len:8;; @@ -29,13 +27,13 @@ let drawstring size x y s = Gl.enable `blend; Gl.enable `texture_2d; GlFunc.blend_func ~src:`src_alpha ~dst:`one_minus_src_alpha; - ignore (drawstr size x y s); + ignore (Ffi.drawstr size x y s); Gl.disable `blend; Gl.disable `texture_2d; ;; let drawstring1 size x y s = - drawstr size x y s; + Ffi.drawstr size x y s; ;; let drawstring2 size x y fmt = diff --git a/help.ml b/help.ml index ce5460c..165d46e 100644 --- a/help.ml +++ b/help.ml @@ -175,9 +175,6 @@ o Text searching is very naive|};; open Utils;; -external fz_version : unit -> string = "ml_fz_version";; -external llpp_version : unit -> string = "ml_llpp_version";; - let gotourl launcher url = let command = Str.global_replace Utils.Re.percent url launcher in try ignore @@ spawn command [] @@ -195,7 +192,7 @@ let gotouri launcher uri = let version () = Printf.sprintf "llpp version %s, fitz %s, ocaml %s/%d bit" - (llpp_version ()) (fz_version ()) Sys.ocaml_version Sys.word_size + (Ffi.llpp_version ()) (Ffi.fz_version ()) Sys.ocaml_version Sys.word_size ;; let fixup = let open Str in let gr = global_replace in -- 2.11.4.GIT