{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A t'GI.Gdk.Unions.Event.Event' contains a union of all of the event types,
-- and allows access to the data fields in a number of ways.
-- 
-- The event type is always the first field in all of the event types, and
-- can always be accessed with the following code, no matter what type of
-- event it is:
-- 
-- === /C code/
-- >
-- >  GdkEvent *event;
-- >  GdkEventType type;
-- >
-- >  type = event->type;
-- 
-- 
-- To access other fields of the event, the pointer to the event
-- can be cast to the appropriate event type, or the union member
-- name can be used. For example if the event type is 'GI.Gdk.Enums.EventTypeButtonPress'
-- then the x coordinate of the button press can be accessed with:
-- 
-- === /C code/
-- >
-- >  GdkEvent *event;
-- >  gdouble x;
-- >
-- >  x = ((GdkEventButton*)event)->x;
-- 
-- or:
-- 
-- === /C code/
-- >
-- >  GdkEvent *event;
-- >  gdouble x;
-- >
-- >  x = event->button.x;
-- 

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Gdk.Unions.Event
    ( 

-- * Exported types
    Event(..)                               ,
    newZeroEvent                            ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveEventMethod                      ,
#endif


-- ** copy #method:copy#

#if defined(ENABLE_OVERLOADING)
    EventCopyMethodInfo                     ,
#endif
    eventCopy                               ,


-- ** free #method:free#

#if defined(ENABLE_OVERLOADING)
    EventFreeMethodInfo                     ,
#endif
    eventFree                               ,


-- ** get #method:get#

    eventGet                                ,


-- ** getAxis #method:getAxis#

#if defined(ENABLE_OVERLOADING)
    EventGetAxisMethodInfo                  ,
#endif
    eventGetAxis                            ,


-- ** getButton #method:getButton#

#if defined(ENABLE_OVERLOADING)
    EventGetButtonMethodInfo                ,
#endif
    eventGetButton                          ,


-- ** getClickCount #method:getClickCount#

#if defined(ENABLE_OVERLOADING)
    EventGetClickCountMethodInfo            ,
#endif
    eventGetClickCount                      ,


-- ** getCoords #method:getCoords#

#if defined(ENABLE_OVERLOADING)
    EventGetCoordsMethodInfo                ,
#endif
    eventGetCoords                          ,


-- ** getDevice #method:getDevice#

#if defined(ENABLE_OVERLOADING)
    EventGetDeviceMethodInfo                ,
#endif
    eventGetDevice                          ,


-- ** getDeviceTool #method:getDeviceTool#

#if defined(ENABLE_OVERLOADING)
    EventGetDeviceToolMethodInfo            ,
#endif
    eventGetDeviceTool                      ,


-- ** getEventSequence #method:getEventSequence#

#if defined(ENABLE_OVERLOADING)
    EventGetEventSequenceMethodInfo         ,
#endif
    eventGetEventSequence                   ,


-- ** getEventType #method:getEventType#

#if defined(ENABLE_OVERLOADING)
    EventGetEventTypeMethodInfo             ,
#endif
    eventGetEventType                       ,


-- ** getKeycode #method:getKeycode#

#if defined(ENABLE_OVERLOADING)
    EventGetKeycodeMethodInfo               ,
#endif
    eventGetKeycode                         ,


-- ** getKeyval #method:getKeyval#

#if defined(ENABLE_OVERLOADING)
    EventGetKeyvalMethodInfo                ,
#endif
    eventGetKeyval                          ,


-- ** getPointerEmulated #method:getPointerEmulated#

#if defined(ENABLE_OVERLOADING)
    EventGetPointerEmulatedMethodInfo       ,
#endif
    eventGetPointerEmulated                 ,


-- ** getRootCoords #method:getRootCoords#

#if defined(ENABLE_OVERLOADING)
    EventGetRootCoordsMethodInfo            ,
#endif
    eventGetRootCoords                      ,


-- ** getScancode #method:getScancode#

#if defined(ENABLE_OVERLOADING)
    EventGetScancodeMethodInfo              ,
#endif
    eventGetScancode                        ,


-- ** getScreen #method:getScreen#

#if defined(ENABLE_OVERLOADING)
    EventGetScreenMethodInfo                ,
#endif
    eventGetScreen                          ,


-- ** getScrollDeltas #method:getScrollDeltas#

#if defined(ENABLE_OVERLOADING)
    EventGetScrollDeltasMethodInfo          ,
#endif
    eventGetScrollDeltas                    ,


-- ** getScrollDirection #method:getScrollDirection#

#if defined(ENABLE_OVERLOADING)
    EventGetScrollDirectionMethodInfo       ,
#endif
    eventGetScrollDirection                 ,


-- ** getSeat #method:getSeat#

#if defined(ENABLE_OVERLOADING)
    EventGetSeatMethodInfo                  ,
#endif
    eventGetSeat                            ,


-- ** getSourceDevice #method:getSourceDevice#

#if defined(ENABLE_OVERLOADING)
    EventGetSourceDeviceMethodInfo          ,
#endif
    eventGetSourceDevice                    ,


-- ** getState #method:getState#

#if defined(ENABLE_OVERLOADING)
    EventGetStateMethodInfo                 ,
#endif
    eventGetState                           ,


-- ** getTime #method:getTime#

#if defined(ENABLE_OVERLOADING)
    EventGetTimeMethodInfo                  ,
#endif
    eventGetTime                            ,


-- ** getWindow #method:getWindow#

#if defined(ENABLE_OVERLOADING)
    EventGetWindowMethodInfo                ,
#endif
    eventGetWindow                          ,


-- ** handlerSet #method:handlerSet#

    eventHandlerSet                         ,


-- ** isScrollStopEvent #method:isScrollStopEvent#

#if defined(ENABLE_OVERLOADING)
    EventIsScrollStopEventMethodInfo        ,
#endif
    eventIsScrollStopEvent                  ,


-- ** new #method:new#

    eventNew                                ,


-- ** peek #method:peek#

    eventPeek                               ,


-- ** put #method:put#

#if defined(ENABLE_OVERLOADING)
    EventPutMethodInfo                      ,
#endif
    eventPut                                ,


-- ** requestMotions #method:requestMotions#

    eventRequestMotions                     ,


-- ** setDevice #method:setDevice#

#if defined(ENABLE_OVERLOADING)
    EventSetDeviceMethodInfo                ,
#endif
    eventSetDevice                          ,


-- ** setDeviceTool #method:setDeviceTool#

#if defined(ENABLE_OVERLOADING)
    EventSetDeviceToolMethodInfo            ,
#endif
    eventSetDeviceTool                      ,


-- ** setScreen #method:setScreen#

#if defined(ENABLE_OVERLOADING)
    EventSetScreenMethodInfo                ,
#endif
    eventSetScreen                          ,


-- ** setSourceDevice #method:setSourceDevice#

#if defined(ENABLE_OVERLOADING)
    EventSetSourceDeviceMethodInfo          ,
#endif
    eventSetSourceDevice                    ,


-- ** triggersContextMenu #method:triggersContextMenu#

#if defined(ENABLE_OVERLOADING)
    EventTriggersContextMenuMethodInfo      ,
#endif
    eventTriggersContextMenu                ,




 -- * Properties
-- ** any #attr:any#
-- | a t'GI.Gdk.Structs.EventAny.EventAny'

#if defined(ENABLE_OVERLOADING)
    event_any                               ,
#endif
    getEventAny                             ,


-- ** button #attr:button#
-- | a t'GI.Gdk.Structs.EventButton.EventButton'

#if defined(ENABLE_OVERLOADING)
    event_button                            ,
#endif
    getEventButton                          ,


-- ** configure #attr:configure#
-- | a t'GI.Gdk.Structs.EventConfigure.EventConfigure'

#if defined(ENABLE_OVERLOADING)
    event_configure                         ,
#endif
    getEventConfigure                       ,


-- ** crossing #attr:crossing#
-- | a t'GI.Gdk.Structs.EventCrossing.EventCrossing'

#if defined(ENABLE_OVERLOADING)
    event_crossing                          ,
#endif
    getEventCrossing                        ,


-- ** dnd #attr:dnd#
-- | a t'GI.Gdk.Structs.EventDND.EventDND'

#if defined(ENABLE_OVERLOADING)
    event_dnd                               ,
#endif
    getEventDnd                             ,


-- ** expose #attr:expose#
-- | a t'GI.Gdk.Structs.EventExpose.EventExpose'

#if defined(ENABLE_OVERLOADING)
    event_expose                            ,
#endif
    getEventExpose                          ,


-- ** focusChange #attr:focusChange#
-- | a t'GI.Gdk.Structs.EventFocus.EventFocus'

#if defined(ENABLE_OVERLOADING)
    event_focusChange                       ,
#endif
    getEventFocusChange                     ,


-- ** grabBroken #attr:grabBroken#
-- | a t'GI.Gdk.Structs.EventGrabBroken.EventGrabBroken'

#if defined(ENABLE_OVERLOADING)
    event_grabBroken                        ,
#endif
    getEventGrabBroken                      ,


-- ** key #attr:key#
-- | a t'GI.Gdk.Structs.EventKey.EventKey'

#if defined(ENABLE_OVERLOADING)
    event_key                               ,
#endif
    getEventKey                             ,


-- ** motion #attr:motion#
-- | a t'GI.Gdk.Structs.EventMotion.EventMotion'

#if defined(ENABLE_OVERLOADING)
    event_motion                            ,
#endif
    getEventMotion                          ,


-- ** ownerChange #attr:ownerChange#
-- | a t'GI.Gdk.Structs.EventOwnerChange.EventOwnerChange'

#if defined(ENABLE_OVERLOADING)
    event_ownerChange                       ,
#endif
    getEventOwnerChange                     ,


-- ** padAxis #attr:padAxis#
-- | a t'GI.Gdk.Structs.EventPadAxis.EventPadAxis'

#if defined(ENABLE_OVERLOADING)
    event_padAxis                           ,
#endif
    getEventPadAxis                         ,


-- ** padButton #attr:padButton#
-- | a t'GI.Gdk.Structs.EventPadButton.EventPadButton'

#if defined(ENABLE_OVERLOADING)
    event_padButton                         ,
#endif
    getEventPadButton                       ,


-- ** padGroupMode #attr:padGroupMode#
-- | a t'GI.Gdk.Structs.EventPadGroupMode.EventPadGroupMode'

#if defined(ENABLE_OVERLOADING)
    event_padGroupMode                      ,
#endif
    getEventPadGroupMode                    ,


-- ** property #attr:property#
-- | a t'GI.Gdk.Structs.EventProperty.EventProperty'

#if defined(ENABLE_OVERLOADING)
    event_property                          ,
#endif
    getEventProperty                        ,


-- ** proximity #attr:proximity#
-- | a t'GI.Gdk.Structs.EventProximity.EventProximity'

#if defined(ENABLE_OVERLOADING)
    event_proximity                         ,
#endif
    getEventProximity                       ,


-- ** scroll #attr:scroll#
-- | a t'GI.Gdk.Structs.EventScroll.EventScroll'

#if defined(ENABLE_OVERLOADING)
    event_scroll                            ,
#endif
    getEventScroll                          ,


-- ** selection #attr:selection#
-- | a t'GI.Gdk.Structs.EventSelection.EventSelection'

#if defined(ENABLE_OVERLOADING)
    event_selection                         ,
#endif
    getEventSelection                       ,


-- ** setting #attr:setting#
-- | a t'GI.Gdk.Structs.EventSetting.EventSetting'

#if defined(ENABLE_OVERLOADING)
    event_setting                           ,
#endif
    getEventSetting                         ,


-- ** touch #attr:touch#
-- | a t'GI.Gdk.Structs.EventTouch.EventTouch'

#if defined(ENABLE_OVERLOADING)
    event_touch                             ,
#endif
    getEventTouch                           ,


-- ** touchpadPinch #attr:touchpadPinch#
-- | a t'GI.Gdk.Structs.EventTouchpadPinch.EventTouchpadPinch'

#if defined(ENABLE_OVERLOADING)
    event_touchpadPinch                     ,
#endif
    getEventTouchpadPinch                   ,


-- ** touchpadSwipe #attr:touchpadSwipe#
-- | a t'GI.Gdk.Structs.EventTouchpadSwipe.EventTouchpadSwipe'

#if defined(ENABLE_OVERLOADING)
    event_touchpadSwipe                     ,
#endif
    getEventTouchpadSwipe                   ,


-- ** type #attr:type#
-- | the t'GI.Gdk.Enums.EventType'

#if defined(ENABLE_OVERLOADING)
    event_type                              ,
#endif
    getEventType                            ,
    setEventType                            ,


-- ** visibility #attr:visibility#
-- | a t'GI.Gdk.Structs.EventVisibility.EventVisibility'

#if defined(ENABLE_OVERLOADING)
    event_visibility                        ,
#endif
    getEventVisibility                      ,


-- ** windowState #attr:windowState#
-- | a t'GI.Gdk.Structs.EventWindowState.EventWindowState'

#if defined(ENABLE_OVERLOADING)
    event_windowState                       ,
#endif
    getEventWindowState                     ,




    ) 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.BasicTypes as B.Types
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 Control.Monad.IO.Class as MIO
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.GLib.Callbacks as GLib.Callbacks
import qualified GI.Gdk.Callbacks as Gdk.Callbacks
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.Screen as Gdk.Screen
import {-# SOURCE #-} qualified GI.Gdk.Objects.Seat as Gdk.Seat
import {-# SOURCE #-} qualified GI.Gdk.Objects.Window as Gdk.Window
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventAny as Gdk.EventAny
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventButton as Gdk.EventButton
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventConfigure as Gdk.EventConfigure
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventCrossing as Gdk.EventCrossing
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventDND as Gdk.EventDND
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventExpose as Gdk.EventExpose
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventFocus as Gdk.EventFocus
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventGrabBroken as Gdk.EventGrabBroken
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventKey as Gdk.EventKey
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventMotion as Gdk.EventMotion
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventOwnerChange as Gdk.EventOwnerChange
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventPadAxis as Gdk.EventPadAxis
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventPadButton as Gdk.EventPadButton
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventPadGroupMode as Gdk.EventPadGroupMode
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventProperty as Gdk.EventProperty
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventProximity as Gdk.EventProximity
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventScroll as Gdk.EventScroll
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventSelection as Gdk.EventSelection
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventSequence as Gdk.EventSequence
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventSetting as Gdk.EventSetting
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventTouch as Gdk.EventTouch
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventTouchpadPinch as Gdk.EventTouchpadPinch
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventTouchpadSwipe as Gdk.EventTouchpadSwipe
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventVisibility as Gdk.EventVisibility
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventWindowState as Gdk.EventWindowState

-- | Memory-managed wrapper type.
newtype Event = Event (SP.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)

instance SP.ManagedPtrNewtype Event where
    toManagedPtr :: Event -> ManagedPtr Event
toManagedPtr (Event ManagedPtr Event
p) = ManagedPtr Event
p

foreign import ccall "gdk_event_get_type" c_gdk_event_get_type :: 
    IO GType

type instance O.ParentTypes Event = '[]
instance O.HasParentTypes Event

instance B.Types.TypedObject Event where
    glibType :: IO GType
glibType = IO GType
c_gdk_event_get_type

instance B.Types.GBoxed Event

-- | Convert 'Event' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue Event where
    toGValue :: Event -> IO GValue
toGValue 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. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
        
    fromGValue :: GValue -> IO Event
fromGValue GValue
gv = do
        Ptr Event
ptr <- GValue -> IO (Ptr Event)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr Event)
        (ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Event -> Event
Event Ptr Event
ptr
        
    

-- | Construct a `Event` struct initialized to zero.
newZeroEvent :: MonadIO m => m Event
newZeroEvent :: m Event
newZeroEvent = 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
$ Int -> IO (Ptr Event)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
96 IO (Ptr Event) -> (Ptr Event -> IO Event) -> IO Event
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Event

instance tag ~ 'AttrSet => Constructible Event tag where
    new :: (ManagedPtr Event -> Event) -> [AttrOp Event tag] -> m Event
new ManagedPtr Event -> Event
_ [AttrOp Event tag]
attrs = do
        Event
o <- m Event
forall (m :: * -> *). MonadIO m => m Event
newZeroEvent
        Event -> [AttrOp Event 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Event
o [AttrOp Event tag]
[AttrOp Event 'AttrSet]
attrs
        Event -> m Event
forall (m :: * -> *) a. Monad m => a -> m a
return Event
o


-- | Get the value of the “@type@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #type
-- @
getEventType :: MonadIO m => Event -> m Gdk.Enums.EventType
getEventType :: Event -> m EventType
getEventType Event
s = 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
$ Event -> (Ptr Event -> IO EventType) -> IO EventType
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventType) -> IO EventType)
-> (Ptr Event -> IO EventType) -> IO EventType
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    CInt
val <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr Event
ptr Ptr Event -> Int -> Ptr CInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CInt
    let val' :: EventType
val' = (Int -> EventType
forall a. Enum a => Int -> a
toEnum (Int -> EventType) -> (CInt -> Int) -> CInt -> EventType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
val
    EventType -> IO EventType
forall (m :: * -> *) a. Monad m => a -> m a
return EventType
val'

-- | Set the value of the “@type@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' event [ #type 'Data.GI.Base.Attributes.:=' value ]
-- @
setEventType :: MonadIO m => Event -> Gdk.Enums.EventType -> m ()
setEventType :: Event -> EventType -> m ()
setEventType Event
s EventType
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO ()) -> IO ()) -> (Ptr Event -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val' :: CInt
val' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (EventType -> Int) -> EventType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EventType -> Int
forall a. Enum a => a -> Int
fromEnum) EventType
val
    Ptr CInt -> CInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Event
ptr Ptr Event -> Int -> Ptr CInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CInt
val' :: CInt)

#if defined(ENABLE_OVERLOADING)
data EventTypeFieldInfo
instance AttrInfo EventTypeFieldInfo where
    type AttrBaseTypeConstraint EventTypeFieldInfo = (~) Event
    type AttrAllowedOps EventTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint EventTypeFieldInfo = (~) Gdk.Enums.EventType
    type AttrTransferTypeConstraint EventTypeFieldInfo = (~)Gdk.Enums.EventType
    type AttrTransferType EventTypeFieldInfo = Gdk.Enums.EventType
    type AttrGetType EventTypeFieldInfo = Gdk.Enums.EventType
    type AttrLabel EventTypeFieldInfo = "type"
    type AttrOrigin EventTypeFieldInfo = Event
    attrGet = getEventType
    attrSet = setEventType
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer _ v = do
        return v

event_type :: AttrLabelProxy "type"
event_type = AttrLabelProxy

#endif


-- | Get the value of the “@any@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #any
-- @
getEventAny :: MonadIO m => Event -> m Gdk.EventAny.EventAny
getEventAny :: Event -> m EventAny
getEventAny Event
s = IO EventAny -> m EventAny
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventAny -> m EventAny) -> IO EventAny -> m EventAny
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventAny) -> IO EventAny
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventAny) -> IO EventAny)
-> (Ptr Event -> IO EventAny) -> IO EventAny
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventAny
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventAny
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventAny.EventAny)
    EventAny
