module Graphics.UI.Gtk.WebKit.DOM.WheelEvent(
initWheelEvent,
pattern DOM_DELTA_PIXEL,
pattern DOM_DELTA_LINE,
pattern DOM_DELTA_PAGE,
getDeltaX,
getDeltaY,
getDeltaZ,
getDeltaMode,
getWheelDeltaX,
getWheelDeltaY,
getWheelDelta,
getWebkitDirectionInvertedFromDevice,
WheelEvent,
castToWheelEvent,
gTypeWheelEvent,
WheelEventClass,
toWheelEvent,
) 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.DOM.EventM
import Graphics.UI.Gtk.WebKit.Types
import Graphics.UI.Gtk.WebKit.DOM.Enums
initWheelEvent ::
(MonadIO m, WheelEventClass self, WindowClass view) =>
self ->
Int ->
Int ->
Maybe view ->
Int -> Int -> Int -> Int -> Bool -> Bool -> Bool -> Bool -> m ()
initWheelEvent self wheelDeltaX wheelDeltaY view screenX screenY
clientX clientY ctrlKey altKey shiftKey metaKey
= liftIO
((\(WheelEvent arg1) arg2 arg3 (Window arg4) arg5 arg6 arg7 arg8 arg9 arg10 arg11 arg12 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg4 $ \argPtr4 ->webkit_dom_wheel_event_init_wheel_event argPtr1 arg2 arg3 argPtr4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 arg12)
(toWheelEvent self)
(fromIntegral wheelDeltaX)
(fromIntegral wheelDeltaY)
(maybe (Window nullForeignPtr) toWindow view)
(fromIntegral screenX)
(fromIntegral screenY)
(fromIntegral clientX)
(fromIntegral clientY)
(fromBool ctrlKey)
(fromBool altKey)
(fromBool shiftKey)
(fromBool metaKey))
pattern DOM_DELTA_PIXEL = 0
pattern DOM_DELTA_LINE = 1
pattern DOM_DELTA_PAGE = 2
getDeltaX :: (MonadIO m, WheelEventClass self) => self -> m Double
getDeltaX self
= liftIO
(realToFrac <$>
((\(WheelEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_wheel_event_get_delta_x argPtr1)
(toWheelEvent self)))
getDeltaY :: (MonadIO m, WheelEventClass self) => self -> m Double
getDeltaY self
= liftIO
(realToFrac <$>
((\(WheelEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_wheel_event_get_delta_y argPtr1)
(toWheelEvent self)))
getDeltaZ :: (MonadIO m, WheelEventClass self) => self -> m Double
getDeltaZ self
= liftIO
(realToFrac <$>
((\(WheelEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_wheel_event_get_delta_z argPtr1)
(toWheelEvent self)))
getDeltaMode :: (MonadIO m, WheelEventClass self) => self -> m Word
getDeltaMode self
= liftIO
(fromIntegral <$>
((\(WheelEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_wheel_event_get_delta_mode argPtr1)
(toWheelEvent self)))
getWheelDeltaX ::
(MonadIO m, WheelEventClass self) => self -> m Int
getWheelDeltaX self
= liftIO
(fromIntegral <$>
((\(WheelEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_wheel_event_get_wheel_delta_x argPtr1)
(toWheelEvent self)))
getWheelDeltaY ::
(MonadIO m, WheelEventClass self) => self -> m Int
getWheelDeltaY self
= liftIO
(fromIntegral <$>
((\(WheelEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_wheel_event_get_wheel_delta_y argPtr1)
(toWheelEvent self)))
getWheelDelta :: (MonadIO m, WheelEventClass self) => self -> m Int
getWheelDelta self
= liftIO
(fromIntegral <$>
((\(WheelEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_wheel_event_get_wheel_delta argPtr1)
(toWheelEvent self)))
getWebkitDirectionInvertedFromDevice ::
(MonadIO m, WheelEventClass self) => self -> m Bool
getWebkitDirectionInvertedFromDevice self
= liftIO
(toBool <$>
((\(WheelEvent arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_dom_wheel_event_get_webkit_direction_inverted_from_device argPtr1)
(toWheelEvent self)))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_init_wheel_event"
webkit_dom_wheel_event_init_wheel_event :: ((Ptr WheelEvent) -> (CLong -> (CLong -> ((Ptr Window) -> (CLong -> (CLong -> (CLong -> (CLong -> (CInt -> (CInt -> (CInt -> (CInt -> (IO ())))))))))))))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_get_delta_x"
webkit_dom_wheel_event_get_delta_x :: ((Ptr WheelEvent) -> (IO CDouble))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_get_delta_y"
webkit_dom_wheel_event_get_delta_y :: ((Ptr WheelEvent) -> (IO CDouble))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_get_delta_z"
webkit_dom_wheel_event_get_delta_z :: ((Ptr WheelEvent) -> (IO CDouble))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_get_delta_mode"
webkit_dom_wheel_event_get_delta_mode :: ((Ptr WheelEvent) -> (IO CULong))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_get_wheel_delta_x"
webkit_dom_wheel_event_get_wheel_delta_x :: ((Ptr WheelEvent) -> (IO CLong))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_get_wheel_delta_y"
webkit_dom_wheel_event_get_wheel_delta_y :: ((Ptr WheelEvent) -> (IO CLong))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_get_wheel_delta"
webkit_dom_wheel_event_get_wheel_delta :: ((Ptr WheelEvent) -> (IO CLong))
foreign import ccall safe "dist/build/Graphics/UI/Gtk/WebKit/DOM/WheelEvent.h webkit_dom_wheel_event_get_webkit_direction_inverted_from_device"
webkit_dom_wheel_event_get_webkit_direction_inverted_from_device :: ((Ptr WheelEvent) -> (IO CInt))