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


{-# LINE 1 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
module Graphics.UI.Gtk.WebKit.DOM.KeyboardEvent
       (
        keyboardEventGetModifierState, keyboardEventInitKeyboardEvent,
        cKEY_LOCATION_STANDARD, cKEY_LOCATION_LEFT, cKEY_LOCATION_RIGHT,
        cKEY_LOCATION_NUMPAD, keyboardEventGetKeyIdentifier,
        keyboardEventGetKeyLocation, keyboardEventGetCtrlKey,
        keyboardEventGetShiftKey, keyboardEventGetAltKey,
        keyboardEventGetMetaKey, keyboardEventGetAltGraphKey,
        KeyboardEvent, KeyboardEventClass, castToKeyboardEvent,
        gTypeKeyboardEvent, toKeyboardEvent
       )
       where

import System.Glib.FFI
import System.Glib.UTFString
import Control.Applicative
import Graphics.UI.Gtk.WebKit.Types
{-# LINE 20 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventM
 
keyboardEventGetModifierState ::
                              (KeyboardEventClass self, GlibString string) =>
                                self -> string -> IO Bool
keyboardEventGetModifierState self keyIdentifierArg
  = toBool <$>
      (withUTFString keyIdentifierArg $
         \ keyIdentifierArgPtr ->
           (\(KeyboardEvent arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_keyboard_event_get_modifier_state argPtr1 arg2)
{-# LINE 31 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
             (toKeyboardEvent self)
             keyIdentifierArgPtr)
 
keyboardEventInitKeyboardEvent ::
                               (KeyboardEventClass self, DOMWindowClass view,
                                GlibString string) =>
                                 self ->
                                   string ->
                                     Bool ->
                                       Bool ->
                                         Maybe view ->
                                           string ->
                                             Word -> Bool -> Bool -> Bool -> Bool -> Bool -> IO ()
keyboardEventInitKeyboardEvent self type' canBubble cancelable view
  keyIdentifier location ctrlKey altKey shiftKey metaKey altGraphKey
  = withUTFString keyIdentifier $
      \ keyIdentifierPtr ->
        withUTFString type' $
          \ typePtr ->
            (\(KeyboardEvent arg1) arg2 arg3 arg4 (DOMWindow arg5) arg6 arg7 arg8 arg9 arg10 arg11 arg12 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg5 $ \argPtr5 ->webkit_dom_keyboard_event_init_keyboard_event argPtr1 arg2 arg3 arg4 argPtr5 arg6 arg7 arg8 arg9 arg10 arg11 arg12)
{-# LINE 51 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
              (toKeyboardEvent self)
              typePtr
          (fromBool canBubble)
          (fromBool cancelable)
          (maybe (DOMWindow nullForeignPtr) toDOMWindow view)
          keyIdentifierPtr
      (fromIntegral location)
      (fromBool ctrlKey)
      (fromBool altKey)
      (fromBool shiftKey)
      (fromBool metaKey)
      (fromBool altGraphKey)
cKEY_LOCATION_STANDARD = 0
cKEY_LOCATION_LEFT = 1
cKEY_LOCATION_RIGHT = 2
cKEY_LOCATION_NUMPAD = 3
 
keyboardEventGetKeyIdentifier ::
                              (KeyboardEventClass self, GlibString string) => self -> IO string
keyboardEventGetKeyIdentifier self
  = ((\(KeyboardEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_keyboard_event_get_key_identifier argPtr1)
{-# LINE 72 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
       (toKeyboardEvent self))
      >>=
      readUTFString
 
keyboardEventGetKeyLocation ::
                            (KeyboardEventClass self) => self -> IO Word
keyboardEventGetKeyLocation self
  = fromIntegral <$>
      ((\(KeyboardEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_keyboard_event_get_key_location argPtr1)
{-# LINE 81 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
         (toKeyboardEvent self))
 
keyboardEventGetCtrlKey ::
                        (KeyboardEventClass self) => self -> IO Bool
keyboardEventGetCtrlKey self
  = toBool <$>
      ((\(KeyboardEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_keyboard_event_get_ctrl_key argPtr1)
{-# LINE 88 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
         (toKeyboardEvent self))
 
keyboardEventGetShiftKey ::
                         (KeyboardEventClass self) => self -> IO Bool
keyboardEventGetShiftKey self
  = toBool <$>
      ((\(KeyboardEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_keyboard_event_get_shift_key argPtr1)
{-# LINE 95 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
         (toKeyboardEvent self))
 
keyboardEventGetAltKey ::
                       (KeyboardEventClass self) => self -> IO Bool
keyboardEventGetAltKey self
  = toBool <$>
      ((\(KeyboardEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_keyboard_event_get_alt_key argPtr1)
{-# LINE 102 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
         (toKeyboardEvent self))
 
keyboardEventGetMetaKey ::
                        (KeyboardEventClass self) => self -> IO Bool
keyboardEventGetMetaKey self
  = toBool <$>
      ((\(KeyboardEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_keyboard_event_get_meta_key argPtr1)
{-# LINE 109 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
         (toKeyboardEvent self))
 
keyboardEventGetAltGraphKey ::
                            (KeyboardEventClass self) => self -> IO Bool
keyboardEventGetAltGraphKey self
  = toBool <$>
      ((\(KeyboardEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_keyboard_event_get_alt_graph_key argPtr1)
{-# LINE 116 "./Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.chs" #-}
         (toKeyboardEvent self))

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

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.h webkit_dom_keyboard_event_init_keyboard_event"
  webkit_dom_keyboard_event_init_keyboard_event :: ((Ptr KeyboardEvent) -> ((Ptr CChar) -> (CInt -> (CInt -> ((Ptr DOMWindow) -> ((Ptr CChar) -> (CULong -> (CInt -> (CInt -> (CInt -> (CInt -> (CInt -> (IO ())))))))))))))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.h webkit_dom_keyboard_event_get_key_identifier"
  webkit_dom_keyboard_event_get_key_identifier :: ((Ptr KeyboardEvent) -> (IO (Ptr CChar)))

foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/KeyboardEvent.h webkit_dom_keyboard_event_get_key_location"
  webkit_dom_keyboard_event_get_key_location :: ((Ptr KeyboardEvent) -> (IO CULong))

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

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

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

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

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