{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.DragSource
(
DragSource(..) ,
IsDragSource ,
toDragSource ,
#if defined(ENABLE_OVERLOADING)
ResolveDragSourceMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DragSourceDragCancelMethodInfo ,
#endif
dragSourceDragCancel ,
#if defined(ENABLE_OVERLOADING)
DragSourceGetActionsMethodInfo ,
#endif
dragSourceGetActions ,
#if defined(ENABLE_OVERLOADING)
DragSourceGetContentMethodInfo ,
#endif
dragSourceGetContent ,
#if defined(ENABLE_OVERLOADING)
DragSourceGetDragMethodInfo ,
#endif
dragSourceGetDrag ,
dragSourceNew ,
#if defined(ENABLE_OVERLOADING)
DragSourceSetActionsMethodInfo ,
#endif
dragSourceSetActions ,
#if defined(ENABLE_OVERLOADING)
DragSourceSetContentMethodInfo ,
#endif
dragSourceSetContent ,
#if defined(ENABLE_OVERLOADING)
DragSourceSetIconMethodInfo ,
#endif
dragSourceSetIcon ,
#if defined(ENABLE_OVERLOADING)
DragSourceActionsPropertyInfo ,
#endif
constructDragSourceActions ,
#if defined(ENABLE_OVERLOADING)
dragSourceActions ,
#endif
getDragSourceActions ,
setDragSourceActions ,
#if defined(ENABLE_OVERLOADING)
DragSourceContentPropertyInfo ,
#endif
clearDragSourceContent ,
constructDragSourceContent ,
#if defined(ENABLE_OVERLOADING)
dragSourceContent ,
#endif
getDragSourceContent ,
setDragSourceContent ,
DragSourceDragBeginCallback ,
#if defined(ENABLE_OVERLOADING)
DragSourceDragBeginSignalInfo ,
#endif
afterDragSourceDragBegin ,
onDragSourceDragBegin ,
DragSourceDragCancelCallback ,
#if defined(ENABLE_OVERLOADING)
DragSourceDragCancelSignalInfo ,
#endif
afterDragSourceDragCancel ,
onDragSourceDragCancel ,
DragSourceDragEndCallback ,
#if defined(ENABLE_OVERLOADING)
DragSourceDragEndSignalInfo ,
#endif
afterDragSourceDragEnd ,
onDragSourceDragEnd ,
DragSourcePrepareCallback ,
#if defined(ENABLE_OVERLOADING)
DragSourcePrepareSignalInfo ,
#endif
afterDragSourcePrepare ,
onDragSourcePrepare ,
) 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.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.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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Enums as Gdk.Enums
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Interfaces.Paintable as Gdk.Paintable
import qualified GI.Gdk.Objects.ContentProvider as Gdk.ContentProvider
import qualified GI.Gdk.Objects.Drag as Gdk.Drag
import {-# SOURCE #-} qualified GI.Gtk.Objects.EventController as Gtk.EventController
import {-# SOURCE #-} qualified GI.Gtk.Objects.Gesture as Gtk.Gesture
import {-# SOURCE #-} qualified GI.Gtk.Objects.GestureSingle as Gtk.GestureSingle
newtype DragSource = DragSource (SP.ManagedPtr DragSource)
deriving (DragSource -> DragSource -> Bool
(DragSource -> DragSource -> Bool)
-> (DragSource -> DragSource -> Bool) -> Eq DragSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DragSource -> DragSource -> Bool
$c/= :: DragSource -> DragSource -> Bool
== :: DragSource -> DragSource -> Bool
$c== :: DragSource -> DragSource -> Bool
Eq)
instance SP.ManagedPtrNewtype DragSource where
toManagedPtr :: DragSource -> ManagedPtr DragSource
toManagedPtr (DragSource ManagedPtr DragSource
p) = ManagedPtr DragSource
p
foreign import ccall "gtk_drag_source_get_type"
c_gtk_drag_source_get_type :: IO B.Types.GType
instance B.Types.TypedObject DragSource where
glibType :: IO GType
glibType = IO GType
c_gtk_drag_source_get_type
instance B.Types.GObject DragSource
class (SP.GObject o, O.IsDescendantOf DragSource o) => IsDragSource o
instance (SP.GObject o, O.IsDescendantOf DragSource o) => IsDragSource o
instance O.HasParentTypes DragSource
type instance O.ParentTypes DragSource = '[Gtk.GestureSingle.GestureSingle, Gtk.Gesture.Gesture, Gtk.EventController.EventController, GObject.Object.Object]
toDragSource :: (MIO.MonadIO m, IsDragSource o) => o -> m DragSource
toDragSource :: forall (m :: * -> *) o.
(MonadIO m, IsDragSource o) =>
o -> m DragSource
toDragSource = IO DragSource -> m DragSource
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO DragSource -> m DragSource)
-> (o -> IO DragSource) -> o -> m DragSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DragSource -> DragSource) -> o -> IO DragSource
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr DragSource -> DragSource
DragSource
instance B.GValue.IsGValue (Maybe DragSource) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_drag_source_get_type
gvalueSet_ :: Ptr GValue -> Maybe DragSource -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DragSource
P.Nothing = Ptr GValue -> Ptr DragSource -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr DragSource
forall a. Ptr a
FP.nullPtr :: FP.Ptr DragSource)
gvalueSet_ Ptr GValue
gv (P.Just DragSource
obj) = DragSource -> (Ptr DragSource -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DragSource
obj (Ptr GValue -> Ptr DragSource -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DragSource)
gvalueGet_ Ptr GValue
gv = do
Ptr DragSource
ptr <- Ptr GValue -> IO (Ptr DragSource)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DragSource)
if Ptr DragSource
ptr Ptr DragSource -> Ptr DragSource -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr DragSource
forall a. Ptr a
FP.nullPtr
then DragSource -> Maybe DragSource
forall a. a -> Maybe a
P.Just (DragSource -> Maybe DragSource)
-> IO DragSource -> IO (Maybe DragSource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr DragSource -> DragSource)
-> Ptr DragSource -> IO DragSource
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DragSource -> DragSource
DragSource Ptr DragSource
ptr
else Maybe DragSource -> IO (Maybe DragSource)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DragSource
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDragSourceMethod (t :: Symbol) (o :: *) :: * where
ResolveDragSourceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDragSourceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDragSourceMethod "dragCancel" o = DragSourceDragCancelMethodInfo
ResolveDragSourceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDragSourceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDragSourceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDragSourceMethod "group" o = Gtk.Gesture.GestureGroupMethodInfo
ResolveDragSourceMethod "handlesSequence" o = Gtk.Gesture.GestureHandlesSequenceMethodInfo
ResolveDragSourceMethod "isActive" o = Gtk.Gesture.GestureIsActiveMethodInfo
ResolveDragSourceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDragSourceMethod "isGroupedWith" o = Gtk.Gesture.GestureIsGroupedWithMethodInfo
ResolveDragSourceMethod "isRecognized" o = Gtk.Gesture.GestureIsRecognizedMethodInfo
ResolveDragSourceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDragSourceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDragSourceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDragSourceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDragSourceMethod "reset" o = Gtk.EventController.EventControllerResetMethodInfo
ResolveDragSourceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDragSourceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDragSourceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDragSourceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDragSourceMethod "ungroup" o = Gtk.Gesture.GestureUngroupMethodInfo
ResolveDragSourceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDragSourceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDragSourceMethod "getActions" o = DragSourceGetActionsMethodInfo
ResolveDragSourceMethod "getBoundingBox" o = Gtk.Gesture.GestureGetBoundingBoxMethodInfo
ResolveDragSourceMethod "getBoundingBoxCenter" o = Gtk.Gesture.GestureGetBoundingBoxCenterMethodInfo
ResolveDragSourceMethod "getButton" o = Gtk.GestureSingle.GestureSingleGetButtonMethodInfo
ResolveDragSourceMethod "getContent" o = DragSourceGetContentMethodInfo
ResolveDragSourceMethod "getCurrentButton" o = Gtk.GestureSingle.GestureSingleGetCurrentButtonMethodInfo
ResolveDragSourceMethod "getCurrentEvent" o = Gtk.EventController.EventControllerGetCurrentEventMethodInfo
ResolveDragSourceMethod "getCurrentEventDevice" o = Gtk.EventController.EventControllerGetCurrentEventDeviceMethodInfo
ResolveDragSourceMethod "getCurrentEventState" o = Gtk.EventController.EventControllerGetCurrentEventStateMethodInfo
ResolveDragSourceMethod "getCurrentEventTime" o = Gtk.EventController.EventControllerGetCurrentEventTimeMethodInfo
ResolveDragSourceMethod "getCurrentSequence" o = Gtk.GestureSingle.GestureSingleGetCurrentSequenceMethodInfo
ResolveDragSourceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDragSourceMethod "getDevice" o = Gtk.Gesture.GestureGetDeviceMethodInfo
ResolveDragSourceMethod "getDrag" o = DragSourceGetDragMethodInfo
ResolveDragSourceMethod "getExclusive" o = Gtk.GestureSingle.GestureSingleGetExclusiveMethodInfo
ResolveDragSourceMethod "getGroup" o = Gtk.Gesture.GestureGetGroupMethodInfo
ResolveDragSourceMethod "getLastEvent" o = Gtk.Gesture.GestureGetLastEventMethodInfo
ResolveDragSourceMethod "getLastUpdatedSequence" o = Gtk.Gesture.GestureGetLastUpdatedSequenceMethodInfo
ResolveDragSourceMethod "getName" o = Gtk.EventController.EventControllerGetNameMethodInfo
ResolveDragSourceMethod "getPoint" o = Gtk.Gesture.GestureGetPointMethodInfo
ResolveDragSourceMethod "getPropagationLimit" o = Gtk.EventController.EventControllerGetPropagationLimitMethodInfo
ResolveDragSourceMethod "getPropagationPhase" o = Gtk.EventController.EventControllerGetPropagationPhaseMethodInfo
ResolveDragSourceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDragSourceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDragSourceMethod "getSequenceState" o = Gtk.Gesture.GestureGetSequenceStateMethodInfo
ResolveDragSourceMethod "getSequences" o = Gtk.Gesture.GestureGetSequencesMethodInfo
ResolveDragSourceMethod "getTouchOnly" o = Gtk.GestureSingle.GestureSingleGetTouchOnlyMethodInfo
ResolveDragSourceMethod "getWidget" o = Gtk.EventController.EventControllerGetWidgetMethodInfo
ResolveDragSourceMethod "setActions" o = DragSourceSetActionsMethodInfo
ResolveDragSourceMethod "setButton" o = Gtk.GestureSingle.GestureSingleSetButtonMethodInfo
ResolveDragSourceMethod "setContent" o = DragSourceSetContentMethodInfo
ResolveDragSourceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDragSourceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDragSourceMethod "setExclusive" o = Gtk.GestureSingle.GestureSingleSetExclusiveMethodInfo
ResolveDragSourceMethod "setIcon" o = DragSourceSetIconMethodInfo
ResolveDragSourceMethod "setName" o = Gtk.EventController.EventControllerSetNameMethodInfo
ResolveDragSourceMethod "setPropagationLimit" o = Gtk.EventController.EventControllerSetPropagationLimitMethodInfo
ResolveDragSourceMethod "setPropagationPhase" o = Gtk.EventController.EventControllerSetPropagationPhaseMethodInfo
ResolveDragSourceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDragSourceMethod "setSequenceState" o = Gtk.Gesture.GestureSetSequenceStateMethodInfo
ResolveDragSourceMethod "setState" o = Gtk.Gesture.GestureSetStateMethodInfo
ResolveDragSourceMethod "setTouchOnly" o = Gtk.GestureSingle.GestureSingleSetTouchOnlyMethodInfo
ResolveDragSourceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDragSourceMethod t DragSource, O.OverloadedMethod info DragSource p) => OL.IsLabel t (DragSource -> 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 ~ ResolveDragSourceMethod t DragSource, O.OverloadedMethod info DragSource p, R.HasField t DragSource p) => R.HasField t DragSource p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDragSourceMethod t DragSource, O.OverloadedMethodInfo info DragSource) => OL.IsLabel t (O.MethodProxy info DragSource) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type DragSourceDragBeginCallback =
Gdk.Drag.Drag
-> IO ()
type C_DragSourceDragBeginCallback =
Ptr DragSource ->
Ptr Gdk.Drag.Drag ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragSourceDragBeginCallback :: C_DragSourceDragBeginCallback -> IO (FunPtr C_DragSourceDragBeginCallback)
wrap_DragSourceDragBeginCallback ::
GObject a => (a -> DragSourceDragBeginCallback) ->
C_DragSourceDragBeginCallback
wrap_DragSourceDragBeginCallback :: forall a.
GObject a =>
(a -> DragSourceDragBeginCallback) -> C_DragSourceDragBeginCallback
wrap_DragSourceDragBeginCallback a -> DragSourceDragBeginCallback
gi'cb Ptr DragSource
gi'selfPtr Ptr Drag
drag Ptr ()
_ = do
Drag
drag' <- ((ManagedPtr Drag -> Drag) -> Ptr Drag -> IO Drag
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Drag -> Drag
Gdk.Drag.Drag) Ptr Drag
drag
Ptr DragSource -> (DragSource -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr DragSource
gi'selfPtr ((DragSource -> IO ()) -> IO ()) -> (DragSource -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \DragSource
gi'self -> a -> DragSourceDragBeginCallback
gi'cb (DragSource -> a
Coerce.coerce DragSource
gi'self) Drag
drag'
onDragSourceDragBegin :: (IsDragSource a, MonadIO m) => a -> ((?self :: a) => DragSourceDragBeginCallback) -> m SignalHandlerId
onDragSourceDragBegin :: forall a (m :: * -> *).
(IsDragSource a, MonadIO m) =>
a
-> ((?self::a) => DragSourceDragBeginCallback) -> m SignalHandlerId
onDragSourceDragBegin a
obj (?self::a) => DragSourceDragBeginCallback
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 wrapped :: a -> DragSourceDragBeginCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DragSourceDragBeginCallback
DragSourceDragBeginCallback
cb
let wrapped' :: C_DragSourceDragBeginCallback
wrapped' = (a -> DragSourceDragBeginCallback) -> C_DragSourceDragBeginCallback
forall a.
GObject a =>
(a -> DragSourceDragBeginCallback) -> C_DragSourceDragBeginCallback
wrap_DragSourceDragBeginCallback a -> DragSourceDragBeginCallback
wrapped
FunPtr C_DragSourceDragBeginCallback
wrapped'' <- C_DragSourceDragBeginCallback
-> IO (FunPtr C_DragSourceDragBeginCallback)
mk_DragSourceDragBeginCallback C_DragSourceDragBeginCallback
wrapped'
a
-> Text
-> FunPtr C_DragSourceDragBeginCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"drag-begin" FunPtr C_DragSourceDragBeginCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragSourceDragBegin :: (IsDragSource a, MonadIO m) => a -> ((?self :: a) => DragSourceDragBeginCallback) -> m SignalHandlerId
afterDragSourceDragBegin :: forall a (m :: * -> *).
(IsDragSource a, MonadIO m) =>
a
-> ((?self::a) => DragSourceDragBeginCallback) -> m SignalHandlerId
afterDragSourceDragBegin a
obj (?self::a) => DragSourceDragBeginCallback
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 wrapped :: a -> DragSourceDragBeginCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DragSourceDragBeginCallback
DragSourceDragBeginCallback
cb
let wrapped' :: C_DragSourceDragBeginCallback
wrapped' = (a -> DragSourceDragBeginCallback) -> C_DragSourceDragBeginCallback
forall a.
GObject a =>
(a -> DragSourceDragBeginCallback) -> C_DragSourceDragBeginCallback
wrap_DragSourceDragBeginCallback a -> DragSourceDragBeginCallback
wrapped
FunPtr C_DragSourceDragBeginCallback
wrapped'' <- C_DragSourceDragBeginCallback
-> IO (FunPtr C_DragSourceDragBeginCallback)
mk_DragSourceDragBeginCallback C_DragSourceDragBeginCallback
wrapped'
a
-> Text
-> FunPtr C_DragSourceDragBeginCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"drag-begin" FunPtr C_DragSourceDragBeginCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragSourceDragBeginSignalInfo
instance SignalInfo DragSourceDragBeginSignalInfo where
type HaskellCallbackType DragSourceDragBeginSignalInfo = DragSourceDragBeginCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragSourceDragBeginCallback cb
cb'' <- mk_DragSourceDragBeginCallback cb'
connectSignalFunPtr obj "drag-begin" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource::drag-begin"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#g:signal:dragBegin"})
#endif
type DragSourceDragCancelCallback =
Gdk.Drag.Drag
-> Gdk.Enums.DragCancelReason
-> IO Bool
type C_DragSourceDragCancelCallback =
Ptr DragSource ->
Ptr Gdk.Drag.Drag ->
CUInt ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_DragSourceDragCancelCallback :: C_DragSourceDragCancelCallback -> IO (FunPtr C_DragSourceDragCancelCallback)
wrap_DragSourceDragCancelCallback ::
GObject a => (a -> DragSourceDragCancelCallback) ->
C_DragSourceDragCancelCallback
wrap_DragSourceDragCancelCallback :: forall a.
GObject a =>
(a -> DragSourceDragCancelCallback)
-> C_DragSourceDragCancelCallback
wrap_DragSourceDragCancelCallback a -> DragSourceDragCancelCallback
gi'cb Ptr DragSource
gi'selfPtr Ptr Drag
drag CUInt
reason Ptr ()
_ = do
Drag
drag' <- ((ManagedPtr Drag -> Drag) -> Ptr Drag -> IO Drag
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Drag -> Drag
Gdk.Drag.Drag) Ptr Drag
drag
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
Bool
result <- Ptr DragSource -> (DragSource -> IO Bool) -> IO Bool
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr DragSource
gi'selfPtr ((DragSource -> IO Bool) -> IO Bool)
-> (DragSource -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \DragSource
gi'self -> a -> DragSourceDragCancelCallback
gi'cb (DragSource -> a
Coerce.coerce DragSource
gi'self) Drag
drag' DragCancelReason
reason'
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
onDragSourceDragCancel :: (IsDragSource a, MonadIO m) => a -> ((?self :: a) => DragSourceDragCancelCallback) -> m SignalHandlerId
onDragSourceDragCancel :: forall a (m :: * -> *).
(IsDragSource a, MonadIO m) =>
a
-> ((?self::a) => DragSourceDragCancelCallback)
-> m SignalHandlerId
onDragSourceDragCancel a
obj (?self::a) => DragSourceDragCancelCallback
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 wrapped :: a -> DragSourceDragCancelCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DragSourceDragCancelCallback
DragSourceDragCancelCallback
cb
let wrapped' :: C_DragSourceDragCancelCallback
wrapped' = (a -> DragSourceDragCancelCallback)
-> C_DragSourceDragCancelCallback
forall a.
GObject a =>
(a -> DragSourceDragCancelCallback)
-> C_DragSourceDragCancelCallback
wrap_DragSourceDragCancelCallback a -> DragSourceDragCancelCallback
wrapped
FunPtr C_DragSourceDragCancelCallback
wrapped'' <- C_DragSourceDragCancelCallback
-> IO (FunPtr C_DragSourceDragCancelCallback)
mk_DragSourceDragCancelCallback C_DragSourceDragCancelCallback
wrapped'
a
-> Text
-> FunPtr C_DragSourceDragCancelCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"drag-cancel" FunPtr C_DragSourceDragCancelCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragSourceDragCancel :: (IsDragSource a, MonadIO m) => a -> ((?self :: a) => DragSourceDragCancelCallback) -> m SignalHandlerId
afterDragSourceDragCancel :: forall a (m :: * -> *).
(IsDragSource a, MonadIO m) =>
a
-> ((?self::a) => DragSourceDragCancelCallback)
-> m SignalHandlerId
afterDragSourceDragCancel a
obj (?self::a) => DragSourceDragCancelCallback
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 wrapped :: a -> DragSourceDragCancelCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DragSourceDragCancelCallback
DragSourceDragCancelCallback
cb
let wrapped' :: C_DragSourceDragCancelCallback
wrapped' = (a -> DragSourceDragCancelCallback)
-> C_DragSourceDragCancelCallback
forall a.
GObject a =>
(a -> DragSourceDragCancelCallback)
-> C_DragSourceDragCancelCallback
wrap_DragSourceDragCancelCallback a -> DragSourceDragCancelCallback
wrapped
FunPtr C_DragSourceDragCancelCallback
wrapped'' <- C_DragSourceDragCancelCallback
-> IO (FunPtr C_DragSourceDragCancelCallback)
mk_DragSourceDragCancelCallback C_DragSourceDragCancelCallback
wrapped'
a
-> Text
-> FunPtr C_DragSourceDragCancelCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"drag-cancel" FunPtr C_DragSourceDragCancelCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragSourceDragCancelSignalInfo
instance SignalInfo DragSourceDragCancelSignalInfo where
type HaskellCallbackType DragSourceDragCancelSignalInfo = DragSourceDragCancelCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragSourceDragCancelCallback cb
cb'' <- mk_DragSourceDragCancelCallback cb'
connectSignalFunPtr obj "drag-cancel" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource::drag-cancel"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#g:signal:dragCancel"})
#endif
type DragSourceDragEndCallback =
Gdk.Drag.Drag
-> Bool
-> IO ()
type C_DragSourceDragEndCallback =
Ptr DragSource ->
Ptr Gdk.Drag.Drag ->
CInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragSourceDragEndCallback :: C_DragSourceDragEndCallback -> IO (FunPtr C_DragSourceDragEndCallback)
wrap_DragSourceDragEndCallback ::
GObject a => (a -> DragSourceDragEndCallback) ->
C_DragSourceDragEndCallback
wrap_DragSourceDragEndCallback :: forall a.
GObject a =>
(a -> DragSourceDragEndCallback) -> C_DragSourceDragEndCallback
wrap_DragSourceDragEndCallback a -> DragSourceDragEndCallback
gi'cb Ptr DragSource
gi'selfPtr Ptr Drag
drag CInt
deleteData Ptr ()
_ = do
Drag
drag' <- ((ManagedPtr Drag -> Drag) -> Ptr Drag -> IO Drag
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Drag -> Drag
Gdk.Drag.Drag) Ptr Drag
drag
let deleteData' :: Bool
deleteData' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
deleteData
Ptr DragSource -> (DragSource -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr DragSource
gi'selfPtr ((DragSource -> IO ()) -> IO ()) -> (DragSource -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \DragSource
gi'self -> a -> DragSourceDragEndCallback
gi'cb (DragSource -> a
Coerce.coerce DragSource
gi'self) Drag
drag' Bool
deleteData'
onDragSourceDragEnd :: (IsDragSource a, MonadIO m) => a -> ((?self :: a) => DragSourceDragEndCallback) -> m SignalHandlerId
onDragSourceDragEnd :: forall a (m :: * -> *).
(IsDragSource a, MonadIO m) =>
a -> ((?self::a) => DragSourceDragEndCallback) -> m SignalHandlerId
onDragSourceDragEnd a
obj (?self::a) => DragSourceDragEndCallback
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 wrapped :: a -> DragSourceDragEndCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DragSourceDragEndCallback
DragSourceDragEndCallback
cb
let wrapped' :: C_DragSourceDragEndCallback
wrapped' = (a -> DragSourceDragEndCallback) -> C_DragSourceDragEndCallback
forall a.
GObject a =>
(a -> DragSourceDragEndCallback) -> C_DragSourceDragEndCallback
wrap_DragSourceDragEndCallback a -> DragSourceDragEndCallback
wrapped
FunPtr C_DragSourceDragEndCallback
wrapped'' <- C_DragSourceDragEndCallback
-> IO (FunPtr C_DragSourceDragEndCallback)
mk_DragSourceDragEndCallback C_DragSourceDragEndCallback
wrapped'
a
-> Text
-> FunPtr C_DragSourceDragEndCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"drag-end" FunPtr C_DragSourceDragEndCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragSourceDragEnd :: (IsDragSource a, MonadIO m) => a -> ((?self :: a) => DragSourceDragEndCallback) -> m SignalHandlerId
afterDragSourceDragEnd :: forall a (m :: * -> *).
(IsDragSource a, MonadIO m) =>
a -> ((?self::a) => DragSourceDragEndCallback) -> m SignalHandlerId
afterDragSourceDragEnd a
obj (?self::a) => DragSourceDragEndCallback
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 wrapped :: a -> DragSourceDragEndCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DragSourceDragEndCallback
DragSourceDragEndCallback
cb
let wrapped' :: C_DragSourceDragEndCallback
wrapped' = (a -> DragSourceDragEndCallback) -> C_DragSourceDragEndCallback
forall a.
GObject a =>
(a -> DragSourceDragEndCallback) -> C_DragSourceDragEndCallback
wrap_DragSourceDragEndCallback a -> DragSourceDragEndCallback
wrapped
FunPtr C_DragSourceDragEndCallback
wrapped'' <- C_DragSourceDragEndCallback
-> IO (FunPtr C_DragSourceDragEndCallback)
mk_DragSourceDragEndCallback C_DragSourceDragEndCallback
wrapped'
a
-> Text
-> FunPtr C_DragSourceDragEndCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"drag-end" FunPtr C_DragSourceDragEndCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragSourceDragEndSignalInfo
instance SignalInfo DragSourceDragEndSignalInfo where
type HaskellCallbackType DragSourceDragEndSignalInfo = DragSourceDragEndCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragSourceDragEndCallback cb
cb'' <- mk_DragSourceDragEndCallback cb'
connectSignalFunPtr obj "drag-end" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource::drag-end"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#g:signal:dragEnd"})
#endif
type DragSourcePrepareCallback =
Double
-> Double
-> IO (Maybe Gdk.ContentProvider.ContentProvider)
type C_DragSourcePrepareCallback =
Ptr DragSource ->
CDouble ->
CDouble ->
Ptr () ->
IO (Ptr Gdk.ContentProvider.ContentProvider)
foreign import ccall "wrapper"
mk_DragSourcePrepareCallback :: C_DragSourcePrepareCallback -> IO (FunPtr C_DragSourcePrepareCallback)
wrap_DragSourcePrepareCallback ::
GObject a => (a -> DragSourcePrepareCallback) ->
C_DragSourcePrepareCallback
wrap_DragSourcePrepareCallback :: forall a.
GObject a =>
(a -> DragSourcePrepareCallback) -> C_DragSourcePrepareCallback
wrap_DragSourcePrepareCallback a -> DragSourcePrepareCallback
gi'cb Ptr DragSource
gi'selfPtr CDouble
x CDouble
y Ptr ()
_ = do
let x' :: Double
x' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
x
let y' :: Double
y' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
y
Maybe ContentProvider
result <- Ptr DragSource
-> (DragSource -> IO (Maybe ContentProvider))
-> IO (Maybe ContentProvider)
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr DragSource
gi'selfPtr ((DragSource -> IO (Maybe ContentProvider))
-> IO (Maybe ContentProvider))
-> (DragSource -> IO (Maybe ContentProvider))
-> IO (Maybe ContentProvider)
forall a b. (a -> b) -> a -> b
$ \DragSource
gi'self -> a -> DragSourcePrepareCallback
gi'cb (DragSource -> a
Coerce.coerce DragSource
gi'self) Double
x' Double
y'
Ptr ContentProvider
-> Maybe ContentProvider
-> (ContentProvider -> IO (Ptr ContentProvider))
-> IO (Ptr ContentProvider)
forall (m :: * -> *) b a.
Monad m =>
b -> Maybe a -> (a -> m b) -> m b
maybeM Ptr ContentProvider
forall a. Ptr a
FP.nullPtr Maybe ContentProvider
result ((ContentProvider -> IO (Ptr ContentProvider))
-> IO (Ptr ContentProvider))
-> (ContentProvider -> IO (Ptr ContentProvider))
-> IO (Ptr ContentProvider)
forall a b. (a -> b) -> a -> b
$ \ContentProvider
result' -> do
Ptr ContentProvider
result'' <- ContentProvider -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
B.ManagedPtr.disownObject ContentProvider
result'
Ptr ContentProvider -> IO (Ptr ContentProvider)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ContentProvider
result''
onDragSourcePrepare :: (IsDragSource a, MonadIO m) => a -> ((?self :: a) => DragSourcePrepareCallback) -> m SignalHandlerId
onDragSourcePrepare :: forall a (m :: * -> *).
(IsDragSource a, MonadIO m) =>
a -> ((?self::a) => DragSourcePrepareCallback) -> m SignalHandlerId
onDragSourcePrepare a
obj (?self::a) => DragSourcePrepareCallback
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 wrapped :: a -> DragSourcePrepareCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DragSourcePrepareCallback
DragSourcePrepareCallback
cb
let wrapped' :: C_DragSourcePrepareCallback
wrapped' = (a -> DragSourcePrepareCallback) -> C_DragSourcePrepareCallback
forall a.
GObject a =>
(a -> DragSourcePrepareCallback) -> C_DragSourcePrepareCallback
wrap_DragSourcePrepareCallback a -> DragSourcePrepareCallback
wrapped
FunPtr C_DragSourcePrepareCallback
wrapped'' <- C_DragSourcePrepareCallback
-> IO (FunPtr C_DragSourcePrepareCallback)
mk_DragSourcePrepareCallback C_DragSourcePrepareCallback
wrapped'
a
-> Text
-> FunPtr C_DragSourcePrepareCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"prepare" FunPtr C_DragSourcePrepareCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragSourcePrepare :: (IsDragSource a, MonadIO m) => a -> ((?self :: a) => DragSourcePrepareCallback) -> m SignalHandlerId
afterDragSourcePrepare :: forall a (m :: * -> *).
(IsDragSource a, MonadIO m) =>
a -> ((?self::a) => DragSourcePrepareCallback) -> m SignalHandlerId
afterDragSourcePrepare a
obj (?self::a) => DragSourcePrepareCallback
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 wrapped :: a -> DragSourcePrepareCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DragSourcePrepareCallback
DragSourcePrepareCallback
cb
let wrapped' :: C_DragSourcePrepareCallback
wrapped' = (a -> DragSourcePrepareCallback) -> C_DragSourcePrepareCallback
forall a.
GObject a =>
(a -> DragSourcePrepareCallback) -> C_DragSourcePrepareCallback
wrap_DragSourcePrepareCallback a -> DragSourcePrepareCallback
wrapped
FunPtr C_DragSourcePrepareCallback
wrapped'' <- C_DragSourcePrepareCallback
-> IO (FunPtr C_DragSourcePrepareCallback)
mk_DragSourcePrepareCallback C_DragSourcePrepareCallback
wrapped'
a
-> Text
-> FunPtr C_DragSourcePrepareCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"prepare" FunPtr C_DragSourcePrepareCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragSourcePrepareSignalInfo
instance SignalInfo DragSourcePrepareSignalInfo where
type HaskellCallbackType DragSourcePrepareSignalInfo = DragSourcePrepareCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragSourcePrepareCallback cb
cb'' <- mk_DragSourcePrepareCallback cb'
connectSignalFunPtr obj "prepare" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource::prepare"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#g:signal:prepare"})
#endif
getDragSourceActions :: (MonadIO m, IsDragSource o) => o -> m [Gdk.Flags.DragAction]
getDragSourceActions :: forall (m :: * -> *) o.
(MonadIO m, IsDragSource o) =>
o -> m [DragAction]
getDragSourceActions o
obj = IO [DragAction] -> m [DragAction]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO [DragAction] -> m [DragAction])
-> IO [DragAction] -> m [DragAction]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [DragAction]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"actions"
setDragSourceActions :: (MonadIO m, IsDragSource o) => o -> [Gdk.Flags.DragAction] -> m ()
setDragSourceActions :: forall (m :: * -> *) o.
(MonadIO m, IsDragSource o) =>
o -> [DragAction] -> m ()
setDragSourceActions o
obj [DragAction]
val = IO () -> m ()
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 -> [DragAction] -> IO ()
forall a b.
(IsGFlag b, BoxedFlags b, GObject a) =>
a -> String -> [b] -> IO ()
B.Properties.setObjectPropertyFlags o
obj String
"actions" [DragAction]
val
constructDragSourceActions :: (IsDragSource o, MIO.MonadIO m) => [Gdk.Flags.DragAction] -> m (GValueConstruct o)
constructDragSourceActions :: forall o (m :: * -> *).
(IsDragSource o, MonadIO m) =>
[DragAction] -> m (GValueConstruct o)
constructDragSourceActions [DragAction]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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 (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 -> [DragAction] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"actions" [DragAction]
val
#if defined(ENABLE_OVERLOADING)
data DragSourceActionsPropertyInfo
instance AttrInfo DragSourceActionsPropertyInfo where
type AttrAllowedOps DragSourceActionsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DragSourceActionsPropertyInfo = IsDragSource
type AttrSetTypeConstraint DragSourceActionsPropertyInfo = (~) [Gdk.Flags.DragAction]
type AttrTransferTypeConstraint DragSourceActionsPropertyInfo = (~) [Gdk.Flags.DragAction]
type AttrTransferType DragSourceActionsPropertyInfo = [Gdk.Flags.DragAction]
type AttrGetType DragSourceActionsPropertyInfo = [Gdk.Flags.DragAction]
type AttrLabel DragSourceActionsPropertyInfo = "actions"
type AttrOrigin DragSourceActionsPropertyInfo = DragSource
attrGet = getDragSourceActions
attrSet = setDragSourceActions
attrTransfer _ v = do
return v
attrConstruct = constructDragSourceActions
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.actions"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#g:attr:actions"
})
#endif
getDragSourceContent :: (MonadIO m, IsDragSource o) => o -> m (Maybe Gdk.ContentProvider.ContentProvider)
getDragSourceContent :: forall (m :: * -> *) o.
(MonadIO m, IsDragSource o) =>
o -> m (Maybe ContentProvider)
getDragSourceContent o
obj = IO (Maybe ContentProvider) -> m (Maybe ContentProvider)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe ContentProvider) -> m (Maybe ContentProvider))
-> IO (Maybe ContentProvider) -> m (Maybe ContentProvider)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr ContentProvider -> ContentProvider)
-> IO (Maybe ContentProvider)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"content" ManagedPtr ContentProvider -> ContentProvider
Gdk.ContentProvider.ContentProvider
setDragSourceContent :: (MonadIO m, IsDragSource o, Gdk.ContentProvider.IsContentProvider a) => o -> a -> m ()
setDragSourceContent :: forall (m :: * -> *) o a.
(MonadIO m, IsDragSource o, IsContentProvider a) =>
o -> a -> m ()
setDragSourceContent o
obj a
val = IO () -> m ()
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 a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"content" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructDragSourceContent :: (IsDragSource o, MIO.MonadIO m, Gdk.ContentProvider.IsContentProvider a) => a -> m (GValueConstruct o)
constructDragSourceContent :: forall o (m :: * -> *) a.
(IsDragSource o, MonadIO m, IsContentProvider a) =>
a -> m (GValueConstruct o)
constructDragSourceContent a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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 (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 a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"content" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
clearDragSourceContent :: (MonadIO m, IsDragSource o) => o -> m ()
clearDragSourceContent :: forall (m :: * -> *) o. (MonadIO m, IsDragSource o) => o -> m ()
clearDragSourceContent o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe ContentProvider -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"content" (Maybe ContentProvider
forall a. Maybe a
Nothing :: Maybe Gdk.ContentProvider.ContentProvider)
#if defined(ENABLE_OVERLOADING)
data DragSourceContentPropertyInfo
instance AttrInfo DragSourceContentPropertyInfo where
type AttrAllowedOps DragSourceContentPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DragSourceContentPropertyInfo = IsDragSource
type AttrSetTypeConstraint DragSourceContentPropertyInfo = Gdk.ContentProvider.IsContentProvider
type AttrTransferTypeConstraint DragSourceContentPropertyInfo = Gdk.ContentProvider.IsContentProvider
type AttrTransferType DragSourceContentPropertyInfo = Gdk.ContentProvider.ContentProvider
type AttrGetType DragSourceContentPropertyInfo = (Maybe Gdk.ContentProvider.ContentProvider)
type AttrLabel DragSourceContentPropertyInfo = "content"
type AttrOrigin DragSourceContentPropertyInfo = DragSource
attrGet = getDragSourceContent
attrSet = setDragSourceContent
attrTransfer _ v = do
unsafeCastTo Gdk.ContentProvider.ContentProvider v
attrConstruct = constructDragSourceContent
attrClear = clearDragSourceContent
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.content"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#g:attr:content"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DragSource
type instance O.AttributeList DragSource = DragSourceAttributeList
type DragSourceAttributeList = ('[ '("actions", DragSourceActionsPropertyInfo), '("button", Gtk.GestureSingle.GestureSingleButtonPropertyInfo), '("content", DragSourceContentPropertyInfo), '("exclusive", Gtk.GestureSingle.GestureSingleExclusivePropertyInfo), '("nPoints", Gtk.Gesture.GestureNPointsPropertyInfo), '("name", Gtk.EventController.EventControllerNamePropertyInfo), '("propagationLimit", Gtk.EventController.EventControllerPropagationLimitPropertyInfo), '("propagationPhase", Gtk.EventController.EventControllerPropagationPhasePropertyInfo), '("touchOnly", Gtk.GestureSingle.GestureSingleTouchOnlyPropertyInfo), '("widget", Gtk.EventController.EventControllerWidgetPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
dragSourceActions :: AttrLabelProxy "actions"
dragSourceActions = AttrLabelProxy
dragSourceContent :: AttrLabelProxy "content"
dragSourceContent = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DragSource = DragSourceSignalList
type DragSourceSignalList = ('[ '("begin", Gtk.Gesture.GestureBeginSignalInfo), '("cancel", Gtk.Gesture.GestureCancelSignalInfo), '("dragBegin", DragSourceDragBeginSignalInfo), '("dragCancel", DragSourceDragCancelSignalInfo), '("dragEnd", DragSourceDragEndSignalInfo), '("end", Gtk.Gesture.GestureEndSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("prepare", DragSourcePrepareSignalInfo), '("sequenceStateChanged", Gtk.Gesture.GestureSequenceStateChangedSignalInfo), '("update", Gtk.Gesture.GestureUpdateSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_drag_source_new" gtk_drag_source_new ::
IO (Ptr DragSource)
dragSourceNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m DragSource
dragSourceNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m DragSource
dragSourceNew = IO DragSource -> m DragSource
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DragSource -> m DragSource) -> IO DragSource -> m DragSource
forall a b. (a -> b) -> a -> b
$ do
Ptr DragSource
result <- IO (Ptr DragSource)
gtk_drag_source_new
Text -> Ptr DragSource -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dragSourceNew" Ptr DragSource
result
DragSource
result' <- ((ManagedPtr DragSource -> DragSource)
-> Ptr DragSource -> IO DragSource
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DragSource -> DragSource
DragSource) Ptr DragSource
result
DragSource -> IO DragSource
forall (m :: * -> *) a. Monad m => a -> m a
return DragSource
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_drag_source_drag_cancel" gtk_drag_source_drag_cancel ::
Ptr DragSource ->
IO ()
dragSourceDragCancel ::
(B.CallStack.HasCallStack, MonadIO m, IsDragSource a) =>
a
-> m ()
dragSourceDragCancel :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDragSource a) =>
a -> m ()
dragSourceDragCancel a
source = 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 DragSource
source' <- a -> IO (Ptr DragSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
Ptr DragSource -> IO ()
gtk_drag_source_drag_cancel Ptr DragSource
source'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DragSourceDragCancelMethodInfo
instance (signature ~ (m ()), MonadIO m, IsDragSource a) => O.OverloadedMethod DragSourceDragCancelMethodInfo a signature where
overloadedMethod = dragSourceDragCancel
instance O.OverloadedMethodInfo DragSourceDragCancelMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.dragSourceDragCancel",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#v:dragSourceDragCancel"
})
#endif
foreign import ccall "gtk_drag_source_get_actions" gtk_drag_source_get_actions ::
Ptr DragSource ->
IO CUInt
dragSourceGetActions ::
(B.CallStack.HasCallStack, MonadIO m, IsDragSource a) =>
a
-> m [Gdk.Flags.DragAction]
dragSourceGetActions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDragSource a) =>
a -> m [DragAction]
dragSourceGetActions a
source = 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 DragSource
source' <- a -> IO (Ptr DragSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
CUInt
result <- Ptr DragSource -> IO CUInt
gtk_drag_source_get_actions Ptr DragSource
source'
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
source
[DragAction] -> IO [DragAction]
forall (m :: * -> *) a. Monad m => a -> m a
return [DragAction]
result'
#if defined(ENABLE_OVERLOADING)
data DragSourceGetActionsMethodInfo
instance (signature ~ (m [Gdk.Flags.DragAction]), MonadIO m, IsDragSource a) => O.OverloadedMethod DragSourceGetActionsMethodInfo a signature where
overloadedMethod = dragSourceGetActions
instance O.OverloadedMethodInfo DragSourceGetActionsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.dragSourceGetActions",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#v:dragSourceGetActions"
})
#endif
foreign import ccall "gtk_drag_source_get_content" gtk_drag_source_get_content ::
Ptr DragSource ->
IO (Ptr Gdk.ContentProvider.ContentProvider)
dragSourceGetContent ::
(B.CallStack.HasCallStack, MonadIO m, IsDragSource a) =>
a
-> m (Maybe Gdk.ContentProvider.ContentProvider)
dragSourceGetContent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDragSource a) =>
a -> m (Maybe ContentProvider)
dragSourceGetContent a
source = IO (Maybe ContentProvider) -> m (Maybe ContentProvider)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ContentProvider) -> m (Maybe ContentProvider))
-> IO (Maybe ContentProvider) -> m (Maybe ContentProvider)
forall a b. (a -> b) -> a -> b
$ do
Ptr DragSource
source' <- a -> IO (Ptr DragSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
Ptr ContentProvider
result <- Ptr DragSource -> IO (Ptr ContentProvider)
gtk_drag_source_get_content Ptr DragSource
source'
Maybe ContentProvider
maybeResult <- Ptr ContentProvider
-> (Ptr ContentProvider -> IO ContentProvider)
-> IO (Maybe ContentProvider)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr ContentProvider
result ((Ptr ContentProvider -> IO ContentProvider)
-> IO (Maybe ContentProvider))
-> (Ptr ContentProvider -> IO ContentProvider)
-> IO (Maybe ContentProvider)
forall a b. (a -> b) -> a -> b
$ \Ptr ContentProvider
result' -> do
ContentProvider
result'' <- ((ManagedPtr ContentProvider -> ContentProvider)
-> Ptr ContentProvider -> IO ContentProvider
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ContentProvider -> ContentProvider
Gdk.ContentProvider.ContentProvider) Ptr ContentProvider
result'
ContentProvider -> IO ContentProvider
forall (m :: * -> *) a. Monad m => a -> m a
return ContentProvider
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
Maybe ContentProvider -> IO (Maybe ContentProvider)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ContentProvider
maybeResult
#if defined(ENABLE_OVERLOADING)
data DragSourceGetContentMethodInfo
instance (signature ~ (m (Maybe Gdk.ContentProvider.ContentProvider)), MonadIO m, IsDragSource a) => O.OverloadedMethod DragSourceGetContentMethodInfo a signature where
overloadedMethod = dragSourceGetContent
instance O.OverloadedMethodInfo DragSourceGetContentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.dragSourceGetContent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#v:dragSourceGetContent"
})
#endif
foreign import ccall "gtk_drag_source_get_drag" gtk_drag_source_get_drag ::
Ptr DragSource ->
IO (Ptr Gdk.Drag.Drag)
dragSourceGetDrag ::
(B.CallStack.HasCallStack, MonadIO m, IsDragSource a) =>
a
-> m (Maybe Gdk.Drag.Drag)
dragSourceGetDrag :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDragSource a) =>
a -> m (Maybe Drag)
dragSourceGetDrag a
source = IO (Maybe Drag) -> m (Maybe Drag)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Drag) -> m (Maybe Drag))
-> IO (Maybe Drag) -> m (Maybe Drag)
forall a b. (a -> b) -> a -> b
$ do
Ptr DragSource
source' <- a -> IO (Ptr DragSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
Ptr Drag
result <- Ptr DragSource -> IO (Ptr Drag)
gtk_drag_source_get_drag Ptr DragSource
source'
Maybe Drag
maybeResult <- Ptr Drag -> (Ptr Drag -> IO Drag) -> IO (Maybe Drag)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Drag
result ((Ptr Drag -> IO Drag) -> IO (Maybe Drag))
-> (Ptr Drag -> IO Drag) -> IO (Maybe Drag)
forall a b. (a -> b) -> a -> b
$ \Ptr Drag
result' -> do
Drag
result'' <- ((ManagedPtr Drag -> Drag) -> Ptr Drag -> IO Drag
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Drag -> Drag
Gdk.Drag.Drag) Ptr Drag
result'
Drag -> IO Drag
forall (m :: * -> *) a. Monad m => a -> m a
return Drag
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
Maybe Drag -> IO (Maybe Drag)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Drag
maybeResult
#if defined(ENABLE_OVERLOADING)
data DragSourceGetDragMethodInfo
instance (signature ~ (m (Maybe Gdk.Drag.Drag)), MonadIO m, IsDragSource a) => O.OverloadedMethod DragSourceGetDragMethodInfo a signature where
overloadedMethod = dragSourceGetDrag
instance O.OverloadedMethodInfo DragSourceGetDragMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.dragSourceGetDrag",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#v:dragSourceGetDrag"
})
#endif
foreign import ccall "gtk_drag_source_set_actions" gtk_drag_source_set_actions ::
Ptr DragSource ->
CUInt ->
IO ()
dragSourceSetActions ::
(B.CallStack.HasCallStack, MonadIO m, IsDragSource a) =>
a
-> [Gdk.Flags.DragAction]
-> m ()
dragSourceSetActions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDragSource a) =>
a -> [DragAction] -> m ()
dragSourceSetActions a
source [DragAction]
actions = 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 DragSource
source' <- a -> IO (Ptr DragSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
let actions' :: CUInt
actions' = [DragAction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DragAction]
actions
Ptr DragSource -> CUInt -> IO ()
gtk_drag_source_set_actions Ptr DragSource
source' CUInt
actions'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DragSourceSetActionsMethodInfo
instance (signature ~ ([Gdk.Flags.DragAction] -> m ()), MonadIO m, IsDragSource a) => O.OverloadedMethod DragSourceSetActionsMethodInfo a signature where
overloadedMethod = dragSourceSetActions
instance O.OverloadedMethodInfo DragSourceSetActionsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.dragSourceSetActions",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#v:dragSourceSetActions"
})
#endif
foreign import ccall "gtk_drag_source_set_content" gtk_drag_source_set_content ::
Ptr DragSource ->
Ptr Gdk.ContentProvider.ContentProvider ->
IO ()
dragSourceSetContent ::
(B.CallStack.HasCallStack, MonadIO m, IsDragSource a, Gdk.ContentProvider.IsContentProvider b) =>
a
-> Maybe (b)
-> m ()
dragSourceSetContent :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDragSource a, IsContentProvider b) =>
a -> Maybe b -> m ()
dragSourceSetContent a
source Maybe b
content = 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 DragSource
source' <- a -> IO (Ptr DragSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
Ptr ContentProvider
maybeContent <- case Maybe b
content of
Maybe b
Nothing -> Ptr ContentProvider -> IO (Ptr ContentProvider)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ContentProvider
forall a. Ptr a
nullPtr
Just b
jContent -> do
Ptr ContentProvider
jContent' <- b -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jContent
Ptr ContentProvider -> IO (Ptr ContentProvider)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ContentProvider
jContent'
Ptr DragSource -> Ptr ContentProvider -> IO ()
gtk_drag_source_set_content Ptr DragSource
source' Ptr ContentProvider
maybeContent
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
content b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DragSourceSetContentMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsDragSource a, Gdk.ContentProvider.IsContentProvider b) => O.OverloadedMethod DragSourceSetContentMethodInfo a signature where
overloadedMethod = dragSourceSetContent
instance O.OverloadedMethodInfo DragSourceSetContentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.dragSourceSetContent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#v:dragSourceSetContent"
})
#endif
foreign import ccall "gtk_drag_source_set_icon" gtk_drag_source_set_icon ::
Ptr DragSource ->
Ptr Gdk.Paintable.Paintable ->
Int32 ->
Int32 ->
IO ()
dragSourceSetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsDragSource a, Gdk.Paintable.IsPaintable b) =>
a
-> Maybe (b)
-> Int32
-> Int32
-> m ()
dragSourceSetIcon :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDragSource a, IsPaintable b) =>
a -> Maybe b -> Int32 -> Int32 -> m ()
dragSourceSetIcon a
source Maybe b
paintable 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 DragSource
source' <- a -> IO (Ptr DragSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
Ptr Paintable
maybePaintable <- case Maybe b
paintable of
Maybe b
Nothing -> Ptr Paintable -> IO (Ptr Paintable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Paintable
forall a. Ptr a
nullPtr
Just b
jPaintable -> do
Ptr Paintable
jPaintable' <- b -> IO (Ptr Paintable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jPaintable
Ptr Paintable -> IO (Ptr Paintable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Paintable
jPaintable'
Ptr DragSource -> Ptr Paintable -> Int32 -> Int32 -> IO ()
gtk_drag_source_set_icon Ptr DragSource
source' Ptr Paintable
maybePaintable Int32
hotX Int32
hotY
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
paintable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DragSourceSetIconMethodInfo
instance (signature ~ (Maybe (b) -> Int32 -> Int32 -> m ()), MonadIO m, IsDragSource a, Gdk.Paintable.IsPaintable b) => O.OverloadedMethod DragSourceSetIconMethodInfo a signature where
overloadedMethod = dragSourceSetIcon
instance O.OverloadedMethodInfo DragSourceSetIconMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.DragSource.dragSourceSetIcon",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.5/docs/GI-Gtk-Objects-DragSource.html#v:dragSourceSetIcon"
})
#endif