module GI.Gtk.Interfaces.TreeDragSource
(
TreeDragSource(..) ,
noTreeDragSource ,
IsTreeDragSource ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
TreeDragSourceDragDataDeleteMethodInfo ,
#endif
treeDragSourceDragDataDelete ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
TreeDragSourceDragDataGetMethodInfo ,
#endif
treeDragSourceDragDataGet ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
TreeDragSourceRowDraggableMethodInfo ,
#endif
treeDragSourceRowDraggable ,
) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.Gtk.Structs.SelectionData as Gtk.SelectionData
import qualified GI.Gtk.Structs.TreePath as Gtk.TreePath
newtype TreeDragSource = TreeDragSource (ManagedPtr TreeDragSource)
noTreeDragSource :: Maybe TreeDragSource
noTreeDragSource = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList TreeDragSource = TreeDragSourceSignalList
type TreeDragSourceSignalList = ('[ ] :: [(Symbol, *)])
#endif
class ManagedPtrNewtype a => IsTreeDragSource a
instance IsTreeDragSource TreeDragSource
instance WrappedPtr TreeDragSource where
wrappedPtrCalloc = return nullPtr
wrappedPtrCopy = return
wrappedPtrFree = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveTreeDragSourceMethod (t :: Symbol) (o :: *) :: * where
ResolveTreeDragSourceMethod "dragDataDelete" o = TreeDragSourceDragDataDeleteMethodInfo
ResolveTreeDragSourceMethod "dragDataGet" o = TreeDragSourceDragDataGetMethodInfo
ResolveTreeDragSourceMethod "rowDraggable" o = TreeDragSourceRowDraggableMethodInfo
ResolveTreeDragSourceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTreeDragSourceMethod t TreeDragSource, O.MethodInfo info TreeDragSource p) => O.IsLabelProxy t (TreeDragSource -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveTreeDragSourceMethod t TreeDragSource, O.MethodInfo info TreeDragSource p) => O.IsLabel t (TreeDragSource -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
foreign import ccall "gtk_tree_drag_source_drag_data_delete" gtk_tree_drag_source_drag_data_delete ::
Ptr TreeDragSource ->
Ptr Gtk.TreePath.TreePath ->
IO CInt
treeDragSourceDragDataDelete ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeDragSource a) =>
a
-> Gtk.TreePath.TreePath
-> m Bool
treeDragSourceDragDataDelete dragSource path = liftIO $ do
dragSource' <- unsafeManagedPtrCastPtr dragSource
path' <- unsafeManagedPtrGetPtr path
result <- gtk_tree_drag_source_drag_data_delete dragSource' path'
let result' = (/= 0) result
touchManagedPtr dragSource
touchManagedPtr path
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data TreeDragSourceDragDataDeleteMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> m Bool), MonadIO m, IsTreeDragSource a) => O.MethodInfo TreeDragSourceDragDataDeleteMethodInfo a signature where
overloadedMethod _ = treeDragSourceDragDataDelete
#endif
foreign import ccall "gtk_tree_drag_source_drag_data_get" gtk_tree_drag_source_drag_data_get ::
Ptr TreeDragSource ->
Ptr Gtk.TreePath.TreePath ->
Ptr Gtk.SelectionData.SelectionData ->
IO CInt
treeDragSourceDragDataGet ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeDragSource a) =>
a
-> Gtk.TreePath.TreePath
-> Gtk.SelectionData.SelectionData
-> m Bool
treeDragSourceDragDataGet dragSource path selectionData = liftIO $ do
dragSource' <- unsafeManagedPtrCastPtr dragSource
path' <- unsafeManagedPtrGetPtr path
selectionData' <- unsafeManagedPtrGetPtr selectionData
result <- gtk_tree_drag_source_drag_data_get dragSource' path' selectionData'
let result' = (/= 0) result
touchManagedPtr dragSource
touchManagedPtr path
touchManagedPtr selectionData
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data TreeDragSourceDragDataGetMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> Gtk.SelectionData.SelectionData -> m Bool), MonadIO m, IsTreeDragSource a) => O.MethodInfo TreeDragSourceDragDataGetMethodInfo a signature where
overloadedMethod _ = treeDragSourceDragDataGet
#endif
foreign import ccall "gtk_tree_drag_source_row_draggable" gtk_tree_drag_source_row_draggable ::
Ptr TreeDragSource ->
Ptr Gtk.TreePath.TreePath ->
IO CInt
treeDragSourceRowDraggable ::
(B.CallStack.HasCallStack, MonadIO m, IsTreeDragSource a) =>
a
-> Gtk.TreePath.TreePath
-> m Bool
treeDragSourceRowDraggable dragSource path = liftIO $ do
dragSource' <- unsafeManagedPtrCastPtr dragSource
path' <- unsafeManagedPtrGetPtr path
result <- gtk_tree_drag_source_row_draggable dragSource' path'
let result' = (/= 0) result
touchManagedPtr dragSource
touchManagedPtr path
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data TreeDragSourceRowDraggableMethodInfo
instance (signature ~ (Gtk.TreePath.TreePath -> m Bool), MonadIO m, IsTreeDragSource a) => O.MethodInfo TreeDragSourceRowDraggableMethodInfo a signature where
overloadedMethod _ = treeDragSourceRowDraggable
#endif