val' <- ((ManagedPtr EventAny -> EventAny) -> Ptr EventAny -> IO EventAny
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventAny -> EventAny
Gdk.EventAny.EventAny) Ptr EventAny
val
    EventAny -> IO EventAny
forall (m :: * -> *) a. Monad m => a -> m a
return EventAny
val'

#if defined(ENABLE_OVERLOADING)
data EventAnyFieldInfo
instance AttrInfo EventAnyFieldInfo where
    type AttrBaseTypeConstraint EventAnyFieldInfo = (~) Event
    type AttrAllowedOps EventAnyFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventAnyFieldInfo = (~) (Ptr Gdk.EventAny.EventAny)
    type AttrTransferTypeConstraint EventAnyFieldInfo = (~)(Ptr Gdk.EventAny.EventAny)
    type AttrTransferType EventAnyFieldInfo = (Ptr Gdk.EventAny.EventAny)
    type AttrGetType EventAnyFieldInfo = Gdk.EventAny.EventAny
    type AttrLabel EventAnyFieldInfo = "any"
    type AttrOrigin EventAnyFieldInfo = Event
    attrGet = getEventAny
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_any :: AttrLabelProxy "any"
event_any = AttrLabelProxy

#endif


-- | Get the value of the “@expose@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #expose
-- @
getEventExpose :: MonadIO m => Event -> m Gdk.EventExpose.EventExpose
getEventExpose :: Event -> m EventExpose
getEventExpose Event
s = IO EventExpose -> m EventExpose
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventExpose -> m EventExpose)
-> IO EventExpose -> m EventExpose
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventExpose) -> IO EventExpose
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventExpose) -> IO EventExpose)
-> (Ptr Event -> IO EventExpose) -> IO EventExpose
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventExpose
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventExpose
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventExpose.EventExpose)
    EventExpose
val' <- ((ManagedPtr EventExpose -> EventExpose)
-> Ptr EventExpose -> IO EventExpose
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventExpose -> EventExpose
Gdk.EventExpose.EventExpose) Ptr EventExpose
val
    EventExpose -> IO EventExpose
forall (m :: * -> *) a. Monad m => a -> m a
return EventExpose
val'

#if defined(ENABLE_OVERLOADING)
data EventExposeFieldInfo
instance AttrInfo EventExposeFieldInfo where
    type AttrBaseTypeConstraint EventExposeFieldInfo = (~) Event
    type AttrAllowedOps EventExposeFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventExposeFieldInfo = (~) (Ptr Gdk.EventExpose.EventExpose)
    type AttrTransferTypeConstraint EventExposeFieldInfo = (~)(Ptr Gdk.EventExpose.EventExpose)
    type AttrTransferType EventExposeFieldInfo = (Ptr Gdk.EventExpose.EventExpose)
    type AttrGetType EventExposeFieldInfo = Gdk.EventExpose.EventExpose
    type AttrLabel EventExposeFieldInfo = "expose"
    type AttrOrigin EventExposeFieldInfo = Event
    attrGet = getEventExpose
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_expose :: AttrLabelProxy "expose"
event_expose = AttrLabelProxy

#endif


-- | Get the value of the “@visibility@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #visibility
-- @
getEventVisibility :: MonadIO m => Event -> m Gdk.EventVisibility.EventVisibility
getEventVisibility :: Event -> m EventVisibility
getEventVisibility Event
s = IO EventVisibility -> m EventVisibility
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventVisibility -> m EventVisibility)
-> IO EventVisibility -> m EventVisibility
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventVisibility) -> IO EventVisibility
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventVisibility) -> IO EventVisibility)
-> (Ptr Event -> IO EventVisibility) -> IO EventVisibility
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventVisibility
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventVisibility
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventVisibility.EventVisibility)
    EventVisibility
val' <- ((ManagedPtr EventVisibility -> EventVisibility)
-> Ptr EventVisibility -> IO EventVisibility
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventVisibility -> EventVisibility
Gdk.EventVisibility.EventVisibility) Ptr EventVisibility
val
    EventVisibility -> IO EventVisibility
forall (m :: * -> *) a. Monad m => a -> m a
return EventVisibility
val'

#if defined(ENABLE_OVERLOADING)
data EventVisibilityFieldInfo
instance AttrInfo EventVisibilityFieldInfo where
    type AttrBaseTypeConstraint EventVisibilityFieldInfo = (~) Event
    type AttrAllowedOps EventVisibilityFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventVisibilityFieldInfo = (~) (Ptr Gdk.EventVisibility.EventVisibility)
    type AttrTransferTypeConstraint EventVisibilityFieldInfo = (~)(Ptr Gdk.EventVisibility.EventVisibility)
    type AttrTransferType EventVisibilityFieldInfo = (Ptr Gdk.EventVisibility.EventVisibility)
    type AttrGetType EventVisibilityFieldInfo = Gdk.EventVisibility.EventVisibility
    type AttrLabel EventVisibilityFieldInfo = "visibility"
    type AttrOrigin EventVisibilityFieldInfo = Event
    attrGet = getEventVisibility
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_visibility :: AttrLabelProxy "visibility"
event_visibility = AttrLabelProxy

#endif


-- | Get the value of the “@motion@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #motion
-- @
getEventMotion :: MonadIO m => Event -> m Gdk.EventMotion.EventMotion
getEventMotion :: Event -> m EventMotion
getEventMotion Event
s = IO EventMotion -> m EventMotion
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventMotion -> m EventMotion)
-> IO EventMotion -> m EventMotion
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventMotion) -> IO EventMotion
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventMotion) -> IO EventMotion)
-> (Ptr Event -> IO EventMotion) -> IO EventMotion
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventMotion
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventMotion
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventMotion.EventMotion)
    EventMotion
val' <- ((ManagedPtr EventMotion -> EventMotion)
-> Ptr EventMotion -> IO EventMotion
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventMotion -> EventMotion
Gdk.EventMotion.EventMotion) Ptr EventMotion
val
    EventMotion -> IO EventMotion
forall (m :: * -> *) a. Monad m => a -> m a
return EventMotion
val'

#if defined(ENABLE_OVERLOADING)
data EventMotionFieldInfo
instance AttrInfo EventMotionFieldInfo where
    type AttrBaseTypeConstraint EventMotionFieldInfo = (~) Event
    type AttrAllowedOps EventMotionFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventMotionFieldInfo = (~) (Ptr Gdk.EventMotion.EventMotion)
    type AttrTransferTypeConstraint EventMotionFieldInfo = (~)(Ptr Gdk.EventMotion.EventMotion)
    type AttrTransferType EventMotionFieldInfo = (Ptr Gdk.EventMotion.EventMotion)
    type AttrGetType EventMotionFieldInfo = Gdk.EventMotion.EventMotion
    type AttrLabel EventMotionFieldInfo = "motion"
    type AttrOrigin EventMotionFieldInfo = Event
    attrGet = getEventMotion
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_motion :: AttrLabelProxy "motion"
event_motion = AttrLabelProxy

#endif


-- | Get the value of the “@button@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #button
-- @
getEventButton :: MonadIO m => Event -> m Gdk.EventButton.EventButton
getEventButton :: Event -> m EventButton
getEventButton Event
s = IO EventButton -> m EventButton
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventButton -> m EventButton)
-> IO EventButton -> m EventButton
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventButton) -> IO EventButton
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventButton) -> IO EventButton)
-> (Ptr Event -> IO EventButton) -> IO EventButton
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventButton
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventButton
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventButton.EventButton)
    EventButton
