{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- @GtkEventController@ is the base class for event controllers.
-- 
-- These are ancillary objects associated to widgets, which react
-- to @GdkEvents@, and possibly trigger actions as a consequence.
-- 
-- Event controllers are added to a widget with
-- 'GI.Gtk.Objects.Widget.widgetAddController'. It is rarely necessary to
-- explicitly remove a controller with 'GI.Gtk.Objects.Widget.widgetRemoveController'.
-- 
-- See the chapter on <https://docs.gtk.org/gtk4/input-handling.html input handling> for
-- an overview of the basic concepts, such as the capture and bubble
-- phases of event propagation.

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

module GI.Gtk.Objects.EventController
    ( 

-- * Exported types
    EventController(..)                     ,
    IsEventController                       ,
    toEventController                       ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [reset]("GI.Gtk.Objects.EventController#g:method:reset"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getCurrentEvent]("GI.Gtk.Objects.EventController#g:method:getCurrentEvent"), [getCurrentEventDevice]("GI.Gtk.Objects.EventController#g:method:getCurrentEventDevice"), [getCurrentEventState]("GI.Gtk.Objects.EventController#g:method:getCurrentEventState"), [getCurrentEventTime]("GI.Gtk.Objects.EventController#g:method:getCurrentEventTime"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getName]("GI.Gtk.Objects.EventController#g:method:getName"), [getPropagationLimit]("GI.Gtk.Objects.EventController#g:method:getPropagationLimit"), [getPropagationPhase]("GI.Gtk.Objects.EventController#g:method:getPropagationPhase"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getWidget]("GI.Gtk.Objects.EventController#g:method:getWidget").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setName]("GI.Gtk.Objects.EventController#g:method:setName"), [setPropagationLimit]("GI.Gtk.Objects.EventController#g:method:setPropagationLimit"), [setPropagationPhase]("GI.Gtk.Objects.EventController#g:method:setPropagationPhase"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setStaticName]("GI.Gtk.Objects.EventController#g:method:setStaticName").

#if defined(ENABLE_OVERLOADING)
    ResolveEventControllerMethod            ,
#endif

-- ** getCurrentEvent #method:getCurrentEvent#

#if defined(ENABLE_OVERLOADING)
    EventControllerGetCurrentEventMethodInfo,
#endif
    eventControllerGetCurrentEvent          ,


-- ** getCurrentEventDevice #method:getCurrentEventDevice#

#if defined(ENABLE_OVERLOADING)
    EventControllerGetCurrentEventDeviceMethodInfo,
#endif
    eventControllerGetCurrentEventDevice    ,


-- ** getCurrentEventState #method:getCurrentEventState#

#if defined(ENABLE_OVERLOADING)
    EventControllerGetCurrentEventStateMethodInfo,
#endif
    eventControllerGetCurrentEventState     ,


-- ** getCurrentEventTime #method:getCurrentEventTime#

#if defined(ENABLE_OVERLOADING)
    EventControllerGetCurrentEventTimeMethodInfo,
#endif
    eventControllerGetCurrentEventTime      ,


-- ** getName #method:getName#

#if defined(ENABLE_OVERLOADING)
    EventControllerGetNameMethodInfo        ,
#endif
    eventControllerGetName                  ,


-- ** getPropagationLimit #method:getPropagationLimit#

#if defined(ENABLE_OVERLOADING)
    EventControllerGetPropagationLimitMethodInfo,
#endif
    eventControllerGetPropagationLimit      ,


-- ** getPropagationPhase #method:getPropagationPhase#

#if defined(ENABLE_OVERLOADING)
    EventControllerGetPropagationPhaseMethodInfo,
#endif
    eventControllerGetPropagationPhase      ,


-- ** getWidget #method:getWidget#

#if defined(ENABLE_OVERLOADING)
    EventControllerGetWidgetMethodInfo      ,
#endif
    eventControllerGetWidget                ,


-- ** reset #method:reset#

#if defined(ENABLE_OVERLOADING)
    EventControllerResetMethodInfo          ,
#endif
    eventControllerReset                    ,


-- ** setName #method:setName#

#if defined(ENABLE_OVERLOADING)
    EventControllerSetNameMethodInfo        ,
#endif
    eventControllerSetName                  ,


-- ** setPropagationLimit #method:setPropagationLimit#

#if defined(ENABLE_OVERLOADING)
    EventControllerSetPropagationLimitMethodInfo,
#endif
    eventControllerSetPropagationLimit      ,


-- ** setPropagationPhase #method:setPropagationPhase#

#if defined(ENABLE_OVERLOADING)
    EventControllerSetPropagationPhaseMethodInfo,
#endif
    eventControllerSetPropagationPhase      ,


-- ** setStaticName #method:setStaticName#

#if defined(ENABLE_OVERLOADING)
    EventControllerSetStaticNameMethodInfo  ,
#endif
    eventControllerSetStaticName            ,




 -- * Properties


-- ** name #attr:name#
-- | The name for this controller, typically used for debugging purposes.

#if defined(ENABLE_OVERLOADING)
    EventControllerNamePropertyInfo         ,
#endif
    clearEventControllerName                ,
    constructEventControllerName            ,
#if defined(ENABLE_OVERLOADING)
    eventControllerName                     ,
#endif
    getEventControllerName                  ,
    setEventControllerName                  ,


-- ** propagationLimit #attr:propagationLimit#
-- | The limit for which events this controller will handle.

#if defined(ENABLE_OVERLOADING)
    EventControllerPropagationLimitPropertyInfo,
#endif
    constructEventControllerPropagationLimit,
#if defined(ENABLE_OVERLOADING)
    eventControllerPropagationLimit         ,
#endif
    getEventControllerPropagationLimit      ,
    setEventControllerPropagationLimit      ,


-- ** propagationPhase #attr:propagationPhase#
-- | The propagation phase at which this controller will handle events.

#if defined(ENABLE_OVERLOADING)
    EventControllerPropagationPhasePropertyInfo,
#endif
    constructEventControllerPropagationPhase,
#if defined(ENABLE_OVERLOADING)
    eventControllerPropagationPhase         ,
#endif
    getEventControllerPropagationPhase      ,
    setEventControllerPropagationPhase      ,


-- ** widget #attr:widget#
-- | The widget receiving the @GdkEvents@ that the controller will handle.

#if defined(ENABLE_OVERLOADING)
    EventControllerWidgetPropertyInfo       ,
#endif
#if defined(ENABLE_OVERLOADING)
    eventControllerWidget                   ,
#endif
    getEventControllerWidget                ,




    ) 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.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.FontOptions as Cairo.FontOptions
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Interfaces.Paintable as Gdk.Paintable
import qualified GI.Gdk.Objects.Clipboard as Gdk.Clipboard
import qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import qualified GI.Gdk.Objects.Device as Gdk.Device
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Objects.Event as Gdk.Event
import qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
import qualified GI.Gdk.Objects.Surface as Gdk.Surface
import qualified GI.Gdk.Objects.Texture as Gdk.Texture
import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import qualified GI.Gio.Interfaces.ActionGroup as Gio.ActionGroup
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.Graphene.Structs.Matrix as Graphene.Matrix
import qualified GI.Graphene.Structs.Point as Graphene.Point
import qualified GI.Graphene.Structs.Point3D as Graphene.Point3D
import qualified GI.Graphene.Structs.Rect as Graphene.Rect
import qualified GI.Graphene.Structs.Size as Graphene.Size
import qualified GI.Graphene.Structs.Vec3 as Graphene.Vec3
import qualified GI.Graphene.Structs.Vec4 as Graphene.Vec4
import qualified GI.Gsk.Enums as Gsk.Enums
import qualified GI.Gsk.Objects.GLShader as Gsk.GLShader
import qualified GI.Gsk.Objects.RenderNode as Gsk.RenderNode
import qualified GI.Gsk.Objects.Renderer as Gsk.Renderer
import qualified GI.Gsk.Structs.ColorStop as Gsk.ColorStop
import qualified GI.Gsk.Structs.Path as Gsk.Path
import qualified GI.Gsk.Structs.RoundedRect as Gsk.RoundedRect
import qualified GI.Gsk.Structs.Shadow as Gsk.Shadow
import qualified GI.Gsk.Structs.Stroke as Gsk.Stroke
import qualified GI.Gsk.Structs.Transform as Gsk.Transform
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Accessible as Gtk.Accessible
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.ConstraintTarget as Gtk.ConstraintTarget
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Native as Gtk.Native
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Root as Gtk.Root
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.StyleProvider as Gtk.StyleProvider
import {-# SOURCE #-} qualified GI.Gtk.Objects.ATContext as Gtk.ATContext
import {-# SOURCE #-} qualified GI.Gtk.Objects.LayoutChild as Gtk.LayoutChild
import {-# SOURCE #-} qualified GI.Gtk.Objects.LayoutManager as Gtk.LayoutManager
import {-# SOURCE #-} qualified GI.Gtk.Objects.Settings as Gtk.Settings
import {-# SOURCE #-} qualified GI.Gtk.Objects.Snapshot as Gtk.Snapshot
import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleContext as Gtk.StyleContext
import {-# SOURCE #-} qualified GI.Gtk.Objects.Tooltip as Gtk.Tooltip
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
import {-# SOURCE #-} qualified GI.Gtk.Structs.Border as Gtk.Border
import {-# SOURCE #-} qualified GI.Gtk.Structs.Requisition as Gtk.Requisition
import qualified GI.Pango.Enums as Pango.Enums
import qualified GI.Pango.Objects.Context as Pango.Context
import qualified GI.Pango.Objects.FontMap as Pango.FontMap
import qualified GI.Pango.Objects.Layout as Pango.Layout

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Objects.Device as Gdk.Device
import qualified GI.Gdk.Objects.Event as Gdk.Event
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget

#endif

-- | Memory-managed wrapper type.
newtype EventController = EventController (SP.ManagedPtr EventController)
    deriving (EventController -> EventController -> Bool
(EventController -> EventController -> Bool)
-> (EventController -> EventController -> Bool)
-> Eq EventController
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EventController -> EventController -> Bool
== :: EventController -> EventController -> Bool
$c/= :: EventController -> EventController -> Bool
/= :: EventController -> EventController -> Bool
Eq)

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

foreign import ccall "gtk_event_controller_get_type"
    c_gtk_event_controller_get_type :: IO B.Types.GType

instance B.Types.TypedObject EventController where
    glibType :: IO GType
glibType = IO GType
c_gtk_event_controller_get_type

instance B.Types.GObject EventController

-- | Type class for types which can be safely cast to `EventController`, for instance with `toEventController`.
class (SP.GObject o, O.IsDescendantOf EventController o) => IsEventController o
instance (SP.GObject o, O.IsDescendantOf EventController o) => IsEventController o

instance O.HasParentTypes EventController
type instance O.ParentTypes EventController = '[GObject.Object.Object]

-- | Cast to `EventController`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toEventController :: (MIO.MonadIO m, IsEventController o) => o -> m EventController
toEventController :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> m EventController
toEventController = IO EventController -> m EventController
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO EventController -> m EventController)
-> (o -> IO EventController) -> o -> m EventController
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr EventController -> EventController)
-> o -> IO EventController
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr EventController -> EventController
EventController

-- | Convert 'EventController' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe EventController) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_event_controller_get_type
    gvalueSet_ :: Ptr GValue -> Maybe EventController -> IO ()
gvalueSet_ Ptr GValue
gv Maybe EventController
P.Nothing = Ptr GValue -> Ptr EventController -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr EventController
forall a. Ptr a
FP.nullPtr :: FP.Ptr EventController)
    gvalueSet_ Ptr GValue
gv (P.Just EventController
obj) = EventController -> (Ptr EventController -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr EventController
obj (Ptr GValue -> Ptr EventController -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe EventController)
gvalueGet_ Ptr GValue
gv = do
        Ptr EventController
ptr <- Ptr GValue -> IO (Ptr EventController)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr EventController)
        if Ptr EventController
ptr Ptr EventController -> Ptr EventController -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr EventController
forall a. Ptr a
FP.nullPtr
        then EventController -> Maybe EventController
forall a. a -> Maybe a
P.Just (EventController -> Maybe EventController)
-> IO EventController -> IO (Maybe EventController)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr EventController -> EventController)
-> Ptr EventController -> IO EventController
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr EventController -> EventController
EventController Ptr EventController
ptr
        else Maybe EventController -> IO (Maybe EventController)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe EventController
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveEventControllerMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveEventControllerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveEventControllerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveEventControllerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveEventControllerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveEventControllerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveEventControllerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveEventControllerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveEventControllerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveEventControllerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveEventControllerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveEventControllerMethod "reset" o = EventControllerResetMethodInfo
    ResolveEventControllerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveEventControllerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveEventControllerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveEventControllerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveEventControllerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveEventControllerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveEventControllerMethod "getCurrentEvent" o = EventControllerGetCurrentEventMethodInfo
    ResolveEventControllerMethod "getCurrentEventDevice" o = EventControllerGetCurrentEventDeviceMethodInfo
    ResolveEventControllerMethod "getCurrentEventState" o = EventControllerGetCurrentEventStateMethodInfo
    ResolveEventControllerMethod "getCurrentEventTime" o = EventControllerGetCurrentEventTimeMethodInfo
    ResolveEventControllerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveEventControllerMethod "getName" o = EventControllerGetNameMethodInfo
    ResolveEventControllerMethod "getPropagationLimit" o = EventControllerGetPropagationLimitMethodInfo
    ResolveEventControllerMethod "getPropagationPhase" o = EventControllerGetPropagationPhaseMethodInfo
    ResolveEventControllerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveEventControllerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveEventControllerMethod "getWidget" o = EventControllerGetWidgetMethodInfo
    ResolveEventControllerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveEventControllerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveEventControllerMethod "setName" o = EventControllerSetNameMethodInfo
    ResolveEventControllerMethod "setPropagationLimit" o = EventControllerSetPropagationLimitMethodInfo
    ResolveEventControllerMethod "setPropagationPhase" o = EventControllerSetPropagationPhaseMethodInfo
    ResolveEventControllerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveEventControllerMethod "setStaticName" o = EventControllerSetStaticNameMethodInfo
    ResolveEventControllerMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveEventControllerMethod t EventController, O.OverloadedMethod info EventController p) => OL.IsLabel t (EventController -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveEventControllerMethod t EventController, O.OverloadedMethod info EventController p, R.HasField t EventController p) => R.HasField t EventController p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveEventControllerMethod t EventController, O.OverloadedMethodInfo info EventController) => OL.IsLabel t (O.MethodProxy info EventController) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

-- VVV Prop "name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just True)

-- | Get the value of the “@name@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' eventController #name
-- @
getEventControllerName :: (MonadIO m, IsEventController o) => o -> m (Maybe T.Text)
getEventControllerName :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> m (Maybe Text)
getEventControllerName o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"name"

-- | Set the value of the “@name@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' eventController [ #name 'Data.GI.Base.Attributes.:=' value ]
-- @
setEventControllerName :: (MonadIO m, IsEventController o) => o -> T.Text -> m ()
setEventControllerName :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> Text -> m ()
setEventControllerName o
obj Text
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

-- | Construct a `GValueConstruct` with valid value for the “@name@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructEventControllerName :: (IsEventController o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructEventControllerName :: forall o (m :: * -> *).
(IsEventController o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructEventControllerName Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"name" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

-- | Set the value of the “@name@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #name
-- @
clearEventControllerName :: (MonadIO m, IsEventController o) => o -> m ()
clearEventControllerName :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> m ()
clearEventControllerName o
obj = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"name" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)

#if defined(ENABLE_OVERLOADING)
data EventControllerNamePropertyInfo
instance AttrInfo EventControllerNamePropertyInfo where
    type AttrAllowedOps EventControllerNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint EventControllerNamePropertyInfo = IsEventController
    type AttrSetTypeConstraint EventControllerNamePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint EventControllerNamePropertyInfo = (~) T.Text
    type AttrTransferType EventControllerNamePropertyInfo = T.Text
    type AttrGetType EventControllerNamePropertyInfo = (Maybe T.Text)
    type AttrLabel EventControllerNamePropertyInfo = "name"
    type AttrOrigin EventControllerNamePropertyInfo = EventController
    attrGet = getEventControllerName
    attrSet = setEventControllerName
    attrTransfer _ v = do
        return v
    attrConstruct = constructEventControllerName
    attrClear = clearEventControllerName
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.name"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#g:attr:name"
        })
#endif

-- VVV Prop "propagation-limit"
   -- Type: TInterface (Name {namespace = "Gtk", name = "PropagationLimit"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

-- | Get the value of the “@propagation-limit@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' eventController #propagationLimit
-- @
getEventControllerPropagationLimit :: (MonadIO m, IsEventController o) => o -> m Gtk.Enums.PropagationLimit
getEventControllerPropagationLimit :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> m PropagationLimit
getEventControllerPropagationLimit o
obj = IO PropagationLimit -> m PropagationLimit
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO PropagationLimit -> m PropagationLimit)
-> IO PropagationLimit -> m PropagationLimit
forall a b. (a -> b) -> a -> b
$ o -> String -> IO PropagationLimit
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"propagation-limit"

-- | Set the value of the “@propagation-limit@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' eventController [ #propagationLimit 'Data.GI.Base.Attributes.:=' value ]
-- @
setEventControllerPropagationLimit :: (MonadIO m, IsEventController o) => o -> Gtk.Enums.PropagationLimit -> m ()
setEventControllerPropagationLimit :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> PropagationLimit -> m ()
setEventControllerPropagationLimit o
obj PropagationLimit
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> PropagationLimit -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj String
"propagation-limit" PropagationLimit
val

-- | Construct a `GValueConstruct` with valid value for the “@propagation-limit@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructEventControllerPropagationLimit :: (IsEventController o, MIO.MonadIO m) => Gtk.Enums.PropagationLimit -> m (GValueConstruct o)
constructEventControllerPropagationLimit :: forall o (m :: * -> *).
(IsEventController o, MonadIO m) =>
PropagationLimit -> m (GValueConstruct o)
constructEventControllerPropagationLimit PropagationLimit
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> PropagationLimit -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"propagation-limit" PropagationLimit
val

#if defined(ENABLE_OVERLOADING)
data EventControllerPropagationLimitPropertyInfo
instance AttrInfo EventControllerPropagationLimitPropertyInfo where
    type AttrAllowedOps EventControllerPropagationLimitPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint EventControllerPropagationLimitPropertyInfo = IsEventController
    type AttrSetTypeConstraint EventControllerPropagationLimitPropertyInfo = (~) Gtk.Enums.PropagationLimit
    type AttrTransferTypeConstraint EventControllerPropagationLimitPropertyInfo = (~) Gtk.Enums.PropagationLimit
    type AttrTransferType EventControllerPropagationLimitPropertyInfo = Gtk.Enums.PropagationLimit
    type AttrGetType EventControllerPropagationLimitPropertyInfo = Gtk.Enums.PropagationLimit
    type AttrLabel EventControllerPropagationLimitPropertyInfo = "propagation-limit"
    type AttrOrigin EventControllerPropagationLimitPropertyInfo = EventController
    attrGet = getEventControllerPropagationLimit
    attrSet = setEventControllerPropagationLimit
    attrTransfer _ v = do
        return v
    attrConstruct = constructEventControllerPropagationLimit
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.propagationLimit"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#g:attr:propagationLimit"
        })
