-- GENERATED by C->Haskell Compiler, version 0.13.13 (gtk2hs branch) "Bin IO", 27 May 2012 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "./Graphics/UI/Gtk/WebKit/DOM/UIEvent.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.UIEvent(
initUIEvent,
getView,
getDetail,
getKeyCode,
getCharCode,
getLayerX,
getLayerY,
getPageX,
getPageY,
getWhich,
UIEvent,
castToUIEvent,
gTypeUIEvent,
UIEventClass,
toUIEvent,
) where
import Prelude hiding (drop, error, print)
import Data.Typeable (Typeable)
import Foreign.Marshal (maybePeek, maybeWith)
import System.Glib.FFI (maybeNull, withForeignPtr, nullForeignPtr, Ptr, nullPtr, castPtr, Word, Int64, Word64, CChar(..), CInt(..), CUInt(..), CLong(..), CULong(..), CLLong(..), CULLong(..), CShort(..), CUShort(..), CFloat(..), CDouble(..), toBool, fromBool)
import System.Glib.UTFString (GlibString(..), readUTFString)
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Monad.IO.Class (MonadIO(..))
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventTargetClosures
import Graphics.UI.Gtk.WebKit.Types
{-# LINE 28 "./Graphics/UI/Gtk/WebKit/DOM/UIEvent.chs" #-}
import Graphics.UI.Gtk.WebKit.DOM.Enums

 
initUIEvent ::
            (MonadIO m, UIEventClass self, WindowClass view,
             GlibString string) =>
              self -> string -> Bool -> Bool -> Maybe view -> Int -> m ()
initUIEvent self type' canBubble cancelable view detail
  = liftIO
      (withUTFString type' $
         \ typePtr ->
           (\(UIEvent arg1) arg2 arg3 arg4 (Window arg5) arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg5 $ \argPtr5 ->webkit_dom_ui_event_init_ui_event argPtr1 arg2 arg3 arg4 argPtr5 arg6) (toUIEvent self)
             typePtr
         (fromBool canBubble)
         (fromBool cancelable)
         (maybe (Window nullForeignPtr) toWindow view)
         (fromIntegral detail))
 
getView ::
        (MonadIO m, UIEventClass self) => self -> m (Maybe Window)
getView self
  = liftIO
      (maybeNull (makeNewGObject mkWindow)
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_view argPtr1) (toUIEvent self)))
 
getDetail :: (MonadIO m, UIEventClass self) => self -> m Int
getDetail self
  = liftIO
      (fromIntegral <$>
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_detail argPtr1) (toUIEvent self)))
 
getKeyCode :: (MonadIO m, UIEventClass self) => self -> m Int
getKeyCode self
  = liftIO
      (fromIntegral <$>
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_key_code argPtr1) (toUIEvent self)))
 
getCharCode :: (MonadIO m, UIEventClass self) => self -> m Int
getCharCode self
  = liftIO
      (fromIntegral <$>
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_char_code argPtr1) (toUIEvent self)))
 
getLayerX :: (MonadIO m, UIEventClass self) => self -> m Int
getLayerX self
  = liftIO
      (fromIntegral <$>
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_layer_x argPtr1) (toUIEvent self)))
 
getLayerY :: (MonadIO m, UIEventClass self) => self -> m Int
getLayerY self
  = liftIO
      (fromIntegral <$>
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_layer_y argPtr1) (toUIEvent self)))
 
getPageX :: (MonadIO m, UIEventClass self) => self -> m Int
getPageX self
  = liftIO
      (fromIntegral <$>
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_page_x argPtr1) (toUIEvent self)))
 
getPageY :: (MonadIO m, UIEventClass self) => self -> m Int
getPageY self
  = liftIO
      (fromIntegral <$>
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_page_y argPtr1) (toUIEvent self)))
 
getWhich :: (MonadIO m, UIEventClass self) => self -> m Int
getWhich self
  = liftIO
      (fromIntegral <$>
         ((\(UIEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_ui_event_get_which argPtr1) (toUIEvent self)))

foreign import ccall safe "webkit_dom_ui_event_init_ui_event"
  webkit_dom_ui_event_init_ui_event :: ((Ptr UIEvent) -> ((Ptr CChar) -> (CInt -> (CInt -> ((Ptr Window) -> (CLong -> (IO ())))))))

foreign import ccall safe "webkit_dom_ui_event_get_view"
  webkit_dom_ui_event_get_view :: ((Ptr UIEvent) -> (IO (Ptr Window)))

foreign import ccall safe "webkit_dom_ui_event_get_detail"
  webkit_dom_ui_event_get_detail :: ((Ptr UIEvent) -> (IO CLong))

foreign import ccall safe "webkit_dom_ui_event_get_key_code"
  webkit_dom_ui_event_get_key_code :: ((Ptr UIEvent) -> (IO CLong))

foreign import ccall safe "webkit_dom_ui_event_get_char_code"
  webkit_dom_ui_event_get_char_code :: ((Ptr UIEvent) -> (IO CLong))

foreign import ccall safe "webkit_dom_ui_event_get_layer_x"
  webkit_dom_ui_event_get_layer_x :: ((Ptr UIEvent) -> (IO CLong))

foreign import ccall safe "webkit_dom_ui_event_get_layer_y"
  webkit_dom_ui_event_get_layer_y :: ((Ptr UIEvent) -> (IO CLong))

foreign import ccall safe "webkit_dom_ui_event_get_page_x"
  webkit_dom_ui_event_get_page_x :: ((Ptr UIEvent) -> (IO CLong))

foreign import ccall safe "webkit_dom_ui_event_get_page_y"
  webkit_dom_ui_event_get_page_y :: ((Ptr UIEvent) -> (IO CLong))

foreign import ccall safe "webkit_dom_ui_event_get_which"
  webkit_dom_ui_event_get_which :: ((Ptr UIEvent) -> (IO CLong))