{-# LANGUAGE CPP, RankNTypes, UndecidableInstances, GADTs, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Graphics.UI.FLTK.LowLevel.Dial ( -- * Hierarchy -- -- $hierarchy -- * Widget Functions -- -- $functions ) where #include "Fl_ExportMacros.h" #include "Fl_Types.h" #include "Fl_DialC.h" import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum) import Graphics.UI.FLTK.LowLevel.Fl_Enumerations import Graphics.UI.FLTK.LowLevel.Fl_Types import Graphics.UI.FLTK.LowLevel.Utils import Graphics.UI.FLTK.LowLevel.Dispatch import Graphics.UI.FLTK.LowLevel.Hierarchy {# fun Fl_Dial_resize as resize' { id `Ptr ()',`Int',`Int',`Int',`Int' } -> `()' supressWarningAboutRes #} instance (impl ~ (Rectangle -> IO ())) => Op (Resize ()) Dial orig impl where runOp _ _ dial rectangle = withRef dial $ \dialPtr -> do let (x_pos,y_pos,w_pos,h_pos) = fromRectangle rectangle resize' dialPtr x_pos y_pos w_pos h_pos {# fun Fl_Dial_hide as hide' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (Hide ()) Dial orig impl where runOp _ _ dial = withRef dial $ \dialPtr -> hide' dialPtr {# fun Fl_Dial_show as show' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (ShowWidget ()) Dial orig impl where runOp _ _ dial = withRef dial $ \dialPtr -> show' dialPtr {#fun Fl_Dial_handle as dialHandle' { id `Ptr ()', id `CInt' } -> `Int' #} instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (Handle ()) Dial orig impl where runOp _ _ dial event = withRef dial (\p -> dialHandle' p (fromIntegral . fromEnum $ event)) >>= return . successOrUnknownEvent {# fun Fl_Dial_draw as draw'' { id `Ptr ()' } -> `()' #} instance (impl ~ ( IO ())) => Op (Draw ()) Dial orig impl where runOp _ _ dial = withRef dial $ \dialPtr -> draw'' dialPtr -- $hierarchy -- @ -- "Graphics.UI.FLTK.LowLevel.Base.Widget" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Base.Valuator" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Base.Dial" -- | -- v -- "Graphics.UI.FLTK.LowLevel.Dial" -- @ -- $functions -- @ -- draw :: 'Ref' 'Dial' -> 'IO' () -- -- handle :: 'Ref' 'Dial' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ()) -- -- hide :: 'Ref' 'Dial' -> 'IO' () -- -- resize :: 'Ref' 'Dial' -> 'Rectangle' -> 'IO' () -- -- showWidget :: 'Ref' 'Dial' -> 'IO' () -- @