summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/builtin/builtini_GetCursor.ml
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/labltk/builtin/builtini_GetCursor.ml')
-rw-r--r--otherlibs/labltk/builtin/builtini_GetCursor.ml24
1 files changed, 24 insertions, 0 deletions
diff --git a/otherlibs/labltk/builtin/builtini_GetCursor.ml b/otherlibs/labltk/builtin/builtini_GetCursor.ml
new file mode 100644
index 000000000..8c63876cb
--- /dev/null
+++ b/otherlibs/labltk/builtin/builtini_GetCursor.ml
@@ -0,0 +1,24 @@
+let cCAMLtoTKcolor : color -> tkArgs = function
+ `Color x -> TkToken x
+ | `Black -> TkToken "black"
+ | `White -> TkToken "white"
+ | `Red -> TkToken "red"
+ | `Green -> TkToken "green"
+ | `Blue -> TkToken "blue"
+ | `Yellow -> TkToken "yellow"
+
+let cTKtoCAMLcolor = function s -> `Color s
+
+
+let cCAMLtoTKcursor : cursor -> tkArgs = function
+ `Xcursor s -> TkToken s
+ | `Xcursorfg (s,fg) ->
+ TkQuote(TkTokenList [TkToken s; cCAMLtoTKcolor fg])
+ | `Xcursorfgbg (s,fg,bg) ->
+ TkQuote(TkTokenList [TkToken s; cCAMLtoTKcolor fg; cCAMLtoTKcolor bg])
+ | `Cursorfilefg (s,fg) ->
+ TkQuote(TkTokenList [TkToken ("@"^s); cCAMLtoTKcolor fg])
+ | `Cursormaskfile (s,m,fg,bg) ->
+ TkQuote(TkTokenList [TkToken ("@"^s); TkToken m; cCAMLtoTKcolor fg; cCAMLtoTKcolor bg])
+
+