#endif

-- VVV Prop "propagation-phase"
   -- Type: TInterface (Name {namespace = "Gtk", name = "PropagationPhase"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

-- | Get the value of the “@propagation-phase@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' eventController #propagationPhase
-- @
getEventControllerPropagationPhase :: (MonadIO m, IsEventController o) => o -> m Gtk.Enums.PropagationPhase
getEventControllerPropagationPhase :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> m PropagationPhase
getEventControllerPropagationPhase o
obj = IO PropagationPhase -> m PropagationPhase
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO PropagationPhase -> m PropagationPhase)
-> IO PropagationPhase -> m PropagationPhase
forall a b. (a -> b) -> a -> b
$ o -> String -> IO PropagationPhase
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"propagation-phase"

-- | Set the value of the “@propagation-phase@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' eventController [ #propagationPhase 'Data.GI.Base.Attributes.:=' value ]
-- @
setEventControllerPropagationPhase :: (MonadIO m, IsEventController o) => o -> Gtk.Enums.PropagationPhase -> m ()
setEventControllerPropagationPhase :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> PropagationPhase -> m ()
setEventControllerPropagationPhase o
obj PropagationPhase
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> PropagationPhase -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj String
"propagation-phase" PropagationPhase
val

-- | Construct a `GValueConstruct` with valid value for the “@propagation-phase@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructEventControllerPropagationPhase :: (IsEventController o, MIO.MonadIO m) => Gtk.Enums.PropagationPhase -> m (GValueConstruct o)
constructEventControllerPropagationPhase :: forall o (m :: * -> *).
(IsEventController o, MonadIO m) =>
PropagationPhase -> m (GValueConstruct o)
constructEventControllerPropagationPhase PropagationPhase
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> PropagationPhase -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"propagation-phase" PropagationPhase
val

#if defined(ENABLE_OVERLOADING)
data EventControllerPropagationPhasePropertyInfo
instance AttrInfo EventControllerPropagationPhasePropertyInfo where
    type AttrAllowedOps EventControllerPropagationPhasePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint EventControllerPropagationPhasePropertyInfo = IsEventController
    type AttrSetTypeConstraint EventControllerPropagationPhasePropertyInfo = (~) Gtk.Enums.PropagationPhase
    type AttrTransferTypeConstraint EventControllerPropagationPhasePropertyInfo = (~) Gtk.Enums.PropagationPhase
    type AttrTransferType EventControllerPropagationPhasePropertyInfo = Gtk.Enums.PropagationPhase
    type AttrGetType EventControllerPropagationPhasePropertyInfo = Gtk.Enums.PropagationPhase
    type AttrLabel EventControllerPropagationPhasePropertyInfo = "propagation-phase"
    type AttrOrigin EventControllerPropagationPhasePropertyInfo = EventController
    attrGet = getEventControllerPropagationPhase
    attrSet = setEventControllerPropagationPhase
    attrTransfer _ v = do
        return v
    attrConstruct = constructEventControllerPropagationPhase
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.propagationPhase"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#g:attr:propagationPhase"
        })
