{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Interfaces.TreeDragDest
(
TreeDragDest(..) ,
noTreeDragDest ,
IsTreeDragDest ,
#if defined(ENABLE_OVERLOADING)
ResolveTreeDragDestMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TreeDragDestDragDataReceivedMethodInfo ,
#endif
treeDragDestDragDataReceived ,
#if defined(ENABLE_OVERLOADING)
TreeDragDestRowDropPossibleMethodInfo ,
#endif
treeDragDestRowDropPossible ,
) 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 {-# SOURCE #-} qualified GI.Gtk.Structs.SelectionData as Gtk.SelectionData
import {-# SOURCE #-} qualified GI.Gtk.Structs.TreePath as Gtk.TreePath
newtype TreeDragDest = TreeDragDest (ManagedPtr TreeDragDest)
deriving (TreeDragDest -> TreeDragDest -> Bool
(TreeDragDest -> TreeDragDest -> Bool)
-> (TreeDragDest -> TreeDragDest -> Bool) -> Eq TreeDragDest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TreeDragDest -> TreeDragDest -> Bool
$c/= :: TreeDragDest -> TreeDragDest -> Bool
== :: TreeDragDest -> TreeDragDest -> Bool
$c== :: TreeDragDest -> TreeDragDest -> Bool
Eq)
noTreeDragDest :: Maybe TreeDragDest
noTreeDragDest :: Maybe TreeDragDest
noTreeDragDest = Maybe TreeDragDest
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList TreeDragDest = TreeDragDestSignalList
type TreeDragDestSignalList = ('[ ] :: [(Symbol, *)])
#endif
class (ManagedPtrNewtype o, O.IsDescendantOf TreeDragDest o) => IsTreeDragDest o
instance (ManagedPtrNewtype o, O.IsDescendantOf TreeDragDest o) => IsTreeDragDest o
instance WrappedPtr TreeDragDest where
wrappedPtrCalloc :: IO (Ptr TreeDragDest)
wrappedPtrCalloc = Ptr TreeDragDest -> IO (Ptr TreeDragDest)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TreeDragDest
forall a. Ptr a
nullPtr
wrappedPtrCopy :: TreeDragDest -> IO TreeDragDest
wrappedPtrCopy = TreeDragDest -> IO TreeDragDest
forall (m :: * -> *) a. Monad m => a -> m a
return
wrappedPtrFree :: Maybe (GDestroyNotify TreeDragDest)
wrappedPtrFree = Maybe (GDestroyNotify TreeDragDest)
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveTreeDragDestMethod (t :: Symbol) (o :: *) :: * where
ResolveTreeDragDestMethod "dragDataReceived" o = TreeDragDestDragDataReceivedMethodInfo
ResolveTreeDragDestMethod "rowDropPossible" o = TreeDragDestRowDropPossibleMethodInfo
ResolveTreeDragDestMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTreeDragDestMethod t TreeDragDest, O.MethodInfo info TreeDragDest p) => OL.IsLabel t (TreeDragDest -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "gtk_tree_drag_dest_drag_data_received" gtk_tree_drag_dest_drag_data_received ::
Ptr TreeDragDest ->
Ptr Gtk.TreePath.TreePath ->
Ptr Gtk.SelectionData.SelectionData ->
IO CInt
treeDragDestDragDataReceived ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeDragDest a) =>
a
-> Gtk.TreePath.TreePath
-> Gtk.SelectionData.SelectionData
-> m Bool
treeDragDestDragDataReceived :: a -> TreePath -> SelectionData -> m Bool
treeDragDestDragDataReceived dragDest :: a
dragDest dest :: TreePath
dest selectionData :: SelectionData
selectionData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeDragDest
dragDest' <- a -> IO (Ptr TreeDragDest)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
dragDest
Ptr TreePath
dest' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
dest
Ptr SelectionData
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
CInt
result <- Ptr TreeDragDest -> Ptr TreePath -> Ptr SelectionData -> IO CInt
gtk_tree_drag_dest_drag_data_received Ptr TreeDragDest
dragDest' Ptr TreePath
dest' Ptr SelectionData
selectionData'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
dragDest
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
dest
SelectionData -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SelectionData
selectionData
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TreeDragDestDragDataReceivedMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> Gtk.SelectionData.SelectionData -> m Bool), MonadIO m, IsTreeDragDest a) => O.MethodInfo TreeDragDestDragDataReceivedMethodInfo a signature where
overloadedMethod = treeDragDestDragDataReceived
#endif
foreign import ccall "gtk_tree_drag_dest_row_drop_possible" gtk_tree_drag_dest_row_drop_possible ::
Ptr TreeDragDest ->
Ptr Gtk.TreePath.TreePath ->
Ptr Gtk.SelectionData.SelectionData ->
IO CInt
treeDragDestRowDropPossible ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeDragDest a) =>
a
-> Gtk.TreePath.TreePath
-> Gtk.SelectionData.SelectionData
-> m Bool
treeDragDestRowDropPossible :: a -> TreePath -> SelectionData -> m Bool
treeDragDestRowDropPossible dragDest :: a
dragDest destPath :: TreePath
destPath selectionData :: SelectionData
selectionData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr TreeDragDest
dragDest' <- a -> IO (Ptr TreeDragDest)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
dragDest
Ptr TreePath
destPath' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
destPath
Ptr SelectionData
selectionData' <- SelectionData -> IO (Ptr SelectionData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SelectionData
selectionData
CInt
result <- Ptr TreeDragDest -> Ptr TreePath -> Ptr SelectionData -> IO CInt
gtk_tree_drag_dest_row_drop_possible Ptr TreeDragDest
dragDest' Ptr TreePath
destPath' Ptr SelectionData
selectionData'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
dragDest
TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
destPath
SelectionData -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SelectionData
selectionData
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TreeDragDestRowDropPossibleMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> Gtk.SelectionData.SelectionData -> m Bool), MonadIO m, IsTreeDragDest a) => O.MethodInfo TreeDragDestRowDropPossibleMethodInfo a signature where
overloadedMethod = treeDragDestRowDropPossible
#endif