{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Atk.Structs.TextRange
(
TextRange(..) ,
newZeroTextRange ,
#if defined(ENABLE_OVERLOADING)
ResolveTextRangeMethod ,
#endif
getTextRangeBounds ,
#if defined(ENABLE_OVERLOADING)
textRange_bounds ,
#endif
clearTextRangeContent ,
getTextRangeContent ,
setTextRangeContent ,
#if defined(ENABLE_OVERLOADING)
textRange_content ,
#endif
getTextRangeEndOffset ,
setTextRangeEndOffset ,
#if defined(ENABLE_OVERLOADING)
textRange_endOffset ,
#endif
getTextRangeStartOffset ,
setTextRangeStartOffset ,
#if defined(ENABLE_OVERLOADING)
textRange_startOffset ,
#endif
) 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 Data.Bits as DB
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import {-# SOURCE #-} qualified GI.Atk.Structs.TextRectangle as Atk.TextRectangle
#else
import {-# SOURCE #-} qualified GI.Atk.Structs.TextRectangle as Atk.TextRectangle
#endif
newtype = (SP.ManagedPtr TextRange)
deriving (TextRange -> TextRange -> Bool
(TextRange -> TextRange -> Bool)
-> (TextRange -> TextRange -> Bool) -> Eq TextRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TextRange -> TextRange -> Bool
== :: TextRange -> TextRange -> Bool
$c/= :: TextRange -> TextRange -> Bool
/= :: TextRange -> TextRange -> Bool
Eq)
instance SP.ManagedPtrNewtype TextRange where
toManagedPtr :: TextRange -> ManagedPtr TextRange
toManagedPtr (TextRange ManagedPtr TextRange
p) = ManagedPtr TextRange
p
foreign import ccall "atk_text_range_get_type" c_atk_text_range_get_type ::
IO GType
type instance O.ParentTypes TextRange = '[]
instance O.HasParentTypes TextRange
instance B.Types.TypedObject TextRange where
glibType :: IO GType
glibType = IO GType
c_atk_text_range_get_type
instance B.Types.GBoxed TextRange
instance B.GValue.IsGValue (Maybe TextRange) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_atk_text_range_get_type
gvalueSet_ :: Ptr GValue -> Maybe TextRange -> IO ()
gvalueSet_ Ptr GValue
gv Maybe TextRange
P.Nothing = Ptr GValue -> Ptr TextRange -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr TextRange
forall a. Ptr a
FP.nullPtr :: FP.Ptr TextRange)
gvalueSet_ Ptr GValue
gv (P.Just TextRange
obj) = TextRange -> (Ptr TextRange -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TextRange
obj (Ptr GValue -> Ptr TextRange -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe TextRange)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr TextRange)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr TextRange)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newBoxed TextRange ptr
else return P.Nothing
newZeroTextRange :: MonadIO m => m TextRange
= IO TextRange -> m TextRange
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TextRange -> m TextRange) -> IO TextRange -> m TextRange
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr TextRange)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
32 IO (Ptr TextRange)
-> (Ptr TextRange -> IO TextRange) -> IO TextRange
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr TextRange -> TextRange)
-> Ptr TextRange -> IO TextRange
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextRange -> TextRange
TextRange
instance tag ~ 'AttrSet => Constructible TextRange tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr TextRange -> TextRange)
-> [AttrOp TextRange tag] -> m TextRange
new ManagedPtr TextRange -> TextRange
_ [AttrOp TextRange tag]
attrs = do
o <- m TextRange
forall (m :: * -> *). MonadIO m => m TextRange
newZeroTextRange
GI.Attributes.set o attrs
return o
getTextRangeBounds :: MonadIO m => TextRange -> m Atk.TextRectangle.TextRectangle
TextRange
s = IO TextRectangle -> m TextRectangle
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TextRectangle -> m TextRectangle)
-> IO TextRectangle -> m TextRectangle
forall a b. (a -> b) -> a -> b
$ TextRange
-> (Ptr TextRange -> IO TextRectangle) -> IO TextRectangle
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TextRange
s ((Ptr TextRange -> IO TextRectangle) -> IO TextRectangle)
-> (Ptr TextRange -> IO TextRectangle) -> IO TextRectangle
forall a b. (a -> b) -> a -> b
$ \Ptr TextRange
ptr -> do
let val :: Ptr TextRectangle
val = Ptr TextRange
ptr Ptr TextRange -> Int -> Ptr TextRectangle
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr Atk.TextRectangle.TextRectangle)
val' <- ((ManagedPtr TextRectangle -> TextRectangle)
-> Ptr TextRectangle -> IO TextRectangle
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TextRectangle -> TextRectangle
Atk.TextRectangle.TextRectangle) Ptr TextRectangle
val
return val'
#if defined(ENABLE_OVERLOADING)
data
instance AttrInfo TextRangeBoundsFieldInfo where
type AttrBaseTypeConstraint TextRangeBoundsFieldInfo = (~) TextRange
type AttrAllowedOps TextRangeBoundsFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint TextRangeBoundsFieldInfo = (~) (Ptr Atk.TextRectangle.TextRectangle)
type AttrTransferTypeConstraint TextRangeBoundsFieldInfo = (~)(Ptr Atk.TextRectangle.TextRectangle)
type AttrTransferType TextRangeBoundsFieldInfo = (Ptr Atk.TextRectangle.TextRectangle)
type AttrGetType TextRangeBoundsFieldInfo = Atk.TextRectangle.TextRectangle
type AttrLabel TextRangeBoundsFieldInfo = "bounds"
type AttrOrigin TextRangeBoundsFieldInfo = TextRange
attrGet :: forall o.
AttrBaseTypeConstraint TextRangeBoundsFieldInfo o =>
o -> IO (AttrGetType TextRangeBoundsFieldInfo)
attrGet = o -> IO (AttrGetType TextRangeBoundsFieldInfo)
TextRange -> IO TextRectangle
forall (m :: * -> *). MonadIO m => TextRange -> m TextRectangle
getTextRangeBounds
attrSet :: forall o b.
(AttrBaseTypeConstraint TextRangeBoundsFieldInfo o,
AttrSetTypeConstraint TextRangeBoundsFieldInfo b) =>
o -> b -> IO ()
attrSet = o -> b -> IO ()
forall a. HasCallStack => a
undefined
attrConstruct :: forall o b.
(AttrBaseTypeConstraint TextRangeBoundsFieldInfo o,
AttrSetTypeConstraint TextRangeBoundsFieldInfo b) =>
b -> IO (GValueConstruct o)
attrConstruct = b -> IO (GValueConstruct o)
forall a. HasCallStack => a
undefined
attrClear :: forall o.
AttrBaseTypeConstraint TextRangeBoundsFieldInfo o =>
o -> IO ()
attrClear = o -> IO ()
forall a. HasCallStack => a
undefined
attrTransfer :: forall o b.
(AttrBaseTypeConstraint TextRangeBoundsFieldInfo o,
AttrTransferTypeConstraint TextRangeBoundsFieldInfo b) =>
Proxy o -> b -> IO (AttrTransferType TextRangeBoundsFieldInfo)
attrTransfer = Proxy o -> b -> IO (Ptr TextRectangle)
Proxy o -> b -> IO (AttrTransferType TextRangeBoundsFieldInfo)
forall a. HasCallStack => a
undefined
dbgAttrInfo :: Maybe ResolvedSymbolInfo
dbgAttrInfo = ResolvedSymbolInfo -> Maybe ResolvedSymbolInfo
forall a. a -> Maybe a
P.Just (O.ResolvedSymbolInfo {
resolvedSymbolName :: Text
O.resolvedSymbolName = Text
"GI.Atk.Structs.TextRange.bounds"
, resolvedSymbolURL :: Text
O.resolvedSymbolURL = Text
"https://hackage.haskell.org/package/gi-atk-2.0.29/docs/GI-Atk-Structs-TextRange.html#g:attr:bounds"
})
textRange_bounds :: AttrLabelProxy "bounds"
= AttrLabelProxy "bounds"
forall (a :: Symbol). AttrLabelProxy a
AttrLabelProxy
#endif
getTextRangeStartOffset :: MonadIO m => TextRange -> m Int32
TextRange
s = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ TextRange -> (Ptr TextRange -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TextRange
s ((Ptr TextRange -> IO Int32) -> IO Int32)
-> (Ptr TextRange -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Ptr TextRange
ptr -> do
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr TextRange
ptr Ptr TextRange -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO Int32
return val
setTextRangeStartOffset :: MonadIO m => TextRange -> Int32 -> m ()
TextRange
s Int32
val = 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
$ TextRange -> (Ptr TextRange -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TextRange
s ((Ptr TextRange -> IO ()) -> IO ())
-> (Ptr TextRange -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TextRange
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TextRange
ptr Ptr TextRange -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data
instance AttrInfo TextRangeStartOffsetFieldInfo where
type AttrBaseTypeConstraint TextRangeStartOffsetFieldInfo = (~) TextRange
type AttrAllowedOps TextRangeStartOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TextRangeStartOffsetFieldInfo = (~) Int32
type AttrTransferTypeConstraint TextRangeStartOffsetFieldInfo = (~)Int32
type AttrTransferType TextRangeStartOffsetFieldInfo = Int32
type AttrGetType TextRangeStartOffsetFieldInfo = Int32
type AttrLabel TextRangeStartOffsetFieldInfo = "start_offset"
type AttrOrigin TextRangeStartOffsetFieldInfo = TextRange
attrGet :: forall o.
AttrBaseTypeConstraint TextRangeStartOffsetFieldInfo o =>
o -> IO (AttrGetType TextRangeStartOffsetFieldInfo)
attrGet = o -> IO (AttrGetType TextRangeStartOffsetFieldInfo)
TextRange -> IO Int32
forall (m :: * -> *). MonadIO m => TextRange -> m Int32
getTextRangeStartOffset
attrSet :: forall o b.
(AttrBaseTypeConstraint TextRangeStartOffsetFieldInfo o,
AttrSetTypeConstraint TextRangeStartOffsetFieldInfo b) =>
o -> b -> IO ()
attrSet = o -> b -> IO ()
TextRange -> Int32 -> IO ()
forall (m :: * -> *). MonadIO m => TextRange -> Int32 -> m ()
setTextRangeStartOffset
attrConstruct :: forall o b.
(AttrBaseTypeConstraint TextRangeStartOffsetFieldInfo o,
AttrSetTypeConstraint TextRangeStartOffsetFieldInfo b) =>
b -> IO (GValueConstruct o)
attrConstruct = b -> IO (GValueConstruct o)
forall a. HasCallStack => a
undefined
attrClear :: forall o.
AttrBaseTypeConstraint TextRangeStartOffsetFieldInfo o =>
o -> IO ()
attrClear = o -> IO ()
forall a. HasCallStack => a
undefined
attrTransfer :: forall o b.
(AttrBaseTypeConstraint TextRangeStartOffsetFieldInfo o,
AttrTransferTypeConstraint TextRangeStartOffsetFieldInfo b) =>
Proxy o -> b -> IO (AttrTransferType TextRangeStartOffsetFieldInfo)
attrTransfer Proxy o
_ b
v = do
b -> IO b
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return b
v
dbgAttrInfo :: Maybe ResolvedSymbolInfo
dbgAttrInfo = ResolvedSymbolInfo -> Maybe ResolvedSymbolInfo
forall a. a -> Maybe a
P.Just (O.ResolvedSymbolInfo {
resolvedSymbolName :: Text
O.resolvedSymbolName = Text
"GI.Atk.Structs.TextRange.startOffset"
, resolvedSymbolURL :: Text
O.resolvedSymbolURL = Text
"https://hackage.haskell.org/package/gi-atk-2.0.29/docs/GI-Atk-Structs-TextRange.html#g:attr:startOffset"
})
textRange_startOffset :: AttrLabelProxy "startOffset"
= AttrLabelProxy "startOffset"
forall (a :: Symbol). AttrLabelProxy a
AttrLabelProxy
#endif
getTextRangeEndOffset :: MonadIO m => TextRange -> m Int32
TextRange
s = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ TextRange -> (Ptr TextRange -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TextRange
s ((Ptr TextRange -> IO Int32) -> IO Int32)
-> (Ptr TextRange -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Ptr TextRange
ptr -> do
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr TextRange
ptr Ptr TextRange -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20) :: IO Int32
return val
setTextRangeEndOffset :: MonadIO m => TextRange -> Int32 -> m ()
TextRange
s Int32
val = 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
$ TextRange -> (Ptr TextRange -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TextRange
s ((Ptr TextRange -> IO ()) -> IO ())
-> (Ptr TextRange -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TextRange
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TextRange
ptr Ptr TextRange -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data
instance AttrInfo TextRangeEndOffsetFieldInfo where
type AttrBaseTypeConstraint TextRangeEndOffsetFieldInfo = (~) TextRange
type AttrAllowedOps TextRangeEndOffsetFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TextRangeEndOffsetFieldInfo = (~) Int32
type AttrTransferTypeConstraint TextRangeEndOffsetFieldInfo = (~)Int32
type AttrTransferType TextRangeEndOffsetFieldInfo = Int32
type AttrGetType TextRangeEndOffsetFieldInfo = Int32
type AttrLabel TextRangeEndOffsetFieldInfo = "end_offset"
type AttrOrigin TextRangeEndOffsetFieldInfo = TextRange
attrGet :: forall o.
AttrBaseTypeConstraint TextRangeEndOffsetFieldInfo o =>
o -> IO (AttrGetType TextRangeEndOffsetFieldInfo)
attrGet = o -> IO (AttrGetType TextRangeEndOffsetFieldInfo)
TextRange -> IO Int32
forall (m :: * -> *). MonadIO m => TextRange -> m Int32
getTextRangeEndOffset
attrSet :: forall o b.
(AttrBaseTypeConstraint TextRangeEndOffsetFieldInfo o,
AttrSetTypeConstraint TextRangeEndOffsetFieldInfo b) =>
o -> b -> IO ()
attrSet = o -> b -> IO ()
TextRange -> Int32 -> IO ()
forall (m :: * -> *). MonadIO m => TextRange -> Int32 -> m ()
setTextRangeEndOffset
attrConstruct :: forall o b.
(AttrBaseTypeConstraint TextRangeEndOffsetFieldInfo o,
AttrSetTypeConstraint TextRangeEndOffsetFieldInfo b) =>
b -> IO (GValueConstruct o)
attrConstruct = b -> IO (GValueConstruct o)
forall a. HasCallStack => a
undefined
attrClear :: forall o.
AttrBaseTypeConstraint TextRangeEndOffsetFieldInfo o =>
o -> IO ()
attrClear = o -> IO ()
forall a. HasCallStack => a
undefined
attrTransfer :: forall o b.
(AttrBaseTypeConstraint TextRangeEndOffsetFieldInfo o,
AttrTransferTypeConstraint TextRangeEndOffsetFieldInfo b) =>
Proxy o -> b -> IO (AttrTransferType TextRangeEndOffsetFieldInfo)
attrTransfer Proxy o
_ b
v = do
b -> IO b
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return b
v
dbgAttrInfo :: Maybe ResolvedSymbolInfo
dbgAttrInfo = ResolvedSymbolInfo -> Maybe ResolvedSymbolInfo
forall a. a -> Maybe a
P.Just (O.ResolvedSymbolInfo {
resolvedSymbolName :: Text
O.resolvedSymbolName = Text
"GI.Atk.Structs.TextRange.endOffset"
, resolvedSymbolURL :: Text
O.resolvedSymbolURL = Text
"https://hackage.haskell.org/package/gi-atk-2.0.29/docs/GI-Atk-Structs-TextRange.html#g:attr:endOffset"
})
textRange_endOffset :: AttrLabelProxy "endOffset"
= AttrLabelProxy "endOffset"
forall (a :: Symbol). AttrLabelProxy a
AttrLabelProxy
#endif
getTextRangeContent :: MonadIO m => TextRange -> m (Maybe T.Text)
TextRange
s = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
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
$ TextRange -> (Ptr TextRange -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TextRange
s ((Ptr TextRange -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr TextRange -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr TextRange
ptr -> do
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr TextRange
ptr Ptr TextRange -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO CString
result <- SP.convertIfNonNull val $ \CString
val' -> do
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
return val''
return result
setTextRangeContent :: MonadIO m => TextRange -> CString -> m ()
TextRange
s CString
val = 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
$ TextRange -> (Ptr TextRange -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TextRange
s ((Ptr TextRange -> IO ()) -> IO ())
-> (Ptr TextRange -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TextRange
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TextRange
ptr Ptr TextRange -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (CString
val :: CString)
clearTextRangeContent :: MonadIO m => TextRange -> m ()
TextRange
s = 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
$ TextRange -> (Ptr TextRange -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr TextRange
s ((Ptr TextRange -> IO ()) -> IO ())
-> (Ptr TextRange -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr TextRange
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr TextRange
ptr Ptr TextRange -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data
instance AttrInfo TextRangeContentFieldInfo where
type AttrBaseTypeConstraint TextRangeContentFieldInfo = (~) TextRange
type AttrAllowedOps TextRangeContentFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint TextRangeContentFieldInfo = (~) CString
type AttrTransferTypeConstraint TextRangeContentFieldInfo = (~)CString
type AttrTransferType TextRangeContentFieldInfo = CString
type AttrGetType TextRangeContentFieldInfo = Maybe T.Text
type AttrLabel TextRangeContentFieldInfo = "content"
type AttrOrigin TextRangeContentFieldInfo = TextRange
attrGet :: forall o.
AttrBaseTypeConstraint TextRangeContentFieldInfo o =>
o -> IO (AttrGetType TextRangeContentFieldInfo)
attrGet = o -> IO (AttrGetType TextRangeContentFieldInfo)
TextRange -> IO (Maybe Text)
forall (m :: * -> *). MonadIO m => TextRange -> m (Maybe Text)
getTextRangeContent
attrSet :: forall o b.
(AttrBaseTypeConstraint TextRangeContentFieldInfo o,
AttrSetTypeConstraint TextRangeContentFieldInfo b) =>
o -> b -> IO ()
attrSet = o -> b -> IO ()
TextRange -> CString -> IO ()
forall (m :: * -> *). MonadIO m => TextRange -> CString -> m ()
setTextRangeContent
attrConstruct :: forall o b.
(AttrBaseTypeConstraint TextRangeContentFieldInfo o,
AttrSetTypeConstraint TextRangeContentFieldInfo b) =>
b -> IO (GValueConstruct o)
attrConstruct = b -> IO (GValueConstruct o)
forall a. HasCallStack => a
undefined
attrClear :: forall o.
AttrBaseTypeConstraint TextRangeContentFieldInfo o =>
o -> IO ()
attrClear = o -> IO ()
TextRange -> IO ()
forall (m :: * -> *). MonadIO m => TextRange -> m ()
clearTextRangeContent
attrTransfer :: forall o b.
(AttrBaseTypeConstraint TextRangeContentFieldInfo o,
AttrTransferTypeConstraint TextRangeContentFieldInfo b) =>
Proxy o -> b -> IO (AttrTransferType TextRangeContentFieldInfo)
attrTransfer Proxy o
_ b
v = do
b -> IO b
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return b
v
dbgAttrInfo :: Maybe ResolvedSymbolInfo
dbgAttrInfo = ResolvedSymbolInfo -> Maybe ResolvedSymbolInfo
forall a. a -> Maybe a
P.Just (O.ResolvedSymbolInfo {
resolvedSymbolName :: Text
O.resolvedSymbolName = Text
"GI.Atk.Structs.TextRange.content"
, resolvedSymbolURL :: Text
O.resolvedSymbolURL = Text
"https://hackage.haskell.org/package/gi-atk-2.0.29/docs/GI-Atk-Structs-TextRange.html#g:attr:content"
})
textRange_content :: AttrLabelProxy "content"
= AttrLabelProxy "content"
forall (a :: Symbol). AttrLabelProxy a
AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TextRange
type instance O.AttributeList TextRange = TextRangeAttributeList
type = ('[ '("bounds", TextRangeBoundsFieldInfo), '("startOffset", TextRangeStartOffsetFieldInfo), '("endOffset", TextRangeEndOffsetFieldInfo), '("content", TextRangeContentFieldInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
type family (t :: Symbol) (o :: DK.Type) :: DK.Type where
l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTextRangeMethod t TextRange, O.OverloadedMethod info TextRange p) => OL.IsLabel t (TextRange -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel :: TextRange -> p
fromLabel = forall {k} (i :: k) o s. OverloadedMethod i o s => o -> s
forall i o s. OverloadedMethod i o s => o -> s
O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveTextRangeMethod t TextRange, O.OverloadedMethod info TextRange p, R.HasField t TextRange p) => R.HasField t TextRange p where
getField :: TextRange -> p
getField = forall {k} (i :: k) o s. OverloadedMethod i o s => o -> s
forall i o s. OverloadedMethod i o s => o -> s
O.overloadedMethod @info
#endif
instance (info ~ ResolveTextRangeMethod t TextRange, O.OverloadedMethodInfo info TextRange) => OL.IsLabel t (O.MethodProxy info TextRange) where
#if MIN_VERSION_base(4,10,0)
fromLabel :: MethodProxy info TextRange
fromLabel = MethodProxy info TextRange
forall info obj. MethodProxy info obj
O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif