-- 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/MouseEvent.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.MouseEvent(
initMouseEvent,
getScreenX,
getScreenY,
getClientX,
getClientY,
getCtrlKey,
getShiftKey,
getAltKey,
getMetaKey,
getButton,
getRelatedTarget,
getMovementX,
getMovementY,
getOffsetX,
getOffsetY,
getX,
getY,
getFromElement,
getToElement,
MouseEvent,
castToMouseEvent,
gTypeMouseEvent,
MouseEventClass,
toMouseEvent,
) 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 37 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
import Graphics.UI.Gtk.WebKit.DOM.Enums

 
initMouseEvent ::
               (MonadIO m, MouseEventClass self, WindowClass view,
                EventTargetClass relatedTarget, GlibString string) =>
                 self ->
                   string ->
                     Bool ->
                       Bool ->
                         Maybe view ->
                           Int ->
                             Int ->
                               Int ->
                                 Int ->
                                   Int ->
                                     Bool ->
                                       Bool -> Bool -> Bool -> Word -> Maybe relatedTarget -> m ()
initMouseEvent self type' canBubble cancelable view detail screenX
  screenY clientX clientY ctrlKey altKey shiftKey metaKey button
  relatedTarget
  = liftIO
      (withUTFString type' $
         \ typePtr ->
           (\(MouseEvent arg1) arg2 arg3 arg4 (Window arg5) arg6 arg7 arg8 arg9 arg10 arg11 arg12 arg13 arg14 arg15 (EventTarget arg16) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg5 $ \argPtr5 ->withForeignPtr arg16 $ \argPtr16 ->webkit_dom_mouse_event_init_mouse_event argPtr1 arg2 arg3 arg4 argPtr5 arg6 arg7 arg8 arg9 arg10 arg11 arg12 arg13 arg14 arg15 argPtr16)
{-# LINE 62 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
             (toMouseEvent self)
             typePtr
         (fromBool canBubble)
         (fromBool cancelable)
         (maybe (Window nullForeignPtr) toWindow view)
         (fromIntegral detail)
         (fromIntegral screenX)
         (fromIntegral screenY)
         (fromIntegral clientX)
         (fromIntegral clientY)
         (fromBool ctrlKey)
         (fromBool altKey)
         (fromBool shiftKey)
         (fromBool metaKey)
         (fromIntegral button)
         (maybe (EventTarget nullForeignPtr) toEventTarget relatedTarget))
 
getScreenX :: (MonadIO m, MouseEventClass self) => self -> m Int
getScreenX self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_screen_x argPtr1)
{-# LINE 84 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getScreenY :: (MonadIO m, MouseEventClass self) => self -> m Int
getScreenY self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_screen_y argPtr1)
{-# LINE 91 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getClientX :: (MonadIO m, MouseEventClass self) => self -> m Int
getClientX self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_client_x argPtr1)
{-# LINE 98 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getClientY :: (MonadIO m, MouseEventClass self) => self -> m Int
getClientY self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_client_y argPtr1)
{-# LINE 105 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getCtrlKey :: (MonadIO m, MouseEventClass self) => self -> m Bool
getCtrlKey self
  = liftIO
      (toBool <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_ctrl_key argPtr1)
{-# LINE 112 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getShiftKey :: (MonadIO m, MouseEventClass self) => self -> m Bool
getShiftKey self
  = liftIO
      (toBool <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_shift_key argPtr1)
{-# LINE 119 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getAltKey :: (MonadIO m, MouseEventClass self) => self -> m Bool
getAltKey self
  = liftIO
      (toBool <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_alt_key argPtr1)
{-# LINE 126 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getMetaKey :: (MonadIO m, MouseEventClass self) => self -> m Bool
getMetaKey self
  = liftIO
      (toBool <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_meta_key argPtr1)
{-# LINE 133 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getButton :: (MonadIO m, MouseEventClass self) => self -> m Word
getButton self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_button argPtr1) (toMouseEvent self)))
 
getRelatedTarget ::
                 (MonadIO m, MouseEventClass self) => self -> m (Maybe EventTarget)
getRelatedTarget self
  = liftIO
      (maybeNull (makeNewGObject mkEventTarget)
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_related_target argPtr1)
{-# LINE 147 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getMovementX :: (MonadIO m, MouseEventClass self) => self -> m Int
getMovementX self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_webkit_movement_x argPtr1)
{-# LINE 158 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getMovementY :: (MonadIO m, MouseEventClass self) => self -> m Int
getMovementY self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_webkit_movement_y argPtr1)
{-# LINE 169 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getOffsetX :: (MonadIO m, MouseEventClass self) => self -> m Int
getOffsetX self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_offset_x argPtr1)
{-# LINE 176 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getOffsetY :: (MonadIO m, MouseEventClass self) => self -> m Int
getOffsetY self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_offset_y argPtr1)
{-# LINE 183 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getX :: (MonadIO m, MouseEventClass self) => self -> m Int
getX self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_x argPtr1) (toMouseEvent self)))
 
getY :: (MonadIO m, MouseEventClass self) => self -> m Int
getY self
  = liftIO
      (fromIntegral <$>
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_y argPtr1) (toMouseEvent self)))
 
getFromElement ::
               (MonadIO m, MouseEventClass self) => self -> m (Maybe Node)
getFromElement self
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_from_element argPtr1)
{-# LINE 203 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))
 
getToElement ::
             (MonadIO m, MouseEventClass self) => self -> m (Maybe Node)
getToElement self
  = liftIO
      (maybeNull (makeNewGObject mkNode)
         ((\(MouseEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_mouse_event_get_to_element argPtr1)
{-# LINE 211 "./Graphics/UI/Gtk/WebKit/DOM/MouseEvent.chs" #-}
            (toMouseEvent self)))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_init_mouse_event"
  webkit_dom_mouse_event_init_mouse_event :: ((Ptr MouseEvent) -> ((Ptr CChar) -> (CInt -> (CInt -> ((Ptr Window) -> (CLong -> (CLong -> (CLong -> (CLong -> (CLong -> (CInt -> (CInt -> (CInt -> (CInt -> (CUShort -> ((Ptr EventTarget) -> (IO ())))))))))))))))))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_screen_x"
  webkit_dom_mouse_event_get_screen_x :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_screen_y"
  webkit_dom_mouse_event_get_screen_y :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_client_x"
  webkit_dom_mouse_event_get_client_x :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_client_y"
  webkit_dom_mouse_event_get_client_y :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_ctrl_key"
  webkit_dom_mouse_event_get_ctrl_key :: ((Ptr MouseEvent) -> (IO CInt))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_shift_key"
  webkit_dom_mouse_event_get_shift_key :: ((Ptr MouseEvent) -> (IO CInt))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_alt_key"
  webkit_dom_mouse_event_get_alt_key :: ((Ptr MouseEvent) -> (IO CInt))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_meta_key"
  webkit_dom_mouse_event_get_meta_key :: ((Ptr MouseEvent) -> (IO CInt))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_button"
  webkit_dom_mouse_event_get_button :: ((Ptr MouseEvent) -> (IO CUShort))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_related_target"
  webkit_dom_mouse_event_get_related_target :: ((Ptr MouseEvent) -> (IO (Ptr EventTarget)))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_webkit_movement_x"
  webkit_dom_mouse_event_get_webkit_movement_x :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_webkit_movement_y"
  webkit_dom_mouse_event_get_webkit_movement_y :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_offset_x"
  webkit_dom_mouse_event_get_offset_x :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_offset_y"
  webkit_dom_mouse_event_get_offset_y :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_x"
  webkit_dom_mouse_event_get_x :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_y"
  webkit_dom_mouse_event_get_y :: ((Ptr MouseEvent) -> (IO CLong))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_from_element"
  webkit_dom_mouse_event_get_from_element :: ((Ptr MouseEvent) -> (IO (Ptr Node)))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/MouseEvent.h webkit_dom_mouse_event_get_to_element"
  webkit_dom_mouse_event_get_to_element :: ((Ptr MouseEvent) -> (IO (Ptr Node)))