#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Objects.EventController
(
EventController(..) ,
IsEventController ,
toEventController ,
noEventController ,
#if ENABLE_OVERLOADING
EventControllerGetPropagationPhaseMethodInfo,
#endif
eventControllerGetPropagationPhase ,
#if ENABLE_OVERLOADING
EventControllerGetWidgetMethodInfo ,
#endif
eventControllerGetWidget ,
#if ENABLE_OVERLOADING
EventControllerHandleEventMethodInfo ,
#endif
eventControllerHandleEvent ,
#if ENABLE_OVERLOADING
EventControllerResetMethodInfo ,
#endif
eventControllerReset ,
#if ENABLE_OVERLOADING
EventControllerSetPropagationPhaseMethodInfo,
#endif
eventControllerSetPropagationPhase ,
#if ENABLE_OVERLOADING
EventControllerPropagationPhasePropertyInfo,
#endif
constructEventControllerPropagationPhase,
#if ENABLE_OVERLOADING
eventControllerPropagationPhase ,
#endif
getEventControllerPropagationPhase ,
setEventControllerPropagationPhase ,
#if ENABLE_OVERLOADING
EventControllerWidgetPropertyInfo ,
#endif
constructEventControllerWidget ,
#if 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.ManagedPtr as B.ManagedPtr
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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Unions.Event as Gdk.Event
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
newtype EventController = EventController (ManagedPtr EventController)
foreign import ccall "gtk_event_controller_get_type"
c_gtk_event_controller_get_type :: IO GType
instance GObject EventController where
gobjectType _ = c_gtk_event_controller_get_type
class GObject o => IsEventController o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError EventController a) =>
IsEventController a
#endif
instance IsEventController EventController
instance GObject.Object.IsObject EventController
toEventController :: (MonadIO m, IsEventController o) => o -> m EventController
toEventController = liftIO . unsafeCastTo EventController
noEventController :: Maybe EventController
noEventController = Nothing
#if ENABLE_OVERLOADING
type family ResolveEventControllerMethod (t :: Symbol) (o :: *) :: * 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 "handleEvent" o = EventControllerHandleEventMethodInfo
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 "getData" o = GObject.Object.ObjectGetDataMethodInfo
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 "setPropagationPhase" o = EventControllerSetPropagationPhaseMethodInfo
ResolveEventControllerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveEventControllerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEventControllerMethod t EventController, O.MethodInfo info EventController p) => O.IsLabelProxy t (EventController -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveEventControllerMethod t EventController, O.MethodInfo info EventController p) => O.IsLabel t (EventController -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
getEventControllerPropagationPhase :: (MonadIO m, IsEventController o) => o -> m Gtk.Enums.PropagationPhase
getEventControllerPropagationPhase obj = liftIO $ getObjectPropertyEnum obj "propagation-phase"
setEventControllerPropagationPhase :: (MonadIO m, IsEventController o) => o -> Gtk.Enums.PropagationPhase -> m ()
setEventControllerPropagationPhase obj val = liftIO $ setObjectPropertyEnum obj "propagation-phase" val
constructEventControllerPropagationPhase :: (IsEventController o) => Gtk.Enums.PropagationPhase -> IO (GValueConstruct o)
constructEventControllerPropagationPhase val = constructObjectPropertyEnum "propagation-phase" val
#if ENABLE_OVERLOADING
data EventControllerPropagationPhasePropertyInfo
instance AttrInfo EventControllerPropagationPhasePropertyInfo where
type AttrAllowedOps EventControllerPropagationPhasePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint EventControllerPropagationPhasePropertyInfo = (~) Gtk.Enums.PropagationPhase
type AttrBaseTypeConstraint EventControllerPropagationPhasePropertyInfo = IsEventController
type AttrGetType EventControllerPropagationPhasePropertyInfo = Gtk.Enums.PropagationPhase
type AttrLabel EventControllerPropagationPhasePropertyInfo = "propagation-phase"
type AttrOrigin EventControllerPropagationPhasePropertyInfo = EventController
attrGet _ = getEventControllerPropagationPhase
attrSet _ = setEventControllerPropagationPhase
attrConstruct _ = constructEventControllerPropagationPhase
attrClear _ = undefined
#endif
getEventControllerWidget :: (MonadIO m, IsEventController o) => o -> m Gtk.Widget.Widget
getEventControllerWidget obj = liftIO $ checkUnexpectedNothing "getEventControllerWidget" $ getObjectPropertyObject obj "widget" Gtk.Widget.Widget
constructEventControllerWidget :: (IsEventController o, Gtk.Widget.IsWidget a) => a -> IO (GValueConstruct o)
constructEventControllerWidget val = constructObjectPropertyObject "widget" (Just val)
#if ENABLE_OVERLOADING
data EventControllerWidgetPropertyInfo
instance AttrInfo EventControllerWidgetPropertyInfo where
type AttrAllowedOps EventControllerWidgetPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EventControllerWidgetPropertyInfo = Gtk.Widget.IsWidget
type AttrBaseTypeConstraint EventControllerWidgetPropertyInfo = IsEventController
type AttrGetType EventControllerWidgetPropertyInfo = Gtk.Widget.Widget
type AttrLabel EventControllerWidgetPropertyInfo = "widget"
type AttrOrigin EventControllerWidgetPropertyInfo = EventController
attrGet _ = getEventControllerWidget
attrSet _ = undefined
attrConstruct _ = constructEventControllerWidget
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList EventController
type instance O.AttributeList EventController = EventControllerAttributeList
type EventControllerAttributeList = ('[ '("propagationPhase", EventControllerPropagationPhasePropertyInfo), '("widget", EventControllerWidgetPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
eventControllerPropagationPhase :: AttrLabelProxy "propagationPhase"
eventControllerPropagationPhase = AttrLabelProxy
eventControllerWidget :: AttrLabelProxy "widget"
eventControllerWidget = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList EventController = EventControllerSignalList
type EventControllerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_event_controller_get_propagation_phase" gtk_event_controller_get_propagation_phase ::
Ptr EventController ->
IO CUInt
eventControllerGetPropagationPhase ::
(B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
a
-> m Gtk.Enums.PropagationPhase
eventControllerGetPropagationPhase controller = liftIO $ do
controller' <- unsafeManagedPtrCastPtr controller
result <- gtk_event_controller_get_propagation_phase controller'
let result' = (toEnum . fromIntegral) result
touchManagedPtr controller
return result'
#if ENABLE_OVERLOADING
data EventControllerGetPropagationPhaseMethodInfo
instance (signature ~ (m Gtk.Enums.PropagationPhase), MonadIO m, IsEventController a) => O.MethodInfo EventControllerGetPropagationPhaseMethodInfo a signature where
overloadedMethod _ = eventControllerGetPropagationPhase
#endif
foreign import ccall "gtk_event_controller_get_widget" gtk_event_controller_get_widget ::
Ptr EventController ->
IO (Ptr Gtk.Widget.Widget)
eventControllerGetWidget ::
(B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
a
-> m Gtk.Widget.Widget
eventControllerGetWidget controller = liftIO $ do
controller' <- unsafeManagedPtrCastPtr controller
result <- gtk_event_controller_get_widget controller'
checkUnexpectedReturnNULL "eventControllerGetWidget" result
result' <- (newObject Gtk.Widget.Widget) result
touchManagedPtr controller
return result'
#if ENABLE_OVERLOADING
data EventControllerGetWidgetMethodInfo
instance (signature ~ (m Gtk.Widget.Widget), MonadIO m, IsEventController a) => O.MethodInfo EventControllerGetWidgetMethodInfo a signature where
overloadedMethod _ = eventControllerGetWidget
#endif
foreign import ccall "gtk_event_controller_handle_event" gtk_event_controller_handle_event ::
Ptr EventController ->
Ptr Gdk.Event.Event ->
IO CInt
eventControllerHandleEvent ::
(B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
a
-> Gdk.Event.Event
-> m Bool
eventControllerHandleEvent controller event = liftIO $ do
controller' <- unsafeManagedPtrCastPtr controller
event' <- unsafeManagedPtrGetPtr event
result <- gtk_event_controller_handle_event controller' event'
let result' = (/= 0) result
touchManagedPtr controller
touchManagedPtr event
return result'
#if ENABLE_OVERLOADING
data EventControllerHandleEventMethodInfo
instance (signature ~ (Gdk.Event.Event -> m Bool), MonadIO m, IsEventController a) => O.MethodInfo EventControllerHandleEventMethodInfo a signature where
overloadedMethod _ = eventControllerHandleEvent
#endif
foreign import ccall "gtk_event_controller_reset" gtk_event_controller_reset ::
Ptr EventController ->
IO ()
eventControllerReset ::
(B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
a
-> m ()
eventControllerReset controller = liftIO $ do
controller' <- unsafeManagedPtrCastPtr controller
gtk_event_controller_reset controller'
touchManagedPtr controller
return ()
#if ENABLE_OVERLOADING
data EventControllerResetMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEventController a) => O.MethodInfo EventControllerResetMethodInfo a signature where
overloadedMethod _ = eventControllerReset
#endif
foreign import ccall "gtk_event_controller_set_propagation_phase" gtk_event_controller_set_propagation_phase ::
Ptr EventController ->
CUInt ->
IO ()
eventControllerSetPropagationPhase ::
(B.CallStack.HasCallStack, MonadIO m, IsEventController a) =>
a
-> Gtk.Enums.PropagationPhase
-> m ()
eventControllerSetPropagationPhase controller phase = liftIO $ do
controller' <- unsafeManagedPtrCastPtr controller
let phase' = (fromIntegral . fromEnum) phase
gtk_event_controller_set_propagation_phase controller' phase'
touchManagedPtr controller
return ()
#if ENABLE_OVERLOADING
data EventControllerSetPropagationPhaseMethodInfo
instance (signature ~ (Gtk.Enums.PropagationPhase -> m ()), MonadIO m, IsEventController a) => O.MethodInfo EventControllerSetPropagationPhaseMethodInfo a signature where
overloadedMethod _ = eventControllerSetPropagationPhase
#endif