{-# LANGUAGE CPP, FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, ScopedTypeVariables, TypeSynonymInstances, UndecidableInstances #-}
#if !MIN_VERSION_base(4,8,0)
{-# LANGUAGE OverlappingInstances #-}
#endif

---------- GENERATED FILE, EDITS WILL BE LOST ----------

module Graphics.UI.Qtah.Generated.Gui.QRasterWindow (
  castQRasterWindowToQPaintDeviceWindow,
  castQPaintDeviceWindowToQRasterWindow,
  castQRasterWindowToQWindow,
  castQWindowToQRasterWindow,
  castQRasterWindowToQObject,
  castQObjectToQRasterWindow,
  castQRasterWindowToQSurface,
  castQSurfaceToQRasterWindow,
  castQRasterWindowToQPaintDevice,
  castQPaintDeviceToQRasterWindow,
  QRasterWindowValue (..),
  QRasterWindowConstPtr (..),
  QRasterWindowPtr (..),
  QRasterWindowConst (..),
  castQRasterWindowToConst,
  QRasterWindow (..),
  castQRasterWindowToNonconst,
  new,
  newWithParent,
  QRasterWindowSuper (..),
  QRasterWindowSuperConst (..),
  ) where

import qualified Foreign as HoppyF
import qualified Foreign.Hoppy.Runtime as HoppyFHR
import qualified Graphics.UI.Qtah.Generated.Core.QObject as M30
import qualified Graphics.UI.Qtah.Generated.Gui.QPaintDevice as M120
import qualified Graphics.UI.Qtah.Generated.Gui.QPaintDeviceWindow as M122
import qualified Graphics.UI.Qtah.Generated.Gui.QSurface as M142
import qualified Graphics.UI.Qtah.Generated.Gui.QWindow as M150
import Prelude (($), (.), (==))
import qualified Prelude as HoppyP

foreign import ccall "genpop__QRasterWindow_new" new' ::  HoppyP.IO (HoppyF.Ptr QRasterWindow)
foreign import ccall "genpop__QRasterWindow_newWithParent" newWithParent' ::  HoppyF.Ptr M150.QWindow -> HoppyP.IO (HoppyF.Ptr QRasterWindow)
foreign import ccall "gencast__QRasterWindow__QPaintDeviceWindow" castQRasterWindowToQPaintDeviceWindow :: HoppyF.Ptr QRasterWindowConst -> HoppyF.Ptr M122.QPaintDeviceWindowConst
foreign import ccall "gencast__QPaintDeviceWindow__QRasterWindow" castQPaintDeviceWindowToQRasterWindow :: HoppyF.Ptr M122.QPaintDeviceWindowConst -> HoppyF.Ptr QRasterWindowConst
foreign import ccall "gencast__QRasterWindow__QWindow" castQRasterWindowToQWindow :: HoppyF.Ptr QRasterWindowConst -> HoppyF.Ptr M150.QWindowConst
foreign import ccall "gencast__QWindow__QRasterWindow" castQWindowToQRasterWindow :: HoppyF.Ptr M150.QWindowConst -> HoppyF.Ptr QRasterWindowConst
foreign import ccall "gencast__QRasterWindow__QObject" castQRasterWindowToQObject :: HoppyF.Ptr QRasterWindowConst -> HoppyF.Ptr M30.QObjectConst
foreign import ccall "gencast__QObject__QRasterWindow" castQObjectToQRasterWindow :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr QRasterWindowConst
foreign import ccall "gencast__QRasterWindow__QSurface" castQRasterWindowToQSurface :: HoppyF.Ptr QRasterWindowConst -> HoppyF.Ptr M142.QSurfaceConst
foreign import ccall "gencast__QSurface__QRasterWindow" castQSurfaceToQRasterWindow :: HoppyF.Ptr M142.QSurfaceConst -> HoppyF.Ptr QRasterWindowConst
foreign import ccall "gencast__QRasterWindow__QPaintDevice" castQRasterWindowToQPaintDevice :: HoppyF.Ptr QRasterWindowConst -> HoppyF.Ptr M120.QPaintDeviceConst
foreign import ccall "gencast__QPaintDevice__QRasterWindow" castQPaintDeviceToQRasterWindow :: HoppyF.Ptr M120.QPaintDeviceConst -> HoppyF.Ptr QRasterWindowConst
foreign import ccall "gendel__QRasterWindow" delete'QRasterWindow :: HoppyF.Ptr QRasterWindowConst -> HoppyP.IO ()
foreign import ccall "&gendel__QRasterWindow" deletePtr'QRasterWindow :: HoppyF.FunPtr (HoppyF.Ptr QRasterWindowConst -> HoppyP.IO ())

class QRasterWindowValue a where
  withQRasterWindowPtr :: a -> (QRasterWindowConst -> HoppyP.IO b) -> HoppyP.IO b

#if MIN_VERSION_base(4,8,0)
instance {-# OVERLAPPABLE #-} QRasterWindowConstPtr a => QRasterWindowValue a where
#else
instance QRasterWindowConstPtr a => QRasterWindowValue a where
#endif
  withQRasterWindowPtr = HoppyP.flip ($) . toQRasterWindowConst

class (M122.QPaintDeviceWindowConstPtr this) => QRasterWindowConstPtr this where
  toQRasterWindowConst :: this -> QRasterWindowConst

class (QRasterWindowConstPtr this, M122.QPaintDeviceWindowPtr this) => QRasterWindowPtr this where
  toQRasterWindow :: this -> QRasterWindow

data QRasterWindowConst =
    QRasterWindowConst (HoppyF.Ptr QRasterWindowConst)
  | QRasterWindowConstGc (HoppyF.ForeignPtr ()) (HoppyF.Ptr QRasterWindowConst)
  deriving (HoppyP.Show)

instance HoppyP.Eq QRasterWindowConst where
  x == y = HoppyFHR.toPtr x == HoppyFHR.toPtr y

instance HoppyP.Ord QRasterWindowConst where
  compare x y = HoppyP.compare (HoppyFHR.toPtr x) (HoppyFHR.toPtr y)

castQRasterWindowToConst :: QRasterWindow -> QRasterWindowConst
castQRasterWindowToConst (QRasterWindow ptr') = QRasterWindowConst $ HoppyF.castPtr ptr'
castQRasterWindowToConst (QRasterWindowGc fptr' ptr') = QRasterWindowConstGc fptr' $ HoppyF.castPtr ptr'

instance HoppyFHR.CppPtr QRasterWindowConst where
  nullptr = QRasterWindowConst HoppyF.nullPtr
  
  withCppPtr (QRasterWindowConst ptr') f' = f' ptr'
  withCppPtr (QRasterWindowConstGc fptr' ptr') f' = HoppyF.withForeignPtr fptr' $ \_ -> f' ptr'
  
  toPtr (QRasterWindowConst ptr') = ptr'
  toPtr (QRasterWindowConstGc _ ptr') = ptr'
  
  touchCppPtr (QRasterWindowConst _) = HoppyP.return ()
  touchCppPtr (QRasterWindowConstGc fptr' _) = HoppyF.touchForeignPtr fptr'

instance HoppyFHR.Deletable QRasterWindowConst where
  delete (QRasterWindowConst ptr') = delete'QRasterWindow ptr'
  delete (QRasterWindowConstGc _ _) = HoppyP.fail $ HoppyP.concat ["Deletable.delete: Asked to delete a GC-managed ", "QRasterWindowConst", " object."]
  
  toGc this'@(QRasterWindowConst ptr') = if ptr' == HoppyF.nullPtr then HoppyP.return this' else HoppyP.fmap (HoppyP.flip QRasterWindowConstGc ptr') $ HoppyF.newForeignPtr (HoppyF.castFunPtr deletePtr'QRasterWindow :: HoppyF.FunPtr (HoppyF.Ptr () -> HoppyP.IO ())) (HoppyF.castPtr ptr' :: HoppyF.Ptr ())
  toGc this'@(QRasterWindowConstGc {}) = HoppyP.return this'

instance QRasterWindowConstPtr QRasterWindowConst where
  toQRasterWindowConst = HoppyP.id

instance M122.QPaintDeviceWindowConstPtr QRasterWindowConst where
  toQPaintDeviceWindowConst (QRasterWindowConst ptr') = M122.QPaintDeviceWindowConst $ castQRasterWindowToQPaintDeviceWindow ptr'
  toQPaintDeviceWindowConst (QRasterWindowConstGc fptr' ptr') = M122.QPaintDeviceWindowConstGc fptr' $ castQRasterWindowToQPaintDeviceWindow ptr'

instance M150.QWindowConstPtr QRasterWindowConst where
  toQWindowConst (QRasterWindowConst ptr') = M150.QWindowConst $ castQRasterWindowToQWindow ptr'
  toQWindowConst (QRasterWindowConstGc fptr' ptr') = M150.QWindowConstGc fptr' $ castQRasterWindowToQWindow ptr'

instance M30.QObjectConstPtr QRasterWindowConst where
  toQObjectConst (QRasterWindowConst ptr') = M30.QObjectConst $ castQRasterWindowToQObject ptr'
  toQObjectConst (QRasterWindowConstGc fptr' ptr') = M30.QObjectConstGc fptr' $ castQRasterWindowToQObject ptr'

instance M142.QSurfaceConstPtr QRasterWindowConst where
  toQSurfaceConst (QRasterWindowConst ptr') = M142.QSurfaceConst $ castQRasterWindowToQSurface ptr'
  toQSurfaceConst (QRasterWindowConstGc fptr' ptr') = M142.QSurfaceConstGc fptr' $ castQRasterWindowToQSurface ptr'

instance M120.QPaintDeviceConstPtr QRasterWindowConst where
  toQPaintDeviceConst (QRasterWindowConst ptr') = M120.QPaintDeviceConst $ castQRasterWindowToQPaintDevice ptr'
  toQPaintDeviceConst (QRasterWindowConstGc fptr' ptr') = M120.QPaintDeviceConstGc fptr' $ castQRasterWindowToQPaintDevice ptr'

data QRasterWindow =
    QRasterWindow (HoppyF.Ptr QRasterWindow)
  | QRasterWindowGc (HoppyF.ForeignPtr ()) (HoppyF.Ptr QRasterWindow)
  deriving (HoppyP.Show)

instance HoppyP.Eq QRasterWindow where
  x == y = HoppyFHR.toPtr x == HoppyFHR.toPtr y

instance HoppyP.Ord QRasterWindow where
  compare x y = HoppyP.compare (HoppyFHR.toPtr x) (HoppyFHR.toPtr y)

castQRasterWindowToNonconst :: QRasterWindowConst -> QRasterWindow
castQRasterWindowToNonconst (QRasterWindowConst ptr') = QRasterWindow $ HoppyF.castPtr ptr'
castQRasterWindowToNonconst (QRasterWindowConstGc fptr' ptr') = QRasterWindowGc fptr' $ HoppyF.castPtr ptr'

instance HoppyFHR.CppPtr QRasterWindow where
  nullptr = QRasterWindow HoppyF.nullPtr
  
  withCppPtr (QRasterWindow ptr') f' = f' ptr'
  withCppPtr (QRasterWindowGc fptr' ptr') f' = HoppyF.withForeignPtr fptr' $ \_ -> f' ptr'
  
  toPtr (QRasterWindow ptr') = ptr'
  toPtr (QRasterWindowGc _ ptr') = ptr'
  
  touchCppPtr (QRasterWindow _) = HoppyP.return ()
  touchCppPtr (QRasterWindowGc fptr' _) = HoppyF.touchForeignPtr fptr'

instance HoppyFHR.Deletable QRasterWindow where
  delete (QRasterWindow ptr') = delete'QRasterWindow $ (HoppyF.castPtr ptr' :: HoppyF.Ptr QRasterWindowConst)
  delete (QRasterWindowGc _ _) = HoppyP.fail $ HoppyP.concat ["Deletable.delete: Asked to delete a GC-managed ", "QRasterWindow", " object."]
  
  toGc this'@(QRasterWindow ptr') = if ptr' == HoppyF.nullPtr then HoppyP.return this' else HoppyP.fmap (HoppyP.flip QRasterWindowGc ptr') $ HoppyF.newForeignPtr (HoppyF.castFunPtr deletePtr'QRasterWindow :: HoppyF.FunPtr (HoppyF.Ptr () -> HoppyP.IO ())) (HoppyF.castPtr ptr' :: HoppyF.Ptr ())
  toGc this'@(QRasterWindowGc {}) = HoppyP.return this'

instance QRasterWindowConstPtr QRasterWindow where
  toQRasterWindowConst (QRasterWindow ptr') = QRasterWindowConst $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQRasterWindowConst (QRasterWindowGc fptr' ptr') = QRasterWindowConstGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance QRasterWindowPtr QRasterWindow where
  toQRasterWindow = HoppyP.id

instance M122.QPaintDeviceWindowConstPtr QRasterWindow where
  toQPaintDeviceWindowConst (QRasterWindow ptr') = M122.QPaintDeviceWindowConst $ castQRasterWindowToQPaintDeviceWindow $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQPaintDeviceWindowConst (QRasterWindowGc fptr' ptr') = M122.QPaintDeviceWindowConstGc fptr' $ castQRasterWindowToQPaintDeviceWindow $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M122.QPaintDeviceWindowPtr QRasterWindow where
  toQPaintDeviceWindow (QRasterWindow ptr') = M122.QPaintDeviceWindow $ (HoppyF.castPtr :: HoppyF.Ptr M122.QPaintDeviceWindowConst -> HoppyF.Ptr M122.QPaintDeviceWindow) $ castQRasterWindowToQPaintDeviceWindow $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQPaintDeviceWindow (QRasterWindowGc fptr' ptr') = M122.QPaintDeviceWindowGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M122.QPaintDeviceWindowConst -> HoppyF.Ptr M122.QPaintDeviceWindow) $ castQRasterWindowToQPaintDeviceWindow $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M150.QWindowConstPtr QRasterWindow where
  toQWindowConst (QRasterWindow ptr') = M150.QWindowConst $ castQRasterWindowToQWindow $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQWindowConst (QRasterWindowGc fptr' ptr') = M150.QWindowConstGc fptr' $ castQRasterWindowToQWindow $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M150.QWindowPtr QRasterWindow where
  toQWindow (QRasterWindow ptr') = M150.QWindow $ (HoppyF.castPtr :: HoppyF.Ptr M150.QWindowConst -> HoppyF.Ptr M150.QWindow) $ castQRasterWindowToQWindow $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQWindow (QRasterWindowGc fptr' ptr') = M150.QWindowGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M150.QWindowConst -> HoppyF.Ptr M150.QWindow) $ castQRasterWindowToQWindow $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M30.QObjectConstPtr QRasterWindow where
  toQObjectConst (QRasterWindow ptr') = M30.QObjectConst $ castQRasterWindowToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQObjectConst (QRasterWindowGc fptr' ptr') = M30.QObjectConstGc fptr' $ castQRasterWindowToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M30.QObjectPtr QRasterWindow where
  toQObject (QRasterWindow ptr') = M30.QObject $ (HoppyF.castPtr :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr M30.QObject) $ castQRasterWindowToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQObject (QRasterWindowGc fptr' ptr') = M30.QObjectGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M30.QObjectConst -> HoppyF.Ptr M30.QObject) $ castQRasterWindowToQObject $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M142.QSurfaceConstPtr QRasterWindow where
  toQSurfaceConst (QRasterWindow ptr') = M142.QSurfaceConst $ castQRasterWindowToQSurface $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQSurfaceConst (QRasterWindowGc fptr' ptr') = M142.QSurfaceConstGc fptr' $ castQRasterWindowToQSurface $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M142.QSurfacePtr QRasterWindow where
  toQSurface (QRasterWindow ptr') = M142.QSurface $ (HoppyF.castPtr :: HoppyF.Ptr M142.QSurfaceConst -> HoppyF.Ptr M142.QSurface) $ castQRasterWindowToQSurface $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQSurface (QRasterWindowGc fptr' ptr') = M142.QSurfaceGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M142.QSurfaceConst -> HoppyF.Ptr M142.QSurface) $ castQRasterWindowToQSurface $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M120.QPaintDeviceConstPtr QRasterWindow where
  toQPaintDeviceConst (QRasterWindow ptr') = M120.QPaintDeviceConst $ castQRasterWindowToQPaintDevice $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQPaintDeviceConst (QRasterWindowGc fptr' ptr') = M120.QPaintDeviceConstGc fptr' $ castQRasterWindowToQPaintDevice $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

instance M120.QPaintDevicePtr QRasterWindow where
  toQPaintDevice (QRasterWindow ptr') = M120.QPaintDevice $ (HoppyF.castPtr :: HoppyF.Ptr M120.QPaintDeviceConst -> HoppyF.Ptr M120.QPaintDevice) $ castQRasterWindowToQPaintDevice $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'
  toQPaintDevice (QRasterWindowGc fptr' ptr') = M120.QPaintDeviceGc fptr' $ (HoppyF.castPtr :: HoppyF.Ptr M120.QPaintDeviceConst -> HoppyF.Ptr M120.QPaintDevice) $ castQRasterWindowToQPaintDevice $ (HoppyF.castPtr :: HoppyF.Ptr QRasterWindow -> HoppyF.Ptr QRasterWindowConst) ptr'

new ::  HoppyP.IO QRasterWindow
new =
  HoppyP.fmap QRasterWindow
  (new')

newWithParent :: (M150.QWindowPtr arg'1) => arg'1 -> HoppyP.IO QRasterWindow
newWithParent arg'1 =
  HoppyFHR.withCppPtr (M150.toQWindow arg'1) $ \arg'1' ->
  HoppyP.fmap QRasterWindow
  (newWithParent' arg'1')

class QRasterWindowSuper a where
  downToQRasterWindow :: a -> QRasterWindow

instance QRasterWindowSuper M122.QPaintDeviceWindow where
  downToQRasterWindow = castQRasterWindowToNonconst . cast' . M122.castQPaintDeviceWindowToConst
    where
      cast' (M122.QPaintDeviceWindowConst ptr') = QRasterWindowConst $ castQPaintDeviceWindowToQRasterWindow ptr'
      cast' (M122.QPaintDeviceWindowConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQPaintDeviceWindowToQRasterWindow ptr'
instance QRasterWindowSuper M150.QWindow where
  downToQRasterWindow = castQRasterWindowToNonconst . cast' . M150.castQWindowToConst
    where
      cast' (M150.QWindowConst ptr') = QRasterWindowConst $ castQWindowToQRasterWindow ptr'
      cast' (M150.QWindowConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQWindowToQRasterWindow ptr'
instance QRasterWindowSuper M30.QObject where
  downToQRasterWindow = castQRasterWindowToNonconst . cast' . M30.castQObjectToConst
    where
      cast' (M30.QObjectConst ptr') = QRasterWindowConst $ castQObjectToQRasterWindow ptr'
      cast' (M30.QObjectConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQObjectToQRasterWindow ptr'
instance QRasterWindowSuper M142.QSurface where
  downToQRasterWindow = castQRasterWindowToNonconst . cast' . M142.castQSurfaceToConst
    where
      cast' (M142.QSurfaceConst ptr') = QRasterWindowConst $ castQSurfaceToQRasterWindow ptr'
      cast' (M142.QSurfaceConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQSurfaceToQRasterWindow ptr'
instance QRasterWindowSuper M120.QPaintDevice where
  downToQRasterWindow = castQRasterWindowToNonconst . cast' . M120.castQPaintDeviceToConst
    where
      cast' (M120.QPaintDeviceConst ptr') = QRasterWindowConst $ castQPaintDeviceToQRasterWindow ptr'
      cast' (M120.QPaintDeviceConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQPaintDeviceToQRasterWindow ptr'

class QRasterWindowSuperConst a where
  downToQRasterWindowConst :: a -> QRasterWindowConst

instance QRasterWindowSuperConst M122.QPaintDeviceWindowConst where
  downToQRasterWindowConst = cast'
    where
      cast' (M122.QPaintDeviceWindowConst ptr') = QRasterWindowConst $ castQPaintDeviceWindowToQRasterWindow ptr'
      cast' (M122.QPaintDeviceWindowConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQPaintDeviceWindowToQRasterWindow ptr'
instance QRasterWindowSuperConst M150.QWindowConst where
  downToQRasterWindowConst = cast'
    where
      cast' (M150.QWindowConst ptr') = QRasterWindowConst $ castQWindowToQRasterWindow ptr'
      cast' (M150.QWindowConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQWindowToQRasterWindow ptr'
instance QRasterWindowSuperConst M30.QObjectConst where
  downToQRasterWindowConst = cast'
    where
      cast' (M30.QObjectConst ptr') = QRasterWindowConst $ castQObjectToQRasterWindow ptr'
      cast' (M30.QObjectConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQObjectToQRasterWindow ptr'
instance QRasterWindowSuperConst M142.QSurfaceConst where
  downToQRasterWindowConst = cast'
    where
      cast' (M142.QSurfaceConst ptr') = QRasterWindowConst $ castQSurfaceToQRasterWindow ptr'
      cast' (M142.QSurfaceConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQSurfaceToQRasterWindow ptr'
instance QRasterWindowSuperConst M120.QPaintDeviceConst where
  downToQRasterWindowConst = cast'
    where
      cast' (M120.QPaintDeviceConst ptr') = QRasterWindowConst $ castQPaintDeviceToQRasterWindow ptr'
      cast' (M120.QPaintDeviceConstGc fptr' ptr') = QRasterWindowConstGc fptr' $ castQPaintDeviceToQRasterWindow ptr'

instance HoppyFHR.Assignable (HoppyF.Ptr (HoppyF.Ptr QRasterWindow)) QRasterWindow where
  assign ptr' value' = HoppyF.poke ptr' $ HoppyFHR.toPtr value'

instance HoppyFHR.Decodable (HoppyF.Ptr (HoppyF.Ptr QRasterWindow)) QRasterWindow where
  decode = HoppyP.fmap QRasterWindow . HoppyF.peek