#lang racket (require ffi/unsafe "base.rkt" "glcanvas.rkt") (define libiup-glcontrols (case (system-type 'os) [(windows) (ffi-lib "iupglcontrols")] [else (ffi-lib "libiupglcontrols")])) ;; GLCanvasBox and embedded controls (define glcanvasbox (make-constructor-procedure (get-ffi-obj "IupGLCanvasBoxv" libiup-glcontrols (_fun children :: [children : (_list i _ihandle/null) = (append children '(#f))] -> [handle : _ihandle])))) (define glsubcanvas (make-constructor-procedure (get-ffi-obj "IupGLSubCanvas" libiup-glcontrols (_fun -> [handle : _ihandle])))) (define glframe (make-constructor-procedure (get-ffi-obj "IupGLFrame" libiup-glcontrols (_fun ([child #f]) :: [child : _ihandle/null] -> [handle : _ihandle])))) (define glexpander (make-constructor-procedure (get-ffi-obj "IupGLExpander" libiup-glcontrols (_fun ([child #f]) :: [child : _ihandle/null] -> [handle : _ihandle])))) (define glscrollbox (make-constructor-procedure (get-ffi-obj "IupGLScrollBox" libiup-glcontrols (_fun ([child #f]) :: [child : _ihandle/null] -> [handle : _ihandle])))) (define glsizebox (make-constructor-procedure (get-ffi-obj "IupGLSizeBox" libiup-glcontrols (_fun ([child #f]) :: [child : _ihandle/null] -> [handle : _ihandle])))) (define glseparator (make-constructor-procedure (get-ffi-obj "IupGLSeparator" libiup-glcontrols (_fun -> [handle : _ihandle])))) (define gllabel (make-constructor-procedure (get-ffi-obj "IupGLLabel" libiup-glcontrols (_fun ([title #f]) :: [title : _string/utf-8] -> [handle : _ihandle])))) (define gllink (make-constructor-procedure (get-ffi-obj "IupGLLink" libiup-glcontrols (_fun ([url #f] [title #f]) :: [url : _string/utf-8] [title : _string/utf-8] -> [handle : _ihandle])))) (define glbutton (make-constructor-procedure (get-ffi-obj "IupGLButton" libiup-glcontrols (_fun ([title #f]) :: [title : _string/utf-8] -> [handle : _ihandle])))) (define gltoggle (make-constructor-procedure (get-ffi-obj "IupGLToggle" libiup-glcontrols (_fun ([title #f]) :: [title : _string/utf-8] -> [handle : _ihandle])))) (define glvaluator (make-constructor-procedure (get-ffi-obj "IupGLVal" libiup-glcontrols (_fun -> [handle : _ihandle])))) (define glprogress-bar (make-constructor-procedure (get-ffi-obj "IupGLProgressBar" libiup-glcontrols (_fun -> [handle : _ihandle])))) ;; Library setup (letrec ([open (get-ffi-obj "IupGLControlsOpen" libiup-glcontrols (_fun -> [status : _istatus] -> (case status [(#t ignore) (void)] [else (error 'glcontrols "failed to initialize library (~s)" status)])))]) (open)) (provide (except-out (all-from-out "glcanvas.rkt") glcanvas) glcanvasbox glsubcanvas glframe glexpander glscrollbox glsizebox glseparator gllabel gllink glbutton gltoggle glvaluator glprogress-bar)