#endif

-- VVV Prop "widget"
   -- Type: TInterface (Name {namespace = "Gtk", name = "Widget"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Just True,Nothing)

-- | Get the value of the “@widget@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' eventController #widget
-- @
getEventControllerWidget :: (MonadIO m, IsEventController o) => o -> m (Maybe Gtk.Widget.Widget)
getEventControllerWidget :: forall (m :: * -> *) o.
(MonadIO m, IsEventController o) =>
o -> m (Maybe Widget)
getEventControllerWidget o
obj = IO (Maybe Widget) -> m (Maybe Widget)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Widget) -> m (Maybe Widget))
-> IO (Maybe Widget) -> m (Maybe Widget)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Widget -> Widget) -> IO (Maybe Widget)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"widget" ManagedPtr Widget -> Widget
Gtk.Widget.Widget

#if defined(ENABLE_OVERLOADING)
data EventControllerWidgetPropertyInfo
instance AttrInfo EventControllerWidgetPropertyInfo where
    type AttrAllowedOps EventControllerWidgetPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint EventControllerWidgetPropertyInfo = IsEventController
    type AttrSetTypeConstraint EventControllerWidgetPropertyInfo = (~) ()
    type AttrTransferTypeConstraint EventControllerWidgetPropertyInfo = (~) ()
    type AttrTransferType EventControllerWidgetPropertyInfo = ()
    type AttrGetType EventControllerWidgetPropertyInfo = (Maybe Gtk.Widget.Widget)
    type AttrLabel EventControllerWidgetPropertyInfo = "widget"
    type AttrOrigin EventControllerWidgetPropertyInfo = EventController
    attrGet = getEventControllerWidget
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.widget"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#g:attr:widget"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList EventController
type instance O.AttributeList EventController = EventControllerAttributeList
type EventControllerAttributeList = ('[ '("name", EventControllerNamePropertyInfo), '("propagationLimit", EventControllerPropagationLimitPropertyInfo), '("propagationPhase", EventControllerPropagationPhasePropertyInfo), '("widget", EventControllerWidgetPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
eventControllerName :: AttrLabelProxy "name"
eventControllerName = AttrLabelProxy

eventControllerPropagationLimit :: AttrLabelProxy "propagationLimit"
eventControllerPropagationLimit = AttrLabelProxy

eventControllerPropagationPhase :: AttrLabelProxy "propagationPhase"
eventControllerPropagationPhase = AttrLabelProxy

eventControllerWidget :: AttrLabelProxy "widget"
eventControllerWidget = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList EventController = EventControllerSignalList
type EventControllerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

#endif

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

foreign import ccall "gtk_event_controller_get_current_event" gtk_event_controller_get_current_event :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO (Ptr Gdk.Event.Event)

-- | Returns the event that is currently being handled by the controller.
-- 
-- At other times, 'P.Nothing' is returned.
eventControllerGetCurrentEvent ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m (Maybe Gdk.Event.Event)
    -- ^ __Returns:__ the event that is currently
    --   handled by /@controller@/
eventControllerGetCurrentEvent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m (Maybe Event)
eventControllerGetCurrentEvent a
controller = IO (Maybe Event) -> m (Maybe Event)
forall a. IO a -> m a
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 EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    Ptr Event
result <- Ptr EventController -> IO (Ptr Event)
gtk_event_controller_get_current_event Ptr EventController
controller'
    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, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Event -> Event
Gdk.Event.Event) Ptr Event
result'
        Event -> IO Event
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Event
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    Maybe Event -> IO (Maybe Event)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Event
maybeResult

