{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Drag
(
Drag(..) ,
IsDrag ,
toDrag ,
noDrag ,
#if defined(ENABLE_OVERLOADING)
ResolveDragMethod ,
#endif
dragBegin ,
#if defined(ENABLE_OVERLOADING)
DragDropDoneMethodInfo ,
#endif
dragDropDone ,
#if defined(ENABLE_OVERLOADING)
DragGetActionsMethodInfo ,
#endif
dragGetActions ,
#if defined(ENABLE_OVERLOADING)
DragGetDeviceMethodInfo ,
#endif
dragGetDevice ,
#if defined(ENABLE_OVERLOADING)
DragGetDisplayMethodInfo ,
#endif
dragGetDisplay ,
#if defined(ENABLE_OVERLOADING)
DragGetDragSurfaceMethodInfo ,
#endif
dragGetDragSurface ,
#if defined(ENABLE_OVERLOADING)
DragGetFormatsMethodInfo ,
#endif
dragGetFormats ,
#if defined(ENABLE_OVERLOADING)
DragGetSelectedActionMethodInfo ,
#endif
dragGetSelectedAction ,
#if defined(ENABLE_OVERLOADING)
DragSetHotspotMethodInfo ,
#endif
dragSetHotspot ,
#if defined(ENABLE_OVERLOADING)
DragActionsPropertyInfo ,
#endif
constructDragActions ,
#if defined(ENABLE_OVERLOADING)
dragActions ,
#endif
getDragActions ,
setDragActions ,
#if defined(ENABLE_OVERLOADING)
DragContentPropertyInfo ,
#endif
constructDragContent ,
#if defined(ENABLE_OVERLOADING)
dragContent ,
#endif
getDragContent ,
#if defined(ENABLE_OVERLOADING)
DragDevicePropertyInfo ,
#endif
constructDragDevice ,
#if defined(ENABLE_OVERLOADING)
dragDevice ,
#endif
getDragDevice ,
#if defined(ENABLE_OVERLOADING)
DragDisplayPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
dragDisplay ,
#endif
getDragDisplay ,
#if defined(ENABLE_OVERLOADING)
DragFormatsPropertyInfo ,
#endif
constructDragFormats ,
#if defined(ENABLE_OVERLOADING)
dragFormats ,
#endif
getDragFormats ,
#if defined(ENABLE_OVERLOADING)
DragSelectedActionPropertyInfo ,
#endif
constructDragSelectedAction ,
#if defined(ENABLE_OVERLOADING)
dragSelectedAction ,
#endif
getDragSelectedAction ,
setDragSelectedAction ,
#if defined(ENABLE_OVERLOADING)
DragSurfacePropertyInfo ,
#endif
constructDragSurface ,
#if defined(ENABLE_OVERLOADING)
dragSurface ,
#endif
getDragSurface ,
C_DragCancelCallback ,
DragCancelCallback ,
#if defined(ENABLE_OVERLOADING)
DragCancelSignalInfo ,
#endif
afterDragCancel ,
genClosure_DragCancel ,
mk_DragCancelCallback ,
noDragCancelCallback ,
onDragCancel ,
wrap_DragCancelCallback ,
C_DragDndFinishedCallback ,
DragDndFinishedCallback ,
#if defined(ENABLE_OVERLOADING)
DragDndFinishedSignalInfo ,
#endif
afterDragDndFinished ,
genClosure_DragDndFinished ,
mk_DragDndFinishedCallback ,
noDragDndFinishedCallback ,
onDragDndFinished ,
wrap_DragDndFinishedCallback ,
C_DragDropPerformedCallback ,
DragDropPerformedCallback ,
#if defined(ENABLE_OVERLOADING)
DragDropPerformedSignalInfo ,
#endif
afterDragDropPerformed ,
genClosure_DragDropPerformed ,
mk_DragDropPerformedCallback ,
noDragDropPerformedCallback ,
onDragDropPerformed ,
wrap_DragDropPerformedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.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 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.ContentProvider as Gdk.ContentProvider
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
newtype Drag = Drag (ManagedPtr Drag)
deriving (Drag -> Drag -> Bool
(Drag -> Drag -> Bool) -> (Drag -> Drag -> Bool) -> Eq Drag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Drag -> Drag -> Bool
$c/= :: Drag -> Drag -> Bool
== :: Drag -> Drag -> Bool
$c== :: Drag -> Drag -> Bool
Eq)
foreign import ccall "gdk_drag_get_type"
c_gdk_drag_get_type :: IO GType
instance GObject Drag where
gobjectType :: IO GType
gobjectType = IO GType
c_gdk_drag_get_type
instance B.GValue.IsGValue Drag where
toGValue :: Drag -> IO GValue
toGValue o :: Drag
o = do
GType
gtype <- IO GType
c_gdk_drag_get_type
Drag -> (Ptr Drag -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Drag
o (GType -> (GValue -> Ptr Drag -> IO ()) -> Ptr Drag -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Drag -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Drag
fromGValue gv :: GValue
gv = do
Ptr Drag
ptr <- GValue -> IO (Ptr Drag)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Drag)
(ManagedPtr Drag -> Drag) -> Ptr Drag -> IO Drag
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Drag -> Drag
Drag Ptr Drag
ptr
class (GObject o, O.IsDescendantOf Drag o) => IsDrag o
instance (GObject o, O.IsDescendantOf Drag o) => IsDrag o
instance O.HasParentTypes Drag
type instance O.ParentTypes Drag = '[GObject.Object.Object]
toDrag :: (MonadIO m, IsDrag o) => o -> m Drag
toDrag :: o -> m Drag
toDrag = IO Drag -> m Drag
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Drag -> m Drag) -> (o -> IO Drag) -> o -> m Drag
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Drag -> Drag) -> o -> IO Drag
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Drag -> Drag
Drag
noDrag :: Maybe Drag
noDrag :: Maybe Drag
noDrag = Maybe Drag
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDragMethod (t :: Symbol) (o :: *) :: * where
ResolveDragMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDragMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDragMethod "dropDone" o = DragDropDoneMethodInfo
ResolveDragMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDragMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDragMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDragMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDragMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDragMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDragMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDragMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDragMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDragMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDragMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDragMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDragMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDragMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDragMethod "getActions" o = DragGetActionsMethodInfo
ResolveDragMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDragMethod "getDevice" o = DragGetDeviceMethodInfo
ResolveDragMethod "getDisplay" o = DragGetDisplayMethodInfo
ResolveDragMethod "getDragSurface" o = DragGetDragSurfaceMethodInfo
ResolveDragMethod "getFormats" o = DragGetFormatsMethodInfo
ResolveDragMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDragMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDragMethod "getSelectedAction" o = DragGetSelectedActionMethodInfo
ResolveDragMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDragMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDragMethod "setHotspot" o = DragSetHotspotMethodInfo
ResolveDragMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDragMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDragMethod t Drag, O.MethodInfo info Drag p) => OL.IsLabel t (Drag -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type DragCancelCallback =
Gdk.Enums.DragCancelReason
-> IO ()
noDragCancelCallback :: Maybe DragCancelCallback
noDragCancelCallback :: Maybe DragCancelCallback
noDragCancelCallback = Maybe DragCancelCallback
forall a. Maybe a
Nothing
type C_DragCancelCallback =
Ptr () ->
CUInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragCancelCallback :: C_DragCancelCallback -> IO (FunPtr C_DragCancelCallback)
genClosure_DragCancel :: MonadIO m => DragCancelCallback -> m (GClosure C_DragCancelCallback)
genClosure_DragCancel :: DragCancelCallback -> m (GClosure C_DragCancelCallback)
genClosure_DragCancel cb :: DragCancelCallback
cb = IO (GClosure C_DragCancelCallback)
-> m (GClosure C_DragCancelCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DragCancelCallback)
-> m (GClosure C_DragCancelCallback))
-> IO (GClosure C_DragCancelCallback)
-> m (GClosure C_DragCancelCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragCancelCallback
cb' = DragCancelCallback -> C_DragCancelCallback
wrap_DragCancelCallback DragCancelCallback
cb
C_DragCancelCallback -> IO (FunPtr C_DragCancelCallback)
mk_DragCancelCallback C_DragCancelCallback
cb' IO (FunPtr C_DragCancelCallback)
-> (FunPtr C_DragCancelCallback
-> IO (GClosure C_DragCancelCallback))
-> IO (GClosure C_DragCancelCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DragCancelCallback -> IO (GClosure C_DragCancelCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DragCancelCallback ::
DragCancelCallback ->
C_DragCancelCallback
wrap_DragCancelCallback :: DragCancelCallback -> C_DragCancelCallback
wrap_DragCancelCallback _cb :: DragCancelCallback
_cb _ reason :: CUInt
reason _ = 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
DragCancelCallback
_cb DragCancelReason
reason'
onDragCancel :: (IsDrag a, MonadIO m) => a -> DragCancelCallback -> m SignalHandlerId
onDragCancel :: a -> DragCancelCallback -> m SignalHandlerId
onDragCancel obj :: a
obj cb :: DragCancelCallback
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_DragCancelCallback
cb' = DragCancelCallback -> C_DragCancelCallback
wrap_DragCancelCallback DragCancelCallback
cb
FunPtr C_DragCancelCallback
cb'' <- C_DragCancelCallback -> IO (FunPtr C_DragCancelCallback)
mk_DragCancelCallback C_DragCancelCallback
cb'
a
-> Text
-> FunPtr C_DragCancelCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "cancel" FunPtr C_DragCancelCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragCancel :: (IsDrag a, MonadIO m) => a -> DragCancelCallback -> m SignalHandlerId
afterDragCancel :: a -> DragCancelCallback -> m SignalHandlerId
afterDragCancel obj :: a
obj cb :: DragCancelCallback
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_DragCancelCallback
cb' = DragCancelCallback -> C_DragCancelCallback
wrap_DragCancelCallback DragCancelCallback
cb
FunPtr C_DragCancelCallback
cb'' <- C_DragCancelCallback -> IO (FunPtr C_DragCancelCallback)
mk_DragCancelCallback C_DragCancelCallback
cb'
a
-> Text
-> FunPtr C_DragCancelCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "cancel" FunPtr C_DragCancelCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragCancelSignalInfo
instance SignalInfo DragCancelSignalInfo where
type HaskellCallbackType DragCancelSignalInfo = DragCancelCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragCancelCallback cb
cb'' <- mk_DragCancelCallback cb'
connectSignalFunPtr obj "cancel" cb'' connectMode detail
#endif
type DragDndFinishedCallback =
IO ()
noDragDndFinishedCallback :: Maybe DragDndFinishedCallback
noDragDndFinishedCallback :: Maybe (IO ())
noDragDndFinishedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_DragDndFinishedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragDndFinishedCallback :: C_DragDndFinishedCallback -> IO (FunPtr C_DragDndFinishedCallback)
genClosure_DragDndFinished :: MonadIO m => DragDndFinishedCallback -> m (GClosure C_DragDndFinishedCallback)
genClosure_DragDndFinished :: IO () -> m (GClosure C_DragDndFinishedCallback)
genClosure_DragDndFinished cb :: IO ()
cb = IO (GClosure C_DragDndFinishedCallback)
-> m (GClosure C_DragDndFinishedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DragDndFinishedCallback)
-> m (GClosure C_DragDndFinishedCallback))
-> IO (GClosure C_DragDndFinishedCallback)
-> m (GClosure C_DragDndFinishedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragDndFinishedCallback
cb' = IO () -> C_DragDndFinishedCallback
wrap_DragDndFinishedCallback IO ()
cb
C_DragDndFinishedCallback -> IO (FunPtr C_DragDndFinishedCallback)
mk_DragDndFinishedCallback C_DragDndFinishedCallback
cb' IO (FunPtr C_DragDndFinishedCallback)
-> (FunPtr C_DragDndFinishedCallback
-> IO (GClosure C_DragDndFinishedCallback))
-> IO (GClosure C_DragDndFinishedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DragDndFinishedCallback
-> IO (GClosure C_DragDndFinishedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DragDndFinishedCallback ::
DragDndFinishedCallback ->
C_DragDndFinishedCallback
wrap_DragDndFinishedCallback :: IO () -> C_DragDndFinishedCallback
wrap_DragDndFinishedCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onDragDndFinished :: (IsDrag a, MonadIO m) => a -> DragDndFinishedCallback -> m SignalHandlerId
onDragDndFinished :: a -> IO () -> m SignalHandlerId
onDragDndFinished obj :: a
obj cb :: 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_DragDndFinishedCallback
cb' = IO () -> C_DragDndFinishedCallback
wrap_DragDndFinishedCallback IO ()
cb
FunPtr C_DragDndFinishedCallback
cb'' <- C_DragDndFinishedCallback -> IO (FunPtr C_DragDndFinishedCallback)
mk_DragDndFinishedCallback C_DragDndFinishedCallback
cb'
a
-> Text
-> FunPtr C_DragDndFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "dnd-finished" FunPtr C_DragDndFinishedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragDndFinished :: (IsDrag a, MonadIO m) => a -> DragDndFinishedCallback -> m SignalHandlerId
afterDragDndFinished :: a -> IO () -> m SignalHandlerId
afterDragDndFinished obj :: a
obj cb :: 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_DragDndFinishedCallback
cb' = IO () -> C_DragDndFinishedCallback
wrap_DragDndFinishedCallback IO ()
cb
FunPtr C_DragDndFinishedCallback
cb'' <- C_DragDndFinishedCallback -> IO (FunPtr C_DragDndFinishedCallback)
mk_DragDndFinishedCallback C_DragDndFinishedCallback
cb'
a
-> Text
-> FunPtr C_DragDndFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "dnd-finished" FunPtr C_DragDndFinishedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragDndFinishedSignalInfo
instance SignalInfo DragDndFinishedSignalInfo where
type HaskellCallbackType DragDndFinishedSignalInfo = DragDndFinishedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragDndFinishedCallback cb
cb'' <- mk_DragDndFinishedCallback cb'
connectSignalFunPtr obj "dnd-finished" cb'' connectMode detail
#endif
type DragDropPerformedCallback =
IO ()
noDragDropPerformedCallback :: Maybe DragDropPerformedCallback
noDragDropPerformedCallback :: Maybe (IO ())
noDragDropPerformedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_DragDropPerformedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DragDropPerformedCallback :: C_DragDropPerformedCallback -> IO (FunPtr C_DragDropPerformedCallback)
genClosure_DragDropPerformed :: MonadIO m => DragDropPerformedCallback -> m (GClosure C_DragDropPerformedCallback)
genClosure_DragDropPerformed :: IO () -> m (GClosure C_DragDndFinishedCallback)
genClosure_DragDropPerformed cb :: IO ()
cb = IO (GClosure C_DragDndFinishedCallback)
-> m (GClosure C_DragDndFinishedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DragDndFinishedCallback)
-> m (GClosure C_DragDndFinishedCallback))
-> IO (GClosure C_DragDndFinishedCallback)
-> m (GClosure C_DragDndFinishedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DragDndFinishedCallback
cb' = IO () -> C_DragDndFinishedCallback
wrap_DragDropPerformedCallback IO ()
cb
C_DragDndFinishedCallback -> IO (FunPtr C_DragDndFinishedCallback)
mk_DragDropPerformedCallback C_DragDndFinishedCallback
cb' IO (FunPtr C_DragDndFinishedCallback)
-> (FunPtr C_DragDndFinishedCallback
-> IO (GClosure C_DragDndFinishedCallback))
-> IO (GClosure C_DragDndFinishedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DragDndFinishedCallback
-> IO (GClosure C_DragDndFinishedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DragDropPerformedCallback ::
DragDropPerformedCallback ->
C_DragDropPerformedCallback
wrap_DragDropPerformedCallback :: IO () -> C_DragDndFinishedCallback
wrap_DragDropPerformedCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onDragDropPerformed :: (IsDrag a, MonadIO m) => a -> DragDropPerformedCallback -> m SignalHandlerId
onDragDropPerformed :: a -> IO () -> m SignalHandlerId
onDragDropPerformed obj :: a
obj cb :: 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_DragDndFinishedCallback
cb' = IO () -> C_DragDndFinishedCallback
wrap_DragDropPerformedCallback IO ()
cb
FunPtr C_DragDndFinishedCallback
cb'' <- C_DragDndFinishedCallback -> IO (FunPtr C_DragDndFinishedCallback)
mk_DragDropPerformedCallback C_DragDndFinishedCallback
cb'
a
-> Text
-> FunPtr C_DragDndFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "drop-performed" FunPtr C_DragDndFinishedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDragDropPerformed :: (IsDrag a, MonadIO m) => a -> DragDropPerformedCallback -> m SignalHandlerId
afterDragDropPerformed :: a -> IO () -> m SignalHandlerId
afterDragDropPerformed obj :: a
obj cb :: 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_DragDndFinishedCallback
cb' = IO () -> C_DragDndFinishedCallback
wrap_DragDropPerformedCallback IO ()
cb
FunPtr C_DragDndFinishedCallback
cb'' <- C_DragDndFinishedCallback -> IO (FunPtr C_DragDndFinishedCallback)
mk_DragDropPerformedCallback C_DragDndFinishedCallback
cb'
a
-> Text
-> FunPtr C_DragDndFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "drop-performed" FunPtr C_DragDndFinishedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DragDropPerformedSignalInfo
instance SignalInfo DragDropPerformedSignalInfo where
type HaskellCallbackType DragDropPerformedSignalInfo = DragDropPerformedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DragDropPerformedCallback cb
cb'' <- mk_DragDropPerformedCallback cb'
connectSignalFunPtr obj "drop-performed" cb'' connectMode detail
#endif
getDragActions :: (MonadIO m, IsDrag o) => o -> m [Gdk.Flags.DragAction]
getDragActions :: o -> m [DragAction]
getDragActions obj :: o
obj = 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
$ o -> String -> IO [DragAction]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj "actions"
setDragActions :: (MonadIO m, IsDrag o) => o -> [Gdk.Flags.DragAction] -> m ()
setDragActions :: o -> [DragAction] -> m ()
setDragActions obj :: o
obj val :: [DragAction]
val = 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 -> [DragAction] -> IO ()
forall a b.
(IsGFlag b, BoxedFlags b, GObject a) =>
a -> String -> [b] -> IO ()
B.Properties.setObjectPropertyFlags o
obj "actions" [DragAction]
val
constructDragActions :: (IsDrag o) => [Gdk.Flags.DragAction] -> IO (GValueConstruct o)
constructDragActions :: [DragAction] -> IO (GValueConstruct o)
constructDragActions val :: [DragAction]
val = String -> [DragAction] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags "actions" [DragAction]
val
#if defined(ENABLE_OVERLOADING)
data DragActionsPropertyInfo
instance AttrInfo DragActionsPropertyInfo where
type AttrAllowedOps DragActionsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DragActionsPropertyInfo = IsDrag
type AttrSetTypeConstraint DragActionsPropertyInfo = (~) [Gdk.Flags.DragAction]
type AttrTransferTypeConstraint DragActionsPropertyInfo = (~) [Gdk.Flags.DragAction]
type AttrTransferType DragActionsPropertyInfo = [Gdk.Flags.DragAction]
type AttrGetType DragActionsPropertyInfo = [Gdk.Flags.DragAction]
type AttrLabel DragActionsPropertyInfo = "actions"
type AttrOrigin DragActionsPropertyInfo = Drag
attrGet = getDragActions
attrSet = setDragActions
attrTransfer _ v = do
return v
attrConstruct = constructDragActions
attrClear = undefined
#endif
getDragContent :: (MonadIO m, IsDrag o) => o -> m (Maybe Gdk.ContentProvider.ContentProvider)
getDragContent :: o -> m (Maybe ContentProvider)
getDragContent obj :: o
obj = 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
$ 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 "content" ManagedPtr ContentProvider -> ContentProvider
Gdk.ContentProvider.ContentProvider
constructDragContent :: (IsDrag o, Gdk.ContentProvider.IsContentProvider a) => a -> IO (GValueConstruct o)
constructDragContent :: a -> IO (GValueConstruct o)
constructDragContent val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "content" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data DragContentPropertyInfo
instance AttrInfo DragContentPropertyInfo where
type AttrAllowedOps DragContentPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DragContentPropertyInfo = IsDrag
type AttrSetTypeConstraint DragContentPropertyInfo = Gdk.ContentProvider.IsContentProvider
type AttrTransferTypeConstraint DragContentPropertyInfo = Gdk.ContentProvider.IsContentProvider
type AttrTransferType DragContentPropertyInfo = Gdk.ContentProvider.ContentProvider
type AttrGetType DragContentPropertyInfo = (Maybe Gdk.ContentProvider.ContentProvider)
type AttrLabel DragContentPropertyInfo = "content"
type AttrOrigin DragContentPropertyInfo = Drag
attrGet = getDragContent
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.ContentProvider.ContentProvider v
attrConstruct = constructDragContent
attrClear = undefined
#endif
getDragDevice :: (MonadIO m, IsDrag o) => o -> m Gdk.Device.Device
getDragDevice :: o -> m Device
getDragDevice obj :: o
obj = 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
$ Text -> IO (Maybe Device) -> IO Device
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getDragDevice" (IO (Maybe Device) -> IO Device) -> IO (Maybe Device) -> IO Device
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Device -> Device) -> IO (Maybe Device)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "device" ManagedPtr Device -> Device
Gdk.Device.Device
constructDragDevice :: (IsDrag o, Gdk.Device.IsDevice a) => a -> IO (GValueConstruct o)
constructDragDevice :: a -> IO (GValueConstruct o)
constructDragDevice val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "device" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data DragDevicePropertyInfo
instance AttrInfo DragDevicePropertyInfo where
type AttrAllowedOps DragDevicePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DragDevicePropertyInfo = IsDrag
type AttrSetTypeConstraint DragDevicePropertyInfo = Gdk.Device.IsDevice
type AttrTransferTypeConstraint DragDevicePropertyInfo = Gdk.Device.IsDevice
type AttrTransferType DragDevicePropertyInfo = Gdk.Device.Device
type AttrGetType DragDevicePropertyInfo = Gdk.Device.Device
type AttrLabel DragDevicePropertyInfo = "device"
type AttrOrigin DragDevicePropertyInfo = Drag
attrGet = getDragDevice
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Device.Device v
attrConstruct = constructDragDevice
attrClear = undefined
#endif
getDragDisplay :: (MonadIO m, IsDrag o) => o -> m Gdk.Display.Display
getDragDisplay :: o -> m Display
getDragDisplay obj :: o
obj = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Display) -> IO Display
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getDragDisplay" (IO (Maybe Display) -> IO Display)
-> IO (Maybe Display) -> IO Display
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Display -> Display) -> IO (Maybe Display)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "display" ManagedPtr Display -> Display
Gdk.Display.Display
#if defined(ENABLE_OVERLOADING)
data DragDisplayPropertyInfo
instance AttrInfo DragDisplayPropertyInfo where
type AttrAllowedOps DragDisplayPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DragDisplayPropertyInfo = IsDrag
type AttrSetTypeConstraint DragDisplayPropertyInfo = (~) ()
type AttrTransferTypeConstraint DragDisplayPropertyInfo = (~) ()
type AttrTransferType DragDisplayPropertyInfo = ()
type AttrGetType DragDisplayPropertyInfo = Gdk.Display.Display
type AttrLabel DragDisplayPropertyInfo = "display"
type AttrOrigin DragDisplayPropertyInfo = Drag
attrGet = getDragDisplay
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDragFormats :: (MonadIO m, IsDrag o) => o -> m Gdk.ContentFormats.ContentFormats
getDragFormats :: o -> m ContentFormats
getDragFormats obj :: o
obj = IO ContentFormats -> m ContentFormats
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe ContentFormats) -> IO ContentFormats
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getDragFormats" (IO (Maybe ContentFormats) -> IO ContentFormats)
-> IO (Maybe ContentFormats) -> IO ContentFormats
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr ContentFormats -> ContentFormats)
-> IO (Maybe ContentFormats)
forall a b.
(GObject a, BoxedObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj "formats" ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats
constructDragFormats :: (IsDrag o) => Gdk.ContentFormats.ContentFormats -> IO (GValueConstruct o)
constructDragFormats :: ContentFormats -> IO (GValueConstruct o)
constructDragFormats val :: ContentFormats
val = String -> Maybe ContentFormats -> IO (GValueConstruct o)
forall a o.
BoxedObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed "formats" (ContentFormats -> Maybe ContentFormats
forall a. a -> Maybe a
Just ContentFormats
val)
#if defined(ENABLE_OVERLOADING)
data DragFormatsPropertyInfo
instance AttrInfo DragFormatsPropertyInfo where
type AttrAllowedOps DragFormatsPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DragFormatsPropertyInfo = IsDrag
type AttrSetTypeConstraint DragFormatsPropertyInfo = (~) Gdk.ContentFormats.ContentFormats
type AttrTransferTypeConstraint DragFormatsPropertyInfo = (~) Gdk.ContentFormats.ContentFormats
type AttrTransferType DragFormatsPropertyInfo = Gdk.ContentFormats.ContentFormats
type AttrGetType DragFormatsPropertyInfo = Gdk.ContentFormats.ContentFormats
type AttrLabel DragFormatsPropertyInfo = "formats"
type AttrOrigin DragFormatsPropertyInfo = Drag
attrGet = getDragFormats
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDragFormats
attrClear = undefined
#endif
getDragSelectedAction :: (MonadIO m, IsDrag o) => o -> m [Gdk.Flags.DragAction]
getDragSelectedAction :: o -> m [DragAction]
getDragSelectedAction obj :: o
obj = 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
$ o -> String -> IO [DragAction]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj "selected-action"
setDragSelectedAction :: (MonadIO m, IsDrag o) => o -> [Gdk.Flags.DragAction] -> m ()
setDragSelectedAction :: o -> [DragAction] -> m ()
setDragSelectedAction obj :: o
obj val :: [DragAction]
val = 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 -> [DragAction] -> IO ()
forall a b.
(IsGFlag b, BoxedFlags b, GObject a) =>
a -> String -> [b] -> IO ()
B.Properties.setObjectPropertyFlags o
obj "selected-action" [DragAction]
val
constructDragSelectedAction :: (IsDrag o) => [Gdk.Flags.DragAction] -> IO (GValueConstruct o)
constructDragSelectedAction :: [DragAction] -> IO (GValueConstruct o)
constructDragSelectedAction val :: [DragAction]
val = String -> [DragAction] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags "selected-action" [DragAction]
val
#if defined(ENABLE_OVERLOADING)
data DragSelectedActionPropertyInfo
instance AttrInfo DragSelectedActionPropertyInfo where
type AttrAllowedOps DragSelectedActionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DragSelectedActionPropertyInfo = IsDrag
type AttrSetTypeConstraint DragSelectedActionPropertyInfo = (~) [Gdk.Flags.DragAction]
type AttrTransferTypeConstraint DragSelectedActionPropertyInfo = (~) [Gdk.Flags.DragAction]
type AttrTransferType DragSelectedActionPropertyInfo = [Gdk.Flags.DragAction]
type AttrGetType DragSelectedActionPropertyInfo = [Gdk.Flags.DragAction]
type AttrLabel DragSelectedActionPropertyInfo = "selected-action"
type AttrOrigin DragSelectedActionPropertyInfo = Drag
attrGet = getDragSelectedAction
attrSet = setDragSelectedAction
attrTransfer _ v = do
return v
attrConstruct = constructDragSelectedAction
attrClear = undefined
#endif
getDragSurface :: (MonadIO m, IsDrag o) => o -> m (Maybe Gdk.Surface.Surface)
getDragSurface :: o -> m (Maybe Surface)
getDragSurface obj :: o
obj = IO (Maybe Surface) -> m (Maybe Surface)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Surface) -> m (Maybe Surface))
-> IO (Maybe Surface) -> m (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Surface -> Surface) -> IO (Maybe Surface)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "surface" ManagedPtr Surface -> Surface
Gdk.Surface.Surface
constructDragSurface :: (IsDrag o, Gdk.Surface.IsSurface a) => a -> IO (GValueConstruct o)
constructDragSurface :: a -> IO (GValueConstruct o)
constructDragSurface val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "surface" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if defined(ENABLE_OVERLOADING)
data DragSurfacePropertyInfo
instance AttrInfo DragSurfacePropertyInfo where
type AttrAllowedOps DragSurfacePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DragSurfacePropertyInfo = IsDrag
type AttrSetTypeConstraint DragSurfacePropertyInfo = Gdk.Surface.IsSurface
type AttrTransferTypeConstraint DragSurfacePropertyInfo = Gdk.Surface.IsSurface
type AttrTransferType DragSurfacePropertyInfo = Gdk.Surface.Surface
type AttrGetType DragSurfacePropertyInfo = (Maybe Gdk.Surface.Surface)
type AttrLabel DragSurfacePropertyInfo = "surface"
type AttrOrigin DragSurfacePropertyInfo = Drag
attrGet = getDragSurface
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Surface.Surface v
attrConstruct = constructDragSurface
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Drag
type instance O.AttributeList Drag = DragAttributeList
type DragAttributeList = ('[ '("actions", DragActionsPropertyInfo), '("content", DragContentPropertyInfo), '("device", DragDevicePropertyInfo), '("display", DragDisplayPropertyInfo), '("formats", DragFormatsPropertyInfo), '("selectedAction", DragSelectedActionPropertyInfo), '("surface", DragSurfacePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
dragActions :: AttrLabelProxy "actions"
dragActions = AttrLabelProxy
dragContent :: AttrLabelProxy "content"
dragContent = AttrLabelProxy
dragDevice :: AttrLabelProxy "device"
dragDevice = AttrLabelProxy
dragDisplay :: AttrLabelProxy "display"
dragDisplay = AttrLabelProxy
dragFormats :: AttrLabelProxy "formats"
dragFormats = AttrLabelProxy
dragSelectedAction :: AttrLabelProxy "selectedAction"
dragSelectedAction = AttrLabelProxy
dragSurface :: AttrLabelProxy "surface"
dragSurface = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Drag = DragSignalList
type DragSignalList = ('[ '("cancel", DragCancelSignalInfo), '("dndFinished", DragDndFinishedSignalInfo), '("dropPerformed", DragDropPerformedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_drag_drop_done" gdk_drag_drop_done ::
Ptr Drag ->
CInt ->
IO ()
dragDropDone ::
(B.CallStack.HasCallStack, MonadIO m, IsDrag a) =>
a
-> Bool
-> m ()
dragDropDone :: a -> Bool -> m ()
dragDropDone drag :: a
drag success :: Bool
success = 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 Drag
drag' <- a -> IO (Ptr Drag)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
drag
let success' :: CInt
success' = (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
success
Ptr Drag -> CInt -> IO ()
gdk_drag_drop_done Ptr Drag
drag' CInt
success'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
drag
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DragDropDoneMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsDrag a) => O.MethodInfo DragDropDoneMethodInfo a signature where
overloadedMethod = dragDropDone
#endif
foreign import ccall "gdk_drag_get_actions" gdk_drag_get_actions ::
Ptr Drag ->
IO CUInt
dragGetActions ::
(B.CallStack.HasCallStack, MonadIO m, IsDrag a) =>
a
-> m [Gdk.Flags.DragAction]
dragGetActions :: a -> m [DragAction]
dragGetActions drag :: a
drag = 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 Drag
drag' <- a -> IO (Ptr Drag)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
drag
CUInt
result <- Ptr Drag -> IO CUInt
gdk_drag_get_actions Ptr Drag
drag'
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
drag
[DragAction] -> IO [DragAction]
forall (m :: * -> *) a. Monad m => a -> m a
return [DragAction]
result'
#if defined(ENABLE_OVERLOADING)
data DragGetActionsMethodInfo
instance (signature ~ (m [Gdk.Flags.DragAction]), MonadIO m, IsDrag a) => O.MethodInfo DragGetActionsMethodInfo a signature where
overloadedMethod = dragGetActions
#endif
foreign import ccall "gdk_drag_get_device" gdk_drag_get_device ::
Ptr Drag ->
IO (Ptr Gdk.Device.Device)
dragGetDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsDrag a) =>
a
-> m Gdk.Device.Device
dragGetDevice :: a -> m Device
dragGetDevice drag :: a
drag = 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 Drag
drag' <- a -> IO (Ptr Drag)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
drag
Ptr Device
result <- Ptr Drag -> IO (Ptr Device)
gdk_drag_get_device Ptr Drag
drag'
Text -> Ptr Device -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dragGetDevice" 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
drag
Device -> IO Device
forall (m :: * -> *) a. Monad m => a -> m a
return Device
result'
#if defined(ENABLE_OVERLOADING)
data DragGetDeviceMethodInfo
instance (signature ~ (m Gdk.Device.Device), MonadIO m, IsDrag a) => O.MethodInfo DragGetDeviceMethodInfo a signature where
overloadedMethod = dragGetDevice
#endif
foreign import ccall "gdk_drag_get_display" gdk_drag_get_display ::
Ptr Drag ->
IO (Ptr Gdk.Display.Display)
dragGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsDrag a) =>
a
-> m Gdk.Display.Display
dragGetDisplay :: a -> m Display
dragGetDisplay drag :: a
drag = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ do
Ptr Drag
drag' <- a -> IO (Ptr Drag)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
drag
Ptr Display
result <- Ptr Drag -> IO (Ptr Display)
gdk_drag_get_display Ptr Drag
drag'
Text -> Ptr Display -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dragGetDisplay" Ptr Display
result
Display
result' <- ((ManagedPtr Display -> Display) -> Ptr Display -> IO Display
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Display -> Display
Gdk.Display.Display) Ptr Display
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
drag
Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result'
#if defined(ENABLE_OVERLOADING)
data DragGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsDrag a) => O.MethodInfo DragGetDisplayMethodInfo a signature where
overloadedMethod = dragGetDisplay
#endif
foreign import ccall "gdk_drag_get_drag_surface" gdk_drag_get_drag_surface ::
Ptr Drag ->
IO (Ptr Gdk.Surface.Surface)
dragGetDragSurface ::
(B.CallStack.HasCallStack, MonadIO m, IsDrag a) =>
a
-> m (Maybe Gdk.Surface.Surface)
dragGetDragSurface :: a -> m (Maybe Surface)
dragGetDragSurface drag :: a
drag = IO (Maybe Surface) -> m (Maybe Surface)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Surface) -> m (Maybe Surface))
-> IO (Maybe Surface) -> m (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ do
Ptr Drag
drag' <- a -> IO (Ptr Drag)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
drag
Ptr Surface
result <- Ptr Drag -> IO (Ptr Surface)
gdk_drag_get_drag_surface Ptr Drag
drag'
Maybe Surface
maybeResult <- Ptr Surface -> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Surface
result ((Ptr Surface -> IO Surface) -> IO (Maybe Surface))
-> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Surface
result' -> do
Surface
result'' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Gdk.Surface.Surface) Ptr Surface
result'
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
drag
Maybe Surface -> IO (Maybe Surface)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Surface
maybeResult
#if defined(ENABLE_OVERLOADING)
data DragGetDragSurfaceMethodInfo
instance (signature ~ (m (Maybe Gdk.Surface.Surface)), MonadIO m, IsDrag a) => O.MethodInfo DragGetDragSurfaceMethodInfo a signature where
overloadedMethod = dragGetDragSurface
#endif
foreign import ccall "gdk_drag_get_formats" gdk_drag_get_formats ::
Ptr Drag ->
IO (Ptr Gdk.ContentFormats.ContentFormats)
dragGetFormats ::
(B.CallStack.HasCallStack, MonadIO m, IsDrag a) =>
a
-> m Gdk.ContentFormats.ContentFormats
dragGetFormats :: a -> m ContentFormats
dragGetFormats drag :: a
drag = IO ContentFormats -> m ContentFormats
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr Drag
drag' <- a -> IO (Ptr Drag)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
drag
Ptr ContentFormats
result <- Ptr Drag -> IO (Ptr ContentFormats)
gdk_drag_get_formats Ptr Drag
drag'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dragGetFormats" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats) Ptr ContentFormats
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
drag
ContentFormats -> IO ContentFormats
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data DragGetFormatsMethodInfo
instance (signature ~ (m Gdk.ContentFormats.ContentFormats), MonadIO m, IsDrag a) => O.MethodInfo DragGetFormatsMethodInfo a signature where
overloadedMethod = dragGetFormats
#endif
foreign import ccall "gdk_drag_get_selected_action" gdk_drag_get_selected_action ::
Ptr Drag ->
IO CUInt
dragGetSelectedAction ::
(B.CallStack.HasCallStack, MonadIO m, IsDrag a) =>
a
-> m [Gdk.Flags.DragAction]
dragGetSelectedAction :: a -> m [DragAction]
dragGetSelectedAction drag :: a
drag = 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 Drag
drag' <- a -> IO (Ptr Drag)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
drag
CUInt
result <- Ptr Drag -> IO CUInt
gdk_drag_get_selected_action Ptr Drag
drag'
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
drag
[DragAction] -> IO [DragAction]
forall (m :: * -> *) a. Monad m => a -> m a
return [DragAction]
result'
#if defined(ENABLE_OVERLOADING)
data DragGetSelectedActionMethodInfo
instance (signature ~ (m [Gdk.Flags.DragAction]), MonadIO m, IsDrag a) => O.MethodInfo DragGetSelectedActionMethodInfo a signature where
overloadedMethod = dragGetSelectedAction
#endif
foreign import ccall "gdk_drag_set_hotspot" gdk_drag_set_hotspot ::
Ptr Drag ->
Int32 ->
Int32 ->
IO ()
dragSetHotspot ::
(B.CallStack.HasCallStack, MonadIO m, IsDrag a) =>
a
-> Int32
-> Int32
-> m ()
dragSetHotspot :: a -> Int32 -> Int32 -> m ()
dragSetHotspot drag :: a
drag hotX :: Int32
hotX hotY :: 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 Drag
drag' <- a -> IO (Ptr Drag)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
drag
Ptr Drag -> Int32 -> Int32 -> IO ()
gdk_drag_set_hotspot Ptr Drag
drag' Int32
hotX Int32
hotY
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
drag
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DragSetHotspotMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsDrag a) => O.MethodInfo DragSetHotspotMethodInfo a signature where
overloadedMethod = dragSetHotspot
#endif
foreign import ccall "gdk_drag_begin" gdk_drag_begin ::
Ptr Gdk.Surface.Surface ->
Ptr Gdk.Device.Device ->
Ptr Gdk.ContentProvider.ContentProvider ->
CUInt ->
Int32 ->
Int32 ->
IO (Ptr Drag)
dragBegin ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Surface.IsSurface a, Gdk.Device.IsDevice b, Gdk.ContentProvider.IsContentProvider c) =>
a
-> b
-> c
-> [Gdk.Flags.DragAction]
-> Int32
-> Int32
-> m (Maybe Drag)
dragBegin :: a -> b -> c -> [DragAction] -> Int32 -> Int32 -> m (Maybe Drag)
dragBegin surface :: a
surface device :: b
device content :: c
content actions :: [DragAction]
actions dx :: Int32
dx dy :: Int32
dy = 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 Surface
surface' <- a -> IO (Ptr Surface)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
surface
Ptr Device
device' <- b -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
device
Ptr ContentProvider
content' <- c -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
content
let actions' :: CUInt
actions' = [DragAction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DragAction]
actions
Ptr Drag
result <- Ptr Surface
-> Ptr Device
-> Ptr ContentProvider
-> CUInt
-> Int32
-> Int32
-> IO (Ptr Drag)
gdk_drag_begin Ptr Surface
surface' Ptr Device
device' Ptr ContentProvider
content' CUInt
actions' Int32
dx Int32
dy
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
$ \result' :: 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
wrapObject ManagedPtr Drag -> 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
surface
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
device
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
content
Maybe Drag -> IO (Maybe Drag)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Drag
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif