-- GENERATED by C->Haskell Compiler, version 0.28.6 Switcheroo, 25 November 2017 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}
{-# LANGUAGE CPP, ExistentialQuantification, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.Base.ColorChooser
    (
     -- * Constructor
     colorChooserNew,
     colorChooserCustom,
     rgb2Hsv,
     hsv2Rgb,
     flcColorChooser,
     CustomColorChooserFuncs(..)
    , getModeColorChooserBase
    , setModeColorChooserBase
    , getHueColorChooserBase
    , getSaturationColorChooserBase
    , getValueColorChooserBase
    , getRColorChooserBase
    , getGColorChooserBase
    , getBColorChooserBase
    , setHsvColorChooserBase
    , setRgbColorChooserBase
    , drawColorChooserBase
    , handleColorChooserBase
    , resizeColorChooserBase
    , hideColorChooserBase
    , showWidgetColorChooserBase
     -- * Hierarchy
     --
     -- $hierarchy

     -- *  Functions
     --
     -- $functions
    )
where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import qualified Foreign.Storable as C2HSImp





import C2HS hiding (cFromEnum, cFromBool, cToBool,cToEnum)
import Graphics.UI.FLTK.LowLevel.Base.Widget

import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.Utils
import Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.Dispatch
import qualified Data.Text as T
import Data.List
import Graphics.UI.FLTK.LowLevel.Fl_Enumerations
import Control.Applicative

data CustomColorChooserFuncs a =
  CustomColorChooserFuncs
  {
    CustomColorChooserFuncs a -> Ref a -> IO ColorChooserMode
getModeCustom :: Ref a -> IO ColorChooserMode
  , CustomColorChooserFuncs a -> Ref a -> ColorChooserMode -> IO ()
setModeCustom :: Ref a -> ColorChooserMode -> IO ()
  , CustomColorChooserFuncs a -> Ref a -> IO Between0And6
hueCustom :: Ref a -> IO Between0And6
  , CustomColorChooserFuncs a -> Ref a -> IO Between0And1
saturationCustom :: Ref a -> IO Between0And1
  , CustomColorChooserFuncs a -> Ref a -> IO Between0And1
valueCustom :: Ref a -> IO Between0And1
  , CustomColorChooserFuncs a -> Ref a -> IO Between0And1
rCustom :: Ref a -> IO Between0And1
  , CustomColorChooserFuncs a -> Ref a -> IO Between0And1
gCustom :: Ref a -> IO Between0And1
  , CustomColorChooserFuncs a -> Ref a -> IO Between0And1
bCustom :: Ref a -> IO Between0And1
  , CustomColorChooserFuncs a
-> Ref a -> (Between0And6, Between0And1, Between0And1) -> IO Int
hsvCustom :: Ref a -> (Between0And6,Between0And1,Between0And1) -> IO Int
  , CustomColorChooserFuncs a
-> Ref a -> (Between0And1, Between0And1, Between0And1) -> IO Int
rgbCustom :: Ref a -> (Between0And1,Between0And1,Between0And1) -> IO Int
  }

toGetBetween0And6Prim :: (Ref a -> IO Between0And6) -> IO (FunPtr GetDoublePrim)
toGetBetween0And6Prim :: (Ref a -> IO Between0And6) -> IO (FunPtr GetDoublePrim)
toGetBetween0And6Prim f :: Ref a -> IO Between0And6
f =
  GetDoublePrim -> IO (FunPtr GetDoublePrim)
mkGetDouble (\ptr :: Ptr ()
ptr -> do
                  ForeignPtr (Ptr ())
pp <- Ptr () -> String -> IO (ForeignPtr (Ptr ()))
forall a.
HasCallStack =>
Ptr a -> String -> IO (ForeignPtr (Ptr a))
wrapNonNull Ptr ()
ptr "Null pointer: toGetBetween0And6Prim"
                  (Between0And6 res :: Double
res) <- Ref a -> IO Between0And6
f (Ref Any -> Ref a
forall a r. Ref a -> Ref r
castTo (ForeignPtr (Ptr ()) -> Ref Any
forall a. ForeignPtr (Ptr ()) -> Ref a
wrapInRef ForeignPtr (Ptr ())
pp))
                  CDouble -> IO CDouble
forall (m :: * -> *) a. Monad m => a -> m a
return (Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
res))

toGetBetween0And1Prim :: (Ref a -> IO Between0And1) -> IO (FunPtr GetDoublePrim)
toGetBetween0And1Prim :: (Ref a -> IO Between0And1) -> IO (FunPtr GetDoublePrim)
toGetBetween0And1Prim f :: Ref a -> IO Between0And1
f =
  GetDoublePrim -> IO (FunPtr GetDoublePrim)
mkGetDouble (\ptr :: Ptr ()
ptr -> do
                  ForeignPtr (Ptr ())
pp <- Ptr () -> String -> IO (ForeignPtr (Ptr ()))
forall a.
HasCallStack =>
Ptr a -> String -> IO (ForeignPtr (Ptr a))
wrapNonNull Ptr ()
ptr "Null pointer: toGetBetween0And1Prim"
                  (Between0And1 res :: Double
res) <- Ref a -> IO Between0And1
f (Ref Any -> Ref a
forall a r. Ref a -> Ref r
castTo (ForeignPtr (Ptr ()) -> Ref Any
forall a. ForeignPtr (Ptr ()) -> Ref a
wrapInRef ForeignPtr (Ptr ())
pp))
                  CDouble -> IO CDouble
forall (m :: * -> *) a. Monad m => a -> m a
return (Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
res))

toGetModePrim :: (Ref a -> IO ColorChooserMode) -> IO (FunPtr GetIntPrim)
toGetModePrim :: (Ref a -> IO ColorChooserMode) -> IO (FunPtr GetIntPrim)
toGetModePrim f :: Ref a -> IO ColorChooserMode
f =
  GetIntPrim -> IO (FunPtr GetIntPrim)
mkGetInt (\ptr :: Ptr ()
ptr -> do
               ForeignPtr (Ptr ())
pp <- Ptr () -> String -> IO (ForeignPtr (Ptr ()))
forall a.
HasCallStack =>
Ptr a -> String -> IO (ForeignPtr (Ptr a))
wrapNonNull Ptr ()
ptr "Null pointer: toGetModePrim"
               ColorChooserMode
mode <- Ref a -> IO ColorChooserMode
f (Ref Any -> Ref a
forall a r. Ref a -> Ref r
castTo (ForeignPtr (Ptr ()) -> Ref Any
forall a. ForeignPtr (Ptr ()) -> Ref a
wrapInRef ForeignPtr (Ptr ())
pp))
               CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (ColorChooserMode -> Int
forall a. Enum a => a -> Int
fromEnum ColorChooserMode
mode)))