#if defined(ENABLE_OVERLOADING)
data EventControllerGetCurrentEventMethodInfo
instance (signature ~ (m (Maybe Gdk.Event.Event)), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerGetCurrentEventMethodInfo a signature where
    overloadedMethod = eventControllerGetCurrentEvent

instance O.OverloadedMethodInfo EventControllerGetCurrentEventMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerGetCurrentEvent",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerGetCurrentEvent"
        })


#endif

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

foreign import ccall "gtk_event_controller_get_current_event_device" gtk_event_controller_get_current_event_device :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO (Ptr Gdk.Device.Device)

-- | Returns the device of the event that is currently being
-- handled by the controller.
-- 
-- At other times, 'P.Nothing' is returned.
eventControllerGetCurrentEventDevice ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m (Maybe Gdk.Device.Device)
    -- ^ __Returns:__ device of the event is
    --   currently handled by /@controller@/
eventControllerGetCurrentEventDevice :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m (Maybe Device)
eventControllerGetCurrentEventDevice a
controller = IO (Maybe Device) -> m (Maybe Device)
forall a. IO a -> m a
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 EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    Ptr Device
result <- Ptr EventController -> IO (Ptr Device)
gtk_event_controller_get_current_event_device Ptr EventController
controller'
    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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Device
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    Maybe Device -> IO (Maybe Device)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Device
maybeResult

#if defined(ENABLE_OVERLOADING)
data EventControllerGetCurrentEventDeviceMethodInfo
instance (signature ~ (m (Maybe Gdk.Device.Device)), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerGetCurrentEventDeviceMethodInfo a signature where
    overloadedMethod = eventControllerGetCurrentEventDevice

instance O.OverloadedMethodInfo EventControllerGetCurrentEventDeviceMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerGetCurrentEventDevice",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerGetCurrentEventDevice"
        })


#endif

-- method EventController::get_current_event_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gdk" , name = "ModifierType" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_get_current_event_state" gtk_event_controller_get_current_event_state :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO CUInt

-- | Returns the modifier state of the event that is currently being
-- handled by the controller.
-- 
-- At other times, 0 is returned.
eventControllerGetCurrentEventState ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m [Gdk.Flags.ModifierType]
    -- ^ __Returns:__ modifier state of the event is currently handled by /@controller@/
eventControllerGetCurrentEventState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m [ModifierType]
eventControllerGetCurrentEventState a
controller = IO [ModifierType] -> m [ModifierType]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ModifierType] -> m [ModifierType])
-> IO [ModifierType] -> m [ModifierType]
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    CUInt
result <- Ptr EventController -> IO CUInt
gtk_event_controller_get_current_event_state Ptr EventController
controller'
    let result' :: [ModifierType]
result' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    [ModifierType] -> IO [ModifierType]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [ModifierType]
result'

#if defined(ENABLE_OVERLOADING)
data EventControllerGetCurrentEventStateMethodInfo
instance (signature ~ (m [Gdk.Flags.ModifierType]), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerGetCurrentEventStateMethodInfo a signature where
    overloadedMethod = eventControllerGetCurrentEventState

instance O.OverloadedMethodInfo EventControllerGetCurrentEventStateMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerGetCurrentEventState",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerGetCurrentEventState"
        })


#endif

-- method EventController::get_current_event_time
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_get_current_event_time" gtk_event_controller_get_current_event_time :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO Word32

-- | Returns the timestamp of the event that is currently being
-- handled by the controller.
-- 
-- At other times, 0 is returned.
eventControllerGetCurrentEventTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m Word32
    -- ^ __Returns:__ timestamp of the event is currently handled by /@controller@/
eventControllerGetCurrentEventTime :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m Word32
eventControllerGetCurrentEventTime a
controller = IO Word32 -> m Word32
forall a. IO a -> m a
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 EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    Word32
result <- Ptr EventController -> IO Word32
gtk_event_controller_get_current_event_time Ptr EventController
controller'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data EventControllerGetCurrentEventTimeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerGetCurrentEventTimeMethodInfo a signature where
    overloadedMethod = eventControllerGetCurrentEventTime

instance O.OverloadedMethodInfo EventControllerGetCurrentEventTimeMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerGetCurrentEventTime",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerGetCurrentEventTime"
        })


#endif

-- method EventController::get_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_get_name" gtk_event_controller_get_name :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO CString

-- | Gets the name of /@controller@/.
eventControllerGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m (Maybe T.Text)
    -- ^ __Returns:__ The controller name
eventControllerGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m (Maybe Text)
eventControllerGetName a
controller = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    CString
result <- Ptr EventController -> IO CString
gtk_event_controller_get_name Ptr EventController
controller'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data EventControllerGetNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerGetNameMethodInfo a signature where
    overloadedMethod = eventControllerGetName

instance O.OverloadedMethodInfo EventControllerGetNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerGetName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerGetName"
        })


#endif

-- method EventController::get_propagation_limit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "PropagationLimit" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_get_propagation_limit" gtk_event_controller_get_propagation_limit :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO CUInt

-- | Gets the propagation limit of the event controller.
eventControllerGetPropagationLimit ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m Gtk.Enums.PropagationLimit
    -- ^ __Returns:__ the propagation limit
eventControllerGetPropagationLimit :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m PropagationLimit
eventControllerGetPropagationLimit a
controller = IO PropagationLimit -> m PropagationLimit
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PropagationLimit -> m PropagationLimit)
-> IO PropagationLimit -> m PropagationLimit
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    CUInt
result <- Ptr EventController -> IO CUInt
gtk_event_controller_get_propagation_limit Ptr EventController
controller'
    let result' :: PropagationLimit
