{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Event
(
Event(..) ,
IsEvent ,
toEvent ,
noEvent ,
#if defined(ENABLE_OVERLOADING)
ResolveEventMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
EventCopyMethodInfo ,
#endif
eventCopy ,
#if defined(ENABLE_OVERLOADING)
EventGetAxesMethodInfo ,
#endif
eventGetAxes ,
#if defined(ENABLE_OVERLOADING)
EventGetAxisMethodInfo ,
#endif
eventGetAxis ,
#if defined(ENABLE_OVERLOADING)
EventGetButtonMethodInfo ,
#endif
eventGetButton ,
#if defined(ENABLE_OVERLOADING)
EventGetClickCountMethodInfo ,
#endif
eventGetClickCount ,
#if defined(ENABLE_OVERLOADING)
EventGetCoordsMethodInfo ,
#endif
eventGetCoords ,
#if defined(ENABLE_OVERLOADING)
EventGetCrossingDetailMethodInfo ,
#endif
eventGetCrossingDetail ,
#if defined(ENABLE_OVERLOADING)
EventGetCrossingModeMethodInfo ,
#endif
eventGetCrossingMode ,
#if defined(ENABLE_OVERLOADING)
EventGetDeviceMethodInfo ,
#endif
eventGetDevice ,
#if defined(ENABLE_OVERLOADING)
EventGetDeviceToolMethodInfo ,
#endif
eventGetDeviceTool ,
#if defined(ENABLE_OVERLOADING)
EventGetDisplayMethodInfo ,
#endif
eventGetDisplay ,
#if defined(ENABLE_OVERLOADING)
EventGetDropMethodInfo ,
#endif
eventGetDrop ,
#if defined(ENABLE_OVERLOADING)
EventGetEventSequenceMethodInfo ,
#endif
eventGetEventSequence ,
#if defined(ENABLE_OVERLOADING)
EventGetEventTypeMethodInfo ,
#endif
eventGetEventType ,
#if defined(ENABLE_OVERLOADING)
EventGetFocusInMethodInfo ,
#endif
eventGetFocusIn ,
#if defined(ENABLE_OVERLOADING)
EventGetGrabSurfaceMethodInfo ,
#endif
eventGetGrabSurface ,
#if defined(ENABLE_OVERLOADING)
EventGetKeyGroupMethodInfo ,
#endif
eventGetKeyGroup ,
#if defined(ENABLE_OVERLOADING)
EventGetKeyIsModifierMethodInfo ,
#endif
eventGetKeyIsModifier ,
#if defined(ENABLE_OVERLOADING)
EventGetKeycodeMethodInfo ,
#endif
eventGetKeycode ,
#if defined(ENABLE_OVERLOADING)
EventGetKeyvalMethodInfo ,
#endif
eventGetKeyval ,
#if defined(ENABLE_OVERLOADING)
EventGetMotionHistoryMethodInfo ,
#endif
eventGetMotionHistory ,
#if defined(ENABLE_OVERLOADING)
EventGetPadAxisValueMethodInfo ,
#endif
eventGetPadAxisValue ,
#if defined(ENABLE_OVERLOADING)
EventGetPadButtonMethodInfo ,
#endif
eventGetPadButton ,
#if defined(ENABLE_OVERLOADING)
EventGetPadGroupModeMethodInfo ,
#endif
eventGetPadGroupMode ,
#if defined(ENABLE_OVERLOADING)
EventGetPointerEmulatedMethodInfo ,
#endif
eventGetPointerEmulated ,
#if defined(ENABLE_OVERLOADING)
EventGetRootCoordsMethodInfo ,
#endif
eventGetRootCoords ,
#if defined(ENABLE_OVERLOADING)
EventGetScancodeMethodInfo ,
#endif
eventGetScancode ,
#if defined(ENABLE_OVERLOADING)
EventGetScrollDeltasMethodInfo ,
#endif
eventGetScrollDeltas ,
#if defined(ENABLE_OVERLOADING)
EventGetScrollDirectionMethodInfo ,
#endif
eventGetScrollDirection ,
#if defined(ENABLE_OVERLOADING)
EventGetSeatMethodInfo ,
#endif
eventGetSeat ,
#if defined(ENABLE_OVERLOADING)
EventGetSourceDeviceMethodInfo ,
#endif
eventGetSourceDevice ,
#if defined(ENABLE_OVERLOADING)
EventGetStateMethodInfo ,
#endif
eventGetState ,
#if defined(ENABLE_OVERLOADING)
EventGetSurfaceMethodInfo ,
#endif
eventGetSurface ,
#if defined(ENABLE_OVERLOADING)
EventGetTimeMethodInfo ,
#endif
eventGetTime ,
#if defined(ENABLE_OVERLOADING)
EventGetTouchEmulatingPointerMethodInfo ,
#endif
eventGetTouchEmulatingPointer ,
#if defined(ENABLE_OVERLOADING)
EventGetTouchpadAngleDeltaMethodInfo ,
#endif
eventGetTouchpadAngleDelta ,
#if defined(ENABLE_OVERLOADING)
EventGetTouchpadDeltasMethodInfo ,
#endif
eventGetTouchpadDeltas ,
#if defined(ENABLE_OVERLOADING)
EventGetTouchpadGestureNFingersMethodInfo,
#endif
eventGetTouchpadGestureNFingers ,
#if defined(ENABLE_OVERLOADING)
EventGetTouchpadGesturePhaseMethodInfo ,
#endif
eventGetTouchpadGesturePhase ,
#if defined(ENABLE_OVERLOADING)
EventGetTouchpadScaleMethodInfo ,
#endif
eventGetTouchpadScale ,
#if defined(ENABLE_OVERLOADING)
EventIsScrollStopEventMethodInfo ,
#endif
eventIsScrollStopEvent ,
#if defined(ENABLE_OVERLOADING)
EventIsSentMethodInfo ,
#endif
eventIsSent ,
eventNew ,
#if defined(ENABLE_OVERLOADING)
EventSetCoordsMethodInfo ,
#endif
eventSetCoords ,
#if defined(ENABLE_OVERLOADING)
EventSetDeviceMethodInfo ,
#endif
eventSetDevice ,
#if defined(ENABLE_OVERLOADING)
EventSetDeviceToolMethodInfo ,
#endif
eventSetDeviceTool ,
#if defined(ENABLE_OVERLOADING)
EventSetDisplayMethodInfo ,
#endif
eventSetDisplay ,
#if defined(ENABLE_OVERLOADING)
EventSetKeyvalMethodInfo ,
#endif
eventSetKeyval ,
#if defined(ENABLE_OVERLOADING)
EventSetSourceDeviceMethodInfo ,
#endif
eventSetSourceDevice ,
#if defined(ENABLE_OVERLOADING)
EventTriggersContextMenuMethodInfo ,
#endif
eventTriggersContextMenu ,
#if defined(ENABLE_OVERLOADING)
EventEventTypePropertyInfo ,
#endif
constructEventEventType ,
#if defined(ENABLE_OVERLOADING)
eventEventType ,
#endif
getEventEventType ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.DeviceTool as Gdk.DeviceTool
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Drop as Gdk.Drop
import {-# SOURCE #-} qualified GI.Gdk.Objects.Seat as Gdk.Seat
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventSequence as Gdk.EventSequence
import {-# SOURCE #-} qualified GI.Gdk.Structs.TimeCoord as Gdk.TimeCoord
newtype Event = Event (ManagedPtr Event)
deriving (Event -> Event -> Bool
(Event -> Event -> Bool) -> (Event -> Event -> Bool) -> Eq Event
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Event -> Event -> Bool
$c/= :: Event -> Event -> Bool
== :: Event -> Event -> Bool
$c== :: Event -> Event -> Bool
Eq)
foreign import ccall "gdk_event_get_type"
c_gdk_event_get_type :: IO GType
instance GObject Event where
gobjectType :: IO GType
gobjectType = IO GType
c_gdk_event_get_type
instance B.GValue.IsGValue Event where
toGValue :: Event -> IO GValue
toGValue o :: Event
o = do
GType
gtype <- IO GType
c_gdk_event_get_type
Event -> (Ptr Event -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Event
o (GType -> (GValue -> Ptr Event -> IO ()) -> Ptr Event -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Event -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Event
fromGValue gv :: GValue
gv = do
Ptr Event
ptr <- GValue -> IO (Ptr Event)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Event)
(ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Event -> Event
Event Ptr Event
ptr
class (GObject o, O.IsDescendantOf Event o) => IsEvent o
instance (GObject o, O.IsDescendantOf Event o) => IsEvent o
instance O.HasParentTypes Event
type instance O.ParentTypes Event = '[GObject.Object.Object]
toEvent :: (MonadIO m, IsEvent o) => o -> m Event
toEvent :: o -> m Event
toEvent = IO Event -> m Event
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Event -> m Event) -> (o -> IO Event) -> o -> m Event
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Event -> Event) -> o -> IO Event
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Event -> Event
Event
noEvent :: Maybe Event
noEvent :: Maybe Event
noEvent = Maybe Event
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveEventMethod (t :: Symbol) (o :: *) :: * where
ResolveEventMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveEventMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveEventMethod "copy" o = EventCopyMethodInfo
ResolveEventMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveEventMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveEventMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveEventMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveEventMethod "isScrollStopEvent" o = EventIsScrollStopEventMethodInfo
ResolveEventMethod "isSent" o = EventIsSentMethodInfo
ResolveEventMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveEventMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveEventMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveEventMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveEventMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveEventMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveEventMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveEventMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveEventMethod "triggersContextMenu" o = EventTriggersContextMenuMethodInfo
ResolveEventMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveEventMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveEventMethod "getAxes" o = EventGetAxesMethodInfo
ResolveEventMethod "getAxis" o = EventGetAxisMethodInfo
ResolveEventMethod "getButton" o = EventGetButtonMethodInfo
ResolveEventMethod "getClickCount" o = EventGetClickCountMethodInfo
ResolveEventMethod "getCoords" o = EventGetCoordsMethodInfo
ResolveEventMethod "getCrossingDetail" o = EventGetCrossingDetailMethodInfo
ResolveEventMethod "getCrossingMode" o = EventGetCrossingModeMethodInfo
ResolveEventMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveEventMethod "getDevice" o = EventGetDeviceMethodInfo
ResolveEventMethod "getDeviceTool" o = EventGetDeviceToolMethodInfo
ResolveEventMethod "getDisplay" o = EventGetDisplayMethodInfo
ResolveEventMethod "getDrop" o = EventGetDropMethodInfo
ResolveEventMethod "getEventSequence" o = EventGetEventSequenceMethodInfo
ResolveEventMethod "getEventType" o = EventGetEventTypeMethodInfo
ResolveEventMethod "getFocusIn" o = EventGetFocusInMethodInfo
ResolveEventMethod "getGrabSurface" o = EventGetGrabSurfaceMethodInfo
ResolveEventMethod "getKeyGroup" o = EventGetKeyGroupMethodInfo
ResolveEventMethod "getKeyIsModifier" o = EventGetKeyIsModifierMethodInfo
ResolveEventMethod "getKeycode" o = EventGetKeycodeMethodInfo
ResolveEventMethod "getKeyval" o = EventGetKeyvalMethodInfo
ResolveEventMethod "getMotionHistory" o = EventGetMotionHistoryMethodInfo
ResolveEventMethod "getPadAxisValue" o = EventGetPadAxisValueMethodInfo
ResolveEventMethod "getPadButton" o = EventGetPadButtonMethodInfo
ResolveEventMethod "getPadGroupMode" o = EventGetPadGroupModeMethodInfo
ResolveEventMethod "getPointerEmulated" o = EventGetPointerEmulatedMethodInfo
ResolveEventMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveEventMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveEventMethod "getRootCoords" o = EventGetRootCoordsMethodInfo
ResolveEventMethod "getScancode" o = EventGetScancodeMethodInfo
ResolveEventMethod "getScrollDeltas" o = EventGetScrollDeltasMethodInfo
ResolveEventMethod "getScrollDirection" o = EventGetScrollDirectionMethodInfo
ResolveEventMethod "getSeat" o = EventGetSeatMethodInfo
ResolveEventMethod "getSourceDevice" o = EventGetSourceDeviceMethodInfo
ResolveEventMethod "getState" o = EventGetStateMethodInfo
ResolveEventMethod "getSurface" o = EventGetSurfaceMethodInfo
ResolveEventMethod "getTime" o = EventGetTimeMethodInfo
ResolveEventMethod "getTouchEmulatingPointer" o = EventGetTouchEmulatingPointerMethodInfo
ResolveEventMethod "getTouchpadAngleDelta" o = EventGetTouchpadAngleDeltaMethodInfo
ResolveEventMethod "getTouchpadDeltas" o = EventGetTouchpadDeltasMethodInfo
ResolveEventMethod "getTouchpadGestureNFingers" o = EventGetTouchpadGestureNFingersMethodInfo
ResolveEventMethod "getTouchpadGesturePhase" o = EventGetTouchpadGesturePhaseMethodInfo
ResolveEventMethod "getTouchpadScale" o = EventGetTouchpadScaleMethodInfo
ResolveEventMethod "setCoords" o = EventSetCoordsMethodInfo
ResolveEventMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveEventMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveEventMethod "setDevice" o = EventSetDeviceMethodInfo
ResolveEventMethod "setDeviceTool" o = EventSetDeviceToolMethodInfo
ResolveEventMethod "setDisplay" o = EventSetDisplayMethodInfo
ResolveEventMethod "setKeyval" o = EventSetKeyvalMethodInfo
ResolveEventMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveEventMethod "setSourceDevice" o = EventSetSourceDeviceMethodInfo
ResolveEventMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEventMethod t Event, O.MethodInfo info Event p) => OL.IsLabel t (Event -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getEventEventType :: (MonadIO m, IsEvent o) => o -> m Gdk.Enums.EventType
getEventEventType :: o -> m EventType
getEventEventType obj :: o
obj = IO EventType -> m EventType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventType -> m EventType) -> IO EventType -> m EventType
forall a b. (a -> b) -> a -> b
$ o -> String -> IO EventType
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj "event-type"
constructEventEventType :: (IsEvent o) => Gdk.Enums.EventType -> IO (GValueConstruct o)
constructEventEventType :: EventType -> IO (GValueConstruct o)
constructEventEventType val :: EventType
val = String -> EventType -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum "event-type" EventType
val
#if defined(ENABLE_OVERLOADING)
data EventEventTypePropertyInfo
instance AttrInfo EventEventTypePropertyInfo where
type AttrAllowedOps EventEventTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint EventEventTypePropertyInfo = IsEvent
type AttrSetTypeConstraint EventEventTypePropertyInfo = (~) Gdk.Enums.EventType
type AttrTransferTypeConstraint EventEventTypePropertyInfo = (~) Gdk.Enums.EventType
type AttrTransferType EventEventTypePropertyInfo = Gdk.Enums.EventType
type AttrGetType EventEventTypePropertyInfo = Gdk.Enums.EventType
type AttrLabel EventEventTypePropertyInfo = "event-type"
type AttrOrigin EventEventTypePropertyInfo = Event
attrGet = getEventEventType
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructEventEventType
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Event
type instance O.AttributeList Event = EventAttributeList
type EventAttributeList = ('[ '("eventType", EventEventTypePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
eventEventType :: AttrLabelProxy "eventType"
eventEventType = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Event = EventSignalList
type EventSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_event_new" gdk_event_new ::
CUInt ->
IO (Ptr Event)
eventNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gdk.Enums.EventType
-> m Event
eventNew :: EventType -> m Event
eventNew type_ :: EventType
type_ = IO Event -> m Event
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Event -> m Event) -> IO Event -> m Event
forall a b. (a -> b) -> a -> b
$ do
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (EventType -> Int) -> EventType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EventType -> Int
forall a. Enum a => a -> Int
fromEnum) EventType
type_
Ptr Event
result <- CUInt -> IO (Ptr Event)
gdk_event_new CUInt
type_'
Text -> Ptr Event -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "eventNew" Ptr Event
result
Event
result' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Event -> Event
Event) Ptr Event
result
Event -> IO Event
forall (m :: * -> *) a. Monad m => a -> m a
return Event
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_event_copy" gdk_event_copy ::
Ptr Event ->
IO (Ptr Event)
eventCopy ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Event
eventCopy :: a -> m Event
eventCopy event :: a
event = IO Event -> m Event
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Event -> m Event) -> IO Event -> m Event
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Event
result <- Ptr Event -> IO (Ptr Event)
gdk_event_copy Ptr Event
event'
Text -> Ptr Event -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "eventCopy" Ptr Event
result
Event
result' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Event -> Event
Event) Ptr Event
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Event -> IO Event
forall (m :: * -> *) a. Monad m => a -> m a
return Event
result'
#if defined(ENABLE_OVERLOADING)
data EventCopyMethodInfo
instance (signature ~ (m Event), MonadIO m, IsEvent a) => O.MethodInfo EventCopyMethodInfo a signature where
overloadedMethod = eventCopy
#endif
foreign import ccall "gdk_event_get_axes" gdk_event_get_axes ::
Ptr Event ->
Ptr (Ptr CDouble) ->
Ptr Word32 ->
IO CInt
eventGetAxes ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, [Double]))
eventGetAxes :: a -> m (Bool, [Double])
eventGetAxes event :: a
event = IO (Bool, [Double]) -> m (Bool, [Double])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, [Double]) -> m (Bool, [Double]))
-> IO (Bool, [Double]) -> m (Bool, [Double])
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr (Ptr CDouble)
axes <- IO (Ptr (Ptr CDouble))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr CDouble))
Ptr Word32
nAxes <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Event -> Ptr (Ptr CDouble) -> Ptr Word32 -> IO CInt
gdk_event_get_axes Ptr Event
event' Ptr (Ptr CDouble)
axes Ptr Word32
nAxes
Word32
nAxes' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
nAxes
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Ptr CDouble
axes' <- Ptr (Ptr CDouble) -> IO (Ptr CDouble)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CDouble)
axes
[Double]
axes'' <- ((CDouble -> Double) -> Word32 -> Ptr CDouble -> IO [Double]
forall a b c.
(Integral a, Storable b) =>
(b -> c) -> a -> Ptr b -> IO [c]
unpackMapStorableArrayWithLength CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac Word32
nAxes') Ptr CDouble
axes'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr (Ptr CDouble) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CDouble)
axes
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
nAxes
(Bool, [Double]) -> IO (Bool, [Double])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [Double]
axes'')
#if defined(ENABLE_OVERLOADING)
data EventGetAxesMethodInfo
instance (signature ~ (m ((Bool, [Double]))), MonadIO m, IsEvent a) => O.MethodInfo EventGetAxesMethodInfo a signature where
overloadedMethod = eventGetAxes
#endif
foreign import ccall "gdk_event_get_axis" gdk_event_get_axis ::
Ptr Event ->
CUInt ->
Ptr CDouble ->
IO CInt
eventGetAxis ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> Gdk.Enums.AxisUse
-> m ((Bool, Double))
eventGetAxis :: a -> AxisUse -> m (Bool, Double)
eventGetAxis event :: a
event axisUse :: AxisUse
axisUse = IO (Bool, Double) -> m (Bool, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double) -> m (Bool, Double))
-> IO (Bool, Double) -> m (Bool, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
let axisUse' :: CUInt
axisUse' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (AxisUse -> Int) -> AxisUse -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AxisUse -> Int
forall a. Enum a => a -> Int
fromEnum) AxisUse
axisUse
Ptr CDouble
value <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Event -> CUInt -> Ptr CDouble -> IO CInt
gdk_event_get_axis Ptr Event
event' CUInt
axisUse' Ptr CDouble
value
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CDouble
value' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
value
let value'' :: Double
value'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
value
(Bool, Double) -> IO (Bool, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
value'')
#if defined(ENABLE_OVERLOADING)
data EventGetAxisMethodInfo
instance (signature ~ (Gdk.Enums.AxisUse -> m ((Bool, Double))), MonadIO m, IsEvent a) => O.MethodInfo EventGetAxisMethodInfo a signature where
overloadedMethod = eventGetAxis
#endif
foreign import ccall "gdk_event_get_button" gdk_event_get_button ::
Ptr Event ->
Ptr Word32 ->
IO CInt
eventGetButton ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word32))
eventGetButton :: a -> m (Bool, Word32)
eventGetButton event :: a
event = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word32
button <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Event -> Ptr Word32 -> IO CInt
gdk_event_get_button Ptr Event
event' Ptr Word32
button
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word32
button' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
button
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
button
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
button')
#if defined(ENABLE_OVERLOADING)
data EventGetButtonMethodInfo
instance (signature ~ (m ((Bool, Word32))), MonadIO m, IsEvent a) => O.MethodInfo EventGetButtonMethodInfo a signature where
overloadedMethod = eventGetButton
#endif
foreign import ccall "gdk_event_get_click_count" gdk_event_get_click_count ::
Ptr Event ->
Ptr Word32 ->
IO CInt
eventGetClickCount ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word32))
eventGetClickCount :: a -> m (Bool, Word32)
eventGetClickCount event :: a
event = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word32
clickCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Event -> Ptr Word32 -> IO CInt
gdk_event_get_click_count Ptr Event
event' Ptr Word32
clickCount
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word32
clickCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
clickCount
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
clickCount
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
clickCount')
#if defined(ENABLE_OVERLOADING)
data EventGetClickCountMethodInfo
instance (signature ~ (m ((Bool, Word32))), MonadIO m, IsEvent a) => O.MethodInfo EventGetClickCountMethodInfo a signature where
overloadedMethod = eventGetClickCount
#endif
foreign import ccall "gdk_event_get_coords" gdk_event_get_coords ::
Ptr Event ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
eventGetCoords ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Double, Double))
eventGetCoords :: a -> m (Bool, Double, Double)
eventGetCoords event :: a
event = IO (Bool, Double, Double) -> m (Bool, Double, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double, Double) -> m (Bool, Double, Double))
-> IO (Bool, Double, Double) -> m (Bool, Double, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CDouble
xWin <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
yWin <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Event -> Ptr CDouble -> Ptr CDouble -> IO CInt
gdk_event_get_coords Ptr Event
event' Ptr CDouble
xWin Ptr CDouble
yWin
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CDouble
xWin' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
xWin
let xWin'' :: Double
xWin'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
xWin'
CDouble
yWin' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
yWin
let yWin'' :: Double
yWin'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
yWin'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
xWin
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
yWin
(Bool, Double, Double) -> IO (Bool, Double, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
xWin'', Double
yWin'')
#if defined(ENABLE_OVERLOADING)
data EventGetCoordsMethodInfo
instance (signature ~ (m ((Bool, Double, Double))), MonadIO m, IsEvent a) => O.MethodInfo EventGetCoordsMethodInfo a signature where
overloadedMethod = eventGetCoords
#endif
foreign import ccall "gdk_event_get_crossing_detail" gdk_event_get_crossing_detail ::
Ptr Event ->
Ptr CUInt ->
IO CInt
eventGetCrossingDetail ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Gdk.Enums.NotifyType))
eventGetCrossingDetail :: a -> m (Bool, NotifyType)
eventGetCrossingDetail event :: a
event = IO (Bool, NotifyType) -> m (Bool, NotifyType)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, NotifyType) -> m (Bool, NotifyType))
-> IO (Bool, NotifyType) -> m (Bool, NotifyType)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CUInt
detail <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
CInt
result <- Ptr Event -> Ptr CUInt -> IO CInt
gdk_event_get_crossing_detail Ptr Event
event' Ptr CUInt
detail
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CUInt
detail' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
detail
let detail'' :: NotifyType
detail'' = (Int -> NotifyType
forall a. Enum a => Int -> a
toEnum (Int -> NotifyType) -> (CUInt -> Int) -> CUInt -> NotifyType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
detail'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
detail
(Bool, NotifyType) -> IO (Bool, NotifyType)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', NotifyType
detail'')
#if defined(ENABLE_OVERLOADING)
data EventGetCrossingDetailMethodInfo
instance (signature ~ (m ((Bool, Gdk.Enums.NotifyType))), MonadIO m, IsEvent a) => O.MethodInfo EventGetCrossingDetailMethodInfo a signature where
overloadedMethod = eventGetCrossingDetail
#endif
foreign import ccall "gdk_event_get_crossing_mode" gdk_event_get_crossing_mode ::
Ptr Event ->
Ptr CUInt ->
IO CInt
eventGetCrossingMode ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Gdk.Enums.CrossingMode))
eventGetCrossingMode :: a -> m (Bool, CrossingMode)
eventGetCrossingMode event :: a
event = IO (Bool, CrossingMode) -> m (Bool, CrossingMode)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, CrossingMode) -> m (Bool, CrossingMode))
-> IO (Bool, CrossingMode) -> m (Bool, CrossingMode)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CUInt
mode <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
CInt
result <- Ptr Event -> Ptr CUInt -> IO CInt
gdk_event_get_crossing_mode Ptr Event
event' Ptr CUInt
mode
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CUInt
mode' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
mode
let mode'' :: CrossingMode
mode'' = (Int -> CrossingMode
forall a. Enum a => Int -> a
toEnum (Int -> CrossingMode) -> (CUInt -> Int) -> CUInt -> CrossingMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
mode'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
mode
(Bool, CrossingMode) -> IO (Bool, CrossingMode)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', CrossingMode
mode'')
#if defined(ENABLE_OVERLOADING)
data EventGetCrossingModeMethodInfo
instance (signature ~ (m ((Bool, Gdk.Enums.CrossingMode))), MonadIO m, IsEvent a) => O.MethodInfo EventGetCrossingModeMethodInfo a signature where
overloadedMethod = eventGetCrossingMode
#endif
foreign import ccall "gdk_event_get_device" gdk_event_get_device ::
Ptr Event ->
IO (Ptr Gdk.Device.Device)
eventGetDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m (Maybe Gdk.Device.Device)
eventGetDevice :: a -> m (Maybe Device)
eventGetDevice event :: a
event = IO (Maybe Device) -> m (Maybe Device)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Device) -> m (Maybe Device))
-> IO (Maybe Device) -> m (Maybe Device)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Device
result <- Ptr Event -> IO (Ptr Device)
gdk_event_get_device Ptr Event
event'
Maybe Device
maybeResult <- Ptr Device -> (Ptr Device -> IO Device) -> IO (Maybe Device)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Device
result ((Ptr Device -> IO Device) -> IO (Maybe Device))
-> (Ptr Device -> IO Device) -> IO (Maybe Device)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Device
result' -> do
Device
result'' <- ((ManagedPtr Device -> Device) -> Ptr Device -> IO Device
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Device -> Device
Gdk.Device.Device) Ptr Device
result'
Device -> IO Device
forall (m :: * -> *) a. Monad m => a -> m a
return Device
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Maybe Device -> IO (Maybe Device)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Device
maybeResult
#if defined(ENABLE_OVERLOADING)
data EventGetDeviceMethodInfo
instance (signature ~ (m (Maybe Gdk.Device.Device)), MonadIO m, IsEvent a) => O.MethodInfo EventGetDeviceMethodInfo a signature where
overloadedMethod = eventGetDevice
#endif
foreign import ccall "gdk_event_get_device_tool" gdk_event_get_device_tool ::
Ptr Event ->
IO (Ptr Gdk.DeviceTool.DeviceTool)
eventGetDeviceTool ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Gdk.DeviceTool.DeviceTool
eventGetDeviceTool :: a -> m DeviceTool
eventGetDeviceTool event :: a
event = IO DeviceTool -> m DeviceTool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DeviceTool -> m DeviceTool) -> IO DeviceTool -> m DeviceTool
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr DeviceTool
result <- Ptr Event -> IO (Ptr DeviceTool)
gdk_event_get_device_tool Ptr Event
event'
Text -> Ptr DeviceTool -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "eventGetDeviceTool" Ptr DeviceTool
result
DeviceTool
result' <- ((ManagedPtr DeviceTool -> DeviceTool)
-> Ptr DeviceTool -> IO DeviceTool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DeviceTool -> DeviceTool
Gdk.DeviceTool.DeviceTool) Ptr DeviceTool
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
DeviceTool -> IO DeviceTool
forall (m :: * -> *) a. Monad m => a -> m a
return DeviceTool
result'
#if defined(ENABLE_OVERLOADING)
data EventGetDeviceToolMethodInfo
instance (signature ~ (m Gdk.DeviceTool.DeviceTool), MonadIO m, IsEvent a) => O.MethodInfo EventGetDeviceToolMethodInfo a signature where
overloadedMethod = eventGetDeviceTool
#endif
foreign import ccall "gdk_event_get_display" gdk_event_get_display ::
Ptr Event ->
IO (Ptr Gdk.Display.Display)
eventGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m (Maybe Gdk.Display.Display)
eventGetDisplay :: a -> m (Maybe Display)
eventGetDisplay event :: a
event = IO (Maybe Display) -> m (Maybe Display)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Display) -> m (Maybe Display))
-> IO (Maybe Display) -> m (Maybe Display)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Display
result <- Ptr Event -> IO (Ptr Display)
gdk_event_get_display Ptr Event
event'
Maybe Display
maybeResult <- Ptr Display -> (Ptr Display -> IO Display) -> IO (Maybe Display)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Display
result ((Ptr Display -> IO Display) -> IO (Maybe Display))
-> (Ptr Display -> IO Display) -> IO (Maybe Display)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Display
result' -> do
Display
result'' <- ((ManagedPtr Display -> Display) -> Ptr Display -> IO Display
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Display -> Display
Gdk.Display.Display) Ptr Display
result'
Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Maybe Display -> IO (Maybe Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Display
maybeResult
#if defined(ENABLE_OVERLOADING)
data EventGetDisplayMethodInfo
instance (signature ~ (m (Maybe Gdk.Display.Display)), MonadIO m, IsEvent a) => O.MethodInfo EventGetDisplayMethodInfo a signature where
overloadedMethod = eventGetDisplay
#endif
foreign import ccall "gdk_event_get_drop" gdk_event_get_drop ::
Ptr Event ->
IO (Ptr Gdk.Drop.Drop)
eventGetDrop ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m (Maybe Gdk.Drop.Drop)
eventGetDrop :: a -> m (Maybe Drop)
eventGetDrop event :: a
event = IO (Maybe Drop) -> m (Maybe Drop)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Drop) -> m (Maybe Drop))
-> IO (Maybe Drop) -> m (Maybe Drop)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Drop
result <- Ptr Event -> IO (Ptr Drop)
gdk_event_get_drop Ptr Event
event'
Maybe Drop
maybeResult <- Ptr Drop -> (Ptr Drop -> IO Drop) -> IO (Maybe Drop)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Drop
result ((Ptr Drop -> IO Drop) -> IO (Maybe Drop))
-> (Ptr Drop -> IO Drop) -> IO (Maybe Drop)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Drop
result' -> do
Drop
result'' <- ((ManagedPtr Drop -> Drop) -> Ptr Drop -> IO Drop
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Drop -> Drop
Gdk.Drop.Drop) Ptr Drop
result'
Drop -> IO Drop
forall (m :: * -> *) a. Monad m => a -> m a
return Drop
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Maybe Drop -> IO (Maybe Drop)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Drop
maybeResult
#if defined(ENABLE_OVERLOADING)
data EventGetDropMethodInfo
instance (signature ~ (m (Maybe Gdk.Drop.Drop)), MonadIO m, IsEvent a) => O.MethodInfo EventGetDropMethodInfo a signature where
overloadedMethod = eventGetDrop
#endif
foreign import ccall "gdk_event_get_event_sequence" gdk_event_get_event_sequence ::
Ptr Event ->
IO (Ptr Gdk.EventSequence.EventSequence)
eventGetEventSequence ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Gdk.EventSequence.EventSequence
eventGetEventSequence :: a -> m EventSequence
eventGetEventSequence event :: a
event = IO EventSequence -> m EventSequence
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventSequence -> m EventSequence)
-> IO EventSequence -> m EventSequence
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr EventSequence
result <- Ptr Event -> IO (Ptr EventSequence)
gdk_event_get_event_sequence Ptr Event
event'
Text -> Ptr EventSequence -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "eventGetEventSequence" Ptr EventSequence
result
EventSequence
result' <- ((ManagedPtr EventSequence -> EventSequence)
-> Ptr EventSequence -> IO EventSequence
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr EventSequence -> EventSequence
Gdk.EventSequence.EventSequence) Ptr EventSequence
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
EventSequence -> IO EventSequence
forall (m :: * -> *) a. Monad m => a -> m a
return EventSequence
result'
#if defined(ENABLE_OVERLOADING)
data EventGetEventSequenceMethodInfo
instance (signature ~ (m Gdk.EventSequence.EventSequence), MonadIO m, IsEvent a) => O.MethodInfo EventGetEventSequenceMethodInfo a signature where
overloadedMethod = eventGetEventSequence
#endif
foreign import ccall "gdk_event_get_event_type" gdk_event_get_event_type ::
Ptr Event ->
IO CUInt
eventGetEventType ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Gdk.Enums.EventType
eventGetEventType :: a -> m EventType
eventGetEventType event :: a
event = IO EventType -> m EventType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventType -> m EventType) -> IO EventType -> m EventType
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
CUInt
result <- Ptr Event -> IO CUInt
gdk_event_get_event_type Ptr Event
event'
let result' :: EventType
result' = (Int -> EventType
forall a. Enum a => Int -> a
toEnum (Int -> EventType) -> (CUInt -> Int) -> CUInt -> EventType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
EventType -> IO EventType
forall (m :: * -> *) a. Monad m => a -> m a
return EventType
result'
#if defined(ENABLE_OVERLOADING)
data EventGetEventTypeMethodInfo
instance (signature ~ (m Gdk.Enums.EventType), MonadIO m, IsEvent a) => O.MethodInfo EventGetEventTypeMethodInfo a signature where
overloadedMethod = eventGetEventType
#endif
foreign import ccall "gdk_event_get_focus_in" gdk_event_get_focus_in ::
Ptr Event ->
Ptr CInt ->
IO CInt
eventGetFocusIn ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Bool))
eventGetFocusIn :: a -> m (Bool, Bool)
eventGetFocusIn event :: a
event = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CInt
focusIn <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
CInt
result <- Ptr Event -> Ptr CInt -> IO CInt
gdk_event_get_focus_in Ptr Event
event' Ptr CInt
focusIn
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CInt
focusIn' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
focusIn
let focusIn'' :: Bool
focusIn'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
focusIn'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
focusIn
(Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
focusIn'')
#if defined(ENABLE_OVERLOADING)
data EventGetFocusInMethodInfo
instance (signature ~ (m ((Bool, Bool))), MonadIO m, IsEvent a) => O.MethodInfo EventGetFocusInMethodInfo a signature where
overloadedMethod = eventGetFocusIn
#endif
foreign import ccall "gdk_event_get_grab_surface" gdk_event_get_grab_surface ::
Ptr Event ->
Ptr (Ptr Gdk.Surface.Surface) ->
IO CInt
eventGetGrabSurface ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Gdk.Surface.Surface))
eventGetGrabSurface :: a -> m (Bool, Surface)
eventGetGrabSurface event :: a
event = IO (Bool, Surface) -> m (Bool, Surface)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Surface) -> m (Bool, Surface))
-> IO (Bool, Surface) -> m (Bool, Surface)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr (Ptr Surface)
surface <- IO (Ptr (Ptr Surface))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gdk.Surface.Surface))
CInt
result <- Ptr Event -> Ptr (Ptr Surface) -> IO CInt
gdk_event_get_grab_surface Ptr Event
event' Ptr (Ptr Surface)
surface
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Ptr Surface
surface' <- Ptr (Ptr Surface) -> IO (Ptr Surface)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Surface)
surface
Surface
surface'' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Gdk.Surface.Surface) Ptr Surface
surface'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr (Ptr Surface) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Surface)
surface
(Bool, Surface) -> IO (Bool, Surface)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Surface
surface'')
#if defined(ENABLE_OVERLOADING)
data EventGetGrabSurfaceMethodInfo
instance (signature ~ (m ((Bool, Gdk.Surface.Surface))), MonadIO m, IsEvent a) => O.MethodInfo EventGetGrabSurfaceMethodInfo a signature where
overloadedMethod = eventGetGrabSurface
#endif
foreign import ccall "gdk_event_get_key_group" gdk_event_get_key_group ::
Ptr Event ->
Ptr Word32 ->
IO CInt
eventGetKeyGroup ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word32))
eventGetKeyGroup :: a -> m (Bool, Word32)
eventGetKeyGroup event :: a
event = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word32
group <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Event -> Ptr Word32 -> IO CInt
gdk_event_get_key_group Ptr Event
event' Ptr Word32
group
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word32
group' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
group
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
group
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
group')
#if defined(ENABLE_OVERLOADING)
data EventGetKeyGroupMethodInfo
instance (signature ~ (m ((Bool, Word32))), MonadIO m, IsEvent a) => O.MethodInfo EventGetKeyGroupMethodInfo a signature where
overloadedMethod = eventGetKeyGroup
#endif
foreign import ccall "gdk_event_get_key_is_modifier" gdk_event_get_key_is_modifier ::
Ptr Event ->
Ptr CInt ->
IO CInt
eventGetKeyIsModifier ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Bool))
eventGetKeyIsModifier :: a -> m (Bool, Bool)
eventGetKeyIsModifier event :: a
event = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CInt
isModifier <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
CInt
result <- Ptr Event -> Ptr CInt -> IO CInt
gdk_event_get_key_is_modifier Ptr Event
event' Ptr CInt
isModifier
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CInt
isModifier' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
isModifier
let isModifier'' :: Bool
isModifier'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
isModifier'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
isModifier
(Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
isModifier'')
#if defined(ENABLE_OVERLOADING)
data EventGetKeyIsModifierMethodInfo
instance (signature ~ (m ((Bool, Bool))), MonadIO m, IsEvent a) => O.MethodInfo EventGetKeyIsModifierMethodInfo a signature where
overloadedMethod = eventGetKeyIsModifier
#endif
foreign import ccall "gdk_event_get_keycode" gdk_event_get_keycode ::
Ptr Event ->
Ptr Word16 ->
IO CInt
eventGetKeycode ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word16))
eventGetKeycode :: a -> m (Bool, Word16)
eventGetKeycode event :: a
event = IO (Bool, Word16) -> m (Bool, Word16)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word16) -> m (Bool, Word16))
-> IO (Bool, Word16) -> m (Bool, Word16)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word16
keycode <- IO (Ptr Word16)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word16)
CInt
result <- Ptr Event -> Ptr Word16 -> IO CInt
gdk_event_get_keycode Ptr Event
event' Ptr Word16
keycode
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word16
keycode' <- Ptr Word16 -> IO Word16
forall a. Storable a => Ptr a -> IO a
peek Ptr Word16
keycode
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word16 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word16
keycode
(Bool, Word16) -> IO (Bool, Word16)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word16
keycode')
#if defined(ENABLE_OVERLOADING)
data EventGetKeycodeMethodInfo
instance (signature ~ (m ((Bool, Word16))), MonadIO m, IsEvent a) => O.MethodInfo EventGetKeycodeMethodInfo a signature where
overloadedMethod = eventGetKeycode
#endif
foreign import ccall "gdk_event_get_keyval" gdk_event_get_keyval ::
Ptr Event ->
Ptr Word32 ->
IO CInt
eventGetKeyval ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word32))
eventGetKeyval :: a -> m (Bool, Word32)
eventGetKeyval event :: a
event = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word32
keyval <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Event -> Ptr Word32 -> IO CInt
gdk_event_get_keyval Ptr Event
event' Ptr Word32
keyval
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word32
keyval' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
keyval
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
keyval
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
keyval')
#if defined(ENABLE_OVERLOADING)
data EventGetKeyvalMethodInfo
instance (signature ~ (m ((Bool, Word32))), MonadIO m, IsEvent a) => O.MethodInfo EventGetKeyvalMethodInfo a signature where
overloadedMethod = eventGetKeyval
#endif
foreign import ccall "gdk_event_get_motion_history" gdk_event_get_motion_history ::
Ptr Event ->
IO (Ptr (GList (Ptr Gdk.TimeCoord.TimeCoord)))
eventGetMotionHistory ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m [Gdk.TimeCoord.TimeCoord]
eventGetMotionHistory :: a -> m [TimeCoord]
eventGetMotionHistory event :: a
event = IO [TimeCoord] -> m [TimeCoord]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [TimeCoord] -> m [TimeCoord])
-> IO [TimeCoord] -> m [TimeCoord]
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr (GList (Ptr TimeCoord))
result <- Ptr Event -> IO (Ptr (GList (Ptr TimeCoord)))
gdk_event_get_motion_history Ptr Event
event'
[Ptr TimeCoord]
result' <- Ptr (GList (Ptr TimeCoord)) -> IO [Ptr TimeCoord]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr TimeCoord))
result
[TimeCoord]
result'' <- (Ptr TimeCoord -> IO TimeCoord)
-> [Ptr TimeCoord] -> IO [TimeCoord]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr TimeCoord -> TimeCoord)
-> Ptr TimeCoord -> IO TimeCoord
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TimeCoord -> TimeCoord
Gdk.TimeCoord.TimeCoord) [Ptr TimeCoord]
result'
Ptr (GList (Ptr TimeCoord)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr TimeCoord))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
[TimeCoord] -> IO [TimeCoord]
forall (m :: * -> *) a. Monad m => a -> m a
return [TimeCoord]
result''
#if defined(ENABLE_OVERLOADING)
data EventGetMotionHistoryMethodInfo
instance (signature ~ (m [Gdk.TimeCoord.TimeCoord]), MonadIO m, IsEvent a) => O.MethodInfo EventGetMotionHistoryMethodInfo a signature where
overloadedMethod = eventGetMotionHistory
#endif
foreign import ccall "gdk_event_get_pad_axis_value" gdk_event_get_pad_axis_value ::
Ptr Event ->
Ptr Word32 ->
Ptr CDouble ->
IO CInt
eventGetPadAxisValue ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word32, Double))
eventGetPadAxisValue :: a -> m (Bool, Word32, Double)
eventGetPadAxisValue event :: a
event = IO (Bool, Word32, Double) -> m (Bool, Word32, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32, Double) -> m (Bool, Word32, Double))
-> IO (Bool, Word32, Double) -> m (Bool, Word32, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word32
index <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr CDouble
value <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Event -> Ptr Word32 -> Ptr CDouble -> IO CInt
gdk_event_get_pad_axis_value Ptr Event
event' Ptr Word32
index Ptr CDouble
value
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word32
index' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
index
CDouble
value' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
value
let value'' :: Double
value'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
index
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
value
(Bool, Word32, Double) -> IO (Bool, Word32, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
index', Double
value'')
#if defined(ENABLE_OVERLOADING)
data EventGetPadAxisValueMethodInfo
instance (signature ~ (m ((Bool, Word32, Double))), MonadIO m, IsEvent a) => O.MethodInfo EventGetPadAxisValueMethodInfo a signature where
overloadedMethod = eventGetPadAxisValue
#endif
foreign import ccall "gdk_event_get_pad_button" gdk_event_get_pad_button ::
Ptr Event ->
Ptr Word32 ->
IO CInt
eventGetPadButton ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word32))
eventGetPadButton :: a -> m (Bool, Word32)
eventGetPadButton event :: a
event = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word32
button <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Event -> Ptr Word32 -> IO CInt
gdk_event_get_pad_button Ptr Event
event' Ptr Word32
button
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word32
button' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
button
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
button
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
button')
#if defined(ENABLE_OVERLOADING)
data EventGetPadButtonMethodInfo
instance (signature ~ (m ((Bool, Word32))), MonadIO m, IsEvent a) => O.MethodInfo EventGetPadButtonMethodInfo a signature where
overloadedMethod = eventGetPadButton
#endif
foreign import ccall "gdk_event_get_pad_group_mode" gdk_event_get_pad_group_mode ::
Ptr Event ->
Ptr Word32 ->
Ptr Word32 ->
IO CInt
eventGetPadGroupMode ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word32, Word32))
eventGetPadGroupMode :: a -> m (Bool, Word32, Word32)
eventGetPadGroupMode event :: a
event = IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32))
-> IO (Bool, Word32, Word32) -> m (Bool, Word32, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word32
group <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr Word32
mode <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Event -> Ptr Word32 -> Ptr Word32 -> IO CInt
gdk_event_get_pad_group_mode Ptr Event
event' Ptr Word32
group Ptr Word32
mode
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word32
group' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
group
Word32
mode' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
mode
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
group
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
mode
(Bool, Word32, Word32) -> IO (Bool, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
group', Word32
mode')
#if defined(ENABLE_OVERLOADING)
data EventGetPadGroupModeMethodInfo
instance (signature ~ (m ((Bool, Word32, Word32))), MonadIO m, IsEvent a) => O.MethodInfo EventGetPadGroupModeMethodInfo a signature where
overloadedMethod = eventGetPadGroupMode
#endif
foreign import ccall "gdk_event_get_pointer_emulated" gdk_event_get_pointer_emulated ::
Ptr Event ->
IO CInt
eventGetPointerEmulated ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Bool
eventGetPointerEmulated :: a -> m Bool
eventGetPointerEmulated event :: a
event = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
CInt
result <- Ptr Event -> IO CInt
gdk_event_get_pointer_emulated Ptr Event
event'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data EventGetPointerEmulatedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEvent a) => O.MethodInfo EventGetPointerEmulatedMethodInfo a signature where
overloadedMethod = eventGetPointerEmulated
#endif
foreign import ccall "gdk_event_get_root_coords" gdk_event_get_root_coords ::
Ptr Event ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
eventGetRootCoords ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Double, Double))
eventGetRootCoords :: a -> m (Bool, Double, Double)
eventGetRootCoords event :: a
event = IO (Bool, Double, Double) -> m (Bool, Double, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double, Double) -> m (Bool, Double, Double))
-> IO (Bool, Double, Double) -> m (Bool, Double, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CDouble
xRoot <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
yRoot <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Event -> Ptr CDouble -> Ptr CDouble -> IO CInt
gdk_event_get_root_coords Ptr Event
event' Ptr CDouble
xRoot Ptr CDouble
yRoot
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CDouble
xRoot' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
xRoot
let xRoot'' :: Double
xRoot'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
xRoot'
CDouble
yRoot' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
yRoot
let yRoot'' :: Double
yRoot'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
yRoot'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
xRoot
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
yRoot
(Bool, Double, Double) -> IO (Bool, Double, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
xRoot'', Double
yRoot'')
#if defined(ENABLE_OVERLOADING)
data EventGetRootCoordsMethodInfo
instance (signature ~ (m ((Bool, Double, Double))), MonadIO m, IsEvent a) => O.MethodInfo EventGetRootCoordsMethodInfo a signature where
overloadedMethod = eventGetRootCoords
#endif
foreign import ccall "gdk_event_get_scancode" gdk_event_get_scancode ::
Ptr Event ->
IO Int32
eventGetScancode ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Int32
eventGetScancode :: a -> m Int32
eventGetScancode event :: a
event = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Int32
result <- Ptr Event -> IO Int32
gdk_event_get_scancode Ptr Event
event'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data EventGetScancodeMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsEvent a) => O.MethodInfo EventGetScancodeMethodInfo a signature where
overloadedMethod = eventGetScancode
#endif
foreign import ccall "gdk_event_get_scroll_deltas" gdk_event_get_scroll_deltas ::
Ptr Event ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
eventGetScrollDeltas ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Double, Double))
eventGetScrollDeltas :: a -> m (Bool, Double, Double)
eventGetScrollDeltas event :: a
event = IO (Bool, Double, Double) -> m (Bool, Double, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double, Double) -> m (Bool, Double, Double))
-> IO (Bool, Double, Double) -> m (Bool, Double, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CDouble
deltaX <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
deltaY <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Event -> Ptr CDouble -> Ptr CDouble -> IO CInt
gdk_event_get_scroll_deltas Ptr Event
event' Ptr CDouble
deltaX Ptr CDouble
deltaY
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CDouble
deltaX' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
deltaX
let deltaX'' :: Double
deltaX'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
deltaX'
CDouble
deltaY' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
deltaY
let deltaY'' :: Double
deltaY'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
deltaY'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
deltaX
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
deltaY
(Bool, Double, Double) -> IO (Bool, Double, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
deltaX'', Double
deltaY'')
#if defined(ENABLE_OVERLOADING)
data EventGetScrollDeltasMethodInfo
instance (signature ~ (m ((Bool, Double, Double))), MonadIO m, IsEvent a) => O.MethodInfo EventGetScrollDeltasMethodInfo a signature where
overloadedMethod = eventGetScrollDeltas
#endif
foreign import ccall "gdk_event_get_scroll_direction" gdk_event_get_scroll_direction ::
Ptr Event ->
Ptr CUInt ->
IO CInt
eventGetScrollDirection ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Gdk.Enums.ScrollDirection))
eventGetScrollDirection :: a -> m (Bool, ScrollDirection)
eventGetScrollDirection event :: a
event = IO (Bool, ScrollDirection) -> m (Bool, ScrollDirection)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, ScrollDirection) -> m (Bool, ScrollDirection))
-> IO (Bool, ScrollDirection) -> m (Bool, ScrollDirection)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CUInt
direction <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
CInt
result <- Ptr Event -> Ptr CUInt -> IO CInt
gdk_event_get_scroll_direction Ptr Event
event' Ptr CUInt
direction
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CUInt
direction' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
direction
let direction'' :: ScrollDirection
direction'' = (Int -> ScrollDirection
forall a. Enum a => Int -> a
toEnum (Int -> ScrollDirection)
-> (CUInt -> Int) -> CUInt -> ScrollDirection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
direction'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
direction
(Bool, ScrollDirection) -> IO (Bool, ScrollDirection)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', ScrollDirection
direction'')
#if defined(ENABLE_OVERLOADING)
data EventGetScrollDirectionMethodInfo
instance (signature ~ (m ((Bool, Gdk.Enums.ScrollDirection))), MonadIO m, IsEvent a) => O.MethodInfo EventGetScrollDirectionMethodInfo a signature where
overloadedMethod = eventGetScrollDirection
#endif
foreign import ccall "gdk_event_get_seat" gdk_event_get_seat ::
Ptr Event ->
IO (Ptr Gdk.Seat.Seat)
eventGetSeat ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Gdk.Seat.Seat
eventGetSeat :: a -> m Seat
eventGetSeat event :: a
event = IO Seat -> m Seat
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Seat -> m Seat) -> IO Seat -> m Seat
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Seat
result <- Ptr Event -> IO (Ptr Seat)
gdk_event_get_seat Ptr Event
event'
Text -> Ptr Seat -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "eventGetSeat" Ptr Seat
result
Seat
result' <- ((ManagedPtr Seat -> Seat) -> Ptr Seat -> IO Seat
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Seat -> Seat
Gdk.Seat.Seat) Ptr Seat
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Seat -> IO Seat
forall (m :: * -> *) a. Monad m => a -> m a
return Seat
result'
#if defined(ENABLE_OVERLOADING)
data EventGetSeatMethodInfo
instance (signature ~ (m Gdk.Seat.Seat), MonadIO m, IsEvent a) => O.MethodInfo EventGetSeatMethodInfo a signature where
overloadedMethod = eventGetSeat
#endif
foreign import ccall "gdk_event_get_source_device" gdk_event_get_source_device ::
Ptr Event ->
IO (Ptr Gdk.Device.Device)
eventGetSourceDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m (Maybe Gdk.Device.Device)
eventGetSourceDevice :: a -> m (Maybe Device)
eventGetSourceDevice event :: a
event = IO (Maybe Device) -> m (Maybe Device)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Device) -> m (Maybe Device))
-> IO (Maybe Device) -> m (Maybe Device)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Device
result <- Ptr Event -> IO (Ptr Device)
gdk_event_get_source_device Ptr Event
event'
Maybe Device
maybeResult <- Ptr Device -> (Ptr Device -> IO Device) -> IO (Maybe Device)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Device
result ((Ptr Device -> IO Device) -> IO (Maybe Device))
-> (Ptr Device -> IO Device) -> IO (Maybe Device)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Device
result' -> do
Device
result'' <- ((ManagedPtr Device -> Device) -> Ptr Device -> IO Device
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Device -> Device
Gdk.Device.Device) Ptr Device
result'
Device -> IO Device
forall (m :: * -> *) a. Monad m => a -> m a
return Device
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Maybe Device -> IO (Maybe Device)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Device
maybeResult
#if defined(ENABLE_OVERLOADING)
data EventGetSourceDeviceMethodInfo
instance (signature ~ (m (Maybe Gdk.Device.Device)), MonadIO m, IsEvent a) => O.MethodInfo EventGetSourceDeviceMethodInfo a signature where
overloadedMethod = eventGetSourceDevice
#endif
foreign import ccall "gdk_event_get_state" gdk_event_get_state ::
Ptr Event ->
Ptr CUInt ->
IO CInt
eventGetState ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, [Gdk.Flags.ModifierType]))
eventGetState :: a -> m (Bool, [ModifierType])
eventGetState event :: a
event = IO (Bool, [ModifierType]) -> m (Bool, [ModifierType])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, [ModifierType]) -> m (Bool, [ModifierType]))
-> IO (Bool, [ModifierType]) -> m (Bool, [ModifierType])
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CUInt
state <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
CInt
result <- Ptr Event -> Ptr CUInt -> IO CInt
gdk_event_get_state Ptr Event
event' Ptr CUInt
state
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CUInt
state' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
state
let state'' :: [ModifierType]
state'' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
state'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
state
(Bool, [ModifierType]) -> IO (Bool, [ModifierType])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [ModifierType]
state'')
#if defined(ENABLE_OVERLOADING)
data EventGetStateMethodInfo
instance (signature ~ (m ((Bool, [Gdk.Flags.ModifierType]))), MonadIO m, IsEvent a) => O.MethodInfo EventGetStateMethodInfo a signature where
overloadedMethod = eventGetState
#endif
foreign import ccall "gdk_event_get_surface" gdk_event_get_surface ::
Ptr Event ->
IO (Ptr Gdk.Surface.Surface)
eventGetSurface ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Gdk.Surface.Surface
eventGetSurface :: a -> m Surface
eventGetSurface event :: a
event = IO Surface -> m Surface
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Surface
result <- Ptr Event -> IO (Ptr Surface)
gdk_event_get_surface Ptr Event
event'
Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "eventGetSurface" Ptr Surface
result
Surface
result' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Gdk.Surface.Surface) Ptr Surface
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'
#if defined(ENABLE_OVERLOADING)
data EventGetSurfaceMethodInfo
instance (signature ~ (m Gdk.Surface.Surface), MonadIO m, IsEvent a) => O.MethodInfo EventGetSurfaceMethodInfo a signature where
overloadedMethod = eventGetSurface
#endif
foreign import ccall "gdk_event_get_time" gdk_event_get_time ::
Ptr Event ->
IO Word32
eventGetTime ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Word32
eventGetTime :: a -> m Word32
eventGetTime event :: a
event = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Word32
result <- Ptr Event -> IO Word32
gdk_event_get_time Ptr Event
event'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data EventGetTimeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsEvent a) => O.MethodInfo EventGetTimeMethodInfo a signature where
overloadedMethod = eventGetTime
#endif
foreign import ccall "gdk_event_get_touch_emulating_pointer" gdk_event_get_touch_emulating_pointer ::
Ptr Event ->
Ptr CInt ->
IO CInt
eventGetTouchEmulatingPointer ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Bool))
eventGetTouchEmulatingPointer :: a -> m (Bool, Bool)
eventGetTouchEmulatingPointer event :: a
event = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CInt
emulating <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
CInt
result <- Ptr Event -> Ptr CInt -> IO CInt
gdk_event_get_touch_emulating_pointer Ptr Event
event' Ptr CInt
emulating
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CInt
emulating' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
emulating
let emulating'' :: Bool
emulating'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
emulating'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
emulating
(Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
emulating'')
#if defined(ENABLE_OVERLOADING)
data EventGetTouchEmulatingPointerMethodInfo
instance (signature ~ (m ((Bool, Bool))), MonadIO m, IsEvent a) => O.MethodInfo EventGetTouchEmulatingPointerMethodInfo a signature where
overloadedMethod = eventGetTouchEmulatingPointer
#endif
foreign import ccall "gdk_event_get_touchpad_angle_delta" gdk_event_get_touchpad_angle_delta ::
Ptr Event ->
Ptr CDouble ->
IO CInt
eventGetTouchpadAngleDelta ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Double))
eventGetTouchpadAngleDelta :: a -> m (Bool, Double)
eventGetTouchpadAngleDelta event :: a
event = IO (Bool, Double) -> m (Bool, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double) -> m (Bool, Double))
-> IO (Bool, Double) -> m (Bool, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CDouble
delta <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Event -> Ptr CDouble -> IO CInt
gdk_event_get_touchpad_angle_delta Ptr Event
event' Ptr CDouble
delta
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CDouble
delta' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
delta
let delta'' :: Double
delta'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
delta'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
delta
(Bool, Double) -> IO (Bool, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
delta'')
#if defined(ENABLE_OVERLOADING)
data EventGetTouchpadAngleDeltaMethodInfo
instance (signature ~ (m ((Bool, Double))), MonadIO m, IsEvent a) => O.MethodInfo EventGetTouchpadAngleDeltaMethodInfo a signature where
overloadedMethod = eventGetTouchpadAngleDelta
#endif
foreign import ccall "gdk_event_get_touchpad_deltas" gdk_event_get_touchpad_deltas ::
Ptr Event ->
Ptr CDouble ->
Ptr CDouble ->
IO CInt
eventGetTouchpadDeltas ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Double, Double))
eventGetTouchpadDeltas :: a -> m (Bool, Double, Double)
eventGetTouchpadDeltas event :: a
event = IO (Bool, Double, Double) -> m (Bool, Double, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double, Double) -> m (Bool, Double, Double))
-> IO (Bool, Double, Double) -> m (Bool, Double, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CDouble
dx <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
dy <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Event -> Ptr CDouble -> Ptr CDouble -> IO CInt
gdk_event_get_touchpad_deltas Ptr Event
event' Ptr CDouble
dx Ptr CDouble
dy
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CDouble
dx' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
dx
let dx'' :: Double
dx'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
dx'
CDouble
dy' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
dy
let dy'' :: Double
dy'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
dy'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
dx
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
dy
(Bool, Double, Double) -> IO (Bool, Double, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
dx'', Double
dy'')
#if defined(ENABLE_OVERLOADING)
data EventGetTouchpadDeltasMethodInfo
instance (signature ~ (m ((Bool, Double, Double))), MonadIO m, IsEvent a) => O.MethodInfo EventGetTouchpadDeltasMethodInfo a signature where
overloadedMethod = eventGetTouchpadDeltas
#endif
foreign import ccall "gdk_event_get_touchpad_gesture_n_fingers" gdk_event_get_touchpad_gesture_n_fingers ::
Ptr Event ->
Ptr Word32 ->
IO CInt
eventGetTouchpadGestureNFingers ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Word32))
eventGetTouchpadGestureNFingers :: a -> m (Bool, Word32)
eventGetTouchpadGestureNFingers event :: a
event = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Word32
nFingers <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Event -> Ptr Word32 -> IO CInt
gdk_event_get_touchpad_gesture_n_fingers Ptr Event
event' Ptr Word32
nFingers
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Word32
nFingers' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
nFingers
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
nFingers
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
nFingers')
#if defined(ENABLE_OVERLOADING)
data EventGetTouchpadGestureNFingersMethodInfo
instance (signature ~ (m ((Bool, Word32))), MonadIO m, IsEvent a) => O.MethodInfo EventGetTouchpadGestureNFingersMethodInfo a signature where
overloadedMethod = eventGetTouchpadGestureNFingers
#endif
foreign import ccall "gdk_event_get_touchpad_gesture_phase" gdk_event_get_touchpad_gesture_phase ::
Ptr Event ->
Ptr CUInt ->
IO CInt
eventGetTouchpadGesturePhase ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Gdk.Enums.TouchpadGesturePhase))
eventGetTouchpadGesturePhase :: a -> m (Bool, TouchpadGesturePhase)
eventGetTouchpadGesturePhase event :: a
event = IO (Bool, TouchpadGesturePhase) -> m (Bool, TouchpadGesturePhase)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, TouchpadGesturePhase) -> m (Bool, TouchpadGesturePhase))
-> IO (Bool, TouchpadGesturePhase)
-> m (Bool, TouchpadGesturePhase)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CUInt
phase <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
CInt
result <- Ptr Event -> Ptr CUInt -> IO CInt
gdk_event_get_touchpad_gesture_phase Ptr Event
event' Ptr CUInt
phase
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CUInt
phase' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
phase
let phase'' :: TouchpadGesturePhase
phase'' = (Int -> TouchpadGesturePhase
forall a. Enum a => Int -> a
toEnum (Int -> TouchpadGesturePhase)
-> (CUInt -> Int) -> CUInt -> TouchpadGesturePhase
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
phase'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
phase
(Bool, TouchpadGesturePhase) -> IO (Bool, TouchpadGesturePhase)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', TouchpadGesturePhase
phase'')
#if defined(ENABLE_OVERLOADING)
data EventGetTouchpadGesturePhaseMethodInfo
instance (signature ~ (m ((Bool, Gdk.Enums.TouchpadGesturePhase))), MonadIO m, IsEvent a) => O.MethodInfo EventGetTouchpadGesturePhaseMethodInfo a signature where
overloadedMethod = eventGetTouchpadGesturePhase
#endif
foreign import ccall "gdk_event_get_touchpad_scale" gdk_event_get_touchpad_scale ::
Ptr Event ->
Ptr CDouble ->
IO CInt
eventGetTouchpadScale ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m ((Bool, Double))
eventGetTouchpadScale :: a -> m (Bool, Double)
eventGetTouchpadScale event :: a
event = IO (Bool, Double) -> m (Bool, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double) -> m (Bool, Double))
-> IO (Bool, Double) -> m (Bool, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr CDouble
scale <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
CInt
result <- Ptr Event -> Ptr CDouble -> IO CInt
gdk_event_get_touchpad_scale Ptr Event
event' Ptr CDouble
scale
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CDouble
scale' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
scale
let scale'' :: Double
scale'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
scale'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
scale
(Bool, Double) -> IO (Bool, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
scale'')
#if defined(ENABLE_OVERLOADING)
data EventGetTouchpadScaleMethodInfo
instance (signature ~ (m ((Bool, Double))), MonadIO m, IsEvent a) => O.MethodInfo EventGetTouchpadScaleMethodInfo a signature where
overloadedMethod = eventGetTouchpadScale
#endif
foreign import ccall "gdk_event_is_scroll_stop_event" gdk_event_is_scroll_stop_event ::
Ptr Event ->
IO CInt
eventIsScrollStopEvent ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Bool
eventIsScrollStopEvent :: a -> m Bool
eventIsScrollStopEvent event :: a
event = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
CInt
result <- Ptr Event -> IO CInt
gdk_event_is_scroll_stop_event Ptr Event
event'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data EventIsScrollStopEventMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEvent a) => O.MethodInfo EventIsScrollStopEventMethodInfo a signature where
overloadedMethod = eventIsScrollStopEvent
#endif
foreign import ccall "gdk_event_is_sent" gdk_event_is_sent ::
Ptr Event ->
IO CInt
eventIsSent ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Bool
eventIsSent :: a -> m Bool
eventIsSent event :: a
event = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
CInt
result <- Ptr Event -> IO CInt
gdk_event_is_sent Ptr Event
event'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data EventIsSentMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEvent a) => O.MethodInfo EventIsSentMethodInfo a signature where
overloadedMethod = eventIsSent
#endif
foreign import ccall "gdk_event_set_coords" gdk_event_set_coords ::
Ptr Event ->
CDouble ->
CDouble ->
IO ()
eventSetCoords ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> Double
-> Double
-> m ()
eventSetCoords :: a -> Double -> Double -> m ()
eventSetCoords event :: a
event x :: Double
x y :: Double
y = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
Ptr Event -> CDouble -> CDouble -> IO ()
gdk_event_set_coords Ptr Event
event' CDouble
x' CDouble
y'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EventSetCoordsMethodInfo
instance (signature ~ (Double -> Double -> m ()), MonadIO m, IsEvent a) => O.MethodInfo EventSetCoordsMethodInfo a signature where
overloadedMethod = eventSetCoords
#endif
foreign import ccall "gdk_event_set_device" gdk_event_set_device ::
Ptr Event ->
Ptr Gdk.Device.Device ->
IO ()
eventSetDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a, Gdk.Device.IsDevice b) =>
a
-> b
-> m ()
eventSetDevice :: a -> b -> m ()
eventSetDevice event :: a
event device :: b
device = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
Ptr Event -> Ptr Device -> IO ()
gdk_event_set_device Ptr Event
event' Ptr Device
device'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EventSetDeviceMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsEvent a, Gdk.Device.IsDevice b) => O.MethodInfo EventSetDeviceMethodInfo a signature where
overloadedMethod = eventSetDevice
#endif
foreign import ccall "gdk_event_set_device_tool" gdk_event_set_device_tool ::
Ptr Event ->
Ptr Gdk.DeviceTool.DeviceTool ->
IO ()
eventSetDeviceTool ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a, Gdk.DeviceTool.IsDeviceTool b) =>
a
-> Maybe (b)
-> m ()
eventSetDeviceTool :: a -> Maybe b -> m ()
eventSetDeviceTool event :: a
event tool :: Maybe b
tool = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr DeviceTool
maybeTool <- case Maybe b
tool of
Nothing -> Ptr DeviceTool -> IO (Ptr DeviceTool)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DeviceTool
forall a. Ptr a
nullPtr
Just jTool :: b
jTool -> do
Ptr DeviceTool
jTool' <- b -> IO (Ptr DeviceTool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jTool
Ptr DeviceTool -> IO (Ptr DeviceTool)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DeviceTool
jTool'
Ptr Event -> Ptr DeviceTool -> IO ()
gdk_event_set_device_tool Ptr Event
event' Ptr DeviceTool
maybeTool
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
tool b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EventSetDeviceToolMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsEvent a, Gdk.DeviceTool.IsDeviceTool b) => O.MethodInfo EventSetDeviceToolMethodInfo a signature where
overloadedMethod = eventSetDeviceTool
#endif
foreign import ccall "gdk_event_set_display" gdk_event_set_display ::
Ptr Event ->
Ptr Gdk.Display.Display ->
IO ()
eventSetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a, Gdk.Display.IsDisplay b) =>
a
-> b
-> m ()
eventSetDisplay :: a -> b -> m ()
eventSetDisplay event :: a
event display :: b
display = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Display
display' <- b -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
display
Ptr Event -> Ptr Display -> IO ()
gdk_event_set_display Ptr Event
event' Ptr Display
display'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
display
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EventSetDisplayMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsEvent a, Gdk.Display.IsDisplay b) => O.MethodInfo EventSetDisplayMethodInfo a signature where
overloadedMethod = eventSetDisplay
#endif
foreign import ccall "gdk_event_set_keyval" gdk_event_set_keyval ::
Ptr Event ->
Word32 ->
IO ()
eventSetKeyval ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> Word32
-> m ()
eventSetKeyval :: a -> Word32 -> m ()
eventSetKeyval event :: a
event keyval :: Word32
keyval = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Event -> Word32 -> IO ()
gdk_event_set_keyval Ptr Event
event' Word32
keyval
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EventSetKeyvalMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsEvent a) => O.MethodInfo EventSetKeyvalMethodInfo a signature where
overloadedMethod = eventSetKeyval
#endif
foreign import ccall "gdk_event_set_source_device" gdk_event_set_source_device ::
Ptr Event ->
Ptr Gdk.Device.Device ->
IO ()
eventSetSourceDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a, Gdk.Device.IsDevice b) =>
a
-> b
-> m ()
eventSetSourceDevice :: a -> b -> m ()
eventSetSourceDevice event :: a
event device :: b
device = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
Ptr Event -> Ptr Device -> IO ()
gdk_event_set_source_device Ptr Event
event' Ptr Device
device'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EventSetSourceDeviceMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsEvent a, Gdk.Device.IsDevice b) => O.MethodInfo EventSetSourceDeviceMethodInfo a signature where
overloadedMethod = eventSetSourceDevice
#endif
foreign import ccall "gdk_event_triggers_context_menu" ::
Ptr Event ->
IO CInt
eventTriggersContextMenu ::
(B.CallStack.HasCallStack, MonadIO m, IsEvent a) =>
a
-> m Bool
event :: a
event = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- a -> IO (Ptr Event)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
CInt
result <- Ptr Event -> IO CInt
gdk_event_triggers_context_menu Ptr Event
event'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
event
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data EventTriggersContextMenuMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEvent a) => O.MethodInfo EventTriggersContextMenuMethodInfo a signature where
overloadedMethod = eventTriggersContextMenu
#endif