{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Drop
(
Drop(..) ,
IsDrop ,
toDrop ,
#if defined(ENABLE_OVERLOADING)
ResolveDropMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DropFinishMethodInfo ,
#endif
dropFinish ,
#if defined(ENABLE_OVERLOADING)
DropGetActionsMethodInfo ,
#endif
dropGetActions ,
#if defined(ENABLE_OVERLOADING)
DropGetDeviceMethodInfo ,
#endif
dropGetDevice ,
#if defined(ENABLE_OVERLOADING)
DropGetDisplayMethodInfo ,
#endif
dropGetDisplay ,
#if defined(ENABLE_OVERLOADING)
DropGetDragMethodInfo ,
#endif
dropGetDrag ,
#if defined(ENABLE_OVERLOADING)
DropGetFormatsMethodInfo ,
#endif
dropGetFormats ,
#if defined(ENABLE_OVERLOADING)
DropGetSurfaceMethodInfo ,
#endif
dropGetSurface ,
#if defined(ENABLE_OVERLOADING)
DropReadAsyncMethodInfo ,
#endif
dropReadAsync ,
#if defined(ENABLE_OVERLOADING)
DropReadFinishMethodInfo ,
#endif
dropReadFinish ,
#if defined(ENABLE_OVERLOADING)
DropReadValueAsyncMethodInfo ,
#endif
dropReadValueAsync ,
#if defined(ENABLE_OVERLOADING)
DropReadValueFinishMethodInfo ,
#endif
dropReadValueFinish ,
#if defined(ENABLE_OVERLOADING)
DropStatusMethodInfo ,
#endif
dropStatus ,
#if defined(ENABLE_OVERLOADING)
DropActionsPropertyInfo ,
#endif
constructDropActions ,
#if defined(ENABLE_OVERLOADING)
dropActions ,
#endif
getDropActions ,
#if defined(ENABLE_OVERLOADING)
DropDevicePropertyInfo ,
#endif
constructDropDevice ,
#if defined(ENABLE_OVERLOADING)
dropDevice ,
#endif
getDropDevice ,
#if defined(ENABLE_OVERLOADING)
DropDisplayPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
dropDisplay ,
#endif
getDropDisplay ,
#if defined(ENABLE_OVERLOADING)
DropDragPropertyInfo ,
#endif
constructDropDrag ,
#if defined(ENABLE_OVERLOADING)
dropDrag ,
#endif
getDropDrag ,
#if defined(ENABLE_OVERLOADING)
DropFormatsPropertyInfo ,
#endif
constructDropFormats ,
#if defined(ENABLE_OVERLOADING)
dropFormats ,
#endif
getDropFormats ,
#if defined(ENABLE_OVERLOADING)
DropSurfacePropertyInfo ,
#endif
constructDropSurface ,
#if defined(ENABLE_OVERLOADING)
dropSurface ,
#endif
getDropSurface ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.Cairo.Enums as Cairo.Enums
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Interfaces.Paintable as Gdk.Paintable
import {-# SOURCE #-} qualified GI.Gdk.Objects.AppLaunchContext as Gdk.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.CairoContext as Gdk.CairoContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Clipboard as Gdk.Clipboard
import {-# SOURCE #-} qualified GI.Gdk.Objects.ContentProvider as Gdk.ContentProvider
import {-# SOURCE #-} qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.DeviceTool as Gdk.DeviceTool
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Drag as Gdk.Drag
import {-# SOURCE #-} qualified GI.Gdk.Objects.DrawContext as Gdk.DrawContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Event as Gdk.Event
import {-# SOURCE #-} qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import {-# SOURCE #-} qualified GI.Gdk.Objects.GLContext as Gdk.GLContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Monitor as Gdk.Monitor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Seat as Gdk.Seat
import {-# SOURCE #-} qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import {-# SOURCE #-} qualified GI.Gdk.Objects.Texture as Gdk.Texture
import {-# SOURCE #-} qualified GI.Gdk.Objects.VulkanContext as Gdk.VulkanContext
import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
import {-# SOURCE #-} qualified GI.Gdk.Structs.DmabufFormats as Gdk.DmabufFormats
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventSequence as Gdk.EventSequence
import {-# SOURCE #-} qualified GI.Gdk.Structs.FrameTimings as Gdk.FrameTimings
import {-# SOURCE #-} qualified GI.Gdk.Structs.KeymapKey as Gdk.KeymapKey
import {-# SOURCE #-} qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import {-# SOURCE #-} qualified GI.Gdk.Structs.TimeCoord as Gdk.TimeCoord
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.Gio.Interfaces.LoadableIcon as Gio.LoadableIcon
import qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.Pango.Enums as Pango.Enums
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Drag as Gdk.Drag
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
#endif
newtype Drop = Drop (SP.ManagedPtr Drop)
deriving (Drop -> Drop -> Bool
(Drop -> Drop -> Bool) -> (Drop -> Drop -> Bool) -> Eq Drop
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Drop -> Drop -> Bool
== :: Drop -> Drop -> Bool
$c/= :: Drop -> Drop -> Bool
/= :: Drop -> Drop -> Bool
Eq)
instance SP.ManagedPtrNewtype Drop where
toManagedPtr :: Drop -> ManagedPtr Drop
toManagedPtr (Drop ManagedPtr Drop
p) = ManagedPtr Drop
p
foreign import ccall "gdk_drop_get_type"
c_gdk_drop_get_type :: IO B.Types.GType
instance B.Types.TypedObject Drop where
glibType :: IO GType
glibType = IO GType
c_gdk_drop_get_type
instance B.Types.GObject Drop
class (SP.GObject o, O.IsDescendantOf Drop o) => IsDrop o
instance (SP.GObject o, O.IsDescendantOf Drop o) => IsDrop o
instance O.HasParentTypes Drop
type instance O.ParentTypes Drop = '[GObject.Object.Object]
toDrop :: (MIO.MonadIO m, IsDrop o) => o -> m Drop
toDrop :: forall (m :: * -> *) o. (MonadIO m, IsDrop o) => o -> m Drop
toDrop = IO Drop -> m Drop
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Drop -> m Drop) -> (o -> IO Drop) -> o -> m Drop
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Drop -> Drop) -> o -> IO Drop
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Drop -> Drop
Drop
instance B.GValue.IsGValue (Maybe Drop) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_drop_get_type
gvalueSet_ :: Ptr GValue -> Maybe Drop -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Drop
P.Nothing = Ptr GValue -> Ptr Drop -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Drop
forall a. Ptr a
FP.nullPtr :: FP.Ptr Drop)
gvalueSet_ Ptr GValue
gv (P.Just Drop
obj) = Drop -> (Ptr Drop -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Drop
obj (Ptr GValue -> Ptr Drop -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Drop)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Drop)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Drop)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Drop ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDropMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveDropMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDropMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDropMethod "finish" o = DropFinishMethodInfo
ResolveDropMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDropMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDropMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDropMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDropMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDropMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDropMethod "readAsync" o = DropReadAsyncMethodInfo
ResolveDropMethod "readFinish" o = DropReadFinishMethodInfo
ResolveDropMethod "readValueAsync" o = DropReadValueAsyncMethodInfo
ResolveDropMethod "readValueFinish" o = DropReadValueFinishMethodInfo
ResolveDropMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDropMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDropMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDropMethod "status" o = DropStatusMethodInfo
ResolveDropMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDropMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDropMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDropMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDropMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDropMethod "getActions" o = DropGetActionsMethodInfo
ResolveDropMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDropMethod "getDevice" o = DropGetDeviceMethodInfo
ResolveDropMethod "getDisplay" o = DropGetDisplayMethodInfo
ResolveDropMethod "getDrag" o = DropGetDragMethodInfo
ResolveDropMethod "getFormats" o = DropGetFormatsMethodInfo
ResolveDropMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDropMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDropMethod "getSurface" o = DropGetSurfaceMethodInfo
ResolveDropMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDropMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDropMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDropMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDropMethod t Drop, O.OverloadedMethod info Drop p) => OL.IsLabel t (Drop -> 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 ~ ResolveDropMethod t Drop, O.OverloadedMethod info Drop p, R.HasField t Drop p) => R.HasField t Drop p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDropMethod t Drop, O.OverloadedMethodInfo info Drop) => OL.IsLabel t (O.MethodProxy info Drop) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getDropActions :: (MonadIO m, IsDrop o) => o -> m [Gdk.Flags.DragAction]
getDropActions :: forall (m :: * -> *) o.
(MonadIO m, IsDrop o) =>
o -> m [DragAction]
getDropActions o
obj = IO [DragAction] -> m [DragAction]
forall a. IO a -> m a
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"
constructDropActions :: (IsDrop o, MIO.MonadIO m) => [Gdk.Flags.DragAction] -> m (GValueConstruct o)
constructDropActions :: forall o (m :: * -> *).
(IsDrop o, MonadIO m) =>
[DragAction] -> m (GValueConstruct o)
constructDropActions [DragAction]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
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 a. IO a -> IO a
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 DropActionsPropertyInfo
instance AttrInfo DropActionsPropertyInfo where
type AttrAllowedOps DropActionsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DropActionsPropertyInfo = IsDrop
type AttrSetTypeConstraint DropActionsPropertyInfo = (~) [Gdk.Flags.DragAction]
type AttrTransferTypeConstraint DropActionsPropertyInfo = (~) [Gdk.Flags.DragAction]
type AttrTransferType DropActionsPropertyInfo = [Gdk.Flags.DragAction]
type AttrGetType DropActionsPropertyInfo = [Gdk.Flags.DragAction]
type AttrLabel DropActionsPropertyInfo = "actions"
type AttrOrigin DropActionsPropertyInfo = Drop
attrGet = getDropActions
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDropActions
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.actions"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#g:attr:actions"
})
#endif
getDropDevice :: (MonadIO m, IsDrop o) => o -> m Gdk.Device.Device
getDropDevice :: forall (m :: * -> *) o. (MonadIO m, IsDrop o) => o -> m Device
getDropDevice o
obj = IO Device -> m Device
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 Text
"getDropDevice" (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 String
"device" ManagedPtr Device -> Device
Gdk.Device.Device
constructDropDevice :: (IsDrop o, MIO.MonadIO m, Gdk.Device.IsDevice a) => a -> m (GValueConstruct o)
constructDropDevice :: forall o (m :: * -> *) a.
(IsDrop o, MonadIO m, IsDevice a) =>
a -> m (GValueConstruct o)
constructDropDevice a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
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 a. IO a -> IO a
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
"device" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data DropDevicePropertyInfo
instance AttrInfo DropDevicePropertyInfo where
type AttrAllowedOps DropDevicePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DropDevicePropertyInfo = IsDrop
type AttrSetTypeConstraint DropDevicePropertyInfo = Gdk.Device.IsDevice
type AttrTransferTypeConstraint DropDevicePropertyInfo = Gdk.Device.IsDevice
type AttrTransferType DropDevicePropertyInfo = Gdk.Device.Device
type AttrGetType DropDevicePropertyInfo = Gdk.Device.Device
type AttrLabel DropDevicePropertyInfo = "device"
type AttrOrigin DropDevicePropertyInfo = Drop
attrGet = getDropDevice
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Device.Device v
attrConstruct = constructDropDevice
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.device"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#g:attr:device"
})
#endif
getDropDisplay :: (MonadIO m, IsDrop o) => o -> m Gdk.Display.Display
getDropDisplay :: forall (m :: * -> *) o. (MonadIO m, IsDrop o) => o -> m Display
getDropDisplay o
obj = IO Display -> m Display
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 Text
"getDropDisplay" (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 String
"display" ManagedPtr Display -> Display
Gdk.Display.Display
#if defined(ENABLE_OVERLOADING)
data DropDisplayPropertyInfo
instance AttrInfo DropDisplayPropertyInfo where
type AttrAllowedOps DropDisplayPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DropDisplayPropertyInfo = IsDrop
type AttrSetTypeConstraint DropDisplayPropertyInfo = (~) ()
type AttrTransferTypeConstraint DropDisplayPropertyInfo = (~) ()
type AttrTransferType DropDisplayPropertyInfo = ()
type AttrGetType DropDisplayPropertyInfo = Gdk.Display.Display
type AttrLabel DropDisplayPropertyInfo = "display"
type AttrOrigin DropDisplayPropertyInfo = Drop
attrGet = getDropDisplay
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.display"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#g:attr:display"
})
#endif
getDropDrag :: (MonadIO m, IsDrop o) => o -> m (Maybe Gdk.Drag.Drag)
getDropDrag :: forall (m :: * -> *) o.
(MonadIO m, IsDrop o) =>
o -> m (Maybe Drag)
getDropDrag o
obj = IO (Maybe Drag) -> m (Maybe Drag)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Drag) -> m (Maybe Drag))
-> IO (Maybe Drag) -> m (Maybe Drag)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Drag -> Drag) -> IO (Maybe Drag)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"drag" ManagedPtr Drag -> Drag
Gdk.Drag.Drag
constructDropDrag :: (IsDrop o, MIO.MonadIO m, Gdk.Drag.IsDrag a) => a -> m (GValueConstruct o)
constructDropDrag :: forall o (m :: * -> *) a.
(IsDrop o, MonadIO m, IsDrag a) =>
a -> m (GValueConstruct o)
constructDropDrag a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
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 a. IO a -> IO a
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
"drag" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data DropDragPropertyInfo
instance AttrInfo DropDragPropertyInfo where
type AttrAllowedOps DropDragPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DropDragPropertyInfo = IsDrop
type AttrSetTypeConstraint DropDragPropertyInfo = Gdk.Drag.IsDrag
type AttrTransferTypeConstraint DropDragPropertyInfo = Gdk.Drag.IsDrag
type AttrTransferType DropDragPropertyInfo = Gdk.Drag.Drag
type AttrGetType DropDragPropertyInfo = (Maybe Gdk.Drag.Drag)
type AttrLabel DropDragPropertyInfo = "drag"
type AttrOrigin DropDragPropertyInfo = Drop
attrGet = getDropDrag
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Drag.Drag v
attrConstruct = constructDropDrag
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.drag"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#g:attr:drag"
})
#endif
getDropFormats :: (MonadIO m, IsDrop o) => o -> m Gdk.ContentFormats.ContentFormats
getDropFormats :: forall (m :: * -> *) o.
(MonadIO m, IsDrop o) =>
o -> m ContentFormats
getDropFormats o
obj = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 Text
"getDropFormats" (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, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"formats" ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats
constructDropFormats :: (IsDrop o, MIO.MonadIO m) => Gdk.ContentFormats.ContentFormats -> m (GValueConstruct o)
constructDropFormats :: forall o (m :: * -> *).
(IsDrop o, MonadIO m) =>
ContentFormats -> m (GValueConstruct o)
constructDropFormats ContentFormats
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
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 a. IO a -> IO a
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 ContentFormats -> IO (GValueConstruct o)
forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"formats" (ContentFormats -> Maybe ContentFormats
forall a. a -> Maybe a
P.Just ContentFormats
val)
#if defined(ENABLE_OVERLOADING)
data DropFormatsPropertyInfo
instance AttrInfo DropFormatsPropertyInfo where
type AttrAllowedOps DropFormatsPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DropFormatsPropertyInfo = IsDrop
type AttrSetTypeConstraint DropFormatsPropertyInfo = (~) Gdk.ContentFormats.ContentFormats
type AttrTransferTypeConstraint DropFormatsPropertyInfo = (~) Gdk.ContentFormats.ContentFormats
type AttrTransferType DropFormatsPropertyInfo = Gdk.ContentFormats.ContentFormats
type AttrGetType DropFormatsPropertyInfo = Gdk.ContentFormats.ContentFormats
type AttrLabel DropFormatsPropertyInfo = "formats"
type AttrOrigin DropFormatsPropertyInfo = Drop
attrGet = getDropFormats
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDropFormats
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.formats"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#g:attr:formats"
})
#endif
getDropSurface :: (MonadIO m, IsDrop o) => o -> m Gdk.Surface.Surface
getDropSurface :: forall (m :: * -> *) o. (MonadIO m, IsDrop o) => o -> m Surface
getDropSurface o
obj = IO Surface -> m Surface
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Surface) -> IO Surface
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getDropSurface" (IO (Maybe Surface) -> IO Surface)
-> IO (Maybe Surface) -> IO 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 String
"surface" ManagedPtr Surface -> Surface
Gdk.Surface.Surface
constructDropSurface :: (IsDrop o, MIO.MonadIO m, Gdk.Surface.IsSurface a) => a -> m (GValueConstruct o)
constructDropSurface :: forall o (m :: * -> *) a.
(IsDrop o, MonadIO m, IsSurface a) =>
a -> m (GValueConstruct o)
constructDropSurface a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
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 a. IO a -> IO a
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
"surface" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data DropSurfacePropertyInfo
instance AttrInfo DropSurfacePropertyInfo where
type AttrAllowedOps DropSurfacePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DropSurfacePropertyInfo = IsDrop
type AttrSetTypeConstraint DropSurfacePropertyInfo = Gdk.Surface.IsSurface
type AttrTransferTypeConstraint DropSurfacePropertyInfo = Gdk.Surface.IsSurface
type AttrTransferType DropSurfacePropertyInfo = Gdk.Surface.Surface
type AttrGetType DropSurfacePropertyInfo = Gdk.Surface.Surface
type AttrLabel DropSurfacePropertyInfo = "surface"
type AttrOrigin DropSurfacePropertyInfo = Drop
attrGet = getDropSurface
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Surface.Surface v
attrConstruct = constructDropSurface
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.surface"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#g:attr:surface"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Drop
type instance O.AttributeList Drop = DropAttributeList
type DropAttributeList = ('[ '("actions", DropActionsPropertyInfo), '("device", DropDevicePropertyInfo), '("display", DropDisplayPropertyInfo), '("drag", DropDragPropertyInfo), '("formats", DropFormatsPropertyInfo), '("surface", DropSurfacePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
dropActions :: AttrLabelProxy "actions"
dropActions = AttrLabelProxy
dropDevice :: AttrLabelProxy "device"
dropDevice = AttrLabelProxy
dropDisplay :: AttrLabelProxy "display"
dropDisplay = AttrLabelProxy
dropDrag :: AttrLabelProxy "drag"
dropDrag = AttrLabelProxy
dropFormats :: AttrLabelProxy "formats"
dropFormats = AttrLabelProxy
dropSurface :: AttrLabelProxy "surface"
dropSurface = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Drop = DropSignalList
type DropSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gdk_drop_finish" gdk_drop_finish ::
Ptr Drop ->
CUInt ->
IO ()
dropFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> [Gdk.Flags.DragAction]
-> m ()
dropFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrop a) =>
a -> [DragAction] -> m ()
dropFinish a
self [DragAction]
action = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let action' = [DragAction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DragAction]
action
gdk_drop_finish self' action'
touchManagedPtr self
return ()
#if defined(ENABLE_OVERLOADING)
data DropFinishMethodInfo
instance (signature ~ ([Gdk.Flags.DragAction] -> m ()), MonadIO m, IsDrop a) => O.OverloadedMethod DropFinishMethodInfo a signature where
overloadedMethod = dropFinish
instance O.OverloadedMethodInfo DropFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropFinish"
})
#endif
foreign import ccall "gdk_drop_get_actions" gdk_drop_get_actions ::
Ptr Drop ->
IO CUInt
dropGetActions ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> m [Gdk.Flags.DragAction]
dropGetActions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrop a) =>
a -> m [DragAction]
dropGetActions a
self = IO [DragAction] -> m [DragAction]
forall a. IO a -> m a
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
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- gdk_drop_get_actions self'
let result' = CUInt -> [DragAction]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
touchManagedPtr self
return result'
#if defined(ENABLE_OVERLOADING)
data DropGetActionsMethodInfo
instance (signature ~ (m [Gdk.Flags.DragAction]), MonadIO m, IsDrop a) => O.OverloadedMethod DropGetActionsMethodInfo a signature where
overloadedMethod = dropGetActions
instance O.OverloadedMethodInfo DropGetActionsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropGetActions",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropGetActions"
})
#endif
foreign import ccall "gdk_drop_get_device" gdk_drop_get_device ::
Ptr Drop ->
IO (Ptr Gdk.Device.Device)
dropGetDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> m Gdk.Device.Device
dropGetDevice :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrop a) =>
a -> m Device
dropGetDevice a
self = IO Device -> m Device
forall a. IO a -> m a
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
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- gdk_drop_get_device self'
checkUnexpectedReturnNULL "dropGetDevice" result
result' <- (newObject Gdk.Device.Device) result
touchManagedPtr self
return result'
#if defined(ENABLE_OVERLOADING)
data DropGetDeviceMethodInfo
instance (signature ~ (m Gdk.Device.Device), MonadIO m, IsDrop a) => O.OverloadedMethod DropGetDeviceMethodInfo a signature where
overloadedMethod = dropGetDevice
instance O.OverloadedMethodInfo DropGetDeviceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropGetDevice",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropGetDevice"
})
#endif
foreign import ccall "gdk_drop_get_display" gdk_drop_get_display ::
Ptr Drop ->
IO (Ptr Gdk.Display.Display)
dropGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> m Gdk.Display.Display
dropGetDisplay :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrop a) =>
a -> m Display
dropGetDisplay a
self = IO Display -> m Display
forall a. IO a -> m a
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
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- gdk_drop_get_display self'
checkUnexpectedReturnNULL "dropGetDisplay" result
result' <- (newObject Gdk.Display.Display) result
touchManagedPtr self
return result'
#if defined(ENABLE_OVERLOADING)
data DropGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsDrop a) => O.OverloadedMethod DropGetDisplayMethodInfo a signature where
overloadedMethod = dropGetDisplay
instance O.OverloadedMethodInfo DropGetDisplayMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropGetDisplay",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropGetDisplay"
})
#endif
foreign import ccall "gdk_drop_get_drag" gdk_drop_get_drag ::
Ptr Drop ->
IO (Ptr Gdk.Drag.Drag)
dropGetDrag ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> m (Maybe Gdk.Drag.Drag)
dropGetDrag :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrop a) =>
a -> m (Maybe Drag)
dropGetDrag a
self = IO (Maybe Drag) -> m (Maybe Drag)
forall a. IO a -> m a
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
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- gdk_drop_get_drag self'
maybeResult <- convertIfNonNull result $ \Ptr Drag
result' -> do
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'
return result''
touchManagedPtr self
return maybeResult
#if defined(ENABLE_OVERLOADING)
data DropGetDragMethodInfo
instance (signature ~ (m (Maybe Gdk.Drag.Drag)), MonadIO m, IsDrop a) => O.OverloadedMethod DropGetDragMethodInfo a signature where
overloadedMethod = dropGetDrag
instance O.OverloadedMethodInfo DropGetDragMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropGetDrag",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropGetDrag"
})
#endif
foreign import ccall "gdk_drop_get_formats" gdk_drop_get_formats ::
Ptr Drop ->
IO (Ptr Gdk.ContentFormats.ContentFormats)
dropGetFormats ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> m Gdk.ContentFormats.ContentFormats
dropGetFormats :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrop a) =>
a -> m ContentFormats
dropGetFormats a
self = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
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
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- gdk_drop_get_formats self'
checkUnexpectedReturnNULL "dropGetFormats" result
result' <- (newBoxed Gdk.ContentFormats.ContentFormats) result
touchManagedPtr self
return result'
#if defined(ENABLE_OVERLOADING)
data DropGetFormatsMethodInfo
instance (signature ~ (m Gdk.ContentFormats.ContentFormats), MonadIO m, IsDrop a) => O.OverloadedMethod DropGetFormatsMethodInfo a signature where
overloadedMethod = dropGetFormats
instance O.OverloadedMethodInfo DropGetFormatsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropGetFormats",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropGetFormats"
})
#endif
foreign import ccall "gdk_drop_get_surface" gdk_drop_get_surface ::
Ptr Drop ->
IO (Ptr Gdk.Surface.Surface)
dropGetSurface ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> m Gdk.Surface.Surface
dropGetSurface :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrop a) =>
a -> m Surface
dropGetSurface a
self = IO Surface -> m Surface
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Surface -> m Surface) -> IO Surface -> m Surface
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result <- gdk_drop_get_surface self'
checkUnexpectedReturnNULL "dropGetSurface" result
result' <- (newObject Gdk.Surface.Surface) result
touchManagedPtr self
return result'
#if defined(ENABLE_OVERLOADING)
data DropGetSurfaceMethodInfo
instance (signature ~ (m Gdk.Surface.Surface), MonadIO m, IsDrop a) => O.OverloadedMethod DropGetSurfaceMethodInfo a signature where
overloadedMethod = dropGetSurface
instance O.OverloadedMethodInfo DropGetSurfaceMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropGetSurface",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropGetSurface"
})
#endif
foreign import ccall "gdk_drop_read_async" gdk_drop_read_async ::
Ptr Drop ->
Ptr CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dropReadAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a, Gio.Cancellable.IsCancellable b) =>
a
-> [T.Text]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dropReadAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDrop a, IsCancellable b) =>
a -> [Text] -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dropReadAsync a
self [Text]
mimeTypes Int32
ioPriority Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
mimeTypes' <- packZeroTerminatedUTF8CArray mimeTypes
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
gdk_drop_read_async self' mimeTypes' ioPriority maybeCancellable maybeCallback userData
touchManagedPtr self
whenJust cancellable touchManagedPtr
mapZeroTerminatedCArray freeMem mimeTypes'
freeMem mimeTypes'
return ()
#if defined(ENABLE_OVERLOADING)
data DropReadAsyncMethodInfo
instance (signature ~ ([T.Text] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDrop a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod DropReadAsyncMethodInfo a signature where
overloadedMethod = dropReadAsync
instance O.OverloadedMethodInfo DropReadAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropReadAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropReadAsync"
})
#endif
foreign import ccall "gdk_drop_read_finish" gdk_drop_read_finish ::
Ptr Drop ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr CString ->
Ptr (Ptr GError) ->
IO (Ptr Gio.InputStream.InputStream)
dropReadFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((Maybe Gio.InputStream.InputStream, T.Text))
dropReadFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDrop a, IsAsyncResult b) =>
a -> b -> m (Maybe InputStream, Text)
dropReadFinish a
self b
result_ = IO (Maybe InputStream, Text) -> m (Maybe InputStream, Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream, Text) -> m (Maybe InputStream, Text))
-> IO (Maybe InputStream, Text) -> m (Maybe InputStream, Text)
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result_' <- unsafeManagedPtrCastPtr result_
outMimeType <- callocMem :: IO (Ptr CString)
onException (do
result <- propagateGError $ gdk_drop_read_finish self' result_' outMimeType
maybeResult <- convertIfNonNull result $ \Ptr InputStream
result' -> do
result'' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result'
return result''
outMimeType' <- peek outMimeType
outMimeType'' <- cstringToText outMimeType'
touchManagedPtr self
touchManagedPtr result_
freeMem outMimeType
return (maybeResult, outMimeType'')
) (do
freeMem outMimeType
)
#if defined(ENABLE_OVERLOADING)
data DropReadFinishMethodInfo
instance (signature ~ (b -> m ((Maybe Gio.InputStream.InputStream, T.Text))), MonadIO m, IsDrop a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod DropReadFinishMethodInfo a signature where
overloadedMethod = dropReadFinish
instance O.OverloadedMethodInfo DropReadFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropReadFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropReadFinish"
})
#endif
foreign import ccall "gdk_drop_read_value_async" gdk_drop_read_value_async ::
Ptr Drop ->
CGType ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dropReadValueAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a, Gio.Cancellable.IsCancellable b) =>
a
-> GType
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dropReadValueAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDrop a, IsCancellable b) =>
a -> GType -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dropReadValueAsync a
self GType
type_ Int32
ioPriority Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let type_' = GType -> CGType
gtypeToCGType GType
type_
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
gdk_drop_read_value_async self' type_' ioPriority maybeCancellable maybeCallback userData
touchManagedPtr self
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data DropReadValueAsyncMethodInfo
instance (signature ~ (GType -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDrop a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod DropReadValueAsyncMethodInfo a signature where
overloadedMethod = dropReadValueAsync
instance O.OverloadedMethodInfo DropReadValueAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropReadValueAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropReadValueAsync"
})
#endif
foreign import ccall "gdk_drop_read_value_finish" gdk_drop_read_value_finish ::
Ptr Drop ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr GValue)
dropReadValueFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m GValue
dropReadValueFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDrop a, IsAsyncResult b) =>
a -> b -> m GValue
dropReadValueFinish a
self b
result_ = IO GValue -> m GValue
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ gdk_drop_read_value_finish self' result_'
checkUnexpectedReturnNULL "dropReadValueFinish" result
result' <- B.GValue.newGValueFromPtr result
touchManagedPtr self
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data DropReadValueFinishMethodInfo
instance (signature ~ (b -> m GValue), MonadIO m, IsDrop a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod DropReadValueFinishMethodInfo a signature where
overloadedMethod = dropReadValueFinish
instance O.OverloadedMethodInfo DropReadValueFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropReadValueFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropReadValueFinish"
})
#endif
foreign import ccall "gdk_drop_status" gdk_drop_status ::
Ptr Drop ->
CUInt ->
CUInt ->
IO ()
dropStatus ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> [Gdk.Flags.DragAction]
-> [Gdk.Flags.DragAction]
-> m ()
dropStatus :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDrop a) =>
a -> [DragAction] -> [DragAction] -> m ()
dropStatus a
self [DragAction]
actions [DragAction]
preferred = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let actions' = [DragAction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DragAction]
actions
let preferred' = [DragAction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DragAction]
preferred
gdk_drop_status self' actions' preferred'
touchManagedPtr self
return ()
#if defined(ENABLE_OVERLOADING)
data DropStatusMethodInfo
instance (signature ~ ([Gdk.Flags.DragAction] -> [Gdk.Flags.DragAction] -> m ()), MonadIO m, IsDrop a) => O.OverloadedMethod DropStatusMethodInfo a signature where
overloadedMethod = dropStatus
instance O.OverloadedMethodInfo DropStatusMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Drop.dropStatus",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Drop.html#v:dropStatus"
})
#endif