result' = (Int -> PropagationLimit
forall a. Enum a => Int -> a
toEnum (Int -> PropagationLimit)
-> (CUInt -> Int) -> CUInt -> PropagationLimit
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    PropagationLimit -> IO PropagationLimit
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return PropagationLimit
result'

#if defined(ENABLE_OVERLOADING)
data EventControllerGetPropagationLimitMethodInfo
instance (signature ~ (m Gtk.Enums.PropagationLimit), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerGetPropagationLimitMethodInfo a signature where
    overloadedMethod = eventControllerGetPropagationLimit

instance O.OverloadedMethodInfo EventControllerGetPropagationLimitMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerGetPropagationLimit",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerGetPropagationLimit"
        })


#endif

-- method EventController::get_propagation_phase
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "PropagationPhase" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_get_propagation_phase" gtk_event_controller_get_propagation_phase :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO CUInt

-- | Gets the propagation phase at which /@controller@/ handles events.
eventControllerGetPropagationPhase ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m Gtk.Enums.PropagationPhase
    -- ^ __Returns:__ the propagation phase
eventControllerGetPropagationPhase :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m PropagationPhase
eventControllerGetPropagationPhase a
controller = IO PropagationPhase -> m PropagationPhase
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PropagationPhase -> m PropagationPhase)
-> IO PropagationPhase -> m PropagationPhase
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    CUInt
result <- Ptr EventController -> IO CUInt
gtk_event_controller_get_propagation_phase Ptr EventController
controller'
    let result' :: PropagationPhase
result' = (Int -> PropagationPhase
forall a. Enum a => Int -> a
toEnum (Int -> PropagationPhase)
-> (CUInt -> Int) -> CUInt -> PropagationPhase
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    PropagationPhase -> IO PropagationPhase
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return PropagationPhase
result'

#if defined(ENABLE_OVERLOADING)
data EventControllerGetPropagationPhaseMethodInfo
instance (signature ~ (m Gtk.Enums.PropagationPhase), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerGetPropagationPhaseMethodInfo a signature where
    overloadedMethod = eventControllerGetPropagationPhase

instance O.OverloadedMethodInfo EventControllerGetPropagationPhaseMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerGetPropagationPhase",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerGetPropagationPhase"
        })


#endif

-- method EventController::get_widget
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gtk" , name = "Widget" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_get_widget" gtk_event_controller_get_widget :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO (Ptr Gtk.Widget.Widget)

-- | Returns the @GtkWidget@ this controller relates to.
eventControllerGetWidget ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m (Maybe Gtk.Widget.Widget)
    -- ^ __Returns:__ a @GtkWidget@
eventControllerGetWidget :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m (Maybe Widget)
eventControllerGetWidget a
controller = IO (Maybe Widget) -> m (Maybe Widget)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Widget) -> m (Maybe Widget))
-> IO (Maybe Widget) -> m (Maybe Widget)
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    Ptr Widget
result <- Ptr EventController -> IO (Ptr Widget)
gtk_event_controller_get_widget Ptr EventController
controller'
    Maybe Widget
maybeResult <- Ptr Widget -> (Ptr Widget -> IO Widget) -> IO (Maybe Widget)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Widget
result ((Ptr Widget -> IO Widget) -> IO (Maybe Widget))
-> (Ptr Widget -> IO Widget) -> IO (Maybe Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
result' -> do
        Widget
result'' <- ((ManagedPtr Widget -> Widget) -> Ptr Widget -> IO Widget
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Widget -> Widget
Gtk.Widget.Widget) Ptr Widget
result'
        Widget -> IO Widget
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Widget
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    Maybe Widget -> IO (Maybe Widget)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Widget
maybeResult

#if defined(ENABLE_OVERLOADING)
data EventControllerGetWidgetMethodInfo
instance (signature ~ (m (Maybe Gtk.Widget.Widget)), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerGetWidgetMethodInfo a signature where
    overloadedMethod = eventControllerGetWidget

instance O.OverloadedMethodInfo EventControllerGetWidgetMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerGetWidget",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerGetWidget"
        })


#endif

-- method EventController::reset
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_reset" gtk_event_controller_reset :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    IO ()

-- | Resets the /@controller@/ to a clean state.
eventControllerReset ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> m ()
eventControllerReset :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> m ()
eventControllerReset a
controller = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    Ptr EventController -> IO ()
gtk_event_controller_reset Ptr EventController
controller'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventControllerResetMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerResetMethodInfo a signature where
    overloadedMethod = eventControllerReset

instance O.OverloadedMethodInfo EventControllerResetMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerReset",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerReset"
        })


#endif

-- method EventController::set_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a name for @controller"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_set_name" gtk_event_controller_set_name :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    CString ->                              -- name : TBasicType TUTF8
    IO ()

-- | Sets a name on the controller that can be used for debugging.
eventControllerSetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> Maybe (T.Text)
    -- ^ /@name@/: a name for /@controller@/
    -> m ()
eventControllerSetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> Maybe Text -> m ()
eventControllerSetName a
controller Maybe Text
name = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    CString
maybeName <- case Maybe Text
name of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jName -> do
            CString
