-- 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/GlWindow.chs" #-}
{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses, FlexibleContexts #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.UI.FLTK.LowLevel.GlWindow
where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp




import Foreign
import Foreign.C
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.Fl_Enumerations
import Graphics.UI.FLTK.LowLevel.Utils
import Graphics.UI.FLTK.LowLevel.Dispatch
import Graphics.UI.FLTK.LowLevel.Hierarchy

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

{-# LINE 15 "src/Graphics/UI/FLTK/LowLevel/GlWindow.chs" #-}

instance (impl ~ ( IO ())) => Op (Flush ()) GlWindow orig impl where
  runOp _ _ win = withRef win $ \winPtr -> flush' winPtr
hide' :: (Ptr ()) -> IO ((()))
hide' a1 =
  let {a1' = id a1} in 
  hide''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 18 "src/Graphics/UI/FLTK/LowLevel/GlWindow.chs" #-}

instance (impl ~ ( IO ())) => Op (Hide ()) GlWindow orig impl where
  runOp _ _ win = withRef win $ \winPtr -> hide' winPtr
show' :: (Ptr ()) -> IO ((()))
show' a1 =
  let {a1' = id a1} in 
  show''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 21 "src/Graphics/UI/FLTK/LowLevel/GlWindow.chs" #-}

instance (impl ~ ( IO ())) => Op (ShowWidget ()) GlWindow orig impl where
  runOp _ _ win = withRef win $ \winPtr -> show' winPtr
handle' :: (Ptr ()) -> (Event) -> IO ((Int))
handle' a1 a2 =
  let {a1' = id a1} in 
  let {a2' = cFromEnum a2} in 
  handle''_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  return (res')

{-# LINE 24 "src/Graphics/UI/FLTK/LowLevel/GlWindow.chs" #-}

instance (impl ~ (Event ->  IO(Either UnknownEvent ()))) => Op (Handle ()) GlWindow orig impl where
  runOp _ _ self event = withRef self $ \selfPtr -> handle' selfPtr event >>= return  . successOrUnknownEvent
windowDestroy' :: (Ptr ()) -> IO ((()))
windowDestroy' a1 =
  let {a1' = id a1} in 
  windowDestroy''_ a1' >>= \res ->
  let {res' = supressWarningAboutRes res} in
  return (res')

{-# LINE 27 "src/Graphics/UI/FLTK/LowLevel/GlWindow.chs" #-}

instance (impl ~ (IO ())) => Op (Destroy ()) GlWindow orig impl where
  runOp _ _ win = withRef win $ \winPtr -> windowDestroy' winPtr
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 30 "src/Graphics/UI/FLTK/LowLevel/GlWindow.chs" #-}

instance (impl ~ (Rectangle ->  IO ())) => Op (Resize ()) GlWindow orig impl where
  runOp _ _ win rectangle' =
    let (x_pos', y_pos', width', height') = fromRectangle rectangle' in
    withRef win $ \winPtr -> resize' winPtr x_pos' y_pos' width' height'

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

-- $functions
-- @
-- destroy :: 'Ref' 'GlWindow' -> 'IO' ()
--
-- flush :: 'Ref' 'GlWindow' -> 'IO' ()
--
-- handle :: 'Ref' 'GlWindow' -> 'Event' -> 'IO(Either' 'UnknownEvent' ())
--
-- hide :: 'Ref' 'GlWindow' -> 'IO' ()
--
-- resize :: 'Ref' 'GlWindow' -> 'Rectangle' -> 'IO' ()
--
-- showWidget :: 'Ref' 'GlWindow' -> 'IO' ()
-- @

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/GlWindow.chs.h Fl_DerivedGl_Window_flush"
  flush''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

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

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

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/GlWindow.chs.h Fl_DerivedGl_Window_handle"
  handle''_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CInt)))

foreign import ccall safe "Graphics/UI/FLTK/LowLevel/GlWindow.chs.h Fl_DerivedGl_Window_Destroy"
  windowDestroy''_ :: ((C2HSImp.Ptr ()) -> (IO ()))

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