module Graphics.UI.Gtk.WebKit.DOM.Event
(eventStopPropagation, eventPreventDefault, eventInitEvent,
eventStopImmediatePropagation, cNONE, cCAPTURING_PHASE, cAT_TARGET,
cBUBBLING_PHASE, cMOUSEDOWN, cMOUSEUP, cMOUSEOVER, cMOUSEOUT,
cMOUSEMOVE, cMOUSEDRAG, cCLICK, cDBLCLICK, cKEYDOWN, cKEYUP,
cKEYPRESS, cDRAGDROP, cFOCUS, cBLUR, cSELECT, cCHANGE,
eventGetTarget, eventGetCurrentTarget, eventGetEventPhase,
eventGetBubbles, eventGetCancelable, eventGetTimeStamp,
eventGetDefaultPrevented, eventGetSrcElement, eventSetReturnValue,
eventGetReturnValue, eventSetCancelBubble, eventGetCancelBubble,
Event, EventClass, castToEvent, gTypeEvent, toEvent)
where
import System.Glib.FFI
import System.Glib.UTFString
import Control.Applicative
import Graphics.UI.Gtk.WebKit.Types
import System.Glib.GError
eventStopPropagation :: (EventClass self) => self -> IO ()
eventStopPropagation self
= (\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_stop_propagation argPtr1) (toEvent self)
eventPreventDefault :: (EventClass self) => self -> IO ()
eventPreventDefault self
= (\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_prevent_default argPtr1) (toEvent self)
eventInitEvent ::
(EventClass self, GlibString string) =>
self -> string -> Bool -> Bool -> IO ()
eventInitEvent self eventTypeArg canBubbleArg cancelableArg
= withUTFString eventTypeArg $
\ eventTypeArgPtr ->
(\(Event arg1) arg2 arg3 arg4 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_init_event argPtr1 arg2 arg3 arg4) (toEvent self)
eventTypeArgPtr
(fromBool canBubbleArg)
(fromBool cancelableArg)
eventStopImmediatePropagation :: (EventClass self) => self -> IO ()
eventStopImmediatePropagation self
= (\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_stop_immediate_propagation argPtr1)
(toEvent self)
cNONE = 0
cCAPTURING_PHASE = 1
cAT_TARGET = 2
cBUBBLING_PHASE = 3
cMOUSEDOWN = 1
cMOUSEUP = 2
cMOUSEOVER = 4
cMOUSEOUT = 8
cMOUSEMOVE = 16
cMOUSEDRAG = 32
cCLICK = 64
cDBLCLICK = 128
cKEYDOWN = 256
cKEYUP = 512
cKEYPRESS = 1024
cDRAGDROP = 2048
cFOCUS = 4096
cBLUR = 8192
cSELECT = 16384
cCHANGE = 32768
eventGetTarget ::
(EventClass self) => self -> IO (Maybe EventTarget)
eventGetTarget self
= maybeNull (makeNewGObject mkEventTarget)
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_target argPtr1) (toEvent self))
eventGetCurrentTarget ::
(EventClass self) => self -> IO (Maybe EventTarget)
eventGetCurrentTarget self
= maybeNull (makeNewGObject mkEventTarget)
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_current_target argPtr1) (toEvent self))
eventGetEventPhase :: (EventClass self) => self -> IO Word
eventGetEventPhase self
= fromIntegral <$>
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_event_phase argPtr1) (toEvent self))
eventGetBubbles :: (EventClass self) => self -> IO Bool
eventGetBubbles self
= toBool <$>
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_bubbles argPtr1) (toEvent self))
eventGetCancelable :: (EventClass self) => self -> IO Bool
eventGetCancelable self
= toBool <$>
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_cancelable argPtr1) (toEvent self))
eventGetTimeStamp :: (EventClass self) => self -> IO Word
eventGetTimeStamp self
= fromIntegral <$>
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_time_stamp argPtr1) (toEvent self))
eventGetDefaultPrevented :: (EventClass self) => self -> IO Bool
eventGetDefaultPrevented self
= toBool <$>
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_default_prevented argPtr1) (toEvent self))
eventGetSrcElement ::
(EventClass self) => self -> IO (Maybe EventTarget)
eventGetSrcElement self
= maybeNull (makeNewGObject mkEventTarget)
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_src_element argPtr1) (toEvent self))
eventSetReturnValue :: (EventClass self) => self -> Bool -> IO ()
eventSetReturnValue self val
= (\(Event arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_set_return_value argPtr1 arg2) (toEvent self)
(fromBool val)
eventGetReturnValue :: (EventClass self) => self -> IO Bool
eventGetReturnValue self
= toBool <$>
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_return_value argPtr1) (toEvent self))
eventSetCancelBubble :: (EventClass self) => self -> Bool -> IO ()
eventSetCancelBubble self val
= (\(Event arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_set_cancel_bubble argPtr1 arg2) (toEvent self)
(fromBool val)
eventGetCancelBubble :: (EventClass self) => self -> IO Bool
eventGetCancelBubble self
= toBool <$>
((\(Event arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_event_get_cancel_bubble argPtr1) (toEvent self))
foreign import ccall safe "webkit_dom_event_stop_propagation"
webkit_dom_event_stop_propagation :: ((Ptr Event) -> (IO ()))
foreign import ccall safe "webkit_dom_event_prevent_default"
webkit_dom_event_prevent_default :: ((Ptr Event) -> (IO ()))
foreign import ccall safe "webkit_dom_event_init_event"
webkit_dom_event_init_event :: ((Ptr Event) -> ((Ptr CChar) -> (CInt -> (CInt -> (IO ())))))
foreign import ccall safe "webkit_dom_event_stop_immediate_propagation"
webkit_dom_event_stop_immediate_propagation :: ((Ptr Event) -> (IO ()))
foreign import ccall safe "webkit_dom_event_get_target"
webkit_dom_event_get_target :: ((Ptr Event) -> (IO (Ptr EventTarget)))
foreign import ccall safe "webkit_dom_event_get_current_target"
webkit_dom_event_get_current_target :: ((Ptr Event) -> (IO (Ptr EventTarget)))
foreign import ccall safe "webkit_dom_event_get_event_phase"
webkit_dom_event_get_event_phase :: ((Ptr Event) -> (IO CUShort))
foreign import ccall safe "webkit_dom_event_get_bubbles"
webkit_dom_event_get_bubbles :: ((Ptr Event) -> (IO CInt))
foreign import ccall safe "webkit_dom_event_get_cancelable"
webkit_dom_event_get_cancelable :: ((Ptr Event) -> (IO CInt))
foreign import ccall safe "webkit_dom_event_get_time_stamp"
webkit_dom_event_get_time_stamp :: ((Ptr Event) -> (IO CUInt))
foreign import ccall safe "webkit_dom_event_get_default_prevented"
webkit_dom_event_get_default_prevented :: ((Ptr Event) -> (IO CInt))
foreign import ccall safe "webkit_dom_event_get_src_element"
webkit_dom_event_get_src_element :: ((Ptr Event) -> (IO (Ptr EventTarget)))
foreign import ccall safe "webkit_dom_event_set_return_value"
webkit_dom_event_set_return_value :: ((Ptr Event) -> (CInt -> (IO ())))
foreign import ccall safe "webkit_dom_event_get_return_value"
webkit_dom_event_get_return_value :: ((Ptr Event) -> (IO CInt))
foreign import ccall safe "webkit_dom_event_set_cancel_bubble"
webkit_dom_event_set_cancel_bubble :: ((Ptr Event) -> (CInt -> (IO ())))
foreign import ccall safe "webkit_dom_event_get_cancel_bubble"
webkit_dom_event_get_cancel_bubble :: ((Ptr Event) -> (IO CInt))