{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.DragContext
(
DragContext(..) ,
IsDragContext ,
toDragContext ,
#if defined(ENABLE_OVERLOADING)
ResolveDragContextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DragContextGetActionsMethodInfo ,
#endif
dragContextGetActions ,
#if defined(ENABLE_OVERLOADING)
DragContextGetDestWindowMethodInfo ,
#endif
dragContextGetDestWindow ,
#if defined(ENABLE_OVERLOADING)
DragContextGetDeviceMethodInfo ,
#endif
dragContextGetDevice ,
#if defined(ENABLE_OVERLOADING)
DragContextGetDragWindowMethodInfo ,
#endif
dragContextGetDragWindow ,
#if defined(ENABLE_OVERLOADING)
DragContextGetProtocolMethodInfo ,
#endif
dragContextGetProtocol ,
#if defined(ENABLE_OVERLOADING)
DragContextGetSelectedActionMethodInfo ,
#endif
dragContextGetSelectedAction ,
#if defined(ENABLE_OVERLOADING)
DragContextGetSourceWindowMethodInfo ,
#endif
dragContextGetSourceWindow ,
#if defined(ENABLE_OVERLOADING)
DragContextGetSuggestedActionMethodInfo ,
#endif
dragContextGetSuggestedAction ,
#if defined(ENABLE_OVERLOADING)
DragContextListTargetsMethodInfo ,
#endif
dragContextListTargets ,
#if defined(ENABLE_OVERLOADING)
DragContextManageDndMethodInfo ,
#endif
dragContextManageDnd ,
#if defined(ENABLE_OVERLOADING)
DragContextSetDeviceMethodInfo ,
#endif
dragContextSetDevice ,
#if defined(ENABLE_OVERLOADING)
DragContextSetHotspotMethodInfo ,
#endif
dragContextSetHotspot ,
C_DragContextActionChangedCallback ,
DragContextActionChangedCallback ,
#if defined(ENABLE_OVERLOADING)
DragContextActionChangedSignalInfo ,
#endif
afterDragContextActionChanged ,
genClosure_DragContextActionChanged ,
mk_DragContextActionChangedCallback ,
noDragContextActionChangedCallback ,
onDragContextActionChanged ,
wrap_DragContextActionChangedCallback ,
C_DragContextCancelCallback ,
DragContextCancelCallback ,
#if defined(ENABLE_OVERLOADING)
DragContextCancelSignalInfo ,
#endif
afterDragContextCancel ,
genClosure_DragContextCancel ,
mk_DragContextCancelCallback ,
noDragContextCancelCallback ,
onDragContextCancel ,
wrap_DragContextCancelCallback ,
C_DragContextDndFinishedCallback ,
DragContextDndFinishedCallback ,
#if defined(ENABLE_OVERLOADING)
DragContextDndFinishedSignalInfo ,
#endif
afterDragContextDndFinished ,
genClosure_DragContextDndFinished ,
mk_DragContextDndFinishedCallback ,
noDragContextDndFinishedCallback ,
onDragContextDndFinished ,
wrap_DragContextDndFinishedCallback ,
C_DragContextDropPerformedCallback ,
DragContextDropPerformedCallback ,
#if defined(ENABLE_OVERLOADING)
DragContextDropPerformedSignalInfo ,
#endif
afterDragContextDropPerformed ,
genClosure_DragContextDropPerformed ,
mk_DragContextDropPerformedCallback ,
noDragContextDropPerformedCallback ,
onDragContextDropPerformed ,
wrap_DragContextDropPerformedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.Window as Gdk.Window
import {-# SOURCE #-} qualified GI.Gdk.Structs.Atom as Gdk.Atom
newtype DragContext = DragContext (SP.ManagedPtr DragContext)
deriving (DragContext -> DragContext -> Bool
(DragContext -> DragContext -> Bool)
-> (DragContext -> DragContext -> Bool) -> Eq DragContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DragContext -> DragContext -> Bool
$c/= :: DragContext -> DragContext -> Bool
== :: DragContext -> DragContext -> Bool
$c== :: DragContext -> DragContext -> Bool
Eq)
instance SP.ManagedPtrNewtype DragContext where
toManagedPtr :: DragContext -> ManagedPtr DragContext
toManagedPtr (DragContext ManagedPtr DragContext
p) = ManagedPtr DragContext
p
foreign import ccall "gdk_drag_context_get_type"
c_gdk_drag_context_get_type :: IO B.Types.GType
instance B.Types.TypedObject DragContext where
glibType :: IO GType
glibType = IO GType
c_gdk_drag_context_get_type
instance B.Types.GObject DragContext
instance B.GValue.IsGValue DragContext where
toGValue :: DragContext -> IO GValue
toGValue DragContext
o = do
GType
gtype <- IO GType
c_gdk_drag_context_get_type
DragContext -> (Ptr DragContext -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DragContext
o (GType
-> (GValue -> Ptr DragContext -> IO ())
-> Ptr DragContext
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DragContext -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DragContext
fromGValue GValue
gv = do
Ptr DragContext
ptr <- GValue -> IO (Ptr DragContext)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DragContext)
(ManagedPtr DragContext -> DragContext)
-> Ptr DragContext -> IO DragContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DragContext -> DragContext
DragContext Ptr DragContext
ptr
class (SP.GObject o, O.IsDescendantOf DragContext o) => IsDragContext o
instance (SP.GObject o, O.IsDescendantOf DragContext o) => IsDragContext o
instance O.HasParentTypes DragContext
type instance O.ParentTypes DragContext = '[GObject.Object.Object]
toDragContext :: (MonadIO m, IsDragContext o) => o -> m DragContext
toDragContext :: o -> m DragContext
toDragContext = IO DragContext -> m DragContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DragContext -> m DragContext)
-> (o -> IO DragContext) -> o -> m DragContext
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DragContext -> DragContext) -> o -> IO DragContext
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DragContext -> DragContext
DragContext
#if defined(ENABLE_OVERLOADING)
type family ResolveDragContextMethod (t :: Symbol) (o :: *) :: * where
ResolveDragContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDragContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDragContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDragContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDragContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDragContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDragContextMethod "listTargets" o = DragContextListTargetsMethodInfo
ResolveDragContextMethod "manageDnd" o = DragContextManageDndMethodInfo
ResolveDragContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDragContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDragContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDragContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDragContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDragContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDragContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDragContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDragContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDragContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDragContextMethod "getActions" o = DragContextGetActionsMethodInfo
ResolveDragContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDragContextMethod "getDestWindow" o = DragContextGetDestWindowMethodInfo
ResolveDragContextMethod "getDevice" o = DragContextGetDeviceMethodInfo
ResolveDragContextMethod "getDragWindow" o = DragContextGetDragWindowMethodInfo
ResolveDragContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDragContextMethod "getProtocol" o = DragContextGetProtocolMethodInfo
ResolveDragContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDragContextMethod "getSelectedAction" o = DragContextGetSelectedActionMethodInfo
ResolveDragContextMethod "getSourceWindow" o = DragContextGetSourceWindowMethodInfo
ResolveDragContextMethod "getSuggestedAction" o = DragContextGetSuggestedActionMethodInfo
ResolveDragContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDragContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDragContextMethod "setDevice" o = DragContextSetDeviceMethodInfo
ResolveDragContextMethod "setHotspot" o = DragContextSetHotspotMethodInfo
ResolveDragContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDragContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDragContextMethod t DragContext, O.MethodInfo info DragContext p) => OL.IsLabel t (DragContext -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type DragContextActionChangedCallback =
[Gdk.Flags.DragAction]
-> IO ()
noDragContextActionChangedCallback :: Maybe DragContextActionChangedCallback
noDragContextActionChangedCallback :: Maybe DragContextActionChangedCallback
noDragContextActionChangedCallback = Maybe DragContextActionChangedCallback
forall a. Maybe a
Nothing
type C_DragContextActionChangedCallback =
Ptr () ->
CUInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragContextActionChangedCallback :: C_DragContextActionChangedCallback -> IO (FunPtr C_DragContextActionChangedCallback)
genClosure_DragContextActionChanged :: MonadIO m => DragContextActionChangedCallback -> m (GClosure C_DragContextActionChangedCallback)
genClosure_DragContextActionChanged :: DragContextActionChangedCallback
-> m (GClosure C_DragContextActionChangedCallback)
genClosure_DragContextActionChanged DragContextActionChangedCallback
cb = IO (GClosure C_DragContextActionChangedCallback)
-> m (GClosure C_DragContextActionChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DragContextActionChangedCallback)
-> m (GClosure C_DragContextActionChangedCallback))
-> IO (GClosure C_DragContextActionChangedCallback)
-> m (GClosure C_DragContextActionChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextActionChangedCallback
cb' = DragContextActionChangedCallback
-> C_DragContextActionChangedCallback
wrap_DragContextActionChangedCallback DragContextActionChangedCallback
cb
C_DragContextActionChangedCallback
-> IO (FunPtr C_DragContextActionChangedCallback)
mk_DragContextActionChangedCallback C_DragContextActionChangedCallback
cb' IO (FunPtr C_DragContextActionChangedCallback)
-> (FunPtr C_DragContextActionChangedCallback
-> IO (GClosure C_DragContextActionChangedCallback))
-> IO (GClosure C_DragContextActionChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DragContextActionChangedCallback
-> IO (GClosure C_DragContextActionChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DragContextActionChangedCallback ::
DragContextActionChangedCallback ->
C_DragContextActionChangedCallback
wrap_DragContextActionChangedCallback :: DragContextActionChangedCallback
-> C_DragContextActionChangedCallback
wrap_DragContextActionChangedCallback DragContextActionChangedCallback
_cb Ptr ()
_ CUInt
action Ptr ()
_ = do
let action' :: [DragAction]
action' = CUInt -> [DragAction]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
action
DragContextActionChangedCallback
_cb [DragAction]
action'
onDragContextActionChanged :: (IsDragContext a, MonadIO m) => a -> DragContextActionChangedCallback -> m SignalHandlerId
onDragContextActionChanged :: a -> DragContextActionChangedCallback -> m SignalHandlerId
onDragContextActionChanged a
obj DragContextActionChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextActionChangedCallback
cb' = DragContextActionChangedCallback
-> C_DragContextActionChangedCallback
wrap_DragContextActionChangedCallback DragContextActionChangedCallback
cb
FunPtr C_DragContextActionChangedCallback
cb'' <- C_DragContextActionChangedCallback
-> IO (FunPtr C_DragContextActionChangedCallback)
mk_DragContextActionChangedCallback C_DragContextActionChangedCallback
cb'
a
-> Text
-> FunPtr C_DragContextActionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"action-changed" FunPtr C_DragContextActionChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragContextActionChanged :: (IsDragContext a, MonadIO m) => a -> DragContextActionChangedCallback -> m SignalHandlerId
afterDragContextActionChanged :: a -> DragContextActionChangedCallback -> m SignalHandlerId
afterDragContextActionChanged a
obj DragContextActionChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextActionChangedCallback
cb' = DragContextActionChangedCallback
-> C_DragContextActionChangedCallback
wrap_DragContextActionChangedCallback DragContextActionChangedCallback
cb
FunPtr C_DragContextActionChangedCallback
cb'' <- C_DragContextActionChangedCallback
-> IO (FunPtr C_DragContextActionChangedCallback)
mk_DragContextActionChangedCallback C_DragContextActionChangedCallback
cb'
a
-> Text
-> FunPtr C_DragContextActionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"action-changed" FunPtr C_DragContextActionChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragContextActionChangedSignalInfo
instance SignalInfo DragContextActionChangedSignalInfo where
type HaskellCallbackType DragContextActionChangedSignalInfo = DragContextActionChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragContextActionChangedCallback cb
cb'' <- mk_DragContextActionChangedCallback cb'
connectSignalFunPtr obj "action-changed" cb'' connectMode detail
#endif
type DragContextCancelCallback =
Gdk.Enums.DragCancelReason
-> IO ()
noDragContextCancelCallback :: Maybe DragContextCancelCallback
noDragContextCancelCallback :: Maybe DragContextCancelCallback
noDragContextCancelCallback = Maybe DragContextCancelCallback
forall a. Maybe a
Nothing
type C_DragContextCancelCallback =
Ptr () ->
CUInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragContextCancelCallback :: C_DragContextCancelCallback -> IO (FunPtr C_DragContextCancelCallback)
genClosure_DragContextCancel :: MonadIO m => DragContextCancelCallback -> m (GClosure C_DragContextCancelCallback)
genClosure_DragContextCancel :: DragContextCancelCallback
-> m (GClosure C_DragContextActionChangedCallback)
genClosure_DragContextCancel DragContextCancelCallback
cb = IO (GClosure C_DragContextActionChangedCallback)
-> m (GClosure C_DragContextActionChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DragContextActionChangedCallback)
-> m (GClosure C_DragContextActionChangedCallback))
-> IO (GClosure C_DragContextActionChangedCallback)
-> m (GClosure C_DragContextActionChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextActionChangedCallback
cb' = DragContextCancelCallback -> C_DragContextActionChangedCallback
wrap_DragContextCancelCallback DragContextCancelCallback
cb
C_DragContextActionChangedCallback
-> IO (FunPtr C_DragContextActionChangedCallback)
mk_DragContextCancelCallback C_DragContextActionChangedCallback
cb' IO (FunPtr C_DragContextActionChangedCallback)
-> (FunPtr C_DragContextActionChangedCallback
-> IO (GClosure C_DragContextActionChangedCallback))
-> IO (GClosure C_DragContextActionChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DragContextActionChangedCallback
-> IO (GClosure C_DragContextActionChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DragContextCancelCallback ::
DragContextCancelCallback ->
C_DragContextCancelCallback
wrap_DragContextCancelCallback :: DragContextCancelCallback -> C_DragContextActionChangedCallback
wrap_DragContextCancelCallback DragContextCancelCallback
_cb Ptr ()
_ CUInt
reason Ptr ()
_ = do
let reason' :: DragCancelReason
reason' = (Int -> DragCancelReason
forall a. Enum a => Int -> a
toEnum (Int -> DragCancelReason)
-> (CUInt -> Int) -> CUInt -> DragCancelReason
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
reason
DragContextCancelCallback
_cb DragCancelReason
reason'
onDragContextCancel :: (IsDragContext a, MonadIO m) => a -> DragContextCancelCallback -> m SignalHandlerId
onDragContextCancel :: a -> DragContextCancelCallback -> m SignalHandlerId
onDragContextCancel a
obj DragContextCancelCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextActionChangedCallback
cb' = DragContextCancelCallback -> C_DragContextActionChangedCallback
wrap_DragContextCancelCallback DragContextCancelCallback
cb
FunPtr C_DragContextActionChangedCallback
cb'' <- C_DragContextActionChangedCallback
-> IO (FunPtr C_DragContextActionChangedCallback)
mk_DragContextCancelCallback C_DragContextActionChangedCallback
cb'
a
-> Text
-> FunPtr C_DragContextActionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"cancel" FunPtr C_DragContextActionChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragContextCancel :: (IsDragContext a, MonadIO m) => a -> DragContextCancelCallback -> m SignalHandlerId
afterDragContextCancel :: a -> DragContextCancelCallback -> m SignalHandlerId
afterDragContextCancel a
obj DragContextCancelCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextActionChangedCallback
cb' = DragContextCancelCallback -> C_DragContextActionChangedCallback
wrap_DragContextCancelCallback DragContextCancelCallback
cb
FunPtr C_DragContextActionChangedCallback
cb'' <- C_DragContextActionChangedCallback
-> IO (FunPtr C_DragContextActionChangedCallback)
mk_DragContextCancelCallback C_DragContextActionChangedCallback
cb'
a
-> Text
-> FunPtr C_DragContextActionChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"cancel" FunPtr C_DragContextActionChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragContextCancelSignalInfo
instance SignalInfo DragContextCancelSignalInfo where
type HaskellCallbackType DragContextCancelSignalInfo = DragContextCancelCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragContextCancelCallback cb
cb'' <- mk_DragContextCancelCallback cb'
connectSignalFunPtr obj "cancel" cb'' connectMode detail
#endif
type DragContextDndFinishedCallback =
IO ()
noDragContextDndFinishedCallback :: Maybe DragContextDndFinishedCallback
noDragContextDndFinishedCallback :: Maybe (IO ())
noDragContextDndFinishedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_DragContextDndFinishedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragContextDndFinishedCallback :: C_DragContextDndFinishedCallback -> IO (FunPtr C_DragContextDndFinishedCallback)
genClosure_DragContextDndFinished :: MonadIO m => DragContextDndFinishedCallback -> m (GClosure C_DragContextDndFinishedCallback)
genClosure_DragContextDndFinished :: IO () -> m (GClosure C_DragContextDndFinishedCallback)
genClosure_DragContextDndFinished IO ()
cb = IO (GClosure C_DragContextDndFinishedCallback)
-> m (GClosure C_DragContextDndFinishedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DragContextDndFinishedCallback)
-> m (GClosure C_DragContextDndFinishedCallback))
-> IO (GClosure C_DragContextDndFinishedCallback)
-> m (GClosure C_DragContextDndFinishedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextDndFinishedCallback
cb' = IO () -> C_DragContextDndFinishedCallback
wrap_DragContextDndFinishedCallback IO ()
cb
C_DragContextDndFinishedCallback
-> IO (FunPtr C_DragContextDndFinishedCallback)
mk_DragContextDndFinishedCallback C_DragContextDndFinishedCallback
cb' IO (FunPtr C_DragContextDndFinishedCallback)
-> (FunPtr C_DragContextDndFinishedCallback
-> IO (GClosure C_DragContextDndFinishedCallback))
-> IO (GClosure C_DragContextDndFinishedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DragContextDndFinishedCallback
-> IO (GClosure C_DragContextDndFinishedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DragContextDndFinishedCallback ::
DragContextDndFinishedCallback ->
C_DragContextDndFinishedCallback
wrap_DragContextDndFinishedCallback :: IO () -> C_DragContextDndFinishedCallback
wrap_DragContextDndFinishedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onDragContextDndFinished :: (IsDragContext a, MonadIO m) => a -> DragContextDndFinishedCallback -> m SignalHandlerId
onDragContextDndFinished :: a -> IO () -> m SignalHandlerId
onDragContextDndFinished a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextDndFinishedCallback
cb' = IO () -> C_DragContextDndFinishedCallback
wrap_DragContextDndFinishedCallback IO ()
cb
FunPtr C_DragContextDndFinishedCallback
cb'' <- C_DragContextDndFinishedCallback
-> IO (FunPtr C_DragContextDndFinishedCallback)
mk_DragContextDndFinishedCallback C_DragContextDndFinishedCallback
cb'
a
-> Text
-> FunPtr C_DragContextDndFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"dnd-finished" FunPtr C_DragContextDndFinishedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragContextDndFinished :: (IsDragContext a, MonadIO m) => a -> DragContextDndFinishedCallback -> m SignalHandlerId
afterDragContextDndFinished :: a -> IO () -> m SignalHandlerId
afterDragContextDndFinished a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextDndFinishedCallback
cb' = IO () -> C_DragContextDndFinishedCallback
wrap_DragContextDndFinishedCallback IO ()
cb
FunPtr C_DragContextDndFinishedCallback
cb'' <- C_DragContextDndFinishedCallback
-> IO (FunPtr C_DragContextDndFinishedCallback)
mk_DragContextDndFinishedCallback C_DragContextDndFinishedCallback
cb'
a
-> Text
-> FunPtr C_DragContextDndFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"dnd-finished" FunPtr C_DragContextDndFinishedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragContextDndFinishedSignalInfo
instance SignalInfo DragContextDndFinishedSignalInfo where
type HaskellCallbackType DragContextDndFinishedSignalInfo = DragContextDndFinishedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragContextDndFinishedCallback cb
cb'' <- mk_DragContextDndFinishedCallback cb'
connectSignalFunPtr obj "dnd-finished" cb'' connectMode detail
#endif
type DragContextDropPerformedCallback =
Int32
-> IO ()
noDragContextDropPerformedCallback :: Maybe DragContextDropPerformedCallback
noDragContextDropPerformedCallback :: Maybe DragContextDropPerformedCallback
noDragContextDropPerformedCallback = Maybe DragContextDropPerformedCallback
forall a. Maybe a
Nothing
type C_DragContextDropPerformedCallback =
Ptr () ->
Int32 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragContextDropPerformedCallback :: C_DragContextDropPerformedCallback -> IO (FunPtr C_DragContextDropPerformedCallback)
genClosure_DragContextDropPerformed :: MonadIO m => DragContextDropPerformedCallback -> m (GClosure C_DragContextDropPerformedCallback)
genClosure_DragContextDropPerformed :: DragContextDropPerformedCallback
-> m (GClosure C_DragContextDropPerformedCallback)
genClosure_DragContextDropPerformed DragContextDropPerformedCallback
cb = IO (GClosure C_DragContextDropPerformedCallback)
-> m (GClosure C_DragContextDropPerformedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DragContextDropPerformedCallback)
-> m (GClosure C_DragContextDropPerformedCallback))
-> IO (GClosure C_DragContextDropPerformedCallback)
-> m (GClosure C_DragContextDropPerformedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextDropPerformedCallback
cb' = DragContextDropPerformedCallback
-> C_DragContextDropPerformedCallback
wrap_DragContextDropPerformedCallback DragContextDropPerformedCallback
cb
C_DragContextDropPerformedCallback
-> IO (FunPtr C_DragContextDropPerformedCallback)
mk_DragContextDropPerformedCallback C_DragContextDropPerformedCallback
cb' IO (FunPtr C_DragContextDropPerformedCallback)
-> (FunPtr C_DragContextDropPerformedCallback
-> IO (GClosure C_DragContextDropPerformedCallback))
-> IO (GClosure C_DragContextDropPerformedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DragContextDropPerformedCallback
-> IO (GClosure C_DragContextDropPerformedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DragContextDropPerformedCallback ::
DragContextDropPerformedCallback ->
C_DragContextDropPerformedCallback
wrap_DragContextDropPerformedCallback :: DragContextDropPerformedCallback
-> C_DragContextDropPerformedCallback
wrap_DragContextDropPerformedCallback DragContextDropPerformedCallback
_cb Ptr ()
_ Int32
time Ptr ()
_ = do
DragContextDropPerformedCallback
_cb Int32
time
onDragContextDropPerformed :: (IsDragContext a, MonadIO m) => a -> DragContextDropPerformedCallback -> m SignalHandlerId
onDragContextDropPerformed :: a -> DragContextDropPerformedCallback -> m SignalHandlerId
onDragContextDropPerformed a
obj DragContextDropPerformedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextDropPerformedCallback
cb' = DragContextDropPerformedCallback
-> C_DragContextDropPerformedCallback
wrap_DragContextDropPerformedCallback DragContextDropPerformedCallback
cb
FunPtr C_DragContextDropPerformedCallback
cb'' <- C_DragContextDropPerformedCallback
-> IO (FunPtr C_DragContextDropPerformedCallback)
mk_DragContextDropPerformedCallback C_DragContextDropPerformedCallback
cb'
a
-> Text
-> FunPtr C_DragContextDropPerformedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"drop-performed" FunPtr C_DragContextDropPerformedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragContextDropPerformed :: (IsDragContext a, MonadIO m) => a -> DragContextDropPerformedCallback -> m SignalHandlerId
afterDragContextDropPerformed :: a -> DragContextDropPerformedCallback -> m SignalHandlerId
afterDragContextDropPerformed a
obj DragContextDropPerformedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragContextDropPerformedCallback
cb' = DragContextDropPerformedCallback
-> C_DragContextDropPerformedCallback
wrap_DragContextDropPerformedCallback DragContextDropPerformedCallback
cb
FunPtr C_DragContextDropPerformedCallback
cb'' <- C_DragContextDropPerformedCallback
-> IO (FunPtr C_DragContextDropPerformedCallback)
mk_DragContextDropPerformedCallback C_DragContextDropPerformedCallback
cb'
a
-> Text
-> FunPtr C_DragContextDropPerformedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"drop-performed" FunPtr C_DragContextDropPerformedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragContextDropPerformedSignalInfo
instance SignalInfo DragContextDropPerformedSignalInfo where
type HaskellCallbackType DragContextDropPerformedSignalInfo = DragContextDropPerformedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragContextDropPerformedCallback cb
cb'' <- mk_DragContextDropPerformedCallback cb'
connectSignalFunPtr obj "drop-performed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DragContext
type instance O.AttributeList DragContext = DragContextAttributeList
type DragContextAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DragContext = DragContextSignalList
type DragContextSignalList = ('[ '("actionChanged", DragContextActionChangedSignalInfo), '("cancel", DragContextCancelSignalInfo), '("dndFinished", DragContextDndFinishedSignalInfo), '("dropPerformed", DragContextDropPerformedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_drag_context_get_actions" gdk_drag_context_get_actions ::
Ptr DragContext ->
IO CUInt
dragContextGetActions ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m [Gdk.Flags.DragAction]
dragContextGetActions :: a -> m [DragAction]
dragContextGetActions a
context = IO [DragAction] -> m [DragAction]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DragAction] -> m [DragAction])
-> IO [DragAction] -> m [DragAction]
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
CUInt
result <- Ptr DragContext -> IO CUInt
gdk_drag_context_get_actions Ptr DragContext
context'
let result' :: [DragAction]
result' = CUInt -> [DragAction]
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
context
[DragAction] -> IO [DragAction]
forall (m :: * -> *) a. Monad m => a -> m a
return [DragAction]
result'
#if defined(ENABLE_OVERLOADING)
data DragContextGetActionsMethodInfo
instance (signature ~ (m [Gdk.Flags.DragAction]), MonadIO m, IsDragContext a) => O.MethodInfo DragContextGetActionsMethodInfo a signature where
overloadedMethod = dragContextGetActions
#endif
foreign import ccall "gdk_drag_context_get_dest_window" gdk_drag_context_get_dest_window ::
Ptr DragContext ->
IO (Ptr Gdk.Window.Window)
dragContextGetDestWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m Gdk.Window.Window
dragContextGetDestWindow :: a -> m Window
dragContextGetDestWindow a
context = IO Window -> m Window
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Window -> m Window) -> IO Window -> m Window
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Window
result <- Ptr DragContext -> IO (Ptr Window)
gdk_drag_context_get_dest_window Ptr DragContext
context'
Text -> Ptr Window -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dragContextGetDestWindow" Ptr Window
result
Window
result' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gdk.Window.Window) Ptr Window
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Window -> IO Window
forall (m :: * -> *) a. Monad m => a -> m a
return Window
result'
#if defined(ENABLE_OVERLOADING)
data DragContextGetDestWindowMethodInfo
instance (signature ~ (m Gdk.Window.Window), MonadIO m, IsDragContext a) => O.MethodInfo DragContextGetDestWindowMethodInfo a signature where
overloadedMethod = dragContextGetDestWindow
#endif
foreign import ccall "gdk_drag_context_get_device" gdk_drag_context_get_device ::
Ptr DragContext ->
IO (Ptr Gdk.Device.Device)
dragContextGetDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m Gdk.Device.Device
dragContextGetDevice :: a -> m Device
dragContextGetDevice a
context = IO Device -> m Device
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Device -> m Device) -> IO Device -> m Device
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Device
result <- Ptr DragContext -> IO (Ptr Device)
gdk_drag_context_get_device Ptr DragContext
context'
Text -> Ptr Device -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dragContextGetDevice" Ptr Device
result
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
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Device -> IO Device
forall (m :: * -> *) a. Monad m => a -> m a
return Device
result'
#if defined(ENABLE_OVERLOADING)
data DragContextGetDeviceMethodInfo
instance (signature ~ (m Gdk.Device.Device), MonadIO m, IsDragContext a) => O.MethodInfo DragContextGetDeviceMethodInfo a signature where
overloadedMethod = dragContextGetDevice
#endif
foreign import ccall "gdk_drag_context_get_drag_window" gdk_drag_context_get_drag_window ::
Ptr DragContext ->
IO (Ptr Gdk.Window.Window)
dragContextGetDragWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m (Maybe Gdk.Window.Window)
dragContextGetDragWindow :: a -> m (Maybe Window)
dragContextGetDragWindow a
context = IO (Maybe Window) -> m (Maybe Window)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Window) -> m (Maybe Window))
-> IO (Maybe Window) -> m (Maybe Window)
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Window
result <- Ptr DragContext -> IO (Ptr Window)
gdk_drag_context_get_drag_window Ptr DragContext
context'
Maybe Window
maybeResult <- Ptr Window -> (Ptr Window -> IO Window) -> IO (Maybe Window)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Window
result ((Ptr Window -> IO Window) -> IO (Maybe Window))
-> (Ptr Window -> IO Window) -> IO (Maybe Window)
forall a b. (a -> b) -> a -> b
$ \Ptr Window
result' -> do
Window
result'' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gdk.Window.Window) Ptr Window
result'
Window -> IO Window
forall (m :: * -> *) a. Monad m => a -> m a
return Window
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Maybe Window -> IO (Maybe Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Window
maybeResult
#if defined(ENABLE_OVERLOADING)
data DragContextGetDragWindowMethodInfo
instance (signature ~ (m (Maybe Gdk.Window.Window)), MonadIO m, IsDragContext a) => O.MethodInfo DragContextGetDragWindowMethodInfo a signature where
overloadedMethod = dragContextGetDragWindow
#endif
foreign import ccall "gdk_drag_context_get_protocol" gdk_drag_context_get_protocol ::
Ptr DragContext ->
IO CUInt
dragContextGetProtocol ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m Gdk.Enums.DragProtocol
dragContextGetProtocol :: a -> m DragProtocol
dragContextGetProtocol a
context = IO DragProtocol -> m DragProtocol
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DragProtocol -> m DragProtocol)
-> IO DragProtocol -> m DragProtocol
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
CUInt
result <- Ptr DragContext -> IO CUInt
gdk_drag_context_get_protocol Ptr DragContext
context'
let result' :: DragProtocol
result' = (Int -> DragProtocol
forall a. Enum a => Int -> a
toEnum (Int -> DragProtocol) -> (CUInt -> Int) -> CUInt -> DragProtocol
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
context
DragProtocol -> IO DragProtocol
forall (m :: * -> *) a. Monad m => a -> m a
return DragProtocol
result'
#if defined(ENABLE_OVERLOADING)
data DragContextGetProtocolMethodInfo
instance (signature ~ (m Gdk.Enums.DragProtocol), MonadIO m, IsDragContext a) => O.MethodInfo DragContextGetProtocolMethodInfo a signature where
overloadedMethod = dragContextGetProtocol
#endif
foreign import ccall "gdk_drag_context_get_selected_action" gdk_drag_context_get_selected_action ::
Ptr DragContext ->
IO CUInt
dragContextGetSelectedAction ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m [Gdk.Flags.DragAction]
dragContextGetSelectedAction :: a -> m [DragAction]
dragContextGetSelectedAction a
context = IO [DragAction] -> m [DragAction]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DragAction] -> m [DragAction])
-> IO [DragAction] -> m [DragAction]
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
CUInt
result <- Ptr DragContext -> IO CUInt
gdk_drag_context_get_selected_action Ptr DragContext
context'
let result' :: [DragAction]
result' = CUInt -> [DragAction]
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
context
[DragAction] -> IO [DragAction]
forall (m :: * -> *) a. Monad m => a -> m a
return [DragAction]
result'
#if defined(ENABLE_OVERLOADING)
data DragContextGetSelectedActionMethodInfo
instance (signature ~ (m [Gdk.Flags.DragAction]), MonadIO m, IsDragContext a) => O.MethodInfo DragContextGetSelectedActionMethodInfo a signature where
overloadedMethod = dragContextGetSelectedAction
#endif
foreign import ccall "gdk_drag_context_get_source_window" gdk_drag_context_get_source_window ::
Ptr DragContext ->
IO (Ptr Gdk.Window.Window)
dragContextGetSourceWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m Gdk.Window.Window
dragContextGetSourceWindow :: a -> m Window
dragContextGetSourceWindow a
context = IO Window -> m Window
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Window -> m Window) -> IO Window -> m Window
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Window
result <- Ptr DragContext -> IO (Ptr Window)
gdk_drag_context_get_source_window Ptr DragContext
context'
Text -> Ptr Window -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dragContextGetSourceWindow" Ptr Window
result
Window
result' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gdk.Window.Window) Ptr Window
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
Window -> IO Window
forall (m :: * -> *) a. Monad m => a -> m a
return Window
result'
#if defined(ENABLE_OVERLOADING)
data DragContextGetSourceWindowMethodInfo
instance (signature ~ (m Gdk.Window.Window), MonadIO m, IsDragContext a) => O.MethodInfo DragContextGetSourceWindowMethodInfo a signature where
overloadedMethod = dragContextGetSourceWindow
#endif
foreign import ccall "gdk_drag_context_get_suggested_action" gdk_drag_context_get_suggested_action ::
Ptr DragContext ->
IO CUInt
dragContextGetSuggestedAction ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m [Gdk.Flags.DragAction]
dragContextGetSuggestedAction :: a -> m [DragAction]
dragContextGetSuggestedAction a
context = IO [DragAction] -> m [DragAction]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DragAction] -> m [DragAction])
-> IO [DragAction] -> m [DragAction]
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
CUInt
result <- Ptr DragContext -> IO CUInt
gdk_drag_context_get_suggested_action Ptr DragContext
context'
let result' :: [DragAction]
result' = CUInt -> [DragAction]
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
context
[DragAction] -> IO [DragAction]
forall (m :: * -> *) a. Monad m => a -> m a
return [DragAction]
result'
#if defined(ENABLE_OVERLOADING)
data DragContextGetSuggestedActionMethodInfo
instance (signature ~ (m [Gdk.Flags.DragAction]), MonadIO m, IsDragContext a) => O.MethodInfo DragContextGetSuggestedActionMethodInfo a signature where
overloadedMethod = dragContextGetSuggestedAction
#endif
foreign import ccall "gdk_drag_context_list_targets" gdk_drag_context_list_targets ::
Ptr DragContext ->
IO (Ptr (GList (Ptr Gdk.Atom.Atom)))
dragContextListTargets ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> m [Gdk.Atom.Atom]
dragContextListTargets :: a -> m [Atom]
dragContextListTargets a
context = IO [Atom] -> m [Atom]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Atom] -> m [Atom]) -> IO [Atom] -> m [Atom]
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr (GList (Ptr Atom))
result <- Ptr DragContext -> IO (Ptr (GList (Ptr Atom)))
gdk_drag_context_list_targets Ptr DragContext
context'
[Ptr Atom]
result' <- Ptr (GList (Ptr Atom)) -> IO [Ptr Atom]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Atom))
result
[Atom]
result'' <- (Ptr Atom -> IO Atom) -> [Ptr Atom] -> IO [Atom]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Atom -> Atom) -> Ptr Atom -> IO Atom
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Atom -> Atom
Gdk.Atom.Atom) [Ptr Atom]
result'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
[Atom] -> IO [Atom]
forall (m :: * -> *) a. Monad m => a -> m a
return [Atom]
result''
#if defined(ENABLE_OVERLOADING)
data DragContextListTargetsMethodInfo
instance (signature ~ (m [Gdk.Atom.Atom]), MonadIO m, IsDragContext a) => O.MethodInfo DragContextListTargetsMethodInfo a signature where
overloadedMethod = dragContextListTargets
#endif
foreign import ccall "gdk_drag_context_manage_dnd" gdk_drag_context_manage_dnd ::
Ptr DragContext ->
Ptr Gdk.Window.Window ->
CUInt ->
IO CInt
dragContextManageDnd ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a, Gdk.Window.IsWindow b) =>
a
-> b
-> [Gdk.Flags.DragAction]
-> m Bool
dragContextManageDnd :: a -> b -> [DragAction] -> m Bool
dragContextManageDnd a
context b
ipcWindow [DragAction]
actions = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Window
ipcWindow' <- b -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
ipcWindow
let actions' :: CUInt
actions' = [DragAction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DragAction]
actions
CInt
result <- Ptr DragContext -> Ptr Window -> CUInt -> IO CInt
gdk_drag_context_manage_dnd Ptr DragContext
context' Ptr Window
ipcWindow' CUInt
actions'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
ipcWindow
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DragContextManageDndMethodInfo
instance (signature ~ (b -> [Gdk.Flags.DragAction] -> m Bool), MonadIO m, IsDragContext a, Gdk.Window.IsWindow b) => O.MethodInfo DragContextManageDndMethodInfo a signature where
overloadedMethod = dragContextManageDnd
#endif
foreign import ccall "gdk_drag_context_set_device" gdk_drag_context_set_device ::
Ptr DragContext ->
Ptr Gdk.Device.Device ->
IO ()
dragContextSetDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a, Gdk.Device.IsDevice b) =>
a
-> b
-> m ()
dragContextSetDevice :: a -> b -> m ()
dragContextSetDevice a
context b
device = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
Ptr DragContext -> Ptr Device -> IO ()
gdk_drag_context_set_device Ptr DragContext
context' Ptr Device
device'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DragContextSetDeviceMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDragContext a, Gdk.Device.IsDevice b) => O.MethodInfo DragContextSetDeviceMethodInfo a signature where
overloadedMethod = dragContextSetDevice
#endif
foreign import ccall "gdk_drag_context_set_hotspot" gdk_drag_context_set_hotspot ::
Ptr DragContext ->
Int32 ->
Int32 ->
IO ()
dragContextSetHotspot ::
(B.CallStack.HasCallStack, MonadIO m, IsDragContext a) =>
a
-> Int32
-> Int32
-> m ()
dragContextSetHotspot :: a -> Int32 -> Int32 -> m ()
dragContextSetHotspot a
context Int32
hotX Int32
hotY = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DragContext
context' <- a -> IO (Ptr DragContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
Ptr DragContext -> Int32 -> DragContextDropPerformedCallback
gdk_drag_context_set_hotspot Ptr DragContext
context' Int32
hotX Int32
hotY
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DragContextSetHotspotMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsDragContext a) => O.MethodInfo DragContextSetHotspotMethodInfo a signature where
overloadedMethod = dragContextSetHotspot
#endif