{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.CrossingEvent
(
CrossingEvent(..) ,
IsCrossingEvent ,
toCrossingEvent ,
#if defined(ENABLE_OVERLOADING)
ResolveCrossingEventMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
CrossingEventGetDetailMethodInfo ,
#endif
crossingEventGetDetail ,
#if defined(ENABLE_OVERLOADING)
CrossingEventGetFocusMethodInfo ,
#endif
crossingEventGetFocus ,
#if defined(ENABLE_OVERLOADING)
CrossingEventGetModeMethodInfo ,
#endif
crossingEventGetMode ,
) 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
#if MIN_VERSION_base(4,18,0)
import qualified GI.Cairo.Enums as Cairo.Enums
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Interfaces.Paintable as Gdk.Paintable
import {-# SOURCE #-} qualified GI.Gdk.Objects.AppLaunchContext as Gdk.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.CairoContext as Gdk.CairoContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Clipboard as Gdk.Clipboard
import {-# SOURCE #-} qualified GI.Gdk.Objects.ContentProvider as Gdk.ContentProvider
import {-# SOURCE #-} qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.DeviceTool as Gdk.DeviceTool
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.DrawContext as Gdk.DrawContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Event as Gdk.Event
import {-# SOURCE #-} qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import {-# SOURCE #-} qualified GI.Gdk.Objects.GLContext as Gdk.GLContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Monitor as Gdk.Monitor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Seat as Gdk.Seat
import {-# SOURCE #-} qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import {-# SOURCE #-} qualified GI.Gdk.Objects.Texture as Gdk.Texture
import {-# SOURCE #-} qualified GI.Gdk.Objects.VulkanContext as Gdk.VulkanContext
import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
import {-# SOURCE #-} qualified GI.Gdk.Structs.DmabufFormats as Gdk.DmabufFormats
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventSequence as Gdk.EventSequence
import {-# SOURCE #-} qualified GI.Gdk.Structs.FrameTimings as Gdk.FrameTimings
import {-# SOURCE #-} qualified GI.Gdk.Structs.KeymapKey as Gdk.KeymapKey
import {-# SOURCE #-} qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import {-# SOURCE #-} qualified GI.Gdk.Structs.TimeCoord as Gdk.TimeCoord
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.Gio.Interfaces.LoadableIcon as Gio.LoadableIcon
import qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.Pango.Enums as Pango.Enums
#else
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Objects.Event as Gdk.Event
#endif
newtype CrossingEvent = CrossingEvent (SP.ManagedPtr CrossingEvent)
deriving (CrossingEvent -> CrossingEvent -> Bool
(CrossingEvent -> CrossingEvent -> Bool)
-> (CrossingEvent -> CrossingEvent -> Bool) -> Eq CrossingEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CrossingEvent -> CrossingEvent -> Bool
== :: CrossingEvent -> CrossingEvent -> Bool
$c/= :: CrossingEvent -> CrossingEvent -> Bool
/= :: CrossingEvent -> CrossingEvent -> Bool
Eq)
instance SP.ManagedPtrNewtype CrossingEvent where
toManagedPtr :: CrossingEvent -> ManagedPtr CrossingEvent
toManagedPtr (CrossingEvent ManagedPtr CrossingEvent
p) = ManagedPtr CrossingEvent
p
foreign import ccall "gdk_crossing_event_get_type"
c_gdk_crossing_event_get_type :: IO B.Types.GType
instance B.Types.TypedObject CrossingEvent where
glibType :: IO GType
glibType = IO GType
c_gdk_crossing_event_get_type
class (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf CrossingEvent o) => IsCrossingEvent o
instance (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf CrossingEvent o) => IsCrossingEvent o
instance O.HasParentTypes CrossingEvent
type instance O.ParentTypes CrossingEvent = '[Gdk.Event.Event]
toCrossingEvent :: (MIO.MonadIO m, IsCrossingEvent o) => o -> m CrossingEvent
toCrossingEvent :: forall (m :: * -> *) o.
(MonadIO m, IsCrossingEvent o) =>
o -> m CrossingEvent
toCrossingEvent = IO CrossingEvent -> m CrossingEvent
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO CrossingEvent -> m CrossingEvent)
-> (o -> IO CrossingEvent) -> o -> m CrossingEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr CrossingEvent -> CrossingEvent)
-> o -> IO CrossingEvent
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr CrossingEvent -> CrossingEvent
CrossingEvent
#if defined(ENABLE_OVERLOADING)
type family ResolveCrossingEventMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveCrossingEventMethod "ref" o = Gdk.Event.EventRefMethodInfo
ResolveCrossingEventMethod "triggersContextMenu" o = Gdk.Event.EventTriggersContextMenuMethodInfo
ResolveCrossingEventMethod "unref" o = Gdk.Event.EventUnrefMethodInfo
ResolveCrossingEventMethod "getAxes" o = Gdk.Event.EventGetAxesMethodInfo
ResolveCrossingEventMethod "getAxis" o = Gdk.Event.EventGetAxisMethodInfo
ResolveCrossingEventMethod "getDetail" o = CrossingEventGetDetailMethodInfo
ResolveCrossingEventMethod "getDevice" o = Gdk.Event.EventGetDeviceMethodInfo
ResolveCrossingEventMethod "getDeviceTool" o = Gdk.Event.EventGetDeviceToolMethodInfo
ResolveCrossingEventMethod "getDisplay" o = Gdk.Event.EventGetDisplayMethodInfo
ResolveCrossingEventMethod "getEventSequence" o = Gdk.Event.EventGetEventSequenceMethodInfo
ResolveCrossingEventMethod "getEventType" o = Gdk.Event.EventGetEventTypeMethodInfo
ResolveCrossingEventMethod "getFocus" o = CrossingEventGetFocusMethodInfo
ResolveCrossingEventMethod "getHistory" o = Gdk.Event.EventGetHistoryMethodInfo
ResolveCrossingEventMethod "getMode" o = CrossingEventGetModeMethodInfo
ResolveCrossingEventMethod "getModifierState" o = Gdk.Event.EventGetModifierStateMethodInfo
ResolveCrossingEventMethod "getPointerEmulated" o = Gdk.Event.EventGetPointerEmulatedMethodInfo
ResolveCrossingEventMethod "getPosition" o = Gdk.Event.EventGetPositionMethodInfo
ResolveCrossingEventMethod "getSeat" o = Gdk.Event.EventGetSeatMethodInfo
ResolveCrossingEventMethod "getSurface" o = Gdk.Event.EventGetSurfaceMethodInfo
ResolveCrossingEventMethod "getTime" o = Gdk.Event.EventGetTimeMethodInfo
ResolveCrossingEventMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCrossingEventMethod t CrossingEvent, O.OverloadedMethod info CrossingEvent p) => OL.IsLabel t (CrossingEvent -> 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 ~ ResolveCrossingEventMethod t CrossingEvent, O.OverloadedMethod info CrossingEvent p, R.HasField t CrossingEvent p) => R.HasField t CrossingEvent p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveCrossingEventMethod t CrossingEvent, O.OverloadedMethodInfo info CrossingEvent) => OL.IsLabel t (O.MethodProxy info CrossingEvent) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
instance BoxedPtr CrossingEvent where
boxedPtrCopy :: CrossingEvent -> IO CrossingEvent
boxedPtrCopy = CrossingEvent -> IO CrossingEvent
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: CrossingEvent -> IO ()
boxedPtrFree = \CrossingEvent
_x -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "gdk_crossing_event_get_detail" gdk_crossing_event_get_detail ::
Ptr CrossingEvent ->
IO CUInt
crossingEventGetDetail ::
(B.CallStack.HasCallStack, MonadIO m, IsCrossingEvent a) =>
a
-> m Gdk.Enums.NotifyType
crossingEventGetDetail :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCrossingEvent a) =>
a -> m NotifyType
crossingEventGetDetail a
event = IO NotifyType -> m NotifyType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO NotifyType -> m NotifyType) -> IO NotifyType -> m NotifyType
forall a b. (a -> b) -> a -> b
$ do
event' <- a -> IO (Ptr CrossingEvent)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
result <- gdk_crossing_event_get_detail event'
let result' = (Int -> NotifyType
forall a. Enum a => Int -> a
toEnum (Int -> NotifyType) -> (CUInt -> Int) -> CUInt -> NotifyType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr event
return result'
#if defined(ENABLE_OVERLOADING)
data CrossingEventGetDetailMethodInfo
instance (signature ~ (m Gdk.Enums.NotifyType), MonadIO m, IsCrossingEvent a) => O.OverloadedMethod CrossingEventGetDetailMethodInfo a signature where
overloadedMethod = crossingEventGetDetail
instance O.OverloadedMethodInfo CrossingEventGetDetailMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.CrossingEvent.crossingEventGetDetail",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-CrossingEvent.html#v:crossingEventGetDetail"
})
#endif
foreign import ccall "gdk_crossing_event_get_focus" gdk_crossing_event_get_focus ::
Ptr CrossingEvent ->
IO CInt
crossingEventGetFocus ::
(B.CallStack.HasCallStack, MonadIO m, IsCrossingEvent a) =>
a
-> m Bool
crossingEventGetFocus :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCrossingEvent a) =>
a -> m Bool
crossingEventGetFocus a
event = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
event' <- a -> IO (Ptr CrossingEvent)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
result <- gdk_crossing_event_get_focus event'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr event
return result'
#if defined(ENABLE_OVERLOADING)
data CrossingEventGetFocusMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsCrossingEvent a) => O.OverloadedMethod CrossingEventGetFocusMethodInfo a signature where
overloadedMethod = crossingEventGetFocus
instance O.OverloadedMethodInfo CrossingEventGetFocusMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.CrossingEvent.crossingEventGetFocus",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-CrossingEvent.html#v:crossingEventGetFocus"
})
#endif
foreign import ccall "gdk_crossing_event_get_mode" gdk_crossing_event_get_mode ::
Ptr CrossingEvent ->
IO CUInt
crossingEventGetMode ::
(B.CallStack.HasCallStack, MonadIO m, IsCrossingEvent a) =>
a
-> m Gdk.Enums.CrossingMode
crossingEventGetMode :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCrossingEvent a) =>
a -> m CrossingMode
crossingEventGetMode a
event = IO CrossingMode -> m CrossingMode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CrossingMode -> m CrossingMode)
-> IO CrossingMode -> m CrossingMode
forall a b. (a -> b) -> a -> b
$ do
event' <- a -> IO (Ptr CrossingEvent)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
event
result <- gdk_crossing_event_get_mode event'
let result' = (Int -> CrossingMode
forall a. Enum a => Int -> a
toEnum (Int -> CrossingMode) -> (CUInt -> Int) -> CUInt -> CrossingMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
touchManagedPtr event
return result'
#if defined(ENABLE_OVERLOADING)
data CrossingEventGetModeMethodInfo
instance (signature ~ (m Gdk.Enums.CrossingMode), MonadIO m, IsCrossingEvent a) => O.OverloadedMethod CrossingEventGetModeMethodInfo a signature where
overloadedMethod = crossingEventGetMode
instance O.OverloadedMethodInfo CrossingEventGetModeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.CrossingEvent.crossingEventGetMode",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-CrossingEvent.html#v:crossingEventGetMode"
})
#endif