{-# 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 ,
noDrop ,
#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)
DropReadTextAsyncMethodInfo ,
#endif
dropReadTextAsync ,
#if defined(ENABLE_OVERLOADING)
DropReadTextFinishMethodInfo ,
#endif
dropReadTextFinish ,
#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.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.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
newtype Drop = Drop (ManagedPtr Drop)
deriving (Drop -> Drop -> Bool
(Drop -> Drop -> Bool) -> (Drop -> Drop -> Bool) -> Eq Drop
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Drop -> Drop -> Bool
$c/= :: Drop -> Drop -> Bool
== :: Drop -> Drop -> Bool
$c== :: Drop -> Drop -> Bool
Eq)
foreign import ccall "gdk_drop_get_type"
c_gdk_drop_get_type :: IO GType
instance GObject Drop where
gobjectType :: IO GType
gobjectType = IO GType
c_gdk_drop_get_type
instance B.GValue.IsGValue Drop where
toGValue :: Drop -> IO GValue
toGValue o :: Drop
o = do
GType
gtype <- IO GType
c_gdk_drop_get_type
Drop -> (Ptr Drop -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Drop
o (GType -> (GValue -> Ptr Drop -> IO ()) -> Ptr Drop -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Drop -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Drop
fromGValue gv :: GValue
gv = do
Ptr Drop
ptr <- GValue -> IO (Ptr Drop)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Drop)
(ManagedPtr Drop -> Drop) -> Ptr Drop -> IO Drop
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Drop -> Drop
Drop Ptr Drop
ptr
class (GObject o, O.IsDescendantOf Drop o) => IsDrop o
instance (GObject o, O.IsDescendantOf Drop o) => IsDrop o
instance O.HasParentTypes Drop
type instance O.ParentTypes Drop = '[GObject.Object.Object]
toDrop :: (MonadIO m, IsDrop o) => o -> m Drop
toDrop :: o -> m Drop
toDrop = IO Drop -> m Drop
forall (m :: * -> *) a. MonadIO m => IO a -> m a
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, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Drop -> Drop
Drop
noDrop :: Maybe Drop
noDrop :: Maybe Drop
noDrop = Maybe Drop
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDropMethod (t :: Symbol) (o :: *) :: * 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 "readTextAsync" o = DropReadTextAsyncMethodInfo
ResolveDropMethod "readTextFinish" o = DropReadTextFinishMethodInfo
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.MethodInfo 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
#endif
getDropActions :: (MonadIO m, IsDrop o) => o -> m [Gdk.Flags.DragAction]
getDropActions :: o -> m [DragAction]
getDropActions 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"
constructDropActions :: (IsDrop o) => [Gdk.Flags.DragAction] -> IO (GValueConstruct o)
constructDropActions :: [DragAction] -> IO (GValueConstruct o)
constructDropActions 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 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
#endif
getDropDevice :: (MonadIO m, IsDrop o) => o -> m Gdk.Device.Device
getDropDevice :: o -> m Device
getDropDevice 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 "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 "device" ManagedPtr Device -> Device
Gdk.Device.Device
constructDropDevice :: (IsDrop o, Gdk.Device.IsDevice a) => a -> IO (GValueConstruct o)
constructDropDevice :: a -> IO (GValueConstruct o)
constructDropDevice 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 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
#endif
getDropDisplay :: (MonadIO m, IsDrop o) => o -> m Gdk.Display.Display
getDropDisplay :: o -> m Display
getDropDisplay 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 "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 "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
#endif
getDropDrag :: (MonadIO m, IsDrop o) => o -> m (Maybe Gdk.Drag.Drag)
getDropDrag :: o -> m (Maybe Drag)
getDropDrag obj :: o
obj = 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
$ 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 "drag" ManagedPtr Drag -> Drag
Gdk.Drag.Drag
constructDropDrag :: (IsDrop o, Gdk.Drag.IsDrag a) => a -> IO (GValueConstruct o)
constructDropDrag :: a -> IO (GValueConstruct o)
constructDropDrag val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "drag" (a -> Maybe a
forall a. a -> Maybe a
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
#endif
getDropFormats :: (MonadIO m, IsDrop o) => o -> m Gdk.ContentFormats.ContentFormats
getDropFormats :: o -> m ContentFormats
getDropFormats 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 "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, BoxedObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj "formats" ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats
constructDropFormats :: (IsDrop o) => Gdk.ContentFormats.ContentFormats -> IO (GValueConstruct o)
constructDropFormats :: ContentFormats -> IO (GValueConstruct o)
constructDropFormats 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 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
#endif
getDropSurface :: (MonadIO m, IsDrop o) => o -> m Gdk.Surface.Surface
getDropSurface :: o -> m Surface
getDropSurface obj :: o
obj = IO Surface -> m Surface
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
$ Text -> IO (Maybe Surface) -> IO Surface
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "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 "surface" ManagedPtr Surface -> Surface
Gdk.Surface.Surface
constructDropSurface :: (IsDrop o, Gdk.Surface.IsSurface a) => a -> IO (GValueConstruct o)
constructDropSurface :: a -> IO (GValueConstruct o)
constructDropSurface 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 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
#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, *)])
#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, *)])
#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 :: a -> [DragAction] -> m ()
dropFinish self :: a
self action :: [DragAction]
action = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let action' :: CUInt
action' = [DragAction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DragAction]
action
Ptr Drop -> CUInt -> IO ()
gdk_drop_finish Ptr Drop
self' CUInt
action'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DropFinishMethodInfo
instance (signature ~ ([Gdk.Flags.DragAction] -> m ()), MonadIO m, IsDrop a) => O.MethodInfo DropFinishMethodInfo a signature where
overloadedMethod = 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 :: a -> m [DragAction]
dropGetActions self :: a
self = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CUInt
result <- Ptr Drop -> IO CUInt
gdk_drop_get_actions Ptr Drop
self'
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
self
[DragAction] -> IO [DragAction]
forall (m :: * -> *) a. Monad m => a -> m a
return [DragAction]
result'
#if defined(ENABLE_OVERLOADING)
data DropGetActionsMethodInfo
instance (signature ~ (m [Gdk.Flags.DragAction]), MonadIO m, IsDrop a) => O.MethodInfo DropGetActionsMethodInfo a signature where
overloadedMethod = 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 :: a -> m Device
dropGetDevice self :: a
self = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Device
result <- Ptr Drop -> IO (Ptr Device)
gdk_drop_get_device Ptr Drop
self'
Text -> Ptr Device -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dropGetDevice" 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
self
Device -> IO Device
forall (m :: * -> *) a. Monad m => a -> m a
return Device
result'
#if defined(ENABLE_OVERLOADING)
data DropGetDeviceMethodInfo
instance (signature ~ (m Gdk.Device.Device), MonadIO m, IsDrop a) => O.MethodInfo DropGetDeviceMethodInfo a signature where
overloadedMethod = 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 :: a -> m Display
dropGetDisplay self :: a
self = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Display
result <- Ptr Drop -> IO (Ptr Display)
gdk_drop_get_display Ptr Drop
self'
Text -> Ptr Display -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dropGetDisplay" 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
self
Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result'
#if defined(ENABLE_OVERLOADING)
data DropGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsDrop a) => O.MethodInfo DropGetDisplayMethodInfo a signature where
overloadedMethod = 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 :: a -> m (Maybe Drag)
dropGetDrag self :: a
self = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Drag
result <- Ptr Drop -> IO (Ptr Drag)
gdk_drop_get_drag Ptr Drop
self'
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
newObject ManagedPtr Drag -> Drag
Gdk.Drag.Drag) Ptr Drag
result'
Drag -> IO Drag
forall (m :: * -> *) a. Monad m => a -> m a
return Drag
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe Drag -> IO (Maybe Drag)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Drag
maybeResult
#if defined(ENABLE_OVERLOADING)
data DropGetDragMethodInfo
instance (signature ~ (m (Maybe Gdk.Drag.Drag)), MonadIO m, IsDrop a) => O.MethodInfo DropGetDragMethodInfo a signature where
overloadedMethod = 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 :: a -> m ContentFormats
dropGetFormats self :: a
self = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr ContentFormats
result <- Ptr Drop -> IO (Ptr ContentFormats)
gdk_drop_get_formats Ptr Drop
self'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dropGetFormats" 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
self
ContentFormats -> IO ContentFormats
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data DropGetFormatsMethodInfo
instance (signature ~ (m Gdk.ContentFormats.ContentFormats), MonadIO m, IsDrop a) => O.MethodInfo DropGetFormatsMethodInfo a signature where
overloadedMethod = 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 :: a -> m Surface
dropGetSurface self :: a
self = IO Surface -> m Surface
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
Ptr Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Surface
result <- Ptr Drop -> IO (Ptr Surface)
gdk_drop_get_surface Ptr Drop
self'
Text -> Ptr Surface -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dropGetSurface" Ptr Surface
result
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
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result'
#if defined(ENABLE_OVERLOADING)
data DropGetSurfaceMethodInfo
instance (signature ~ (m Gdk.Surface.Surface), MonadIO m, IsDrop a) => O.MethodInfo DropGetSurfaceMethodInfo a signature where
overloadedMethod = 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 :: a -> [Text] -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dropReadAsync self :: a
self mimeTypes :: [Text]
mimeTypes ioPriority :: Int32
ioPriority cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CString
mimeTypes' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
mimeTypes
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Drop
-> Ptr CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_drop_read_async Ptr Drop
self' Ptr CString
mimeTypes' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
mimeTypes'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
mimeTypes'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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.MethodInfo DropReadAsyncMethodInfo a signature where
overloadedMethod = 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 :: a -> b -> m (Maybe InputStream, Text)
dropReadFinish self :: a
self result_ :: b
result_ = IO (Maybe InputStream, Text) -> m (Maybe InputStream, Text)
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
Ptr Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr CString
outMimeType <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
IO (Maybe InputStream, Text)
-> IO () -> IO (Maybe InputStream, Text)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr InputStream
result <- (Ptr (Ptr GError) -> IO (Ptr InputStream)) -> IO (Ptr InputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream))
-> (Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream)
forall a b. (a -> b) -> a -> b
$ Ptr Drop
-> Ptr AsyncResult
-> Ptr CString
-> Ptr (Ptr GError)
-> IO (Ptr InputStream)
gdk_drop_read_finish Ptr Drop
self' Ptr AsyncResult
result_' Ptr CString
outMimeType
Maybe InputStream
maybeResult <- Ptr InputStream
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr InputStream
result ((Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream))
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr InputStream
result' -> do
InputStream
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'
InputStream -> IO InputStream
forall (m :: * -> *) a. Monad m => a -> m a
return InputStream
result''
CString
outMimeType' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outMimeType
Text
outMimeType'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outMimeType'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
outMimeType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outMimeType
(Maybe InputStream, Text) -> IO (Maybe InputStream, Text)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe InputStream
maybeResult, Text
outMimeType'')
) (do
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
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.MethodInfo DropReadFinishMethodInfo a signature where
overloadedMethod = dropReadFinish
#endif
foreign import ccall "gdk_drop_read_text_async" gdk_drop_read_text_async ::
Ptr Drop ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
dropReadTextAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
dropReadTextAsync :: a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dropReadTextAsync self :: a
self cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Drop
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_drop_read_text_async Ptr Drop
self' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DropReadTextAsyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDrop a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DropReadTextAsyncMethodInfo a signature where
overloadedMethod = dropReadTextAsync
#endif
foreign import ccall "gdk_drop_read_text_finish" gdk_drop_read_text_finish ::
Ptr Drop ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CString
dropReadTextFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m (Maybe T.Text)
dropReadTextFinish :: a -> b -> m (Maybe Text)
dropReadTextFinish self :: a
self result_ :: b
result_ = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO (Maybe Text) -> IO () -> IO (Maybe Text)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr Drop -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CString
gdk_drop_read_text_finish Ptr Drop
self' Ptr AsyncResult
result_'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data DropReadTextFinishMethodInfo
instance (signature ~ (b -> m (Maybe T.Text)), MonadIO m, IsDrop a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DropReadTextFinishMethodInfo a signature where
overloadedMethod = dropReadTextFinish
#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 :: a -> GType -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
dropReadValueAsync self :: a
self type_ :: GType
type_ ioPriority :: Int32
ioPriority cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let type_' :: CGType
type_' = GType -> CGType
gtypeToCGType GType
type_
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Drop
-> CGType
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_drop_read_value_async Ptr Drop
self' CGType
type_' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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.MethodInfo DropReadValueAsyncMethodInfo a signature where
overloadedMethod = 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 :: a -> b -> m GValue
dropReadValueFinish self :: a
self result_ :: b
result_ = IO GValue -> m GValue
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
Ptr Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO GValue -> IO () -> IO GValue
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GValue
result <- (Ptr (Ptr GError) -> IO (Ptr GValue)) -> IO (Ptr GValue)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GValue)) -> IO (Ptr GValue))
-> (Ptr (Ptr GError) -> IO (Ptr GValue)) -> IO (Ptr GValue)
forall a b. (a -> b) -> a -> b
$ Ptr Drop -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr GValue)
gdk_drop_read_value_finish Ptr Drop
self' Ptr AsyncResult
result_'
Text -> Ptr GValue -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dropReadValueFinish" Ptr GValue
result
GValue
result' <- ((ManagedPtr GValue -> GValue) -> Ptr GValue -> IO GValue
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GValue -> GValue
GValue) Ptr GValue
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
GValue -> IO GValue
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data DropReadValueFinishMethodInfo
instance (signature ~ (b -> m GValue), MonadIO m, IsDrop a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DropReadValueFinishMethodInfo a signature where
overloadedMethod = dropReadValueFinish
#endif
foreign import ccall "gdk_drop_status" gdk_drop_status ::
Ptr Drop ->
CUInt ->
IO ()
dropStatus ::
(B.CallStack.HasCallStack, MonadIO m, IsDrop a) =>
a
-> [Gdk.Flags.DragAction]
-> m ()
dropStatus :: a -> [DragAction] -> m ()
dropStatus self :: a
self actions :: [DragAction]
actions = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Drop
self' <- a -> IO (Ptr Drop)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
let actions' :: CUInt
actions' = [DragAction] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [DragAction]
actions
Ptr Drop -> CUInt -> IO ()
gdk_drop_status Ptr Drop
self' CUInt
actions'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DropStatusMethodInfo
instance (signature ~ ([Gdk.Flags.DragAction] -> m ()), MonadIO m, IsDrop a) => O.MethodInfo DropStatusMethodInfo a signature where
overloadedMethod = dropStatus
#endif