{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances    #-}
module Graphics.UI.Feckless where

import Data.IORef
import Data.Map (Map)

import Graphics.Rendering.OpenGL

import Graphics.UI.Feckless.Manager

data FlBar = FlBar

data Scope = Global | FecklessBar
    deriving (Show, Eq)

data BarProperty
    = BarHelp !String
    | BarSize !Size
    | BarColor !(Color3 GLfloat)
    deriving (Show, Eq)

type EnumVal a = Map a String

class VarType a where

instance VarType Bool
instance VarType GLfloat
instance VarType GLuint
instance VarType Float

instance VarType a => VarType (Color4 a)
instance VarType a => VarType (Vector4 a)
instance VarType a => VarType (Vertex3 a)

data VarProperty a
    = VarLabel   !String
    | VarMin     !a
    | VarMax     !a
    | VarStep    !a
    | VarKeyIncr !Char
    | VarKeyDecr !Char
    | VarKey     !Char
    | VarHelp    !String
    | VarGroup   !String
    | VarOpened  !Bool
    | VarEnum    !(EnumVal a)
    deriving (Show, Eq)

init :: IO ()
init = return ()

draw :: IORef Manager -> IO ()
draw man = return ()

windowSize :: GLint -> GLint -> IO ()
windowSize width height = return ()

newBar :: String -> IO FlBar
newBar name = return FlBar

define :: Scope -> [BarProperty] -> IO ()
define scope properties = return ()

addVarRW :: VarType a => FlBar
         -> String -- ^ Variable name.
         -> IORef a
         -> [VarProperty a]
         -> IO ()
addVarRW bar name var properties = return ()

addVarCB :: VarType a => FlBar
         -> String
         -> (a -> IO b) -- ^ Set var callback.
         -> IO a -- ^ Get var callback.
         -> Maybe c
         -> [VarProperty a]
         -> IO ()
addVarCB bar name setter getter clientData properties = return ()