val' <- ((ManagedPtr EventButton -> EventButton)
-> Ptr EventButton -> IO EventButton
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventButton -> EventButton
Gdk.EventButton.EventButton) Ptr EventButton
val
    EventButton -> IO EventButton
forall (m :: * -> *) a. Monad m => a -> m a
return EventButton
val'

#if defined(ENABLE_OVERLOADING)
data EventButtonFieldInfo
instance AttrInfo EventButtonFieldInfo where
    type AttrBaseTypeConstraint EventButtonFieldInfo = (~) Event
    type AttrAllowedOps EventButtonFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventButtonFieldInfo = (~) (Ptr Gdk.EventButton.EventButton)
    type AttrTransferTypeConstraint EventButtonFieldInfo = (~)(Ptr Gdk.EventButton.EventButton)
    type AttrTransferType EventButtonFieldInfo = (Ptr Gdk.EventButton.EventButton)
    type AttrGetType EventButtonFieldInfo = Gdk.EventButton.EventButton
    type AttrLabel EventButtonFieldInfo = "button"
    type AttrOrigin EventButtonFieldInfo = Event
    attrGet = getEventButton
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_button :: AttrLabelProxy "button"
event_button = AttrLabelProxy

#endif


-- | Get the value of the “@touch@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #touch
-- @
getEventTouch :: MonadIO m => Event -> m Gdk.EventTouch.EventTouch
getEventTouch :: Event -> m EventTouch
getEventTouch Event
s = IO EventTouch -> m EventTouch
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventTouch -> m EventTouch) -> IO EventTouch -> m EventTouch
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventTouch) -> IO EventTouch
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventTouch) -> IO EventTouch)
-> (Ptr Event -> IO EventTouch) -> IO EventTouch
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventTouch
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventTouch
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventTouch.EventTouch)
    EventTouch
val' <- ((ManagedPtr EventTouch -> EventTouch)
-> Ptr EventTouch -> IO EventTouch
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventTouch -> EventTouch
Gdk.EventTouch.EventTouch) Ptr EventTouch
val
    EventTouch -> IO EventTouch
forall (m :: * -> *) a. Monad m => a -> m a
return EventTouch
val'

#if defined(ENABLE_OVERLOADING)
data EventTouchFieldInfo
instance AttrInfo EventTouchFieldInfo where
    type AttrBaseTypeConstraint EventTouchFieldInfo = (~) Event
    type AttrAllowedOps EventTouchFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventTouchFieldInfo = (~) (Ptr Gdk.EventTouch.EventTouch)
    type AttrTransferTypeConstraint EventTouchFieldInfo = (~)(Ptr Gdk.EventTouch.EventTouch)
    type AttrTransferType EventTouchFieldInfo = (Ptr Gdk.EventTouch.EventTouch)
    type AttrGetType EventTouchFieldInfo = Gdk.EventTouch.EventTouch
    type AttrLabel EventTouchFieldInfo = "touch"
    type AttrOrigin EventTouchFieldInfo = Event
    attrGet = getEventTouch
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_touch :: AttrLabelProxy "touch"
event_touch = AttrLabelProxy

#endif


-- | Get the value of the “@scroll@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #scroll
-- @
getEventScroll :: MonadIO m => Event -> m Gdk.EventScroll.EventScroll
getEventScroll :: Event -> m EventScroll
getEventScroll Event
s = IO EventScroll -> m EventScroll
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventScroll -> m EventScroll)
-> IO EventScroll -> m EventScroll
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventScroll) -> IO EventScroll
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventScroll) -> IO EventScroll)
-> (Ptr Event -> IO EventScroll) -> IO EventScroll
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventScroll
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventScroll
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventScroll.EventScroll)
    EventScroll
val' <- ((ManagedPtr EventScroll -> EventScroll)
-> Ptr EventScroll -> IO EventScroll
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventScroll -> EventScroll
Gdk.EventScroll.EventScroll) Ptr EventScroll
val
    EventScroll -> IO EventScroll
forall (m :: * -> *) a. Monad m => a -> m a
return EventScroll
val'

#if defined(ENABLE_OVERLOADING)
data EventScrollFieldInfo
instance AttrInfo EventScrollFieldInfo where
    type AttrBaseTypeConstraint EventScrollFieldInfo = (~) Event
    type AttrAllowedOps EventScrollFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventScrollFieldInfo = (~) (Ptr Gdk.EventScroll.EventScroll)
    type AttrTransferTypeConstraint EventScrollFieldInfo = (~)(Ptr Gdk.EventScroll.EventScroll)
    type AttrTransferType EventScrollFieldInfo = (Ptr Gdk.EventScroll.EventScroll)
    type AttrGetType EventScrollFieldInfo = Gdk.EventScroll.EventScroll
    type AttrLabel EventScrollFieldInfo = "scroll"
    type AttrOrigin EventScrollFieldInfo = Event
    attrGet = getEventScroll
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_scroll :: AttrLabelProxy "scroll"
event_scroll = AttrLabelProxy

#endif


-- | Get the value of the “@key@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #key
-- @
getEventKey :: MonadIO m => Event -> m Gdk.EventKey.EventKey
getEventKey :: Event -> m EventKey
getEventKey Event
s = IO EventKey -> m EventKey
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventKey -> m EventKey) -> IO EventKey -> m EventKey
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventKey) -> IO EventKey
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventKey) -> IO EventKey)
-> (Ptr Event -> IO EventKey) -> IO EventKey
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventKey
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventKey
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventKey.EventKey)
    EventKey
val' <- ((ManagedPtr EventKey -> EventKey) -> Ptr EventKey -> IO EventKey
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventKey -> EventKey
Gdk.EventKey.EventKey) Ptr EventKey
val
    EventKey -> IO EventKey
forall (m :: * -> *) a. Monad m => a -> m a
return EventKey
val'

#if defined(ENABLE_OVERLOADING)
data EventKeyFieldInfo
instance AttrInfo EventKeyFieldInfo where
    type AttrBaseTypeConstraint EventKeyFieldInfo = (~) Event
    type AttrAllowedOps EventKeyFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventKeyFieldInfo = (~) (Ptr Gdk.EventKey.EventKey)
    type AttrTransferTypeConstraint EventKeyFieldInfo = (~)(Ptr Gdk.EventKey.EventKey)
    type AttrTransferType EventKeyFieldInfo = (Ptr Gdk.EventKey.EventKey)
    type AttrGetType EventKeyFieldInfo = Gdk.EventKey.EventKey
    type AttrLabel EventKeyFieldInfo = "key"
    type AttrOrigin EventKeyFieldInfo = Event
    attrGet = getEventKey
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_key :: AttrLabelProxy "key"
event_key = AttrLabelProxy

#endif


-- | Get the value of the “@crossing@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #crossing
-- @
getEventCrossing :: MonadIO m => Event -> m Gdk.EventCrossing.EventCrossing
getEventCrossing :: Event -> m EventCrossing
getEventCrossing Event
s = IO EventCrossing -> m EventCrossing
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventCrossing -> m EventCrossing)
-> IO EventCrossing -> m EventCrossing
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventCrossing) -> IO EventCrossing
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventCrossing) -> IO EventCrossing)
-> (Ptr Event -> IO EventCrossing) -> IO EventCrossing
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventCrossing
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventCrossing
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventCrossing.EventCrossing)
    EventCrossing
val' <- ((ManagedPtr EventCrossing -> EventCrossing)
-> Ptr EventCrossing -> IO EventCrossing
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventCrossing -> EventCrossing
Gdk.EventCrossing.EventCrossing) Ptr EventCrossing
val
    EventCrossing -> IO EventCrossing
forall (m :: * -> *) a. Monad m => a -> m a
return EventCrossing
val'

#if defined(ENABLE_OVERLOADING)
data EventCrossingFieldInfo
instance AttrInfo EventCrossingFieldInfo where
    type AttrBaseTypeConstraint EventCrossingFieldInfo = (~) Event
    type AttrAllowedOps EventCrossingFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventCrossingFieldInfo = (~) (Ptr Gdk.EventCrossing.EventCrossing)
    type AttrTransferTypeConstraint EventCrossingFieldInfo = (~)(Ptr Gdk.EventCrossing.EventCrossing)
    type AttrTransferType EventCrossingFieldInfo = (Ptr Gdk.EventCrossing.EventCrossing)
    type AttrGetType EventCrossingFieldInfo = Gdk.EventCrossing.EventCrossing
    type AttrLabel EventCrossingFieldInfo = "crossing"
    type AttrOrigin EventCrossingFieldInfo = Event
    attrGet = getEventCrossing
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_crossing :: AttrLabelProxy "crossing"
event_crossing = AttrLabelProxy

#endif


-- | Get the value of the “@focus_change@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #focusChange
-- @
getEventFocusChange :: MonadIO m => Event -> m Gdk.EventFocus.EventFocus
getEventFocusChange :: Event -> m EventFocus
getEventFocusChange Event
s = IO EventFocus -> m EventFocus
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventFocus -> m EventFocus) -> IO EventFocus -> m EventFocus
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventFocus) -> IO EventFocus
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventFocus) -> IO EventFocus)
-> (Ptr Event -> IO EventFocus) -> IO EventFocus
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventFocus
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventFocus
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventFocus.EventFocus)
    EventFocus
val' <- ((ManagedPtr EventFocus -> EventFocus)
-> Ptr EventFocus -> IO EventFocus
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventFocus -> EventFocus
Gdk.EventFocus.EventFocus) Ptr EventFocus
val
    EventFocus -> IO EventFocus
forall (m :: * -> *) a. Monad m => a -> m a
return EventFocus
val'

#if defined(ENABLE_OVERLOADING)
data EventFocusChangeFieldInfo
instance AttrInfo EventFocusChangeFieldInfo where
    type AttrBaseTypeConstraint EventFocusChangeFieldInfo = (~) Event
    type AttrAllowedOps EventFocusChangeFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventFocusChangeFieldInfo = (~) (Ptr Gdk.EventFocus.EventFocus)
    type AttrTransferTypeConstraint EventFocusChangeFieldInfo = (~)(Ptr Gdk.EventFocus.EventFocus)
    type AttrTransferType EventFocusChangeFieldInfo = (Ptr Gdk.EventFocus.EventFocus)
    type AttrGetType EventFocusChangeFieldInfo = Gdk.EventFocus.EventFocus
    type AttrLabel EventFocusChangeFieldInfo = "focus_change"
    type AttrOrigin EventFocusChangeFieldInfo = Event
    attrGet = getEventFocusChange
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_focusChange :: AttrLabelProxy "focusChange"
event_focusChange = AttrLabelProxy

#endif


-- | Get the value of the “@configure@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #configure
-- @
getEventConfigure :: MonadIO m => Event -> m Gdk.EventConfigure.EventConfigure
getEventConfigure :: Event -> m EventConfigure
getEventConfigure Event
s = IO EventConfigure -> m EventConfigure
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventConfigure -> m EventConfigure)
-> IO EventConfigure -> m EventConfigure
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventConfigure) -> IO EventConfigure
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventConfigure) -> IO EventConfigure)
-> (Ptr Event -> IO EventConfigure) -> IO EventConfigure
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventConfigure
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventConfigure
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventConfigure.EventConfigure)
    EventConfigure
val' <- ((ManagedPtr EventConfigure -> EventConfigure)
-> Ptr EventConfigure -> IO EventConfigure
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventConfigure -> EventConfigure
Gdk.EventConfigure.EventConfigure) Ptr EventConfigure
val
    EventConfigure -> IO EventConfigure
forall (m :: * -> *) a. Monad m => a -> m a
return EventConfigure
val'

#if defined(ENABLE_OVERLOADING)
data EventConfigureFieldInfo
instance AttrInfo EventConfigureFieldInfo where
    type AttrBaseTypeConstraint EventConfigureFieldInfo = (~) Event
    type AttrAllowedOps EventConfigureFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventConfigureFieldInfo = (~) (Ptr Gdk.EventConfigure.EventConfigure)
    type AttrTransferTypeConstraint EventConfigureFieldInfo = (~)(Ptr Gdk.EventConfigure.EventConfigure)
    type AttrTransferType EventConfigureFieldInfo = (Ptr Gdk.EventConfigure.EventConfigure)
    type AttrGetType EventConfigureFieldInfo = Gdk.EventConfigure.EventConfigure
    type AttrLabel EventConfigureFieldInfo = "configure"
    type AttrOrigin EventConfigureFieldInfo = Event
    attrGet = getEventConfigure
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_configure :: AttrLabelProxy "configure"
event_configure = AttrLabelProxy

#endif


-- | Get the value of the “@property@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #property
-- @
getEventProperty :: MonadIO m => Event -> m Gdk.EventProperty.EventProperty
getEventProperty :: Event -> m EventProperty
getEventProperty Event
s = IO EventProperty -> m EventProperty
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventProperty -> m EventProperty)
-> IO EventProperty -> m EventProperty
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventProperty) -> IO EventProperty
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventProperty) -> IO EventProperty)
-> (Ptr Event -> IO EventProperty) -> IO EventProperty
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventProperty
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventProperty
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventProperty.EventProperty)
    EventProperty
val' <- ((ManagedPtr EventProperty -> EventProperty)
-> Ptr EventProperty -> IO EventProperty
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventProperty -> EventProperty
Gdk.EventProperty.EventProperty) Ptr EventProperty
val
    EventProperty -> IO EventProperty
forall (m :: * -> *) a. Monad m => a -> m a
return EventProperty
val'

#if defined(ENABLE_OVERLOADING)
data EventPropertyFieldInfo
instance AttrInfo EventPropertyFieldInfo where
    type AttrBaseTypeConstraint EventPropertyFieldInfo = (~) Event
    type AttrAllowedOps EventPropertyFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventPropertyFieldInfo = (~) (Ptr Gdk.EventProperty.EventProperty)
    type AttrTransferTypeConstraint EventPropertyFieldInfo = (~)(Ptr Gdk.EventProperty.EventProperty)
    type AttrTransferType EventPropertyFieldInfo = (Ptr Gdk.EventProperty.EventProperty)
    type AttrGetType EventPropertyFieldInfo = Gdk.EventProperty.EventProperty
    type AttrLabel EventPropertyFieldInfo = "property"
    type AttrOrigin EventPropertyFieldInfo = Event
    attrGet = getEventProperty
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_property :: AttrLabelProxy "property"
event_property = AttrLabelProxy

#endif


-- | Get the value of the “@selection@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #selection
-- @
getEventSelection :: MonadIO m => Event -> m Gdk.EventSelection.EventSelection
getEventSelection :: Event -> m EventSelection
getEventSelection Event
s = IO EventSelection -> m EventSelection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventSelection -> m EventSelection)
-> IO EventSelection -> m EventSelection
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventSelection) -> IO EventSelection
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventSelection) -> IO EventSelection)
-> (Ptr Event -> IO EventSelection) -> IO EventSelection
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventSelection
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventSelection
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventSelection.EventSelection)
    EventSelection
val' <- ((ManagedPtr EventSelection -> EventSelection)
-> Ptr EventSelection -> IO EventSelection
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventSelection -> EventSelection
Gdk.EventSelection.EventSelection) Ptr EventSelection
val
    EventSelection -> IO EventSelection
forall (m :: * -> *) a. Monad m => a -> m a
return EventSelection
val'

#if defined(ENABLE_OVERLOADING)
data EventSelectionFieldInfo
instance AttrInfo EventSelectionFieldInfo where
    type AttrBaseTypeConstraint EventSelectionFieldInfo = (~) Event
    type AttrAllowedOps EventSelectionFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventSelectionFieldInfo = (~) (Ptr Gdk.EventSelection.EventSelection)
    type AttrTransferTypeConstraint EventSelectionFieldInfo = (~)(Ptr Gdk.EventSelection.EventSelection)
    type AttrTransferType EventSelectionFieldInfo = (Ptr Gdk.EventSelection.EventSelection)
    type AttrGetType EventSelectionFieldInfo = Gdk.EventSelection.EventSelection
    type AttrLabel EventSelectionFieldInfo = "selection"
    type AttrOrigin EventSelectionFieldInfo = Event
    attrGet = getEventSelection
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_selection :: AttrLabelProxy "selection"
event_selection = AttrLabelProxy

#endif


-- | Get the value of the “@owner_change@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #ownerChange
-- @
getEventOwnerChange :: MonadIO m => Event -> m Gdk.EventOwnerChange.EventOwnerChange
getEventOwnerChange :: Event -> m EventOwnerChange
getEventOwnerChange Event
s = IO EventOwnerChange -> m EventOwnerChange
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventOwnerChange -> m EventOwnerChange)
-> IO EventOwnerChange -> m EventOwnerChange
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventOwnerChange) -> IO EventOwnerChange
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventOwnerChange) -> IO EventOwnerChange)
-> (Ptr Event -> IO EventOwnerChange) -> IO EventOwnerChange
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventOwnerChange
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventOwnerChange
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventOwnerChange.EventOwnerChange)
    EventOwnerChange
val' <- ((ManagedPtr EventOwnerChange -> EventOwnerChange)
-> Ptr EventOwnerChange -> IO EventOwnerChange
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventOwnerChange -> EventOwnerChange
Gdk.EventOwnerChange.EventOwnerChange) Ptr EventOwnerChange
val
    EventOwnerChange -> IO EventOwnerChange
forall (m :: * -> *) a. Monad m => a -> m a
return EventOwnerChange
val'

#if defined(ENABLE_OVERLOADING)
data EventOwnerChangeFieldInfo
instance AttrInfo EventOwnerChangeFieldInfo where
    type AttrBaseTypeConstraint EventOwnerChangeFieldInfo = (~) Event
    type AttrAllowedOps EventOwnerChangeFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventOwnerChangeFieldInfo = (~) (Ptr Gdk.EventOwnerChange.EventOwnerChange)
    type AttrTransferTypeConstraint EventOwnerChangeFieldInfo = (~)(Ptr Gdk.EventOwnerChange.EventOwnerChange)
    type AttrTransferType EventOwnerChangeFieldInfo = (Ptr Gdk.EventOwnerChange.EventOwnerChange)
    type AttrGetType EventOwnerChangeFieldInfo = Gdk.EventOwnerChange.EventOwnerChange
    type AttrLabel EventOwnerChangeFieldInfo = "owner_change"
    type AttrOrigin EventOwnerChangeFieldInfo = Event
    attrGet = getEventOwnerChange
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_ownerChange :: AttrLabelProxy "ownerChange"
event_ownerChange = AttrLabelProxy

#endif


-- | Get the value of the “@proximity@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #proximity
-- @
getEventProximity :: MonadIO m => Event -> m Gdk.EventProximity.EventProximity
getEventProximity :: Event -> m EventProximity
getEventProximity Event
s = IO EventProximity -> m EventProximity
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventProximity -> m EventProximity)
-> IO EventProximity -> m EventProximity
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventProximity) -> IO EventProximity
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventProximity) -> IO EventProximity)
-> (Ptr Event -> IO EventProximity) -> IO EventProximity
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventProximity
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventProximity
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventProximity.EventProximity)
    EventProximity
val' <- ((ManagedPtr EventProximity -> EventProximity)
-> Ptr EventProximity -> IO EventProximity
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventProximity -> EventProximity
Gdk.EventProximity.EventProximity) Ptr EventProximity
val
    EventProximity -> IO EventProximity
forall (m :: * -> *) a. Monad m => a -> m a
return EventProximity
val'

#if defined(ENABLE_OVERLOADING)
data EventProximityFieldInfo
instance AttrInfo EventProximityFieldInfo where
    type AttrBaseTypeConstraint EventProximityFieldInfo = (~) Event
    type AttrAllowedOps EventProximityFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventProximityFieldInfo = (~) (Ptr Gdk.EventProximity.EventProximity)
    type AttrTransferTypeConstraint EventProximityFieldInfo = (~)(Ptr Gdk.EventProximity.EventProximity)
    type AttrTransferType EventProximityFieldInfo = (Ptr Gdk.EventProximity.EventProximity)
    type AttrGetType EventProximityFieldInfo = Gdk.EventProximity.EventProximity
    type AttrLabel EventProximityFieldInfo = "proximity"
    type AttrOrigin EventProximityFieldInfo = Event
    attrGet = getEventProximity
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_proximity :: AttrLabelProxy "proximity"
event_proximity = AttrLabelProxy

#endif


-- | Get the value of the “@dnd@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #dnd
-- @
getEventDnd :: MonadIO m => Event -> m Gdk.EventDND.EventDND
getEventDnd :: Event -> m EventDND
getEventDnd Event
s = IO EventDND -> m EventDND
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventDND -> m EventDND) -> IO EventDND -> m EventDND
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventDND) -> IO EventDND
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventDND) -> IO EventDND)
-> (Ptr Event -> IO EventDND) -> IO EventDND
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventDND
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventDND
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventDND.EventDND)
    EventDND
val' <- ((ManagedPtr EventDND -> EventDND) -> Ptr EventDND -> IO EventDND
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventDND -> EventDND
Gdk.EventDND.EventDND) Ptr EventDND
val
    EventDND -> IO EventDND
forall (m :: * -> *) a. Monad m => a -> m a
return EventDND
val'

#if defined(ENABLE_OVERLOADING)
data EventDndFieldInfo
instance AttrInfo EventDndFieldInfo where
    type AttrBaseTypeConstraint EventDndFieldInfo = (~) Event
    type AttrAllowedOps EventDndFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventDndFieldInfo = (~) (Ptr Gdk.EventDND.EventDND)
    type AttrTransferTypeConstraint EventDndFieldInfo = (~)(Ptr Gdk.EventDND.EventDND)
    type AttrTransferType EventDndFieldInfo = (Ptr Gdk.EventDND.EventDND)
    type AttrGetType EventDndFieldInfo = Gdk.EventDND.EventDND
    type AttrLabel EventDndFieldInfo = "dnd"
    type AttrOrigin EventDndFieldInfo = Event
    attrGet = getEventDnd
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_dnd :: AttrLabelProxy "dnd"
event_dnd = AttrLabelProxy

#endif


-- | Get the value of the “@window_state@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #windowState
-- @
getEventWindowState :: MonadIO m => Event -> m Gdk.EventWindowState.EventWindowState
getEventWindowState :: Event -> m EventWindowState
getEventWindowState Event
s = IO EventWindowState -> m EventWindowState
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventWindowState -> m EventWindowState)
-> IO EventWindowState -> m EventWindowState
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventWindowState) -> IO EventWindowState
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventWindowState) -> IO EventWindowState)
-> (Ptr Event -> IO EventWindowState) -> IO EventWindowState
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventWindowState
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventWindowState
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventWindowState.EventWindowState)
    EventWindowState
val' <- ((ManagedPtr EventWindowState -> EventWindowState)
-> Ptr EventWindowState -> IO EventWindowState
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventWindowState -> EventWindowState
Gdk.EventWindowState.EventWindowState) Ptr EventWindowState
val
    EventWindowState -> IO EventWindowState
forall (m :: * -> *) a. Monad m => a -> m a
return EventWindowState
val'

#if defined(ENABLE_OVERLOADING)
data EventWindowStateFieldInfo
instance AttrInfo EventWindowStateFieldInfo where
    type AttrBaseTypeConstraint EventWindowStateFieldInfo = (~) Event
    type AttrAllowedOps EventWindowStateFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventWindowStateFieldInfo = (~) (Ptr Gdk.EventWindowState.EventWindowState)
    type AttrTransferTypeConstraint EventWindowStateFieldInfo = (~)(Ptr Gdk.EventWindowState.EventWindowState)
    type AttrTransferType EventWindowStateFieldInfo = (Ptr Gdk.EventWindowState.EventWindowState)
    type AttrGetType EventWindowStateFieldInfo = Gdk.EventWindowState.EventWindowState
    type AttrLabel EventWindowStateFieldInfo = "window_state"
    type AttrOrigin EventWindowStateFieldInfo = Event
    attrGet = getEventWindowState
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_windowState :: AttrLabelProxy "windowState"
event_windowState = AttrLabelProxy

#endif


-- | Get the value of the “@setting@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #setting
-- @
getEventSetting :: MonadIO m => Event -> m Gdk.EventSetting.EventSetting
getEventSetting :: Event -> m EventSetting
getEventSetting Event
s = IO EventSetting -> m EventSetting
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventSetting -> m EventSetting)
-> IO EventSetting -> m EventSetting
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventSetting) -> IO EventSetting
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventSetting) -> IO EventSetting)
-> (Ptr Event -> IO EventSetting) -> IO EventSetting
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventSetting
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventSetting
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventSetting.EventSetting)
    EventSetting
val' <- ((ManagedPtr EventSetting -> EventSetting)
-> Ptr EventSetting -> IO EventSetting
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventSetting -> EventSetting
Gdk.EventSetting.EventSetting) Ptr EventSetting
val
    EventSetting -> IO EventSetting
forall (m :: * -> *) a. Monad m => a -> m a
return EventSetting
val'

#if defined(ENABLE_OVERLOADING)
data EventSettingFieldInfo
instance AttrInfo EventSettingFieldInfo where
    type AttrBaseTypeConstraint EventSettingFieldInfo = (~) Event
    type AttrAllowedOps EventSettingFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventSettingFieldInfo = (~) (Ptr Gdk.EventSetting.EventSetting)
    type AttrTransferTypeConstraint EventSettingFieldInfo = (~)(Ptr Gdk.EventSetting.EventSetting)
    type AttrTransferType EventSettingFieldInfo = (Ptr Gdk.EventSetting.EventSetting)
    type AttrGetType EventSettingFieldInfo = Gdk.EventSetting.EventSetting
    type AttrLabel EventSettingFieldInfo = "setting"
    type AttrOrigin EventSettingFieldInfo = Event
    attrGet = getEventSetting
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_setting :: AttrLabelProxy "setting"
event_setting = AttrLabelProxy

#endif


-- | Get the value of the “@grab_broken@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #grabBroken
-- @
getEventGrabBroken :: MonadIO m => Event -> m Gdk.EventGrabBroken.EventGrabBroken
getEventGrabBroken :: Event -> m EventGrabBroken
getEventGrabBroken Event
s = IO EventGrabBroken -> m EventGrabBroken
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventGrabBroken -> m EventGrabBroken)
-> IO EventGrabBroken -> m EventGrabBroken
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventGrabBroken) -> IO EventGrabBroken
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventGrabBroken) -> IO EventGrabBroken)
-> (Ptr Event -> IO EventGrabBroken) -> IO EventGrabBroken
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventGrabBroken
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventGrabBroken
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventGrabBroken.EventGrabBroken)
    EventGrabBroken