jName' <- Text -> IO CString
textToCString Text
jName
            CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jName'
    Ptr EventController -> CString -> IO ()
gtk_event_controller_set_name Ptr EventController
controller' CString
maybeName
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeName
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventControllerSetNameMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerSetNameMethodInfo a signature where
    overloadedMethod = eventControllerSetName

instance O.OverloadedMethodInfo EventControllerSetNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerSetName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerSetName"
        })


#endif

-- method EventController::set_propagation_limit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "limit"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "PropagationLimit" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the propagation limit"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_set_propagation_limit" gtk_event_controller_set_propagation_limit :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    CUInt ->                                -- limit : TInterface (Name {namespace = "Gtk", name = "PropagationLimit"})
    IO ()

-- | Sets the event propagation limit on the event controller.
-- 
-- If the limit is set to 'GI.Gtk.Enums.PropagationLimitSameNative', the controller
-- won\'t handle events that are targeted at widgets on a different
-- surface, such as popovers.
eventControllerSetPropagationLimit ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> Gtk.Enums.PropagationLimit
    -- ^ /@limit@/: the propagation limit
    -> m ()
eventControllerSetPropagationLimit :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> PropagationLimit -> m ()
eventControllerSetPropagationLimit a
controller PropagationLimit
limit = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    let limit' :: CUInt
limit' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (PropagationLimit -> Int) -> PropagationLimit -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PropagationLimit -> Int
forall a. Enum a => a -> Int
fromEnum) PropagationLimit
limit
    Ptr EventController -> CUInt -> IO ()
gtk_event_controller_set_propagation_limit Ptr EventController
controller' CUInt
limit'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventControllerSetPropagationLimitMethodInfo
instance (signature ~ (Gtk.Enums.PropagationLimit -> m ()), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerSetPropagationLimitMethodInfo a signature where
    overloadedMethod = eventControllerSetPropagationLimit

instance O.OverloadedMethodInfo EventControllerSetPropagationLimitMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerSetPropagationLimit",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerSetPropagationLimit"
        })


#endif

-- method EventController::set_propagation_phase
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "phase"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "PropagationPhase" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a propagation phase"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_set_propagation_phase" gtk_event_controller_set_propagation_phase :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    CUInt ->                                -- phase : TInterface (Name {namespace = "Gtk", name = "PropagationPhase"})
    IO ()

-- | Sets the propagation phase at which a controller handles events.
-- 
-- If /@phase@/ is 'GI.Gtk.Enums.PropagationPhaseNone', no automatic event handling will be
-- performed, but other additional gesture maintenance will.
eventControllerSetPropagationPhase ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> Gtk.Enums.PropagationPhase
    -- ^ /@phase@/: a propagation phase
    -> m ()
eventControllerSetPropagationPhase :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> PropagationPhase -> m ()
eventControllerSetPropagationPhase a
controller PropagationPhase
phase = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    let phase' :: CUInt
phase' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (PropagationPhase -> Int) -> PropagationPhase -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PropagationPhase -> Int
forall a. Enum a => a -> Int
fromEnum) PropagationPhase
phase
    Ptr EventController -> CUInt -> IO ()
gtk_event_controller_set_propagation_phase Ptr EventController
controller' CUInt
phase'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventControllerSetPropagationPhaseMethodInfo
instance (signature ~ (Gtk.Enums.PropagationPhase -> m ()), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerSetPropagationPhaseMethodInfo a signature where
    overloadedMethod = eventControllerSetPropagationPhase

instance O.OverloadedMethodInfo EventControllerSetPropagationPhaseMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerSetPropagationPhase",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerSetPropagationPhase"
        })


#endif

-- method EventController::set_static_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "controller"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "EventController" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a `GtkEventController`"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a name for @controller, must be a static string"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_event_controller_set_static_name" gtk_event_controller_set_static_name :: 
    Ptr EventController ->                  -- controller : TInterface (Name {namespace = "Gtk", name = "EventController"})
    CString ->                              -- name : TBasicType TUTF8
    IO ()

-- | Sets a name on the controller that can be used for debugging.
-- 
-- /Since: 4.8/
eventControllerSetStaticName ::
    (B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
    a
    -- ^ /@controller@/: a @GtkEventController@
    -> Maybe (T.Text)
    -- ^ /@name@/: a name for /@controller@/, must be a static string
    -> m ()
eventControllerSetStaticName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEventController a) =>
a -> Maybe Text -> m ()
eventControllerSetStaticName a
controller Maybe Text
name = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr EventController
controller' <- a -> IO (Ptr EventController)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
controller
    CString
maybeName <- case Maybe Text
name of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jName -> do
            CString
jName' <- Text -> IO CString
textToCString Text
jName
            CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jName'
    Ptr EventController -> CString -> IO ()
gtk_event_controller_set_static_name Ptr EventController
controller' CString
maybeName
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
controller
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeName
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data EventControllerSetStaticNameMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsEventController a) => O.OverloadedMethod EventControllerSetStaticNameMethodInfo a signature where
    overloadedMethod = eventControllerSetStaticName

instance O.OverloadedMethodInfo EventControllerSetStaticNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Gtk.Objects.EventController.eventControllerSetStaticName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.10/docs/GI-Gtk-Objects-EventController.html#v:eventControllerSetStaticName"
        })


#endif