toSetModePrim :: (Ref a -> ColorChooserMode -> IO ()) -> IO (FunPtr SetIntPrim)
toSetModePrim :: (Ref a -> ColorChooserMode -> IO ()) -> IO (FunPtr SetIntPrim)
toSetModePrim f :: Ref a -> ColorChooserMode -> IO ()
f =
  SetIntPrim -> IO (FunPtr SetIntPrim)
mkSetInt (\ptr :: Ptr ()
ptr m :: CInt
m -> do
               ForeignPtr (Ptr ())
pp <- Ptr () -> String -> IO (ForeignPtr (Ptr ()))
forall a.
HasCallStack =>
Ptr a -> String -> IO (ForeignPtr (Ptr a))
wrapNonNull Ptr ()
ptr "Null pointer: toSetModePrim"
               Ref a -> ColorChooserMode -> IO ()
f (Ref Any -> Ref a
forall a r. Ref a -> Ref r
castTo (ForeignPtr (Ptr ()) -> Ref Any
forall a. ForeignPtr (Ptr ()) -> Ref a
wrapInRef ForeignPtr (Ptr ())
pp)) (Integer -> ColorChooserMode
forall b a. (Integral b, Enum a) => b -> a
cToEnum (CInt -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
m)))

toHsvPrim :: (Ref a -> (Between0And6,Between0And1,Between0And1) -> IO Int)-> IO (FunPtr ColorSetPrim)
toHsvPrim :: (Ref a -> (Between0And6, Between0And1, Between0And1) -> IO Int)
-> IO (FunPtr ColorSetPrim)
toHsvPrim f :: Ref a -> (Between0And6, Between0And1, Between0And1) -> IO Int
f =
  ColorSetPrim -> IO (FunPtr ColorSetPrim)
mkColorSetPrim (\ptr :: Ptr ()
ptr (CDouble h :: Double
h) (CDouble s :: Double
s) (CDouble v :: Double
v) -> do
                     ForeignPtr (Ptr ())
pp <- Ptr () -> String -> IO (ForeignPtr (Ptr ()))
forall a.
HasCallStack =>
Ptr a -> String -> IO (ForeignPtr (Ptr a))
wrapNonNull Ptr ()
ptr "Null pointer: toHsvPrim"
                     Int
ret <- Ref a -> (Between0And6, Between0And1, Between0And1) -> IO Int
f (Ref Any -> Ref a
forall a r. Ref a -> Ref r
castTo (ForeignPtr (Ptr ()) -> Ref Any
forall a. ForeignPtr (Ptr ()) -> Ref a
wrapInRef ForeignPtr (Ptr ())
pp)) (Double -> Between0And6
Between0And6 Double
h,Double -> Between0And1
Between0And1 Double
s,Double -> Between0And1
Between0And1 Double
v)
                     CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
ret))

toRgbPrim :: (Ref a -> (Between0And1,Between0And1,Between0And1) -> IO Int) -> IO (FunPtr ColorSetPrim)
toRgbPrim :: (Ref a -> (Between0And1, Between0And1, Between0And1) -> IO Int)
-> IO (FunPtr ColorSetPrim)
toRgbPrim f :: Ref a -> (Between0And1, Between0And1, Between0And1) -> IO Int
f =
  ColorSetPrim -> IO (FunPtr ColorSetPrim)
mkColorSetPrim (\ptr :: Ptr ()
ptr (CDouble r :: Double
r) (CDouble g :: Double
g) (CDouble b :: Double
b) -> do
                     ForeignPtr (Ptr ())
pp <- Ptr () -> String -> IO (ForeignPtr (Ptr ()))
forall a.
HasCallStack =>
Ptr a -> String -> IO (ForeignPtr (Ptr a))
wrapNonNull Ptr ()
ptr "Null pointer: toRgbPrim"
                     Int
ret <- Ref a -> (Between0And1, Between0And1, Between0And1) -> IO Int
f (Ref Any -> Ref a
forall a r. Ref a -> Ref r
castTo (ForeignPtr (Ptr ()) -> Ref Any
forall a. ForeignPtr (Ptr ()) -> Ref a
wrapInRef ForeignPtr (Ptr ())
pp)) (Double -> Between0And1
Between0And1 Double
r,Double -> Between0And1
Between0And1 Double
g,Double -> Between0And1
Between0And1 Double
b)
                     CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
ret))

fillCustomColorChooserFunctionStruct :: forall a. (Parent a ColorChooserBase) => CustomColorChooserFuncs a -> IO (Ptr ())
fillCustomColorChooserFunctionStruct funcs = do
  structPtr <- mallocBytes 88
{-# LINE 109 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

  toGetModePrim (getModeCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 0 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))))}) structPtr
  toSetModePrim (setModeCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 8 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))))}) structPtr
  toGetBetween0And6Prim (hueCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 16 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))))}) structPtr
  toGetBetween0And1Prim (saturationCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 24 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))))}) structPtr
  toGetBetween0And1Prim (valueCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 32 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))))}) structPtr
  toGetBetween0And1Prim (rCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 40 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))))}) structPtr
  toGetBetween0And1Prim (gCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 48 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))))}) structPtr
  toGetBetween0And1Prim (bCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 56 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))))}) structPtr
  toHsvPrim (hsvCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 64 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CInt)))))))}) structPtr
  toRgbPrim (rgbCustom funcs) >>= (\ptr val -> do {C2HSImp.pokeByteOff ptr 72 (val :: (C2HSImp.FunPtr ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CInt)))))))}) structPtr
  return structPtr

overriddenWidgetNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (CString) -> (Ptr ()) -> (Ptr ()) -> IO ((Ptr ()))
overriddenWidgetNewWithLabel' :: Int
-> Int -> Int -> Int -> CString -> Ptr () -> Ptr () -> IO (Ptr ())
overriddenWidgetNewWithLabel' a1 :: Int
a1 a2 :: Int
a2 a3 a4 :: Int
a4 a5 :: CString
a5 a6 a7 :: Ptr ()
a7 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  (flip ($)) a5 $ \a5' -> 
  let {a6' = id a6} in 
  let {a7' = id a7} in 
  overriddenWidgetNewWithLabel''_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 122 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

overriddenWidgetNew' :: (Int) -> (Int) -> (Int) -> (Int) -> (Ptr ()) -> (Ptr ()) -> IO ((Ptr ()))
overriddenWidgetNew' a1 a2 a3 a4 a5 a6 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = id a5} in 
  let {a6' = id a6} in 
  overriddenWidgetNew''_ a1' a2' a3' a4' a5' a6' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 123 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

colorChooserCustom ::
       Rectangle                         -- ^ The bounds of this ColorChooser
    -> Maybe T.Text                      -- ^ The ColorChooser label
    -> Maybe (Ref ColorChooser -> IO ())           -- ^ Optional custom drawing function
    -> Maybe (CustomColorChooserFuncs ColorChooser)
    -> Maybe (CustomWidgetFuncs ColorChooser)      -- ^ Optional custom widget functions
    -> IO (Ref ColorChooser)
colorChooserCustom rectangle l' draw' colorChooserFuncs' funcs' =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in do
    widgetFuncsPtr <- customWidgetFunctionStruct draw' (maybe defaultCustomWidgetFuncs id funcs')
    colorChooserFuncsPtr <- maybe (return nullPtr) fillCustomColorChooserFunctionStruct colorChooserFuncs'
    colorChooser <-
      maybe
        (overriddenWidgetNew' x_pos y_pos width height (castPtr widgetFuncsPtr) (castPtr colorChooserFuncsPtr))
        (\l -> copyTextToCString l >>= \l' -> overriddenWidgetNewWithLabel' x_pos y_pos width height l' (castPtr widgetFuncsPtr) (castPtr colorChooserFuncsPtr))
        l'
    ref <- toRef colorChooser
    setFlag ref WidgetFlagCopiedLabel
    setFlag ref WidgetFlagCopiedTooltip
    return ref

colorchooserNew' :: (Int) -> (Int) -> (Int) -> (Int) -> IO ((Ptr ()))
colorchooserNew' :: Int -> Int -> Int -> Int -> IO (Ptr ())
colorchooserNew' a1 :: Int
a1 a2 :: Int
a2 a3 :: Int
a3 a4 :: Int
a4 =
  let {a1' :: CInt
a1' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a1} in 
  let {a2' :: CInt
a2' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a2} in 
  let {a3' :: CInt
a3' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a3} in 
  let {a4' :: CInt
a4' = Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
a4} in 
  CInt -> CInt -> CInt -> CInt -> IO (Ptr ())
colorchooserNew''_ CInt
a1' a2' a3' a4' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 146 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

colorchooserNewWithLabel' :: (Int) -> (Int) -> (Int) -> (Int) -> (CString) -> IO ((Ptr ()))
colorchooserNewWithLabel' a1 a2 a3 a4 a5 =
  let {a1' = fromIntegral a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  (flip ($)) a5 $ \a5' -> 
  colorchooserNewWithLabel''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = id res} in
  return (res')

{-# LINE 147 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

colorChooserNew :: Rectangle -> Maybe T.Text -> IO (Ref ColorChooser)
colorChooserNew rectangle l'=
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in case l' of
        Nothing -> colorchooserNew' x_pos y_pos width height >>= toRef
        Just l -> do
          l' <- copyTextToCString l
          ref <- colorchooserNewWithLabel' x_pos y_pos width height l' >>= toRef
          setFlag ref WidgetFlagCopiedLabel
          setFlag ref WidgetFlagCopiedTooltip
          return ref

hsv2rgb' :: (Double) -> (Double) -> (Double) -> (Ptr CDouble) -> (Ptr CDouble) -> (Ptr CDouble) -> IO ()
hsv2rgb' :: Double
-> Double
-> Double
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> IO ()
hsv2rgb' a1 :: Double
a1 a2 :: Double
a2 a3 :: Double
a3 a4 :: Ptr CDouble
a4 a5 :: Ptr CDouble
a5 a6 :: Ptr CDouble
a6 =
  let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: Ptr CDouble
a4' = Ptr CDouble -> Ptr CDouble
forall a. a -> a
id Ptr CDouble
a4} in 
  let {a5' :: Ptr CDouble
a5' = Ptr CDouble -> Ptr CDouble
forall a. a -> a
id Ptr CDouble
a5} in 
  let {a6' :: Ptr CDouble
a6' = Ptr CDouble -> Ptr CDouble
forall a. a -> a
id Ptr CDouble
a6} in 
  hsv2rgb''_ a1' a2' a3' a4' a5' a6' >>
  return ()

{-# LINE 160 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

hsv2Rgb :: (Between0And6, Between0And1, Between0And1) ->  IO (Maybe (Between0And1, Between0And1, Between0And1))
hsv2Rgb (Between0And6 h'', Between0And1 s'', Between0And1 v'') =
  alloca $ \rPtr ->
  alloca $ \gPtr ->
  alloca $ \bPtr -> do
    hsv2rgb' h'' s'' v'' rPtr gPtr bPtr
    r'' <- peek rPtr
    g'' <- peek gPtr
    b'' <- peek bPtr
    return (Just (Between0And1 (realToFrac r''),Between0And1 (realToFrac g''),Between0And1 (realToFrac b'')))

rgb2hsv' :: (Double) -> (Double) -> (Double) -> (Ptr CDouble) -> (Ptr CDouble) -> (Ptr CDouble) -> IO ()
rgb2hsv' :: Double
-> Double
-> Double
-> Ptr CDouble
-> Ptr CDouble
-> Ptr CDouble
-> IO ()
rgb2hsv' a1 :: Double
a1 a2 :: Double
a2 a3 :: Double
a3 a4 :: Ptr CDouble
a4 a5 :: Ptr CDouble
a5 a6 :: Ptr CDouble
a6 =
  let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = realToFrac a3} in 
  let {a4' = id a4} in 
  let {a5' = id a5} in 
  let {a6' = id a6} in 
  rgb2hsv''_ a1' a2' a3' a4' a5' a6' >>
  return ()

{-# LINE 172 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

rgb2Hsv :: (Between0And1, Between0And1, Between0And1) ->  IO (Maybe (Between0And6, Between0And1, Between0And1))
rgb2Hsv (Between0And1 h'', Between0And1 s'', Between0And1 v'') =
  alloca $ \hPtr ->
  alloca $ \sPtr ->
  alloca $ \vPtr -> do
    rgb2hsv' h'' s'' v'' hPtr sPtr vPtr
    let (nullPtrs, nonNullPtrs) = partition ((==) nullPtr) [hPtr, sPtr, vPtr]
    if (not (null nullPtrs))
     then mapM_ free nonNullPtrs >> return Nothing
     else do
       h''' <- peek hPtr
       s''' <- peek sPtr
       v''' <- peek vPtr
       return (Just (Between0And6 (realToFrac h'''),Between0And1 (realToFrac s'''),Between0And1 (realToFrac v''')))

flc_color_chooser_with_m' :: (CString) -> (Ptr CDouble) -> (Ptr CDouble) -> (Ptr CDouble) -> (Int) -> IO ((Int))
flc_color_chooser_with_m' :: CString
-> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> Int -> IO Int
flc_color_chooser_with_m' a1 :: CString
a1 a2 :: Ptr CDouble
a2 a3 :: Ptr CDouble
a3 a4 :: Ptr CDouble
a4 a5 :: Int
a5 =
  (((CString -> IO Int) -> CString -> IO Int)
-> CString -> (CString -> IO Int) -> IO Int
forall a b c. (a -> b -> c) -> b -> a -> c
flip (CString -> IO Int) -> CString -> IO Int
forall a b. (a -> b) -> a -> b
($)) CString
a1 ((CString -> IO Int) -> IO Int) -> (CString -> IO Int) -> IO Int
forall a b. (a -> b) -> a -> b
$ \a1' :: CString
a1' -> 
  let {a2' :: Ptr CDouble
a2' = CString
Ptr CDouble -> Ptr CDouble
forall a. a -> a
a1 :: CString
id :: forall a. a -> a
id Ptr CDouble
a2} in 
  let {a3' :: Ptr CDouble
a3' = Ptr CDouble -> Ptr CDouble
forall a. a -> a
id Ptr CDouble
a3} in 
  let {a4' :: Ptr CDouble
a4' = Ptr CDouble -> Ptr CDouble
forall a. a -> a
id Ptr CDouble
a4} in 
  let {a5' = fromIntegral a5} in 
  flc_color_chooser_with_m''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 188 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

flc_color_chooser_with_uchar_m' :: (CString) -> (Ptr CUChar) -> (Ptr CUChar) -> (Ptr CUChar) -> (Int) -> IO ((Int))
flc_color_chooser_with_uchar_m' a1 a2 a3 a4 a5 =
  (flip ($)) a1 $ \a1' -> 
  let {a2' = id a2} in 
  let {a3' = id a3} in 
  let {a4' = id a4} in 
  let {a5' = fromIntegral a5} in 
  flc_color_chooser_with_uchar_m''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 189 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

flcColorChooser :: T.Text ->
                   ColorChooserRGB ->
                   Maybe ColorChooserMode ->
                   IO (Maybe ColorChooserRGB)
flcColorChooser name (Decimals (Between0And1 r'', Between0And1 g'', Between0And1 b'')) mode =
  alloca $ \r''Ptr ->
  alloca $ \g''Ptr ->
  alloca $ \b''Ptr -> do
    poke r''Ptr $ realToFrac r''
    poke g''Ptr $ realToFrac g''
    poke b''Ptr $ realToFrac b''
    ret <- copyTextToCString name >>= \n' -> flc_color_chooser_with_m' n' r''Ptr g''Ptr b''Ptr (maybe (-1) fromEnum mode)
    if (ret == 0)
     then return Nothing
     else do
      newR <- peek r''Ptr
      newG <- peek g''Ptr
      newB <- peek b''Ptr
      return (Just (Decimals
                     (Between0And1 (realToFrac newR),
                      Between0And1 (realToFrac newG),
                      Between0And1 (realToFrac newB))))
flcColorChooser name :: Text
name (Words (r :: CUChar
r,g :: CUChar
g,b :: CUChar
b)) mode :: Maybe ColorChooserMode
mode =
  (Ptr CUChar -> IO (Maybe ColorChooserRGB))
-> IO (Maybe ColorChooserRGB)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUChar -> IO (Maybe ColorChooserRGB))
 -> IO (Maybe ColorChooserRGB))
-> (Ptr CUChar -> IO (Maybe ColorChooserRGB))
-> IO (Maybe ColorChooserRGB)
forall a b. (a -> b) -> a -> b
$ \r''Ptr :: Ptr CUChar
r''Ptr ->
  (Ptr CUChar -> IO (Maybe ColorChooserRGB))
-> IO (Maybe ColorChooserRGB)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUChar -> IO (Maybe ColorChooserRGB))
 -> IO (Maybe ColorChooserRGB))
-> (Ptr CUChar -> IO (Maybe ColorChooserRGB))
-> IO (Maybe ColorChooserRGB)
forall a b. (a -> b) -> a -> b
$ \g''Ptr :: Ptr CUChar
g''Ptr ->
  (Ptr CUChar -> IO (Maybe ColorChooserRGB))
-> IO (Maybe ColorChooserRGB)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUChar -> IO (Maybe ColorChooserRGB))
 -> IO (Maybe ColorChooserRGB))
-> (Ptr CUChar -> IO (Maybe ColorChooserRGB))
-> IO (Maybe ColorChooserRGB)
forall a b. (a -> b) -> a -> b
$ \b''Ptr :: Ptr CUChar
b''Ptr -> do
    Ptr CUChar -> CUChar -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr CUChar
r''Ptr (CUChar -> CUChar
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUChar
r)
    Ptr CUChar -> CUChar -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr CUChar
g''Ptr (CUChar -> CUChar
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUChar
g)
    Ptr CUChar -> CUChar -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr CUChar
b''Ptr (CUChar -> CUChar
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUChar
b)
    Int
ret <- Text -> IO CString
copyTextToCString Text
name IO CString -> (CString -> IO Int) -> IO Int
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \n' :: CString
n' -> CString -> Ptr CUChar -> Ptr CUChar -> Ptr CUChar -> Int -> IO Int
flc_color_chooser_with_uchar_m' CString
n' Ptr CUChar
r''Ptr Ptr CUChar
g''Ptr Ptr CUChar
b''Ptr (Int -> (ColorChooserMode -> Int) -> Maybe ColorChooserMode -> Int
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (-1) ColorChooserMode -> Int
forall a. Enum a => a -> Int
fromEnum Maybe ColorChooserMode
mode)
    if (Int
ret Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== 0)
     then Maybe ColorChooserRGB -> IO (Maybe ColorChooserRGB)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ColorChooserRGB
forall a. Maybe a
Nothing
     else do
      CUChar
newR <- Ptr CUChar -> IO CUChar
forall a. Storable a => Ptr a -> IO a
peek Ptr CUChar
r''Ptr
      CUChar
newG <- Ptr CUChar -> IO CUChar
forall a. Storable a => Ptr a -> IO a
peek Ptr CUChar
g''Ptr
      CUChar
newB <- Ptr CUChar -> IO CUChar
forall a. Storable a => Ptr a -> IO a
peek Ptr CUChar
b''Ptr
      Maybe ColorChooserRGB -> IO (Maybe ColorChooserRGB)
forall (m :: * -> *) a. Monad m => a -> m a
return (ColorChooserRGB -> Maybe ColorChooserRGB
forall a. a -> Maybe a
Just (RGB -> ColorChooserRGB
Words ((CUChar -> CUChar
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUChar
newR), (CUChar -> CUChar
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUChar
newG), (CUChar -> CUChar
forall a b. (Integral a, Num b) => a -> b
fromIntegral CUChar
newB))))

modeSuper' :: (Ptr ()) -> IO ((Int))
modeSuper' :: Ptr () -> IO Int
modeSuper' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetIntPrim
modeSuper''_ Ptr ()
a1' IO CInt -> (CInt -> IO Int) -> IO Int
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CInt
res ->
  let {res' :: Int
res' = CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
res} in
  Int -> IO Int
forall (m :: * -> *) a. Monad m => a -> m a
return (Int
res')

{-# LINE 228 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

getModeColorChooserBase :: Ref ColorChooserBase ->  IO (ColorChooserMode)
getModeColorChooserBase color_chooser = withRef color_chooser $ \color_chooserPtr -> modeSuper' color_chooserPtr >>= return . toEnum

setModeSuper' :: (Ptr ()) -> (Int) -> IO ()
setModeSuper' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  setModeSuper''_ a1' a2' >>
  return ()

{-# LINE 232 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

setModeColorChooserBase :: Ref ColorChooserBase -> ColorChooserMode ->  IO ()
setModeColorChooserBase color_chooser mode = withRef color_chooser $ \color_chooserPtr -> setModeSuper' color_chooserPtr (fromEnum mode)

hueSuper' :: (Ptr ()) -> IO ((Double))
hueSuper' a1 =
  let {a1' = id a1} in 
  hueSuper''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 236 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

getHueColorChooserBase :: Ref ColorChooserBase ->  IO (Either OutOfRange Between0And6)
getHueColorChooserBase color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    h'' <- hueSuper' color_chooserPtr
    if ((h'' < 0.0) || (h'' >= 6.0))
     then return (Left OutOfRange)
     else return (Right (Between0And6 h''))
saturationSuper' :: (Ptr ()) -> IO ((Double))
saturationSuper' :: Ptr () -> IO Double
saturationSuper' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetDoublePrim
saturationSuper''_ Ptr ()
a1' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CDouble
res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 243 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

getSaturationColorChooserBase :: Ref ColorChooserBase ->  IO (Either OutOfRange Between0And1)
getSaturationColorChooserBase color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    s'' <- saturationSuper' color_chooserPtr
    if ((s'' < 0.0) || (s'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 s''))

valueSuper' :: (Ptr ()) -> IO ((Double))
valueSuper' :: Ptr () -> IO Double
valueSuper' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetDoublePrim
valueSuper''_ Ptr ()
a1' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CDouble
res ->
  let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac res} in
  return (res')

{-# LINE 251 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

getValueColorChooserBase :: Ref ColorChooserBase ->  IO (Either OutOfRange Between0And1)
getValueColorChooserBase color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    v'' <- valueSuper' color_chooserPtr
    if ((v'' < 0.0) || (v'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 v''))

rSuper' :: (Ptr ()) -> IO ((Double))
rSuper' :: Ptr () -> IO Double
rSuper' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetDoublePrim
rSuper''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 259 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

getRColorChooserBase :: Ref ColorChooserBase ->  IO (Either OutOfRange Between0And1)
getRColorChooserBase color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    r'' <- rSuper' color_chooserPtr
    if ((r'' < 0.0) || (r'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 r''))

gSuper' :: (Ptr ()) -> IO ((Double))
gSuper' :: Ptr () -> IO Double
gSuper' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetDoublePrim
gSuper''_ Ptr ()
a1' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CDouble
res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 267 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

getGColorChooserBase :: Ref ColorChooserBase ->  IO (Either OutOfRange Between0And1)
getGColorChooserBase color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    g'' <- gSuper' color_chooserPtr
    if ((g'' < 0.0) || (g'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 g''))

bSuper' :: (Ptr ()) -> IO ((Double))
bSuper' :: Ptr () -> IO Double
bSuper' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = id a1} in 
  bSuper''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 275 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

getBColorChooserBase :: Ref ColorChooserBase ->  IO (Either OutOfRange Between0And1)
getBColorChooserBase color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    b'' <- bSuper' color_chooserPtr
    if ((b'' < 0.0) || (b'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 b''))

hsvSuper' :: (Ptr ()) -> (Double) -> (Double) -> (Double) -> IO ((Int))
hsvSuper' :: Ptr () -> Double -> Double -> Double -> IO Int
hsvSuper' a1 :: Ptr ()
a1 a2 :: Double
a2 a3 :: Double
a3 a4 :: Double
a4 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in 
  let {a3' :: CDouble
a3' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a3} in 
  let {a4' :: CDouble
a4' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a4} in 
  ColorSetPrim
hsvSuper''_ Ptr ()
a1' CDouble
a2' CDouble
a3' CDouble
a4' IO CInt -> (CInt -> IO Int) -> IO Int
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CInt
res ->
  let {res' :: Int
res' = CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
res} in
  Int -> IO Int
forall (m :: * -> *) a. Monad m => a -> m a
return (Int
res')

{-# LINE 283 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

setHsvColorChooserBase :: Ref ColorChooserBase -> (Between0And6, Between0And1, Between0And1) -> IO (Either NoChange ())
setHsvColorChooserBase color_chooser (Between0And6 h'', Between0And1 s'', Between0And1 v'') =
    withRef color_chooser $ \color_chooserPtr -> do
      ret <- hsvSuper' color_chooserPtr h'' s'' v''
      if (ret == 0) then return (Left NoChange) else return (Right ())

rgbSuper' :: (Ptr ()) -> (Double) -> (Double) -> (Double) -> IO ((Int))
rgbSuper' :: Ptr () -> Double -> Double -> Double -> IO Int
rgbSuper' a1 :: Ptr ()
a1 a2 :: Double
a2 a3 :: Double
a3 a4 :: Double
a4 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  rgbSuper''_ a1' a2' a3' a4' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 290 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

setRgbColorChooserBase :: Ref ColorChooserBase -> (Between0And1, Between0And1, Between0And1) ->  IO (Either NoChange ())
setRgbColorChooserBase color_chooser (Between0And1 r'', Between0And1 g'', Between0And1 b'') =
    withRef color_chooser $ \color_chooserPtr -> do
      ret <- rgbSuper' color_chooserPtr r'' g'' b''
      if (ret == 0) then return (Left NoChange) else return (Right ())

drawSuper' :: (Ptr ()) -> IO ((()))
drawSuper' a1 =
  let {a1' = id a1} in 
  drawSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 297 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

drawColorChooserBase ::  Ref ColorChooserBase -> IO ()
drawColorChooserBase colorChoooser = withRef colorChoooser $ \colorChoooserPtr -> drawSuper' colorChoooserPtr
handleSuper' :: (Ptr ()) -> (Int) -> IO ((Int))
handleSuper' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  handleSuper''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 300 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

handleColorChooserBase :: Ref ColorChooserBase -> Event ->  IO (Either UnknownEvent ())
handleColorChooserBase colorChoooser event = withRef colorChoooser $ \colorChoooserPtr -> handleSuper' colorChoooserPtr (fromIntegral (fromEnum event)) >>= return . successOrUnknownEvent
resizeSuper' :: (Ptr ()) -> (Int) -> (Int) -> (Int) -> (Int) -> IO ((()))
resizeSuper' a1 a2 a3 a4 a5 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  resizeSuper''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 303 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

resizeColorChooserBase :: Ref ColorChooserBase -> Rectangle -> IO ()
resizeColorChooserBase colorChoooser rectangle =
    let (x_pos, y_pos, width, height) = fromRectangle rectangle
    in withRef colorChoooser $ \colorChoooserPtr -> resizeSuper' colorChoooserPtr x_pos y_pos width height
hideSuper' :: (Ptr ()) -> IO ((()))
hideSuper' a1 =
  let {a1' = id a1} in 
  hideSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 308 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

hideColorChooserBase ::  Ref ColorChooserBase -> IO ()
hideColorChooserBase colorChoooser = withRef colorChoooser $ \colorChoooserPtr -> hideSuper' colorChoooserPtr
showSuper' :: (Ptr ()) -> IO ((()))
showSuper' a1 =
  let {a1' = id a1} in 
  showSuper''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 311 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

showWidgetColorChooserBase ::  Ref ColorChooserBase -> IO ()
showWidgetColorChooserBase colorChoooser = withRef colorChoooser $ \colorChoooserPtr -> showSuper' colorChoooserPtr

mode' :: (Ptr ()) -> IO ((Int))
mode' a1 =
  let {a1' = id a1} in 
  mode''_ a1' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 315 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ( IO (ColorChooserMode))) => Op (GetMode ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser = withRef color_chooser $ \color_chooserPtr -> mode' color_chooserPtr >>= return . toEnum
setMode' :: (Ptr ()) -> (Int) -> IO ()
setMode' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  setMode''_ a1' a2' >>
  return ()

{-# LINE 318 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ (ColorChooserMode ->  IO ())) => Op (SetMode ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser mode = withRef color_chooser $ \color_chooserPtr -> setMode' color_chooserPtr (fromEnum mode)
hue' :: (Ptr ()) -> IO ((Double))
hue' a1 =
  let {a1' = id a1} in 
  hue''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 321 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ( IO (Either OutOfRange Between0And6))) => Op (GetHue ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    h'' <- hue' color_chooserPtr
    if ((h'' < 0.0) || (h'' >= 6.0))
     then return (Left OutOfRange)
     else return (Right (Between0And6 h''))
saturation' :: (Ptr ()) -> IO ((Double))
saturation' :: Ptr () -> IO Double
saturation' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetDoublePrim
saturation''_ Ptr ()
a1' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CDouble
res ->
  let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
  Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')

{-# LINE 328 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ( IO (Either OutOfRange Between0And1))) => Op (GetSaturation ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    s'' <- saturation' color_chooserPtr
    if ((s'' < 0.0) || (s'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 s''))
value' :: (Ptr ()) -> IO ((Double))
value' :: Ptr () -> IO Double
value' a1 :: Ptr ()
a1 =
  let {a1' = id a1} in 
  value''_ a1' >>= \res ->
  let {res' = realToFrac res} in
  return (res')

{-# LINE 335 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ( IO (Either OutOfRange Between0And1))) => Op (GetValue ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    v'' <- value' color_chooserPtr
    if ((v'' < 0.0) || (v'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 v''))
r' :: (Ptr ()) -> IO ((Double))
r' :: Ptr () -> IO Double
r' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetDoublePrim
r''_ Ptr ()
a1' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CDouble
res ->
  let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
  Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')

{-# LINE 342 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ( IO (Either OutOfRange Between0And1))) => Op (GetR ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    r'' <- r' color_chooserPtr
    if ((r'' < 0.0) || (r'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 r''))
g' :: (Ptr ()) -> IO ((Double))
g' :: Ptr () -> IO Double
g' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetDoublePrim
g''_ Ptr ()
a1' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CDouble
res ->
  let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
  Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')

{-# LINE 349 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ( IO (Either OutOfRange Between0And1))) => Op (GetG ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    g'' <- g' color_chooserPtr
    if ((g'' < 0.0) || (g'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 g''))
b' :: (Ptr ()) -> IO ((Double))
b' :: Ptr () -> IO Double
b' a1 :: Ptr ()
a1 =
  let {a1' :: Ptr ()
a1' = Ptr () -> Ptr ()
forall a. a -> a
id Ptr ()
a1} in 
  GetDoublePrim
b''_ Ptr ()
a1' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CDouble
res ->
  let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
  Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')

{-# LINE 356 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ( IO (Either OutOfRange Between0And1))) => Op (GetB ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser = withRef color_chooser $ \color_chooserPtr -> do
    b'' <- b' color_chooserPtr
    if ((b'' < 0.0) || (b'' > 1.0))
     then return (Left OutOfRange)
     else return (Right (Between0And1 b''))
hsv' :: (Ptr ()) -> (Double) -> (Double) -> (Double) -> IO ((Int))
hsv' :: Ptr () -> Double -> Double -> Double -> IO Int
hsv' a1 :: Ptr ()
a1 a2 :: Double
a2 a3 :: Double
a3 a4 :: Double
a4 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  ColorSetPrim
hsv''_ Ptr ()
a1' CDouble
a2' CDouble
a3' CDouble
a4' IO CInt -> (CInt -> IO Int) -> IO Int
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \res :: CInt
res ->
  let {res' :: Int
res' = CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
res} in
  Int -> IO Int
forall (m :: * -> *) a. Monad m => a -> m a
return (Int
res')

{-# LINE 363 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ((Between0And6, Between0And1, Between0And1) ->  IO (Either NoChange ()))) => Op (SetHsv ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser (Between0And6 h'', Between0And1 s'', Between0And1 v'') =
    withRef color_chooser $ \color_chooserPtr -> do
      ret <- hsv' color_chooserPtr h'' s'' v''
      if (ret == 0) then return (Left NoChange) else return (Right ())
rgb' :: (Ptr ()) -> (Double) -> (Double) -> (Double) -> IO ((Int))
rgb' a1 a2 a3 a4 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  let {a3' = realToFrac a3} in 
  let {a4' = realToFrac a4} in 
  rgb''_ a1' a2' a3' a4' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 369 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ ((Between0And1, Between0And1, Between0And1) ->  IO (Either NoChange ()))) => Op (SetRgb ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser (Between0And1 r'', Between0And1 g'', Between0And1 b'') =
    withRef color_chooser $ \color_chooserPtr -> do
      ret <- rgb' color_chooserPtr r'' g'' b''
      if (ret == 0) then return (Left NoChange) else return (Right ())
draw' :: (Ptr ()) -> IO ()
draw' a1 =
  let {a1' = id a1} in 
  draw''_ a1' >>
  return ()

{-# LINE 375 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ (  IO ())) => Op (Draw ()) ColorChooserBase orig impl where
  runOp _ _ colorChooser = withRef colorChooser $ \colorChooserPtr -> draw' colorChooserPtr
colorChooserHandle' :: (Ptr ()) -> (CInt) -> IO ((Int))
colorChooserHandle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = id a2} in 
  colorChooserHandle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 378 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ (Event -> IO (Either UnknownEvent ()))) => Op (Handle ()) ColorChooserBase orig impl where
  runOp _ _ colorChooser event = withRef colorChooser (\p -> colorChooserHandle' p (fromIntegral . fromEnum $ event)) >>= return  . successOrUnknownEvent
hide' :: (Ptr ()) -> IO ()
hide' a1 =
  let {a1' = id a1} in 
  hide''_ a1' >>
  return ()

{-# LINE 381 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ (  IO ())) => Op (Hide ()) ColorChooserBase orig impl where
  runOp _ _ colorChooser = withRef colorChooser $ \colorChooserPtr -> hide' colorChooserPtr
show' :: (Ptr ()) -> IO ()
show' a1 =
  let {a1' = id a1} in 
  show''_ a1' >>
  return ()

{-# LINE 384 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ (  IO ())) => Op (ShowWidget ()) ColorChooserBase orig impl where
  runOp _ _ colorChooser = withRef colorChooser $ \colorChooserPtr -> show' colorChooserPtr
resize' :: (Ptr ()) -> (Int) -> (Int) -> (Int) -> (Int) -> IO ((()))
resize' a1 a2 a3 a4 a5 =
  let {a1' = id a1} in 
  let {a2' = fromIntegral a2} in 
  let {a3' = fromIntegral a3} in 
  let {a4' = fromIntegral a4} in 
  let {a5' = fromIntegral a5} in 
  resize''_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 387 "src/Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs" #-}

instance (impl ~ (Rectangle -> IO ())) => Op (Resize ()) ColorChooserBase orig impl where
  runOp _ _ colorChooser rectangle = withRef colorChooser $ \colorChooserPtr -> do
                                 let (x_pos,y_pos,w_pos,h_pos) = fromRectangle rectangle
                                 resize' colorChooserPtr x_pos y_pos w_pos h_pos
instance (impl ~ (IO ( Either OutOfRange (Between0And1, Between0And1, Between0And1)))) => Op (GetRgb ()) ColorChooserBase orig impl where
  runOp _ _ color_chooser = do
    _r <- getR color_chooser
    _g <- getG color_chooser
    _b <- getB color_chooser
    return (do
      r <- _r
      g <- _g
      b <- _b
      return (r,g,b))

instance (impl ~ (IO ( Either OutOfRange (Between0And6, Between0And1, Between0And1)))) => Op (GetHsv ()) ColorChooserBase orig impl where
  runOp :: GetHsv () -> orig -> Ref ColorChooserBase -> impl
runOp _ _ color_chooser :: Ref ColorChooserBase
color_chooser = do
    Either OutOfRange Between0And6
_h <- Ref ColorChooserBase -> IO (Either OutOfRange Between0And6)
forall r a impl.
(HasCallStack, Match r ~ FindOp a a (GetHue ()),
 Op (GetHue ()) r a impl) =>
Ref a -> impl
getHue Ref ColorChooserBase
color_chooser
    Either OutOfRange Between0And1
_s <- Ref ColorChooserBase -> IO (Either OutOfRange Between0And1)
forall r a impl.
(HasCallStack, Match r ~ FindOp a a (GetSaturation ()),
 Op (GetSaturation ()) r a impl) =>
Ref a -> impl
getSaturation Ref ColorChooserBase
color_chooser
    Either OutOfRange Between0And1
_v <- Ref ColorChooserBase -> IO (Either OutOfRange Between0And1)
forall r a impl.
(HasCallStack, Match r ~ FindOp a a (GetValue ()),
 Op (GetValue ()) r a impl) =>
Ref a -> impl
getValue Ref ColorChooserBase
color_chooser
    Either OutOfRange (Between0And6, Between0And1, Between0And1)
-> IO
     (Either OutOfRange (Between0And6, Between0And1, Between0And1))
forall (m :: * -> *) a. Monad m => a -> m a
return (do
      Between0And6
h <- Either OutOfRange Between0And6
_h
      Between0And1
s <- Either OutOfRange Between0And1
_s
      Between0And1
v <- Either OutOfRange Between0And1
_v
      (Between0And6, Between0And1, Between0And1)
-> Either OutOfRange (Between0And6, Between0And1, Between0And1)
forall (m :: * -> *) a. Monad m => a -> m a
return (Between0And6
h,Between0And1
s,Between0And1
v))


-- $hierarchy
-- @
-- "Graphics.UI.FLTK.LowLevel.Base.Widget"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Base.Group"
--  |
--  v
-- "Graphics.UI.FLTK.LowLevel.Base.ColorChooser"
-- @

-- $functions
-- @
-- draw :: 'Ref' 'ColorChooserBase' -> 'IO' ()
--
-- getB :: 'Ref' 'ColorChooserBase' -> 'IO' ('Either' 'OutOfRange' 'Between0And1')
--
-- getG :: 'Ref' 'ColorChooserBase' -> 'IO' ('Either' 'OutOfRange' 'Between0And1')
--
-- getHsv :: 'Ref' 'ColorChooserBase' -> 'IO' ( 'Either' 'OutOfRange' ('Between0And6', 'Between0And1', 'Between0And1'))
--
-- getHue :: 'Ref' 'ColorChooserBase' -> 'IO' ('Either' 'OutOfRange' 'Between0And6')
--
-- getMode :: 'Ref' 'ColorChooserBase' -> 'IO' ('ColorChooserMode')
--
-- getR :: 'Ref' 'ColorChooserBase' -> 'IO' ('Either' 'OutOfRange' 'Between0And1')
--
-- getRgb :: 'Ref' 'ColorChooserBase' -> 'IO' ( 'Either' 'OutOfRange' ('Between0And1', 'Between0And1', 'Between0And1'))
--
-- getSaturation :: 'Ref' 'ColorChooserBase' -> 'IO' ('Either' 'OutOfRange' 'Between0And1')
--
-- getValue :: 'Ref' 'ColorChooserBase' -> 'IO' ('Either' 'OutOfRange' 'Between0And1')
--
-- handle :: 'Ref' 'ColorChooserBase' -> 'Event' -> 'IO' ('Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'ColorChooserBase' -> 'IO' ()
--
-- resize :: 'Ref' 'ColorChooserBase' -> 'Rectangle' -> 'IO' ()
--
-- setHsv :: 'Ref' 'ColorChooserBase' -> ('Between0And6', 'Between0And1', 'Between0And1') -> 'IO' ('Either' 'NoChange' ())
--
-- setMode :: 'Ref' 'ColorChooserBase' -> 'ColorChooserMode' -> 'IO' ()
--
-- setRgb :: 'Ref' 'ColorChooserBase' -> ('Between0And1', 'Between0And1', 'Between0And1') -> 'IO' ('Either' 'NoChange' ())
--
-- showWidget :: 'Ref' 'ColorChooserBase' -> 'IO' ()
-- @

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_OverriddenColor_Chooser_New_WithLabel"
  overriddenWidgetNewWithLabel''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ())))))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_OverriddenColor_Chooser_New"
  overriddenWidgetNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr ()) -> ((C2HSImp.Ptr ()) -> (IO (C2HSImp.Ptr ()))))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_New"
  colorchooserNew''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO (C2HSImp.Ptr ()))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_New_WithLabel"
  colorchooserNewWithLabel''_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> ((C2HSImp.Ptr C2HSImp.CChar) -> (IO (C2HSImp.Ptr ())))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_hsv2rgb"
  hsv2rgb''_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (IO ())))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_rgb2hsv"
  rgb2hsv''_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (IO ())))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h flc_color_chooser_with_m"
  flc_color_chooser_with_m''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> ((C2HSImp.Ptr C2HSImp.CDouble) -> (C2HSImp.CInt -> (IO C2HSImp.CInt))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h flc_color_chooser_with_uchar_m"
  flc_color_chooser_with_uchar_m''_ :: ((C2HSImp.Ptr C2HSImp.CChar) -> ((C2HSImp.Ptr C2HSImp.CUChar) -> ((C2HSImp.Ptr C2HSImp.CUChar) -> ((C2HSImp.Ptr C2HSImp.CUChar) -> (C2HSImp.CInt -> (IO C2HSImp.CInt))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_mode_super"
  modeSuper''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_set_mode_super"
  setModeSuper''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_hue_super"
  hueSuper''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_saturation_super"
  saturationSuper''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_value_super"
  valueSuper''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_r_super"
  rSuper''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_g_super"
  gSuper''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_b_super"
  bSuper''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_hsv_super"
  hsvSuper''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CInt)))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_rgb_super"
  rgbSuper''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CInt)))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_draw_super"
  drawSuper''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_handle_super"
  handleSuper''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_resize_super"
  resizeSuper''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_hide_super"
  hideSuper''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_show_super"
  showSuper''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_mode"
  mode''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CInt))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_set_mode"
  setMode''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO ())))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_hue"
  hue''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_saturation"
  saturation''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_value"
  value''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_r"
  r''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_g"
  g''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_b"
  b''_ :: ((C2HSImp.Ptr ()) -> (IO C2HSImp.CDouble))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_hsv"
  hsv''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CInt)))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_rgb"
  rgb''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (IO C2HSImp.CInt)))))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_draw"
  draw''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_handle"
  colorChooserHandle''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_hide"
  hide''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_show"
  show''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/Base/ColorChooser.chs.h Fl_Color_Chooser_resize"
  resize''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO ()))))))