val' <- ((ManagedPtr EventGrabBroken -> EventGrabBroken)
-> Ptr EventGrabBroken -> IO EventGrabBroken
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventGrabBroken -> EventGrabBroken
Gdk.EventGrabBroken.EventGrabBroken) Ptr EventGrabBroken
val
    EventGrabBroken -> IO EventGrabBroken
forall (m :: * -> *) a. Monad m => a -> m a
return EventGrabBroken
val'

#if defined(ENABLE_OVERLOADING)
data EventGrabBrokenFieldInfo
instance AttrInfo EventGrabBrokenFieldInfo where
    type AttrBaseTypeConstraint EventGrabBrokenFieldInfo = (~) Event
    type AttrAllowedOps EventGrabBrokenFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventGrabBrokenFieldInfo = (~) (Ptr Gdk.EventGrabBroken.EventGrabBroken)
    type AttrTransferTypeConstraint EventGrabBrokenFieldInfo = (~)(Ptr Gdk.EventGrabBroken.EventGrabBroken)
    type AttrTransferType EventGrabBrokenFieldInfo = (Ptr Gdk.EventGrabBroken.EventGrabBroken)
    type AttrGetType EventGrabBrokenFieldInfo = Gdk.EventGrabBroken.EventGrabBroken
    type AttrLabel EventGrabBrokenFieldInfo = "grab_broken"
    type AttrOrigin EventGrabBrokenFieldInfo = Event
    attrGet = getEventGrabBroken
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_grabBroken :: AttrLabelProxy "grabBroken"
event_grabBroken = AttrLabelProxy

#endif


-- | Get the value of the “@touchpad_swipe@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #touchpadSwipe
-- @
getEventTouchpadSwipe :: MonadIO m => Event -> m Gdk.EventTouchpadSwipe.EventTouchpadSwipe
getEventTouchpadSwipe :: Event -> m EventTouchpadSwipe
getEventTouchpadSwipe Event
s = IO EventTouchpadSwipe -> m EventTouchpadSwipe
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventTouchpadSwipe -> m EventTouchpadSwipe)
-> IO EventTouchpadSwipe -> m EventTouchpadSwipe
forall a b. (a -> b) -> a -> b
$ Event
-> (Ptr Event -> IO EventTouchpadSwipe) -> IO EventTouchpadSwipe
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventTouchpadSwipe) -> IO EventTouchpadSwipe)
-> (Ptr Event -> IO EventTouchpadSwipe) -> IO EventTouchpadSwipe
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventTouchpadSwipe
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventTouchpadSwipe
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventTouchpadSwipe.EventTouchpadSwipe)
    EventTouchpadSwipe
val' <- ((ManagedPtr EventTouchpadSwipe -> EventTouchpadSwipe)
-> Ptr EventTouchpadSwipe -> IO EventTouchpadSwipe
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventTouchpadSwipe -> EventTouchpadSwipe
Gdk.EventTouchpadSwipe.EventTouchpadSwipe) Ptr EventTouchpadSwipe
val
    EventTouchpadSwipe -> IO EventTouchpadSwipe
forall (m :: * -> *) a. Monad m => a -> m a
return EventTouchpadSwipe
val'

#if defined(ENABLE_OVERLOADING)
data EventTouchpadSwipeFieldInfo
instance AttrInfo EventTouchpadSwipeFieldInfo where
    type AttrBaseTypeConstraint EventTouchpadSwipeFieldInfo = (~) Event
    type AttrAllowedOps EventTouchpadSwipeFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventTouchpadSwipeFieldInfo = (~) (Ptr Gdk.EventTouchpadSwipe.EventTouchpadSwipe)
    type AttrTransferTypeConstraint EventTouchpadSwipeFieldInfo = (~)(Ptr Gdk.EventTouchpadSwipe.EventTouchpadSwipe)
    type AttrTransferType EventTouchpadSwipeFieldInfo = (Ptr Gdk.EventTouchpadSwipe.EventTouchpadSwipe)
    type AttrGetType EventTouchpadSwipeFieldInfo = Gdk.EventTouchpadSwipe.EventTouchpadSwipe
    type AttrLabel EventTouchpadSwipeFieldInfo = "touchpad_swipe"
    type AttrOrigin EventTouchpadSwipeFieldInfo = Event
    attrGet = getEventTouchpadSwipe
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_touchpadSwipe :: AttrLabelProxy "touchpadSwipe"
event_touchpadSwipe = AttrLabelProxy

#endif


-- | Get the value of the “@touchpad_pinch@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #touchpadPinch
-- @
getEventTouchpadPinch :: MonadIO m => Event -> m Gdk.EventTouchpadPinch.EventTouchpadPinch
getEventTouchpadPinch :: Event -> m EventTouchpadPinch
getEventTouchpadPinch Event
s = IO EventTouchpadPinch -> m EventTouchpadPinch
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventTouchpadPinch -> m EventTouchpadPinch)
-> IO EventTouchpadPinch -> m EventTouchpadPinch
forall a b. (a -> b) -> a -> b
$ Event
-> (Ptr Event -> IO EventTouchpadPinch) -> IO EventTouchpadPinch
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventTouchpadPinch) -> IO EventTouchpadPinch)
-> (Ptr Event -> IO EventTouchpadPinch) -> IO EventTouchpadPinch
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventTouchpadPinch
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventTouchpadPinch
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventTouchpadPinch.EventTouchpadPinch)
    EventTouchpadPinch
val' <- ((ManagedPtr EventTouchpadPinch -> EventTouchpadPinch)
-> Ptr EventTouchpadPinch -> IO EventTouchpadPinch
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventTouchpadPinch -> EventTouchpadPinch
Gdk.EventTouchpadPinch.EventTouchpadPinch) Ptr EventTouchpadPinch
val
    EventTouchpadPinch -> IO EventTouchpadPinch
forall (m :: * -> *) a. Monad m => a -> m a
return EventTouchpadPinch
val'

#if defined(ENABLE_OVERLOADING)
data EventTouchpadPinchFieldInfo
instance AttrInfo EventTouchpadPinchFieldInfo where
    type AttrBaseTypeConstraint EventTouchpadPinchFieldInfo = (~) Event
    type AttrAllowedOps EventTouchpadPinchFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventTouchpadPinchFieldInfo = (~) (Ptr Gdk.EventTouchpadPinch.EventTouchpadPinch)
    type AttrTransferTypeConstraint EventTouchpadPinchFieldInfo = (~)(Ptr Gdk.EventTouchpadPinch.EventTouchpadPinch)
    type AttrTransferType EventTouchpadPinchFieldInfo = (Ptr Gdk.EventTouchpadPinch.EventTouchpadPinch)
    type AttrGetType EventTouchpadPinchFieldInfo = Gdk.EventTouchpadPinch.EventTouchpadPinch
    type AttrLabel EventTouchpadPinchFieldInfo = "touchpad_pinch"
    type AttrOrigin EventTouchpadPinchFieldInfo = Event
    attrGet = getEventTouchpadPinch
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_touchpadPinch :: AttrLabelProxy "touchpadPinch"
event_touchpadPinch = AttrLabelProxy

#endif


-- | Get the value of the “@pad_button@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #padButton
-- @
getEventPadButton :: MonadIO m => Event -> m Gdk.EventPadButton.EventPadButton
getEventPadButton :: Event -> m EventPadButton
getEventPadButton Event
s = IO EventPadButton -> m EventPadButton
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventPadButton -> m EventPadButton)
-> IO EventPadButton -> m EventPadButton
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventPadButton) -> IO EventPadButton
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventPadButton) -> IO EventPadButton)
-> (Ptr Event -> IO EventPadButton) -> IO EventPadButton
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventPadButton
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventPadButton
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventPadButton.EventPadButton)
    EventPadButton
val' <- ((ManagedPtr EventPadButton -> EventPadButton)
-> Ptr EventPadButton -> IO EventPadButton
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventPadButton -> EventPadButton
Gdk.EventPadButton.EventPadButton) Ptr EventPadButton
val
    EventPadButton -> IO EventPadButton
forall (m :: * -> *) a. Monad m => a -> m a
return EventPadButton
val'

#if defined(ENABLE_OVERLOADING)
data EventPadButtonFieldInfo
instance AttrInfo EventPadButtonFieldInfo where
    type AttrBaseTypeConstraint EventPadButtonFieldInfo = (~) Event
    type AttrAllowedOps EventPadButtonFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventPadButtonFieldInfo = (~) (Ptr Gdk.EventPadButton.EventPadButton)
    type AttrTransferTypeConstraint EventPadButtonFieldInfo = (~)(Ptr Gdk.EventPadButton.EventPadButton)
    type AttrTransferType EventPadButtonFieldInfo = (Ptr Gdk.EventPadButton.EventPadButton)
    type AttrGetType EventPadButtonFieldInfo = Gdk.EventPadButton.EventPadButton
    type AttrLabel EventPadButtonFieldInfo = "pad_button"
    type AttrOrigin EventPadButtonFieldInfo = Event
    attrGet = getEventPadButton
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_padButton :: AttrLabelProxy "padButton"
event_padButton = AttrLabelProxy

#endif


-- | Get the value of the “@pad_axis@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #padAxis
-- @
getEventPadAxis :: MonadIO m => Event -> m Gdk.EventPadAxis.EventPadAxis
getEventPadAxis :: Event -> m EventPadAxis
getEventPadAxis Event
s = IO EventPadAxis -> m EventPadAxis
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventPadAxis -> m EventPadAxis)
-> IO EventPadAxis -> m EventPadAxis
forall a b. (a -> b) -> a -> b
$ Event -> (Ptr Event -> IO EventPadAxis) -> IO EventPadAxis
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventPadAxis) -> IO EventPadAxis)
-> (Ptr Event -> IO EventPadAxis) -> IO EventPadAxis
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventPadAxis
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventPadAxis
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventPadAxis.EventPadAxis)
    EventPadAxis
val' <- ((ManagedPtr EventPadAxis -> EventPadAxis)
-> Ptr EventPadAxis -> IO EventPadAxis
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventPadAxis -> EventPadAxis
Gdk.EventPadAxis.EventPadAxis) Ptr EventPadAxis
val
    EventPadAxis -> IO EventPadAxis
forall (m :: * -> *) a. Monad m => a -> m a
return EventPadAxis
val'

#if defined(ENABLE_OVERLOADING)
data EventPadAxisFieldInfo
instance AttrInfo EventPadAxisFieldInfo where
    type AttrBaseTypeConstraint EventPadAxisFieldInfo = (~) Event
    type AttrAllowedOps EventPadAxisFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventPadAxisFieldInfo = (~) (Ptr Gdk.EventPadAxis.EventPadAxis)
    type AttrTransferTypeConstraint EventPadAxisFieldInfo = (~)(Ptr Gdk.EventPadAxis.EventPadAxis)
    type AttrTransferType EventPadAxisFieldInfo = (Ptr Gdk.EventPadAxis.EventPadAxis)
    type AttrGetType EventPadAxisFieldInfo = Gdk.EventPadAxis.EventPadAxis
    type AttrLabel EventPadAxisFieldInfo = "pad_axis"
    type AttrOrigin EventPadAxisFieldInfo = Event
    attrGet = getEventPadAxis
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_padAxis :: AttrLabelProxy "padAxis"
event_padAxis = AttrLabelProxy

#endif


-- | Get the value of the “@pad_group_mode@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' event #padGroupMode
-- @
getEventPadGroupMode :: MonadIO m => Event -> m Gdk.EventPadGroupMode.EventPadGroupMode
getEventPadGroupMode :: Event -> m EventPadGroupMode
getEventPadGroupMode Event
s = IO EventPadGroupMode -> m EventPadGroupMode
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EventPadGroupMode -> m EventPadGroupMode)
-> IO EventPadGroupMode -> m EventPadGroupMode
forall a b. (a -> b) -> a -> b
$ Event
-> (Ptr Event -> IO EventPadGroupMode) -> IO EventPadGroupMode
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Event
s ((Ptr Event -> IO EventPadGroupMode) -> IO EventPadGroupMode)
-> (Ptr Event -> IO EventPadGroupMode) -> IO EventPadGroupMode
forall a b. (a -> b) -> a -> b
$ \Ptr Event
ptr -> do
    let val :: Ptr EventPadGroupMode
val = Ptr Event
ptr Ptr Event -> Int -> Ptr EventPadGroupMode
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Gdk.EventPadGroupMode.EventPadGroupMode)
    EventPadGroupMode
val' <- ((ManagedPtr EventPadGroupMode -> EventPadGroupMode)
-> Ptr EventPadGroupMode -> IO EventPadGroupMode
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventPadGroupMode -> EventPadGroupMode
Gdk.EventPadGroupMode.EventPadGroupMode) Ptr EventPadGroupMode
val
    EventPadGroupMode -> IO EventPadGroupMode
forall (m :: * -> *) a. Monad m => a -> m a
return EventPadGroupMode
val'

