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

class (ITNamed a, ITAttLine a, ITAttFill a, ITAttMarker a,
       ITAttText a) =>
      ITStyle a where

upcastTStyle :: forall a . (FPtr a, ITStyle a) => a -> TStyle
upcastTStyle :: forall a. (FPtr a, ITStyle a) => a -> TStyle
upcastTStyle a
h
  = let fh :: Ptr (Raw a)
fh = a -> Ptr (Raw a)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr a
h
        Ptr RawTStyle
fh2 :: Ptr RawTStyle = Ptr (Raw a) -> Ptr RawTStyle
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw TStyle) -> TStyle
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw TStyle)
Ptr RawTStyle
fh2

downcastTStyle :: forall a . (FPtr a, ITStyle a) => TStyle -> a
downcastTStyle :: forall a. (FPtr a, ITStyle a) => TStyle -> a
downcastTStyle TStyle
h
  = let fh :: Ptr (Raw TStyle)
fh = TStyle -> Ptr (Raw TStyle)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr TStyle
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawTStyle -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw TStyle)
Ptr RawTStyle
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2