summaryrefslogtreecommitdiffstats
path: root/otherlibs
diff options
context:
space:
mode:
authorJun FURUSE / 古瀬 淳 <jun.furuse@gmail.com>2003-03-27 15:04:44 +0000
committerJun FURUSE / 古瀬 淳 <jun.furuse@gmail.com>2003-03-27 15:04:44 +0000
commitadd8b93030f29da45604a77861f0d2a5727eff10 (patch)
treef2c26a24dc2259abf0b7e3de728da64b246d3c93 /otherlibs
parent1395ffba852a3381a2e41f4464d104b15d84344b (diff)
imagephoto put support
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5464 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs')
-rw-r--r--otherlibs/labltk/Widgets.src3
-rw-r--r--otherlibs/labltk/compiler/compile.ml11
-rw-r--r--otherlibs/labltk/compiler/parser.mly2
3 files changed, 13 insertions, 3 deletions
diff --git a/otherlibs/labltk/Widgets.src b/otherlibs/labltk/Widgets.src
index 5d8abe634..e011bbe30 100644
--- a/otherlibs/labltk/Widgets.src
+++ b/otherlibs/labltk/Widgets.src
@@ -1430,7 +1430,8 @@ module Imagephoto {
function () copy [ImagePhoto; "copy"; src: ImagePhoto; photo(copy) list]
function (int, int, int) get [ImagePhoto; "get"; x: int; y: int]
% it is buggy ? can't express nested lists ?
-% function () put [ImagePhoto; "put"; [[Color list] list]; photo(put)]
+ function () put [ImagePhoto; "put"; [Color list list]; photo(put) list]
+% external put "builtin/imagephoto_put"
function () read [ImagePhoto; "read"; file: string; photo(read) list]
function () redither [ImagePhoto; "redither"]
function () write [ImagePhoto; "write"; file: string; photo(write) list]
diff --git a/otherlibs/labltk/compiler/compile.ml b/otherlibs/labltk/compiler/compile.ml
index b6b1fcd88..76be09ddb 100644
--- a/otherlibs/labltk/compiler/compile.ml
+++ b/otherlibs/labltk/compiler/compile.ml
@@ -612,10 +612,19 @@ let rec converterCAMLtoTK ~context_widget argname ty =
String.concat ~sep:"; "
(List.map2 vars tyl ~f:(converterCAMLtoTK ~context_widget)) ::
["]"])
+ | List ty -> (* Just added for Imagephoto.put *)
+ String.concat ~sep:" "
+ [(if !Flags.camltk then
+ "TkQuote (TkTokenList (List.map (fun y -> "
+ else
+ "TkQuote (TkTokenList (List.map ~f:(fun y -> ");
+ converterCAMLtoTK ~context_widget "y" ty;
+ ")";
+ argname;
+ "))"]
| Function _ -> fatal_error "unexpected function type in converterCAMLtoTK"
| Unit -> fatal_error "unexpected unit type in converterCAMLtoTK"
| Record _ -> fatal_error "unexpected product type in converterCAMLtoTK"
- | List ty -> fatal_error "unexpected list type in converterCAMLtoTK"
(*
* Produce a list of arguments from a template
diff --git a/otherlibs/labltk/compiler/parser.mly b/otherlibs/labltk/compiler/parser.mly
index d338a037c..c797f4fb5 100644
--- a/otherlibs/labltk/compiler/parser.mly
+++ b/otherlibs/labltk/compiler/parser.mly
@@ -109,7 +109,7 @@ Type1 :
Type2 :
Type1
{ $1 }
- | Type1 LIST
+ | Type2 LIST
{ List $1 }
;