#if defined(ENABLE_OVERLOADING)
data EventPadGroupModeFieldInfo
instance AttrInfo EventPadGroupModeFieldInfo where
    type AttrBaseTypeConstraint EventPadGroupModeFieldInfo = (~) Event
    type AttrAllowedOps EventPadGroupModeFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint EventPadGroupModeFieldInfo = (~) (Ptr Gdk.EventPadGroupMode.EventPadGroupMode)
    type AttrTransferTypeConstraint EventPadGroupModeFieldInfo = (~)(Ptr Gdk.EventPadGroupMode.EventPadGroupMode)
    type AttrTransferType EventPadGroupModeFieldInfo = (Ptr Gdk.EventPadGroupMode.EventPadGroupMode)
    type AttrGetType EventPadGroupModeFieldInfo = Gdk.EventPadGroupMode.EventPadGroupMode
    type AttrLabel EventPadGroupModeFieldInfo = "pad_group_mode"
    type AttrOrigin EventPadGroupModeFieldInfo = Event
    attrGet = getEventPadGroupMode
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

event_padGroupMode :: AttrLabelProxy "padGroupMode"
event_padGroupMode = AttrLabelProxy

#endif



#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Event
type instance O.AttributeList Event = EventAttributeList
type EventAttributeList = ('[ '("type", EventTypeFieldInfo), '("any", EventAnyFieldInfo), '("expose", EventExposeFieldInfo), '("visibility", EventVisibilityFieldInfo), '("motion", EventMotionFieldInfo), '("button", EventButtonFieldInfo), '("touch", EventTouchFieldInfo), '("scroll", EventScrollFieldInfo), '("key", EventKeyFieldInfo), '("crossing", EventCrossingFieldInfo), '("focusChange", EventFocusChangeFieldInfo), '("configure", EventConfigureFieldInfo), '("property", EventPropertyFieldInfo), '("selection", EventSelectionFieldInfo), '("ownerChange", EventOwnerChangeFieldInfo), '("proximity", EventProximityFieldInfo), '("dnd", EventDndFieldInfo), '("windowState", EventWindowStateFieldInfo), '("setting", EventSettingFieldInfo), '("grabBroken", EventGrabBrokenFieldInfo), '("touchpadSwipe", EventTouchpadSwipeFieldInfo), '("touchpadPinch", EventTouchpadPinchFieldInfo), '("padButton", EventPadButtonFieldInfo), '("padAxis", EventPadAxisFieldInfo), '("padGroupMode", EventPadGroupModeFieldInfo)] :: [(Symbol, *)])
#endif

-- method Event::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "type"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "EventType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEventType" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Event" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_new" gdk_event_new :: 
    CInt ->                                 -- type : TInterface (Name {namespace = "Gdk", name = "EventType"})
    IO (Ptr Event)

-- | Creates a new event of the given type. All fields are set to 0.
-- 
-- /Since: 2.2/
eventNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gdk.Enums.EventType
    -- ^ /@type@/: a t'GI.Gdk.Enums.EventType'
    -> m Event
    -- ^ __Returns:__ a newly-allocated t'GI.Gdk.Unions.Event.Event'. The returned t'GI.Gdk.Unions.Event.Event'
    -- should be freed with 'GI.Gdk.Unions.Event.eventFree'.
eventNew :: EventType -> m Event
eventNew 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_' :: CInt
type_' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (EventType -> Int) -> EventType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EventType -> Int
forall a. Enum a => a -> Int
fromEnum) EventType
type_
    Ptr Event
result <- CInt -> IO (Ptr Event)
gdk_event_new CInt
type_'
    Text -> Ptr Event -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"eventNew" Ptr Event
result
    Event
result' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed 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

-- method Event::copy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Event" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_copy" gdk_event_copy :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO (Ptr Event)

-- | Copies a t'GI.Gdk.Unions.Event.Event', copying or incrementing the reference count of the
-- resources associated with it (e.g. t'GI.Gdk.Objects.Window.Window'’s and strings).
eventCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Event
    -- ^ __Returns:__ a copy of /@event@/. The returned t'GI.Gdk.Unions.Event.Event' should be freed with
    -- 'GI.Gdk.Unions.Event.eventFree'.
eventCopy :: Event -> m Event
eventCopy Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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 Text
"eventCopy" Ptr Event
result
    Event
result' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Event) Ptr Event
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventCopyMethodInfo Event signature where
    overloadedMethod = eventCopy

#endif

-- method Event::free
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_free" gdk_event_free :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO ()

-- | Frees a t'GI.Gdk.Unions.Event.Event', freeing or decrementing any resources associated with it.
-- Note that this function should only be called with events returned from
-- functions such as 'GI.Gdk.Functions.eventPeek', 'GI.Gdk.Functions.eventGet', 'GI.Gdk.Unions.Event.eventCopy'
-- and 'GI.Gdk.Unions.Event.eventNew'.
eventFree ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'.
    -> m ()
eventFree :: Event -> m ()
eventFree Event
event = 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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr Event -> IO ()
gdk_event_free Ptr Event
event'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo EventFreeMethodInfo Event signature where
    overloadedMethod = eventFree

#endif

-- method Event::get_axis
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axis_use"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "AxisUse" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the axis use to look for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the value found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_axis" gdk_event_get_axis :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    CUInt ->                                -- axis_use : TInterface (Name {namespace = "Gdk", name = "AxisUse"})
    Ptr CDouble ->                          -- value : TBasicType TDouble
    IO CInt

-- | Extract the axis value for a particular axis use from
-- an event structure.
eventGetAxis ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> Gdk.Enums.AxisUse
    -- ^ /@axisUse@/: the axis use to look for
    -> m ((Bool, Double))
    -- ^ __Returns:__ 'P.True' if the specified axis was found, otherwise 'P.False'
eventGetAxis :: Event -> AxisUse -> m (Bool, Double)
eventGetAxis Event
event 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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
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'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetAxisMethodInfo Event signature where
    overloadedMethod = eventGetAxis

#endif

-- method Event::get_button
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "button"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store mouse button number"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_button" gdk_event_get_button :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr Word32 ->                           -- button : TBasicType TUInt
    IO CInt

-- | Extract the button number from an event.
-- 
-- /Since: 3.2/
eventGetButton ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m ((Bool, Word32))
    -- ^ __Returns:__ 'P.True' if the event delivered a button number
eventGetButton :: Event -> m (Bool, Word32)
eventGetButton Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
0) CInt
result
    Word32
button' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
button
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetButtonMethodInfo Event signature where
    overloadedMethod = eventGetButton

#endif

-- method Event::get_click_count
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "click_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store click count"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_click_count" gdk_event_get_click_count :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr Word32 ->                           -- click_count : TBasicType TUInt
    IO CInt

-- | Extracts the click count from an event.
-- 
-- /Since: 3.2/
eventGetClickCount ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m ((Bool, Word32))
    -- ^ __Returns:__ 'P.True' if the event delivered a click count
eventGetClickCount :: Event -> m (Bool, Word32)
eventGetClickCount Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
0) CInt
result
    Word32
clickCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
clickCount
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetClickCountMethodInfo Event signature where
    overloadedMethod = eventGetClickCount

#endif

-- method Event::get_coords
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x_win"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to put event window x coordinate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y_win"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to put event window y coordinate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_coords" gdk_event_get_coords :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr CDouble ->                          -- x_win : TBasicType TDouble
    Ptr CDouble ->                          -- y_win : TBasicType TDouble
    IO CInt

-- | Extract the event window relative x\/y coordinates from an event.
eventGetCoords ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m ((Bool, Double, Double))
    -- ^ __Returns:__ 'P.True' if the event delivered event window coordinates
eventGetCoords :: Event -> m (Bool, Double, Double)
eventGetCoords Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
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'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetCoordsMethodInfo Event signature where
    overloadedMethod = eventGetCoords

#endif

-- method Event::get_device
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Device" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_device" gdk_event_get_device :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO (Ptr Gdk.Device.Device)

-- | If the event contains a “device” field, this function will return
-- it, else it will return 'P.Nothing'.
-- 
-- /Since: 3.0/
eventGetDevice ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'.
    -> m (Maybe Gdk.Device.Device)
    -- ^ __Returns:__ a t'GI.Gdk.Objects.Device.Device', or 'P.Nothing'.
eventGetDevice :: Event -> m (Maybe Device)
eventGetDevice Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
$ \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''
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetDeviceMethodInfo Event signature where
    overloadedMethod = eventGetDevice

#endif

-- method Event::get_device_tool
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "DeviceTool" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_device_tool" gdk_event_get_device_tool :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO (Ptr Gdk.DeviceTool.DeviceTool)

-- | If the event was generated by a device that supports
-- different tools (eg. a tablet), this function will
-- return a t'GI.Gdk.Objects.DeviceTool.DeviceTool' representing the tool that
-- caused the event. Otherwise, 'P.Nothing' will be returned.
-- 
-- Note: the t'GI.Gdk.Objects.DeviceTool.DeviceTool's will be constant during
-- the application lifetime, if settings must be stored
-- persistently across runs, see 'GI.Gdk.Objects.DeviceTool.deviceToolGetSerial'
-- 
-- /Since: 3.22/
eventGetDeviceTool ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Gdk.DeviceTool.DeviceTool
    -- ^ __Returns:__ The current device tool, or 'P.Nothing'
eventGetDeviceTool :: Event -> m DeviceTool
eventGetDeviceTool Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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 Text
"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
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetDeviceToolMethodInfo Event signature where
    overloadedMethod = eventGetDeviceTool

#endif

-- method Event::get_event_sequence
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gdk" , name = "EventSequence" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_event_sequence" gdk_event_get_event_sequence :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO (Ptr Gdk.EventSequence.EventSequence)

-- | If /@event@/ if of type 'GI.Gdk.Enums.EventTypeTouchBegin', 'GI.Gdk.Enums.EventTypeTouchUpdate',
-- 'GI.Gdk.Enums.EventTypeTouchEnd' or 'GI.Gdk.Enums.EventTypeTouchCancel', returns the t'GI.Gdk.Structs.EventSequence.EventSequence'
-- to which the event belongs. Otherwise, return 'P.Nothing'.
-- 
-- /Since: 3.4/
eventGetEventSequence ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Gdk.EventSequence.EventSequence
    -- ^ __Returns:__ the event sequence that the event belongs to
eventGetEventSequence :: Event -> m EventSequence
eventGetEventSequence Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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 Text
"eventGetEventSequence" Ptr EventSequence
result
    EventSequence
result' <- ((ManagedPtr EventSequence -> EventSequence)
-> Ptr EventSequence -> IO EventSequence
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr EventSequence -> EventSequence
Gdk.EventSequence.EventSequence) Ptr EventSequence
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetEventSequenceMethodInfo Event signature where
    overloadedMethod = eventGetEventSequence

#endif

-- method Event::get_event_type
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "EventType" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_event_type" gdk_event_get_event_type :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO CInt

-- | Retrieves the type of the event.
-- 
-- /Since: 3.10/
eventGetEventType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Gdk.Enums.EventType
    -- ^ __Returns:__ a t'GI.Gdk.Enums.EventType'
eventGetEventType :: Event -> m EventType
eventGetEventType Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    CInt
result <- Ptr Event -> IO CInt
gdk_event_get_event_type Ptr Event
event'
    let result' :: EventType
result' = (Int -> EventType
forall a. Enum a => Int -> a
toEnum (Int -> EventType) -> (CInt -> Int) -> CInt -> EventType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetEventTypeMethodInfo Event signature where
    overloadedMethod = eventGetEventType

#endif

-- method Event::get_keycode
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keycode"
--           , argType = TBasicType TUInt16
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the keycode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_keycode" gdk_event_get_keycode :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr Word16 ->                           -- keycode : TBasicType TUInt16
    IO CInt

-- | Extracts the hardware keycode from an event.
-- 
-- Also see 'GI.Gdk.Unions.Event.eventGetScancode'.
-- 
-- /Since: 3.2/
eventGetKeycode ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m ((Bool, Word16))
    -- ^ __Returns:__ 'P.True' if the event delivered a hardware keycode
eventGetKeycode :: Event -> m (Bool, Word16)
eventGetKeycode Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
0) CInt
result
    Word16
keycode' <- Ptr Word16 -> IO Word16
forall a. Storable a => Ptr a -> IO a
peek Ptr Word16
keycode
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetKeycodeMethodInfo Event signature where
    overloadedMethod = eventGetKeycode

#endif

-- method Event::get_keyval
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keyval"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the keyval"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_keyval" gdk_event_get_keyval :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr Word32 ->                           -- keyval : TBasicType TUInt
    IO CInt

-- | Extracts the keyval from an event.
-- 
-- /Since: 3.2/
eventGetKeyval ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m ((Bool, Word32))
    -- ^ __Returns:__ 'P.True' if the event delivered a key symbol
eventGetKeyval :: Event -> m (Bool, Word32)
eventGetKeyval Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
0) CInt
result
    Word32
keyval' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
keyval
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetKeyvalMethodInfo Event signature where
    overloadedMethod = eventGetKeyval

#endif

-- method Event::get_pointer_emulated
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_pointer_emulated" gdk_event_get_pointer_emulated :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO CInt

-- | @/event/@: a t'GI.Gdk.Unions.Event.Event'
-- Returns whether this event is an \'emulated\' pointer event (typically
-- from a touch event), as opposed to a real one.
-- 
-- /Since: 3.22/
eventGetPointerEmulated ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -> m Bool
    -- ^ __Returns:__ 'P.True' if this event is emulated
eventGetPointerEmulated :: Event -> m Bool
eventGetPointerEmulated Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
0) CInt
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetPointerEmulatedMethodInfo Event signature where
    overloadedMethod = eventGetPointerEmulated

#endif

