{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Atk.Interfaces.Selection
(
Selection(..) ,
noSelection ,
IsSelection ,
toSelection ,
#if defined(ENABLE_OVERLOADING)
ResolveSelectionMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SelectionAddSelectionMethodInfo ,
#endif
selectionAddSelection ,
#if defined(ENABLE_OVERLOADING)
SelectionClearSelectionMethodInfo ,
#endif
selectionClearSelection ,
#if defined(ENABLE_OVERLOADING)
SelectionGetSelectionCountMethodInfo ,
#endif
selectionGetSelectionCount ,
#if defined(ENABLE_OVERLOADING)
SelectionIsChildSelectedMethodInfo ,
#endif
selectionIsChildSelected ,
#if defined(ENABLE_OVERLOADING)
SelectionRefSelectionMethodInfo ,
#endif
selectionRefSelection ,
#if defined(ENABLE_OVERLOADING)
SelectionRemoveSelectionMethodInfo ,
#endif
selectionRemoveSelection ,
#if defined(ENABLE_OVERLOADING)
SelectionSelectAllSelectionMethodInfo ,
#endif
selectionSelectAllSelection ,
C_SelectionSelectionChangedCallback ,
SelectionSelectionChangedCallback ,
#if defined(ENABLE_OVERLOADING)
SelectionSelectionChangedSignalInfo ,
#endif
afterSelectionSelectionChanged ,
genClosure_SelectionSelectionChanged ,
mk_SelectionSelectionChangedCallback ,
noSelectionSelectionChangedCallback ,
onSelectionSelectionChanged ,
wrap_SelectionSelectionChangedCallback ,
) 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.Atk.Objects.Object as Atk.Object
import qualified GI.GObject.Objects.Object as GObject.Object
newtype Selection = Selection (ManagedPtr Selection)
deriving (Eq)
noSelection :: Maybe Selection
noSelection = Nothing
type SelectionSelectionChangedCallback =
IO ()
noSelectionSelectionChangedCallback :: Maybe SelectionSelectionChangedCallback
noSelectionSelectionChangedCallback = Nothing
type C_SelectionSelectionChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SelectionSelectionChangedCallback :: C_SelectionSelectionChangedCallback -> IO (FunPtr C_SelectionSelectionChangedCallback)
genClosure_SelectionSelectionChanged :: MonadIO m => SelectionSelectionChangedCallback -> m (GClosure C_SelectionSelectionChangedCallback)
genClosure_SelectionSelectionChanged cb = liftIO $ do
let cb' = wrap_SelectionSelectionChangedCallback cb
mk_SelectionSelectionChangedCallback cb' >>= B.GClosure.newGClosure
wrap_SelectionSelectionChangedCallback ::
SelectionSelectionChangedCallback ->
C_SelectionSelectionChangedCallback
wrap_SelectionSelectionChangedCallback _cb _ _ = do
_cb
onSelectionSelectionChanged :: (IsSelection a, MonadIO m) => a -> SelectionSelectionChangedCallback -> m SignalHandlerId
onSelectionSelectionChanged obj cb = liftIO $ do
let cb' = wrap_SelectionSelectionChangedCallback cb
cb'' <- mk_SelectionSelectionChangedCallback cb'
connectSignalFunPtr obj "selection-changed" cb'' SignalConnectBefore Nothing
afterSelectionSelectionChanged :: (IsSelection a, MonadIO m) => a -> SelectionSelectionChangedCallback -> m SignalHandlerId
afterSelectionSelectionChanged obj cb = liftIO $ do
let cb' = wrap_SelectionSelectionChangedCallback cb
cb'' <- mk_SelectionSelectionChangedCallback cb'
connectSignalFunPtr obj "selection-changed" cb'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data SelectionSelectionChangedSignalInfo
instance SignalInfo SelectionSelectionChangedSignalInfo where
type HaskellCallbackType SelectionSelectionChangedSignalInfo = SelectionSelectionChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SelectionSelectionChangedCallback cb
cb'' <- mk_SelectionSelectionChangedCallback cb'
connectSignalFunPtr obj "selection-changed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Selection = SelectionSignalList
type SelectionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("selectionChanged", SelectionSelectionChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "atk_selection_get_type"
c_atk_selection_get_type :: IO GType
instance GObject Selection where
gobjectType = c_atk_selection_get_type
instance B.GValue.IsGValue Selection where
toGValue o = do
gtype <- c_atk_selection_get_type
B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)
fromGValue gv = do
ptr <- B.GValue.get_object gv :: IO (Ptr Selection)
B.ManagedPtr.newObject Selection ptr
class (GObject o, O.IsDescendantOf Selection o) => IsSelection o
instance (GObject o, O.IsDescendantOf Selection o) => IsSelection o
instance O.HasParentTypes Selection
type instance O.ParentTypes Selection = '[GObject.Object.Object]
toSelection :: (MonadIO m, IsSelection o) => o -> m Selection
toSelection = liftIO . unsafeCastTo Selection
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Selection
type instance O.AttributeList Selection = SelectionAttributeList
type SelectionAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveSelectionMethod (t :: Symbol) (o :: *) :: * where
ResolveSelectionMethod "addSelection" o = SelectionAddSelectionMethodInfo
ResolveSelectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSelectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSelectionMethod "clearSelection" o = SelectionClearSelectionMethodInfo
ResolveSelectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSelectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSelectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSelectionMethod "isChildSelected" o = SelectionIsChildSelectedMethodInfo
ResolveSelectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSelectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSelectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSelectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSelectionMethod "refSelection" o = SelectionRefSelectionMethodInfo
ResolveSelectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSelectionMethod "removeSelection" o = SelectionRemoveSelectionMethodInfo
ResolveSelectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSelectionMethod "selectAllSelection" o = SelectionSelectAllSelectionMethodInfo
ResolveSelectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSelectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSelectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSelectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSelectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSelectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSelectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSelectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSelectionMethod "getSelectionCount" o = SelectionGetSelectionCountMethodInfo
ResolveSelectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSelectionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSelectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSelectionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSelectionMethod t Selection, O.MethodInfo info Selection p) => OL.IsLabel t (Selection -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "atk_selection_add_selection" atk_selection_add_selection ::
Ptr Selection ->
Int32 ->
IO CInt
selectionAddSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
a
-> Int32
-> m Bool
selectionAddSelection selection i = liftIO $ do
selection' <- unsafeManagedPtrCastPtr selection
result <- atk_selection_add_selection selection' i
let result' = (/= 0) result
touchManagedPtr selection
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionAddSelectionMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionAddSelectionMethodInfo a signature where
overloadedMethod = selectionAddSelection
#endif
foreign import ccall "atk_selection_clear_selection" atk_selection_clear_selection ::
Ptr Selection ->
IO CInt
selectionClearSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
a
-> m Bool
selectionClearSelection selection = liftIO $ do
selection' <- unsafeManagedPtrCastPtr selection
result <- atk_selection_clear_selection selection'
let result' = (/= 0) result
touchManagedPtr selection
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionClearSelectionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionClearSelectionMethodInfo a signature where
overloadedMethod = selectionClearSelection
#endif
foreign import ccall "atk_selection_get_selection_count" atk_selection_get_selection_count ::
Ptr Selection ->
IO Int32
selectionGetSelectionCount ::
(B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
a
-> m Int32
selectionGetSelectionCount selection = liftIO $ do
selection' <- unsafeManagedPtrCastPtr selection
result <- atk_selection_get_selection_count selection'
touchManagedPtr selection
return result
#if defined(ENABLE_OVERLOADING)
data SelectionGetSelectionCountMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSelection a) => O.MethodInfo SelectionGetSelectionCountMethodInfo a signature where
overloadedMethod = selectionGetSelectionCount
#endif
foreign import ccall "atk_selection_is_child_selected" atk_selection_is_child_selected ::
Ptr Selection ->
Int32 ->
IO CInt
selectionIsChildSelected ::
(B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
a
-> Int32
-> m Bool
selectionIsChildSelected selection i = liftIO $ do
selection' <- unsafeManagedPtrCastPtr selection
result <- atk_selection_is_child_selected selection' i
let result' = (/= 0) result
touchManagedPtr selection
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionIsChildSelectedMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionIsChildSelectedMethodInfo a signature where
overloadedMethod = selectionIsChildSelected
#endif
foreign import ccall "atk_selection_ref_selection" atk_selection_ref_selection ::
Ptr Selection ->
Int32 ->
IO (Ptr Atk.Object.Object)
selectionRefSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
a
-> Int32
-> m (Maybe Atk.Object.Object)
selectionRefSelection selection i = liftIO $ do
selection' <- unsafeManagedPtrCastPtr selection
result <- atk_selection_ref_selection selection' i
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapObject Atk.Object.Object) result'
return result''
touchManagedPtr selection
return maybeResult
#if defined(ENABLE_OVERLOADING)
data SelectionRefSelectionMethodInfo
instance (signature ~ (Int32 -> m (Maybe Atk.Object.Object)), MonadIO m, IsSelection a) => O.MethodInfo SelectionRefSelectionMethodInfo a signature where
overloadedMethod = selectionRefSelection
#endif
foreign import ccall "atk_selection_remove_selection" atk_selection_remove_selection ::
Ptr Selection ->
Int32 ->
IO CInt
selectionRemoveSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
a
-> Int32
-> m Bool
selectionRemoveSelection selection i = liftIO $ do
selection' <- unsafeManagedPtrCastPtr selection
result <- atk_selection_remove_selection selection' i
let result' = (/= 0) result
touchManagedPtr selection
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionRemoveSelectionMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionRemoveSelectionMethodInfo a signature where
overloadedMethod = selectionRemoveSelection
#endif
foreign import ccall "atk_selection_select_all_selection" atk_selection_select_all_selection ::
Ptr Selection ->
IO CInt
selectionSelectAllSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsSelection a) =>
a
-> m Bool
selectionSelectAllSelection selection = liftIO $ do
selection' <- unsafeManagedPtrCastPtr selection
result <- atk_selection_select_all_selection selection'
let result' = (/= 0) result
touchManagedPtr selection
return result'
#if defined(ENABLE_OVERLOADING)
data SelectionSelectAllSelectionMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSelection a) => O.MethodInfo SelectionSelectAllSelectionMethodInfo a signature where
overloadedMethod = selectionSelectAllSelection
#endif