packages feed

HROOT-core-0.9: src/HROOT/Core/TAttText/Interface.hs

{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module HROOT.Core.TAttText.Interface where
import Data.Word
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import HROOT.Core.TAttText.RawType
import HROOT.Core.Deletable.Interface

class IDeletable a => ITAttText a where
        getTextAlign :: a -> IO CInt
        
        getTextAngle :: a -> IO CDouble
        
        getTextColor :: a -> IO CInt
        
        getTextFont :: a -> IO CInt
        
        getTextSize :: a -> IO CDouble
        
        resetAttText :: Castable c0 CString => a -> c0 -> IO ()
        
        setTextAttributes :: a -> IO ()
        
        setTextAlign :: a -> CInt -> IO ()
        
        setTextAngle :: a -> CDouble -> IO ()
        
        setTextColor :: a -> CInt -> IO ()
        
        setTextFont :: a -> CInt -> IO ()
        
        setTextSize :: a -> CDouble -> IO ()
        
        setTextSizePixels :: a -> CInt -> IO ()

upcastTAttText :: forall a . (FPtr a, ITAttText a) => a -> TAttText
upcastTAttText h
  = let fh = get_fptr h
        fh2 :: Ptr RawTAttText = castPtr fh
      in cast_fptr_to_obj fh2

downcastTAttText ::
                 forall a . (FPtr a, ITAttText a) => TAttText -> a
downcastTAttText h
  = let fh = get_fptr h
        fh2 = castPtr fh
      in cast_fptr_to_obj fh2