-- method Event::get_root_coords
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x_root"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to put root window x coordinate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y_root"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to put root window y coordinate"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_root_coords" gdk_event_get_root_coords :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr CDouble ->                          -- x_root : TBasicType TDouble
    Ptr CDouble ->                          -- y_root : TBasicType TDouble
    IO CInt

-- | Extract the root window relative x\/y coordinates from an event.
eventGetRootCoords ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m ((Bool, Double, Double))
    -- ^ __Returns:__ 'P.True' if the event delivered root window coordinates
eventGetRootCoords :: Event -> m (Bool, Double, Double)
eventGetRootCoords Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
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'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetRootCoordsMethodInfo Event signature where
    overloadedMethod = eventGetRootCoords

#endif

-- method Event::get_scancode
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_scancode" gdk_event_get_scancode :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO Int32

-- | Gets the keyboard low-level scancode of a key event.
-- 
-- This is usually hardware_keycode. On Windows this is the high
-- word of WM_KEY{DOWN,UP} lParam which contains the scancode and
-- some extended flags.
-- 
-- /Since: 3.22/
eventGetScancode ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Int32
    -- ^ __Returns:__ The associated keyboard scancode or 0
eventGetScancode :: Event -> m Int32
eventGetScancode Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Int32
result <- Ptr Event -> IO Int32
gdk_event_get_scancode Ptr Event
event'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetScancodeMethodInfo Event signature where
    overloadedMethod = eventGetScancode

#endif

-- method Event::get_screen
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Screen" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_screen" gdk_event_get_screen :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO (Ptr Gdk.Screen.Screen)

-- | Returns the screen for the event. The screen is
-- typically the screen for @event->any.window@, but
-- for events such as mouse events, it is the screen
-- where the pointer was when the event occurs -
-- that is, the screen which has the root window
-- to which @event->motion.x_root@ and
-- @event->motion.y_root@ are relative.
-- 
-- /Since: 2.2/
eventGetScreen ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Gdk.Screen.Screen
    -- ^ __Returns:__ the screen for the event
eventGetScreen :: Event -> m Screen
eventGetScreen Event
event = IO Screen -> m Screen
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Screen -> m Screen) -> IO Screen -> m Screen
forall a b. (a -> b) -> a -> b
$ do
    Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr Screen
result <- Ptr Event -> IO (Ptr Screen)
gdk_event_get_screen Ptr Event
event'
    Text -> Ptr Screen -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"eventGetScreen" Ptr Screen
result
    Screen
result' <- ((ManagedPtr Screen -> Screen) -> Ptr Screen -> IO Screen
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Screen -> Screen
Gdk.Screen.Screen) Ptr Screen
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    Screen -> IO Screen
forall (m :: * -> *) a. Monad m => a -> m a
return Screen
result'

#if defined(ENABLE_OVERLOADING)
data EventGetScreenMethodInfo
instance (signature ~ (m Gdk.Screen.Screen), MonadIO m) => O.MethodInfo EventGetScreenMethodInfo Event signature where
    overloadedMethod = eventGetScreen

#endif

-- method Event::get_scroll_deltas
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "delta_x"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for X delta"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "delta_y"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for Y delta"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_scroll_deltas" gdk_event_get_scroll_deltas :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr CDouble ->                          -- delta_x : TBasicType TDouble
    Ptr CDouble ->                          -- delta_y : TBasicType TDouble
    IO CInt

-- | Retrieves the scroll deltas from a t'GI.Gdk.Unions.Event.Event'
-- 
-- See also: 'GI.Gdk.Unions.Event.eventGetScrollDirection'
-- 
-- /Since: 3.4/
eventGetScrollDeltas ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m ((Bool, Double, Double))
    -- ^ __Returns:__ 'P.True' if the event contains smooth scroll information
    --   and 'P.False' otherwise
eventGetScrollDeltas :: Event -> m (Bool, Double, Double)
eventGetScrollDeltas Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
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'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetScrollDeltasMethodInfo Event signature where
    overloadedMethod = eventGetScrollDeltas

#endif

-- method Event::get_scroll_direction
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ScrollDirection" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the scroll direction"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_scroll_direction" gdk_event_get_scroll_direction :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr CUInt ->                            -- direction : TInterface (Name {namespace = "Gdk", name = "ScrollDirection"})
    IO CInt

-- | Extracts the scroll direction from an event.
-- 
-- If /@event@/ is not of type 'GI.Gdk.Enums.EventTypeScroll', the contents of /@direction@/
-- are undefined.
-- 
-- If you wish to handle both discrete and smooth scrolling, you
-- should check the return value of this function, or of
-- 'GI.Gdk.Unions.Event.eventGetScrollDeltas'; for instance:
-- 
-- 
-- === /C code/
-- >
-- >  GdkScrollDirection direction;
-- >  double vscroll_factor = 0.0;
-- >  double x_scroll, y_scroll;
-- >
-- >  if (gdk_event_get_scroll_direction (event, &direction))
-- >    {
-- >      // Handle discrete scrolling with a known constant delta;
-- >      const double delta = 12.0;
-- >
-- >      switch (direction)
-- >        {
-- >        case GDK_SCROLL_UP:
-- >          vscroll_factor = -delta;
-- >          break;
-- >        case GDK_SCROLL_DOWN:
-- >          vscroll_factor = delta;
-- >          break;
-- >        default:
-- >          // no scrolling
-- >          break;
-- >        }
-- >    }
-- >  else if (gdk_event_get_scroll_deltas (event, &x_scroll, &y_scroll))
-- >    {
-- >      // Handle smooth scrolling directly
-- >      vscroll_factor = y_scroll;
-- >    }
-- 
-- 
-- /Since: 3.2/
eventGetScrollDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m ((Bool, Gdk.Enums.ScrollDirection))
    -- ^ __Returns:__ 'P.True' if the event delivered a scroll direction
    --   and 'P.False' otherwise
eventGetScrollDirection :: Event -> m (Bool, ScrollDirection)
eventGetScrollDirection Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
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'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetScrollDirectionMethodInfo Event signature where
    overloadedMethod = eventGetScrollDirection

#endif

-- method Event::get_seat
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Seat" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_seat" gdk_event_get_seat :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO (Ptr Gdk.Seat.Seat)

-- | Returns the t'GI.Gdk.Objects.Seat.Seat' this event was generated for.
-- 
-- /Since: 3.20/
eventGetSeat ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Gdk.Seat.Seat
    -- ^ __Returns:__ The t'GI.Gdk.Objects.Seat.Seat' of this event
eventGetSeat :: Event -> m Seat
eventGetSeat Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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 Text
"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
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetSeatMethodInfo Event signature where
    overloadedMethod = eventGetSeat

#endif

-- method Event::get_source_device
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Device" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_source_device" gdk_event_get_source_device :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO (Ptr Gdk.Device.Device)

-- | This function returns the hardware (slave) t'GI.Gdk.Objects.Device.Device' that has
-- triggered the event, falling back to the virtual (master) device
-- (as in 'GI.Gdk.Unions.Event.eventGetDevice') if the event wasn’t caused by
-- interaction with a hardware device. This may happen for example
-- in synthesized crossing events after a t'GI.Gdk.Objects.Window.Window' updates its
-- geometry or a grab is acquired\/released.
-- 
-- If the event does not contain a device field, this function will
-- return 'P.Nothing'.
-- 
-- /Since: 3.0/
eventGetSourceDevice ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m (Maybe Gdk.Device.Device)
    -- ^ __Returns:__ a t'GI.Gdk.Objects.Device.Device', or 'P.Nothing'.
eventGetSourceDevice :: Event -> m (Maybe Device)
eventGetSourceDevice Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
$ \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''
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetSourceDeviceMethodInfo Event signature where
    overloadedMethod = eventGetSourceDevice

#endif

-- method Event::get_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "state"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for state"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_state" gdk_event_get_state :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr CUInt ->                            -- state : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CInt

-- | If the event contains a “state” field, puts that field in /@state@/. Otherwise
-- stores an empty state (0). Returns 'P.True' if there was a state field
-- in the event. /@event@/ may be 'P.Nothing', in which case it’s treated
-- as if the event had no state field.
eventGetState ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event' or 'P.Nothing'
    -> m ((Bool, [Gdk.Flags.ModifierType]))
    -- ^ __Returns:__ 'P.True' if there was a state field in the event
eventGetState :: Event -> m (Bool, [ModifierType])
eventGetState Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
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'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetStateMethodInfo Event signature where
    overloadedMethod = eventGetState

#endif

-- method Event::get_time
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_time" gdk_event_get_time :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO Word32

-- | Returns the time stamp from /@event@/, if there is one; otherwise
-- returns 'GI.Gdk.Constants.CURRENT_TIME'. If /@event@/ is 'P.Nothing', returns 'GI.Gdk.Constants.CURRENT_TIME'.
eventGetTime ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Word32
    -- ^ __Returns:__ time stamp field from /@event@/
eventGetTime :: Event -> m Word32
eventGetTime Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Word32
result <- Ptr Event -> IO Word32
gdk_event_get_time Ptr Event
event'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventGetTimeMethodInfo Event signature where
    overloadedMethod = eventGetTime

#endif

-- method Event::get_window
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Window" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get_window" gdk_event_get_window :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO (Ptr Gdk.Window.Window)

-- | Extracts the t'GI.Gdk.Objects.Window.Window' associated with an event.
-- 
-- /Since: 3.10/
eventGetWindow ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Gdk.Window.Window
    -- ^ __Returns:__ The t'GI.Gdk.Objects.Window.Window' associated with the event
eventGetWindow :: Event -> m Window
eventGetWindow Event
event = IO Window -> m Window
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Window -> m Window) -> IO Window -> m Window
forall a b. (a -> b) -> a -> b
$ do
    Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr Window
result <- Ptr Event -> IO (Ptr Window)
gdk_event_get_window Ptr Event
event'
    Text -> Ptr Window -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"eventGetWindow" Ptr Window
result
    Window
result' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gdk.Window.Window) Ptr Window
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    Window -> IO Window
forall (m :: * -> *) a. Monad m => a -> m a
return Window
result'

#if defined(ENABLE_OVERLOADING)
data EventGetWindowMethodInfo
instance (signature ~ (m Gdk.Window.Window), MonadIO m) => O.MethodInfo EventGetWindowMethodInfo Event signature where
    overloadedMethod = eventGetWindow

#endif

-- method Event::is_scroll_stop_event
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_is_scroll_stop_event" gdk_event_is_scroll_stop_event :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO CInt

-- | Check whether a scroll event is a stop scroll event. Scroll sequences
-- with smooth scroll information may provide a stop scroll event once the
-- interaction with the device finishes, e.g. by lifting a finger. This
-- stop scroll event is the signal that a widget may trigger kinetic
-- scrolling based on the current velocity.
-- 
-- Stop scroll events always have a a delta of 0\/0.
-- 
-- /Since: 3.20/
eventIsScrollStopEvent ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the event is a scroll stop event
eventIsScrollStopEvent :: Event -> m Bool
eventIsScrollStopEvent Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
0) CInt
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventIsScrollStopEventMethodInfo Event signature where
    overloadedMethod = eventIsScrollStopEvent

#endif

-- method Event::put
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_put" gdk_event_put :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO ()

-- | Appends a copy of the given event onto the front of the event
-- queue for event->any.window’s display, or the default event
-- queue if event->any.window is 'P.Nothing'. See 'GI.Gdk.Objects.Display.displayPutEvent'.
eventPut ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'.
    -> m ()
eventPut :: Event -> m ()
eventPut Event
event = 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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr Event -> IO ()
gdk_event_put Ptr Event
event'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventPutMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo EventPutMethodInfo Event signature where
    overloadedMethod = eventPut

#endif

-- method Event::set_device
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "device"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Device" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkDevice" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_set_device" gdk_event_set_device :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr Gdk.Device.Device ->                -- device : TInterface (Name {namespace = "Gdk", name = "Device"})
    IO ()

-- | Sets the device for /@event@/ to /@device@/. The event must
-- have been allocated by GTK+, for instance, by
-- 'GI.Gdk.Unions.Event.eventCopy'.
-- 
-- /Since: 3.0/
eventSetDevice ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Device.IsDevice a) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> a
    -- ^ /@device@/: a t'GI.Gdk.Objects.Device.Device'
    -> m ()
eventSetDevice :: Event -> a -> m ()
eventSetDevice Event
event a
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Ptr Event -> Ptr Device -> IO ()
gdk_event_set_device Ptr Event
event' Ptr Device
device'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventSetDeviceMethodInfo
instance (signature ~ (a -> m ()), MonadIO m, Gdk.Device.IsDevice a) => O.MethodInfo EventSetDeviceMethodInfo Event signature where
    overloadedMethod = eventSetDevice

#endif

-- method Event::set_device_tool
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tool"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "DeviceTool" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "tool to set on the event, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_set_device_tool" gdk_event_set_device_tool :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr Gdk.DeviceTool.DeviceTool ->        -- tool : TInterface (Name {namespace = "Gdk", name = "DeviceTool"})
    IO ()

-- | Sets the device tool for this event, should be rarely used.
-- 
-- /Since: 3.22/
eventSetDeviceTool ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.DeviceTool.IsDeviceTool a) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> Maybe (a)
    -- ^ /@tool@/: tool to set on the event, or 'P.Nothing'
    -> m ()
eventSetDeviceTool :: Event -> Maybe a -> m ()
eventSetDeviceTool Event
event Maybe a
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr DeviceTool
maybeTool <- case Maybe a
tool of
        Maybe a
Nothing -> Ptr DeviceTool -> IO (Ptr DeviceTool)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr DeviceTool
forall a. Ptr a
nullPtr
        Just a
jTool -> do
            Ptr DeviceTool
jTool' <- a -> IO (Ptr DeviceTool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
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
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
tool a -> 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 (a) -> m ()), MonadIO m, Gdk.DeviceTool.IsDeviceTool a) => O.MethodInfo EventSetDeviceToolMethodInfo Event signature where
    overloadedMethod = eventSetDeviceTool

#endif

-- method Event::set_screen
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "screen"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Screen" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkScreen" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_set_screen" gdk_event_set_screen :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr Gdk.Screen.Screen ->                -- screen : TInterface (Name {namespace = "Gdk", name = "Screen"})
    IO ()

-- | Sets the screen for /@event@/ to /@screen@/. The event must
-- have been allocated by GTK+, for instance, by
-- 'GI.Gdk.Unions.Event.eventCopy'.
-- 
-- /Since: 2.2/
eventSetScreen ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Screen.IsScreen a) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> a
    -- ^ /@screen@/: a t'GI.Gdk.Objects.Screen.Screen'
    -> m ()
eventSetScreen :: Event -> a -> m ()
eventSetScreen Event
event a
screen = 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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr Screen
screen' <- a -> IO (Ptr Screen)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
screen
    Ptr Event -> Ptr Screen -> IO ()
gdk_event_set_screen Ptr Event
event' Ptr Screen
screen'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
screen
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventSetScreenMethodInfo
instance (signature ~ (a -> m ()), MonadIO m, Gdk.Screen.IsScreen a) => O.MethodInfo EventSetScreenMethodInfo Event signature where
    overloadedMethod = eventSetScreen

#endif

-- method Event::set_source_device
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "device"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Device" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkDevice" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_set_source_device" gdk_event_set_source_device :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    Ptr Gdk.Device.Device ->                -- device : TInterface (Name {namespace = "Gdk", name = "Device"})
    IO ()

-- | Sets the slave device for /@event@/ to /@device@/.
-- 
-- The event must have been allocated by GTK+,
-- for instance by 'GI.Gdk.Unions.Event.eventCopy'.
-- 
-- /Since: 3.0/
eventSetSourceDevice ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Device.IsDevice a) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event'
    -> a
    -- ^ /@device@/: a t'GI.Gdk.Objects.Device.Device'
    -> m ()
eventSetSourceDevice :: Event -> a -> m ()
eventSetSourceDevice Event
event a
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
    Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Ptr Event -> Ptr Device -> IO ()
gdk_event_set_source_device Ptr Event
event' Ptr Device
device'
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventSetSourceDeviceMethodInfo
instance (signature ~ (a -> m ()), MonadIO m, Gdk.Device.IsDevice a) => O.MethodInfo EventSetSourceDeviceMethodInfo Event signature where
    overloadedMethod = eventSetSourceDevice

#endif

-- method Event::triggers_context_menu
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "event"
--           , argType = TInterface Name { namespace = "Gdk" , name = "Event" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #GdkEvent, currently only button events are meaningful values"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_triggers_context_menu" gdk_event_triggers_context_menu :: 
    Ptr Event ->                            -- event : TInterface (Name {namespace = "Gdk", name = "Event"})
    IO CInt

-- | This function returns whether a t'GI.Gdk.Structs.EventButton.EventButton' should trigger a
-- context menu, according to platform conventions. The right mouse
-- button always triggers context menus. Additionally, if
-- 'GI.Gdk.Objects.Keymap.keymapGetModifierMask' returns a non-0 mask for
-- 'GI.Gdk.Enums.ModifierIntentContextMenu', then the left mouse button will
-- also trigger a context menu if this modifier is pressed.
-- 
-- This function should always be used instead of simply checking for
-- event->button == 'GI.Gdk.Constants.BUTTON_SECONDARY'.
-- 
-- /Since: 3.4/
eventTriggersContextMenu ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Event
    -- ^ /@event@/: a t'GI.Gdk.Unions.Event.Event', currently only button events are meaningful values
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the event should trigger a context menu.
eventTriggersContextMenu :: Event -> m Bool
eventTriggersContextMenu Event
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' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
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
/= CInt
0) CInt
result
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
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) => O.MethodInfo EventTriggersContextMenuMethodInfo Event signature where
    overloadedMethod = eventTriggersContextMenu

#endif

-- method Event::get
-- method type : MemberFunction
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Event" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_get" gdk_event_get :: 
    IO (Ptr Event)

-- | Checks all open displays for a t'GI.Gdk.Unions.Event.Event' to process,to be processed
-- on, fetching events from the windowing system if necessary.
-- See 'GI.Gdk.Objects.Display.displayGetEvent'.
eventGet ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m (Maybe Event)
    -- ^ __Returns:__ the next t'GI.Gdk.Unions.Event.Event' to be processed, or 'P.Nothing'
    -- if no events are pending. The returned t'GI.Gdk.Unions.Event.Event' should be freed
    -- with 'GI.Gdk.Unions.Event.eventFree'.
eventGet :: m (Maybe Event)
eventGet  = IO (Maybe Event) -> m (Maybe Event)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Event) -> m (Maybe Event))
-> IO (Maybe Event) -> m (Maybe Event)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Event
result <- IO (Ptr Event)
gdk_event_get
    Maybe Event
maybeResult <- Ptr Event -> (Ptr Event -> IO Event) -> IO (Maybe Event)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Event
result ((Ptr Event -> IO Event) -> IO (Maybe Event))
-> (Ptr Event -> IO Event) -> IO (Maybe Event)
forall a b. (a -> b) -> a -> b
$ \Ptr Event
result' -> do
        Event
result'' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Event) Ptr Event
result'
        Event -> IO Event
forall (m :: * -> *) a. Monad m => a -> m a
return Event
result''
    Maybe Event -> IO (Maybe Event)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Event
maybeResult

#if defined(ENABLE_OVERLOADING)
#endif

-- method Event::handler_set
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "func"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "EventFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the function to call to handle events from GDK."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = 1
--           , argDestroy = 2
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data to pass to the function."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "notify"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DestroyNotify" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the function to call when the handler function is removed, i.e. when\n         gdk_event_handler_set() is called with another event handler."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_handler_set" gdk_event_handler_set :: 
    FunPtr Gdk.Callbacks.C_EventFunc ->     -- func : TInterface (Name {namespace = "Gdk", name = "EventFunc"})
    Ptr () ->                               -- data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

-- | Sets the function to call to handle all events from GDK.
-- 
-- Note that GTK+ uses this to install its own event handler, so it is
-- usually not useful for GTK+ applications. (Although an application
-- can call this function then call @/gtk_main_do_event()/@ to pass
-- events to GTK+.)
eventHandlerSet ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gdk.Callbacks.EventFunc
    -- ^ /@func@/: the function to call to handle events from GDK.
    -> m ()
eventHandlerSet :: (Event -> IO ()) -> m ()
eventHandlerSet Event -> IO ()
func = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    FunPtr C_EventFunc
func' <- C_EventFunc -> IO (FunPtr C_EventFunc)
Gdk.Callbacks.mk_EventFunc (Maybe (Ptr (FunPtr C_EventFunc))
-> EventFunc_WithClosures -> C_EventFunc
Gdk.Callbacks.wrap_EventFunc Maybe (Ptr (FunPtr C_EventFunc))
forall a. Maybe a
Nothing ((Event -> IO ()) -> EventFunc_WithClosures
Gdk.Callbacks.drop_closures_EventFunc Event -> IO ()
func))
    let data_ :: Ptr ()
data_ = FunPtr C_EventFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_EventFunc
func'
    let notify :: FunPtr (Ptr a -> IO ())
notify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
    FunPtr C_EventFunc -> Ptr () -> FunPtr C_DestroyNotify -> IO ()
gdk_event_handler_set FunPtr C_EventFunc
func' Ptr ()
data_ FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
notify
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif

-- method Event::peek
-- method type : MemberFunction
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gdk" , name = "Event" })
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_peek" gdk_event_peek :: 
    IO (Ptr Event)

-- | If there is an event waiting in the event queue of some open
-- display, returns a copy of it. See 'GI.Gdk.Objects.Display.displayPeekEvent'.
eventPeek ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m (Maybe Event)
    -- ^ __Returns:__ a copy of the first t'GI.Gdk.Unions.Event.Event' on some event
    -- queue, or 'P.Nothing' if no events are in any queues. The returned
    -- t'GI.Gdk.Unions.Event.Event' should be freed with 'GI.Gdk.Unions.Event.eventFree'.
eventPeek :: m (Maybe Event)
eventPeek  = IO (Maybe Event) -> m (Maybe Event)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Event) -> m (Maybe Event))
-> IO (Maybe Event) -> m (Maybe Event)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Event
result <- IO (Ptr Event)
gdk_event_peek
    Maybe Event
maybeResult <- Ptr Event -> (Ptr Event -> IO Event) -> IO (Maybe Event)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Event
result ((Ptr Event -> IO Event) -> IO (Maybe Event))
-> (Ptr Event -> IO Event) -> IO (Maybe Event)
forall a b. (a -> b) -> a -> b
$ \Ptr Event
result' -> do
        Event
result'' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Event) Ptr Event
result'
        Event -> IO Event
forall (m :: * -> *) a. Monad m => a -> m a
return Event
result''
    Maybe Event -> IO (Maybe Event)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Event
maybeResult

#if defined(ENABLE_OVERLOADING)
#endif

-- method Event::request_motions
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "event"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "EventMotion" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a valid #GdkEvent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gdk_event_request_motions" gdk_event_request_motions :: 
    Ptr Gdk.EventMotion.EventMotion ->      -- event : TInterface (Name {namespace = "Gdk", name = "EventMotion"})
    IO ()

-- | Request more motion notifies if /@event@/ is a motion notify hint event.
-- 
-- This function should be used instead of 'GI.Gdk.Objects.Window.windowGetPointer' to
-- request further motion notifies, because it also works for extension
-- events where motion notifies are provided for devices other than the
-- core pointer. Coordinate extraction, processing and requesting more
-- motion events from a 'GI.Gdk.Enums.EventTypeMotionNotify' event usually works like this:
-- 
-- 
-- === /C code/
-- >
-- >{
-- >  // motion_event handler
-- >  x = motion_event->x;
-- >  y = motion_event->y;
-- >  // handle (x,y) motion
-- >  gdk_event_request_motions (motion_event); // handles is_hint events
-- >}
-- 
-- 
-- /Since: 2.12/
eventRequestMotions ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gdk.EventMotion.EventMotion
    -- ^ /@event@/: a valid t'GI.Gdk.Unions.Event.Event'
    -> m ()
eventRequestMotions :: EventMotion -> m ()
eventRequestMotions EventMotion
event = 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 EventMotion
event' <- EventMotion -> IO (Ptr EventMotion)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr EventMotion
event
    Ptr EventMotion -> IO ()
gdk_event_request_motions Ptr EventMotion
event'
    EventMotion -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr EventMotion
event
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveEventMethod (t :: Symbol) (o :: *) :: * where
    ResolveEventMethod "copy" o = EventCopyMethodInfo
    ResolveEventMethod "free" o = EventFreeMethodInfo
    ResolveEventMethod "isScrollStopEvent" o = EventIsScrollStopEventMethodInfo
    ResolveEventMethod "put" o = EventPutMethodInfo
    ResolveEventMethod "triggersContextMenu" o = EventTriggersContextMenuMethodInfo
    ResolveEventMethod "getAxis" o = EventGetAxisMethodInfo
    ResolveEventMethod "getButton" o = EventGetButtonMethodInfo
    ResolveEventMethod "getClickCount" o = EventGetClickCountMethodInfo
    ResolveEventMethod "getCoords" o = EventGetCoordsMethodInfo
    ResolveEventMethod "getDevice" o = EventGetDeviceMethodInfo
    ResolveEventMethod "getDeviceTool" o = EventGetDeviceToolMethodInfo
    ResolveEventMethod "getEventSequence" o = EventGetEventSequenceMethodInfo
    ResolveEventMethod "getEventType" o = EventGetEventTypeMethodInfo
    ResolveEventMethod "getKeycode" o = EventGetKeycodeMethodInfo
    ResolveEventMethod "getKeyval" o = EventGetKeyvalMethodInfo
    ResolveEventMethod "getPointerEmulated" o = EventGetPointerEmulatedMethodInfo
    ResolveEventMethod "getRootCoords" o = EventGetRootCoordsMethodInfo
    ResolveEventMethod "getScancode" o = EventGetScancodeMethodInfo
    ResolveEventMethod "getScreen" o = EventGetScreenMethodInfo
    ResolveEventMethod "getScrollDeltas" o = EventGetScrollDeltasMethodInfo
    ResolveEventMethod "getScrollDirection" o = EventGetScrollDirectionMethodInfo
    ResolveEventMethod "getSeat" o = EventGetSeatMethodInfo
    ResolveEventMethod "getSourceDevice" o = EventGetSourceDeviceMethodInfo
    ResolveEventMethod "getState" o = EventGetStateMethodInfo
    ResolveEventMethod "getTime" o = EventGetTimeMethodInfo
    ResolveEventMethod "getWindow" o = EventGetWindowMethodInfo
    ResolveEventMethod "setDevice" o = EventSetDeviceMethodInfo
    ResolveEventMethod "setDeviceTool" o = EventSetDeviceToolMethodInfo
    ResolveEventMethod "setScreen" o = EventSetScreenMethodInfo
    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