{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Atk.Interfaces.Text
(
Text(..) ,
noText ,
IsText ,
toText ,
#if defined(ENABLE_OVERLOADING)
ResolveTextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TextAddSelectionMethodInfo ,
#endif
textAddSelection ,
textFreeRanges ,
#if defined(ENABLE_OVERLOADING)
TextGetBoundedRangesMethodInfo ,
#endif
textGetBoundedRanges ,
#if defined(ENABLE_OVERLOADING)
TextGetCaretOffsetMethodInfo ,
#endif
textGetCaretOffset ,
#if defined(ENABLE_OVERLOADING)
TextGetCharacterAtOffsetMethodInfo ,
#endif
textGetCharacterAtOffset ,
#if defined(ENABLE_OVERLOADING)
TextGetCharacterCountMethodInfo ,
#endif
textGetCharacterCount ,
#if defined(ENABLE_OVERLOADING)
TextGetCharacterExtentsMethodInfo ,
#endif
textGetCharacterExtents ,
#if defined(ENABLE_OVERLOADING)
TextGetDefaultAttributesMethodInfo ,
#endif
textGetDefaultAttributes ,
#if defined(ENABLE_OVERLOADING)
TextGetNSelectionsMethodInfo ,
#endif
textGetNSelections ,
#if defined(ENABLE_OVERLOADING)
TextGetOffsetAtPointMethodInfo ,
#endif
textGetOffsetAtPoint ,
#if defined(ENABLE_OVERLOADING)
TextGetRangeExtentsMethodInfo ,
#endif
textGetRangeExtents ,
#if defined(ENABLE_OVERLOADING)
TextGetRunAttributesMethodInfo ,
#endif
textGetRunAttributes ,
#if defined(ENABLE_OVERLOADING)
TextGetSelectionMethodInfo ,
#endif
textGetSelection ,
#if defined(ENABLE_OVERLOADING)
TextGetStringAtOffsetMethodInfo ,
#endif
textGetStringAtOffset ,
#if defined(ENABLE_OVERLOADING)
TextGetTextMethodInfo ,
#endif
textGetText ,
#if defined(ENABLE_OVERLOADING)
TextGetTextAfterOffsetMethodInfo ,
#endif
textGetTextAfterOffset ,
#if defined(ENABLE_OVERLOADING)
TextGetTextAtOffsetMethodInfo ,
#endif
textGetTextAtOffset ,
#if defined(ENABLE_OVERLOADING)
TextGetTextBeforeOffsetMethodInfo ,
#endif
textGetTextBeforeOffset ,
#if defined(ENABLE_OVERLOADING)
TextRemoveSelectionMethodInfo ,
#endif
textRemoveSelection ,
#if defined(ENABLE_OVERLOADING)
TextScrollSubstringToMethodInfo ,
#endif
textScrollSubstringTo ,
#if defined(ENABLE_OVERLOADING)
TextScrollSubstringToPointMethodInfo ,
#endif
textScrollSubstringToPoint ,
#if defined(ENABLE_OVERLOADING)
TextSetCaretOffsetMethodInfo ,
#endif
textSetCaretOffset ,
#if defined(ENABLE_OVERLOADING)
TextSetSelectionMethodInfo ,
#endif
textSetSelection ,
C_TextTextAttributesChangedCallback ,
TextTextAttributesChangedCallback ,
#if defined(ENABLE_OVERLOADING)
TextTextAttributesChangedSignalInfo ,
#endif
afterTextTextAttributesChanged ,
genClosure_TextTextAttributesChanged ,
mk_TextTextAttributesChangedCallback ,
noTextTextAttributesChangedCallback ,
onTextTextAttributesChanged ,
wrap_TextTextAttributesChangedCallback ,
C_TextTextCaretMovedCallback ,
TextTextCaretMovedCallback ,
#if defined(ENABLE_OVERLOADING)
TextTextCaretMovedSignalInfo ,
#endif
afterTextTextCaretMoved ,
genClosure_TextTextCaretMoved ,
mk_TextTextCaretMovedCallback ,
noTextTextCaretMovedCallback ,
onTextTextCaretMoved ,
wrap_TextTextCaretMovedCallback ,
C_TextTextChangedCallback ,
TextTextChangedCallback ,
#if defined(ENABLE_OVERLOADING)
TextTextChangedSignalInfo ,
#endif
afterTextTextChanged ,
genClosure_TextTextChanged ,
mk_TextTextChangedCallback ,
noTextTextChangedCallback ,
onTextTextChanged ,
wrap_TextTextChangedCallback ,
C_TextTextInsertCallback ,
TextTextInsertCallback ,
#if defined(ENABLE_OVERLOADING)
TextTextInsertSignalInfo ,
#endif
afterTextTextInsert ,
genClosure_TextTextInsert ,
mk_TextTextInsertCallback ,
noTextTextInsertCallback ,
onTextTextInsert ,
wrap_TextTextInsertCallback ,
C_TextTextRemoveCallback ,
TextTextRemoveCallback ,
#if defined(ENABLE_OVERLOADING)
TextTextRemoveSignalInfo ,
#endif
afterTextTextRemove ,
genClosure_TextTextRemove ,
mk_TextTextRemoveCallback ,
noTextTextRemoveCallback ,
onTextTextRemove ,
wrap_TextTextRemoveCallback ,
C_TextTextSelectionChangedCallback ,
TextTextSelectionChangedCallback ,
#if defined(ENABLE_OVERLOADING)
TextTextSelectionChangedSignalInfo ,
#endif
afterTextTextSelectionChanged ,
genClosure_TextTextSelectionChanged ,
mk_TextTextSelectionChangedCallback ,
noTextTextSelectionChangedCallback ,
onTextTextSelectionChanged ,
wrap_TextTextSelectionChangedCallback ,
) 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.Enums as Atk.Enums
import {-# SOURCE #-} qualified GI.Atk.Structs.TextRange as Atk.TextRange
import {-# SOURCE #-} qualified GI.Atk.Structs.TextRectangle as Atk.TextRectangle
import qualified GI.GObject.Objects.Object as GObject.Object
newtype Text = Text (ManagedPtr Text)
deriving (Text -> Text -> Bool
(Text -> Text -> Bool) -> (Text -> Text -> Bool) -> Eq Text
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Text -> Text -> Bool
$c/= :: Text -> Text -> Bool
== :: Text -> Text -> Bool
$c== :: Text -> Text -> Bool
Eq)
noText :: Maybe Text
noText :: Maybe Text
noText = Maybe Text
forall a. Maybe a
Nothing
type TextTextAttributesChangedCallback =
IO ()
noTextTextAttributesChangedCallback :: Maybe TextTextAttributesChangedCallback
noTextTextAttributesChangedCallback :: Maybe TextTextAttributesChangedCallback
noTextTextAttributesChangedCallback = Maybe TextTextAttributesChangedCallback
forall a. Maybe a
Nothing
type C_TextTextAttributesChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTextAttributesChangedCallback :: C_TextTextAttributesChangedCallback -> IO (FunPtr C_TextTextAttributesChangedCallback)
genClosure_TextTextAttributesChanged :: MonadIO m => TextTextAttributesChangedCallback -> m (GClosure C_TextTextAttributesChangedCallback)
genClosure_TextTextAttributesChanged :: TextTextAttributesChangedCallback
-> m (GClosure C_TextTextAttributesChangedCallback)
genClosure_TextTextAttributesChanged cb :: TextTextAttributesChangedCallback
cb = IO (GClosure C_TextTextAttributesChangedCallback)
-> m (GClosure C_TextTextAttributesChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TextTextAttributesChangedCallback)
-> m (GClosure C_TextTextAttributesChangedCallback))
-> IO (GClosure C_TextTextAttributesChangedCallback)
-> m (GClosure C_TextTextAttributesChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextAttributesChangedCallback
cb' = TextTextAttributesChangedCallback
-> C_TextTextAttributesChangedCallback
wrap_TextTextAttributesChangedCallback TextTextAttributesChangedCallback
cb
C_TextTextAttributesChangedCallback
-> IO (FunPtr C_TextTextAttributesChangedCallback)
mk_TextTextAttributesChangedCallback C_TextTextAttributesChangedCallback
cb' IO (FunPtr C_TextTextAttributesChangedCallback)
-> (FunPtr C_TextTextAttributesChangedCallback
-> IO (GClosure C_TextTextAttributesChangedCallback))
-> IO (GClosure C_TextTextAttributesChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TextTextAttributesChangedCallback
-> IO (GClosure C_TextTextAttributesChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TextTextAttributesChangedCallback ::
TextTextAttributesChangedCallback ->
C_TextTextAttributesChangedCallback
wrap_TextTextAttributesChangedCallback :: TextTextAttributesChangedCallback
-> C_TextTextAttributesChangedCallback
wrap_TextTextAttributesChangedCallback _cb :: TextTextAttributesChangedCallback
_cb _ _ = do
TextTextAttributesChangedCallback
_cb
onTextTextAttributesChanged :: (IsText a, MonadIO m) => a -> TextTextAttributesChangedCallback -> m SignalHandlerId
onTextTextAttributesChanged :: a -> TextTextAttributesChangedCallback -> m SignalHandlerId
onTextTextAttributesChanged obj :: a
obj cb :: TextTextAttributesChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextAttributesChangedCallback
cb' = TextTextAttributesChangedCallback
-> C_TextTextAttributesChangedCallback
wrap_TextTextAttributesChangedCallback TextTextAttributesChangedCallback
cb
FunPtr C_TextTextAttributesChangedCallback
cb'' <- C_TextTextAttributesChangedCallback
-> IO (FunPtr C_TextTextAttributesChangedCallback)
mk_TextTextAttributesChangedCallback C_TextTextAttributesChangedCallback
cb'
a
-> Text
-> FunPtr C_TextTextAttributesChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-attributes-changed" FunPtr C_TextTextAttributesChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterTextTextAttributesChanged :: (IsText a, MonadIO m) => a -> TextTextAttributesChangedCallback -> m SignalHandlerId
afterTextTextAttributesChanged :: a -> TextTextAttributesChangedCallback -> m SignalHandlerId
afterTextTextAttributesChanged obj :: a
obj cb :: TextTextAttributesChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextAttributesChangedCallback
cb' = TextTextAttributesChangedCallback
-> C_TextTextAttributesChangedCallback
wrap_TextTextAttributesChangedCallback TextTextAttributesChangedCallback
cb
FunPtr C_TextTextAttributesChangedCallback
cb'' <- C_TextTextAttributesChangedCallback
-> IO (FunPtr C_TextTextAttributesChangedCallback)
mk_TextTextAttributesChangedCallback C_TextTextAttributesChangedCallback
cb'
a
-> Text
-> FunPtr C_TextTextAttributesChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-attributes-changed" FunPtr C_TextTextAttributesChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data TextTextAttributesChangedSignalInfo
instance SignalInfo TextTextAttributesChangedSignalInfo where
type HaskellCallbackType TextTextAttributesChangedSignalInfo = TextTextAttributesChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_TextTextAttributesChangedCallback cb
cb'' <- mk_TextTextAttributesChangedCallback cb'
connectSignalFunPtr obj "text-attributes-changed" cb'' connectMode detail
#endif
type TextTextCaretMovedCallback =
Int32
-> IO ()
noTextTextCaretMovedCallback :: Maybe TextTextCaretMovedCallback
noTextTextCaretMovedCallback :: Maybe TextTextCaretMovedCallback
noTextTextCaretMovedCallback = Maybe TextTextCaretMovedCallback
forall a. Maybe a
Nothing
type C_TextTextCaretMovedCallback =
Ptr () ->
Int32 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTextCaretMovedCallback :: C_TextTextCaretMovedCallback -> IO (FunPtr C_TextTextCaretMovedCallback)
genClosure_TextTextCaretMoved :: MonadIO m => TextTextCaretMovedCallback -> m (GClosure C_TextTextCaretMovedCallback)
genClosure_TextTextCaretMoved :: TextTextCaretMovedCallback
-> m (GClosure C_TextTextCaretMovedCallback)
genClosure_TextTextCaretMoved cb :: TextTextCaretMovedCallback
cb = IO (GClosure C_TextTextCaretMovedCallback)
-> m (GClosure C_TextTextCaretMovedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TextTextCaretMovedCallback)
-> m (GClosure C_TextTextCaretMovedCallback))
-> IO (GClosure C_TextTextCaretMovedCallback)
-> m (GClosure C_TextTextCaretMovedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextCaretMovedCallback
cb' = TextTextCaretMovedCallback -> C_TextTextCaretMovedCallback
wrap_TextTextCaretMovedCallback TextTextCaretMovedCallback
cb
C_TextTextCaretMovedCallback
-> IO (FunPtr C_TextTextCaretMovedCallback)
mk_TextTextCaretMovedCallback C_TextTextCaretMovedCallback
cb' IO (FunPtr C_TextTextCaretMovedCallback)
-> (FunPtr C_TextTextCaretMovedCallback
-> IO (GClosure C_TextTextCaretMovedCallback))
-> IO (GClosure C_TextTextCaretMovedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TextTextCaretMovedCallback
-> IO (GClosure C_TextTextCaretMovedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TextTextCaretMovedCallback ::
TextTextCaretMovedCallback ->
C_TextTextCaretMovedCallback
wrap_TextTextCaretMovedCallback :: TextTextCaretMovedCallback -> C_TextTextCaretMovedCallback
wrap_TextTextCaretMovedCallback _cb :: TextTextCaretMovedCallback
_cb _ arg1 :: Int32
arg1 _ = do
TextTextCaretMovedCallback
_cb Int32
arg1
onTextTextCaretMoved :: (IsText a, MonadIO m) => a -> TextTextCaretMovedCallback -> m SignalHandlerId
onTextTextCaretMoved :: a -> TextTextCaretMovedCallback -> m SignalHandlerId
onTextTextCaretMoved obj :: a
obj cb :: TextTextCaretMovedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextCaretMovedCallback
cb' = TextTextCaretMovedCallback -> C_TextTextCaretMovedCallback
wrap_TextTextCaretMovedCallback TextTextCaretMovedCallback
cb
FunPtr C_TextTextCaretMovedCallback
cb'' <- C_TextTextCaretMovedCallback
-> IO (FunPtr C_TextTextCaretMovedCallback)
mk_TextTextCaretMovedCallback C_TextTextCaretMovedCallback
cb'
a
-> Text
-> FunPtr C_TextTextCaretMovedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-caret-moved" FunPtr C_TextTextCaretMovedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterTextTextCaretMoved :: (IsText a, MonadIO m) => a -> TextTextCaretMovedCallback -> m SignalHandlerId
afterTextTextCaretMoved :: a -> TextTextCaretMovedCallback -> m SignalHandlerId
afterTextTextCaretMoved obj :: a
obj cb :: TextTextCaretMovedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextCaretMovedCallback
cb' = TextTextCaretMovedCallback -> C_TextTextCaretMovedCallback
wrap_TextTextCaretMovedCallback TextTextCaretMovedCallback
cb
FunPtr C_TextTextCaretMovedCallback
cb'' <- C_TextTextCaretMovedCallback
-> IO (FunPtr C_TextTextCaretMovedCallback)
mk_TextTextCaretMovedCallback C_TextTextCaretMovedCallback
cb'
a
-> Text
-> FunPtr C_TextTextCaretMovedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-caret-moved" FunPtr C_TextTextCaretMovedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data TextTextCaretMovedSignalInfo
instance SignalInfo TextTextCaretMovedSignalInfo where
type HaskellCallbackType TextTextCaretMovedSignalInfo = TextTextCaretMovedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_TextTextCaretMovedCallback cb
cb'' <- mk_TextTextCaretMovedCallback cb'
connectSignalFunPtr obj "text-caret-moved" cb'' connectMode detail
#endif
{-# DEPRECATED TextTextChangedCallback ["(Since version 2.9.4)","Use t'GI.Atk.Objects.Object.Object'::@/text-insert/@ or","t'GI.Atk.Objects.Object.Object'::@/text-remove/@ instead."] #-}
type TextTextChangedCallback =
Int32
-> Int32
-> IO ()
noTextTextChangedCallback :: Maybe TextTextChangedCallback
noTextTextChangedCallback :: Maybe TextTextChangedCallback
noTextTextChangedCallback = Maybe TextTextChangedCallback
forall a. Maybe a
Nothing
type C_TextTextChangedCallback =
Ptr () ->
Int32 ->
Int32 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTextChangedCallback :: C_TextTextChangedCallback -> IO (FunPtr C_TextTextChangedCallback)
genClosure_TextTextChanged :: MonadIO m => TextTextChangedCallback -> m (GClosure C_TextTextChangedCallback)
genClosure_TextTextChanged :: TextTextChangedCallback -> m (GClosure C_TextTextChangedCallback)
genClosure_TextTextChanged cb :: TextTextChangedCallback
cb = IO (GClosure C_TextTextChangedCallback)
-> m (GClosure C_TextTextChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TextTextChangedCallback)
-> m (GClosure C_TextTextChangedCallback))
-> IO (GClosure C_TextTextChangedCallback)
-> m (GClosure C_TextTextChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextChangedCallback
cb' = TextTextChangedCallback -> C_TextTextChangedCallback
wrap_TextTextChangedCallback TextTextChangedCallback
cb
C_TextTextChangedCallback -> IO (FunPtr C_TextTextChangedCallback)
mk_TextTextChangedCallback C_TextTextChangedCallback
cb' IO (FunPtr C_TextTextChangedCallback)
-> (FunPtr C_TextTextChangedCallback
-> IO (GClosure C_TextTextChangedCallback))
-> IO (GClosure C_TextTextChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TextTextChangedCallback
-> IO (GClosure C_TextTextChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TextTextChangedCallback ::
TextTextChangedCallback ->
C_TextTextChangedCallback
wrap_TextTextChangedCallback :: TextTextChangedCallback -> C_TextTextChangedCallback
wrap_TextTextChangedCallback _cb :: TextTextChangedCallback
_cb _ arg1 :: Int32
arg1 arg2 :: Int32
arg2 _ = do
TextTextChangedCallback
_cb Int32
arg1 Int32
arg2
onTextTextChanged :: (IsText a, MonadIO m) => a -> P.Maybe T.Text -> TextTextChangedCallback -> m SignalHandlerId
onTextTextChanged :: a -> Maybe Text -> TextTextChangedCallback -> m SignalHandlerId
onTextTextChanged obj :: a
obj detail :: Maybe Text
detail cb :: TextTextChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextChangedCallback
cb' = TextTextChangedCallback -> C_TextTextChangedCallback
wrap_TextTextChangedCallback TextTextChangedCallback
cb
FunPtr C_TextTextChangedCallback
cb'' <- C_TextTextChangedCallback -> IO (FunPtr C_TextTextChangedCallback)
mk_TextTextChangedCallback C_TextTextChangedCallback
cb'
a
-> Text
-> FunPtr C_TextTextChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-changed" FunPtr C_TextTextChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
detail
afterTextTextChanged :: (IsText a, MonadIO m) => a -> P.Maybe T.Text -> TextTextChangedCallback -> m SignalHandlerId
afterTextTextChanged :: a -> Maybe Text -> TextTextChangedCallback -> m SignalHandlerId
afterTextTextChanged obj :: a
obj detail :: Maybe Text
detail cb :: TextTextChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextChangedCallback
cb' = TextTextChangedCallback -> C_TextTextChangedCallback
wrap_TextTextChangedCallback TextTextChangedCallback
cb
FunPtr C_TextTextChangedCallback
cb'' <- C_TextTextChangedCallback -> IO (FunPtr C_TextTextChangedCallback)
mk_TextTextChangedCallback C_TextTextChangedCallback
cb'
a
-> Text
-> FunPtr C_TextTextChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-changed" FunPtr C_TextTextChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
detail
#if defined(ENABLE_OVERLOADING)
data TextTextChangedSignalInfo
instance SignalInfo TextTextChangedSignalInfo where
type HaskellCallbackType TextTextChangedSignalInfo = TextTextChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_TextTextChangedCallback cb
cb'' <- mk_TextTextChangedCallback cb'
connectSignalFunPtr obj "text-changed" cb'' connectMode detail
#endif
type TextTextInsertCallback =
Int32
-> Int32
-> T.Text
-> IO ()
noTextTextInsertCallback :: Maybe TextTextInsertCallback
noTextTextInsertCallback :: Maybe TextTextInsertCallback
noTextTextInsertCallback = Maybe TextTextInsertCallback
forall a. Maybe a
Nothing
type C_TextTextInsertCallback =
Ptr () ->
Int32 ->
Int32 ->
CString ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTextInsertCallback :: C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback)
genClosure_TextTextInsert :: MonadIO m => TextTextInsertCallback -> m (GClosure C_TextTextInsertCallback)
genClosure_TextTextInsert :: TextTextInsertCallback -> m (GClosure C_TextTextInsertCallback)
genClosure_TextTextInsert cb :: TextTextInsertCallback
cb = IO (GClosure C_TextTextInsertCallback)
-> m (GClosure C_TextTextInsertCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TextTextInsertCallback)
-> m (GClosure C_TextTextInsertCallback))
-> IO (GClosure C_TextTextInsertCallback)
-> m (GClosure C_TextTextInsertCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextInsertCallback
cb' = TextTextInsertCallback -> C_TextTextInsertCallback
wrap_TextTextInsertCallback TextTextInsertCallback
cb
C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback)
mk_TextTextInsertCallback C_TextTextInsertCallback
cb' IO (FunPtr C_TextTextInsertCallback)
-> (FunPtr C_TextTextInsertCallback
-> IO (GClosure C_TextTextInsertCallback))
-> IO (GClosure C_TextTextInsertCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TextTextInsertCallback
-> IO (GClosure C_TextTextInsertCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TextTextInsertCallback ::
TextTextInsertCallback ->
C_TextTextInsertCallback
wrap_TextTextInsertCallback :: TextTextInsertCallback -> C_TextTextInsertCallback
wrap_TextTextInsertCallback _cb :: TextTextInsertCallback
_cb _ arg1 :: Int32
arg1 arg2 :: Int32
arg2 arg3 :: CString
arg3 _ = do
Text
arg3' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
arg3
TextTextInsertCallback
_cb Int32
arg1 Int32
arg2 Text
arg3'
onTextTextInsert :: (IsText a, MonadIO m) => a -> P.Maybe T.Text -> TextTextInsertCallback -> m SignalHandlerId
onTextTextInsert :: a -> Maybe Text -> TextTextInsertCallback -> m SignalHandlerId
onTextTextInsert obj :: a
obj detail :: Maybe Text
detail cb :: TextTextInsertCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextInsertCallback
cb' = TextTextInsertCallback -> C_TextTextInsertCallback
wrap_TextTextInsertCallback TextTextInsertCallback
cb
FunPtr C_TextTextInsertCallback
cb'' <- C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback)
mk_TextTextInsertCallback C_TextTextInsertCallback
cb'
a
-> Text
-> FunPtr C_TextTextInsertCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-insert" FunPtr C_TextTextInsertCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
detail
afterTextTextInsert :: (IsText a, MonadIO m) => a -> P.Maybe T.Text -> TextTextInsertCallback -> m SignalHandlerId
afterTextTextInsert :: a -> Maybe Text -> TextTextInsertCallback -> m SignalHandlerId
afterTextTextInsert obj :: a
obj detail :: Maybe Text
detail cb :: TextTextInsertCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextInsertCallback
cb' = TextTextInsertCallback -> C_TextTextInsertCallback
wrap_TextTextInsertCallback TextTextInsertCallback
cb
FunPtr C_TextTextInsertCallback
cb'' <- C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback)
mk_TextTextInsertCallback C_TextTextInsertCallback
cb'
a
-> Text
-> FunPtr C_TextTextInsertCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-insert" FunPtr C_TextTextInsertCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
detail
#if defined(ENABLE_OVERLOADING)
data TextTextInsertSignalInfo
instance SignalInfo TextTextInsertSignalInfo where
type HaskellCallbackType TextTextInsertSignalInfo = TextTextInsertCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_TextTextInsertCallback cb
cb'' <- mk_TextTextInsertCallback cb'
connectSignalFunPtr obj "text-insert" cb'' connectMode detail
#endif
type TextTextRemoveCallback =
Int32
-> Int32
-> T.Text
-> IO ()
noTextTextRemoveCallback :: Maybe TextTextRemoveCallback
noTextTextRemoveCallback :: Maybe TextTextInsertCallback
noTextTextRemoveCallback = Maybe TextTextInsertCallback
forall a. Maybe a
Nothing
type C_TextTextRemoveCallback =
Ptr () ->
Int32 ->
Int32 ->
CString ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTextRemoveCallback :: C_TextTextRemoveCallback -> IO (FunPtr C_TextTextRemoveCallback)
genClosure_TextTextRemove :: MonadIO m => TextTextRemoveCallback -> m (GClosure C_TextTextRemoveCallback)
genClosure_TextTextRemove :: TextTextInsertCallback -> m (GClosure C_TextTextInsertCallback)
genClosure_TextTextRemove cb :: TextTextInsertCallback
cb = IO (GClosure C_TextTextInsertCallback)
-> m (GClosure C_TextTextInsertCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TextTextInsertCallback)
-> m (GClosure C_TextTextInsertCallback))
-> IO (GClosure C_TextTextInsertCallback)
-> m (GClosure C_TextTextInsertCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextInsertCallback
cb' = TextTextInsertCallback -> C_TextTextInsertCallback
wrap_TextTextRemoveCallback TextTextInsertCallback
cb
C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback)
mk_TextTextRemoveCallback C_TextTextInsertCallback
cb' IO (FunPtr C_TextTextInsertCallback)
-> (FunPtr C_TextTextInsertCallback
-> IO (GClosure C_TextTextInsertCallback))
-> IO (GClosure C_TextTextInsertCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TextTextInsertCallback
-> IO (GClosure C_TextTextInsertCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TextTextRemoveCallback ::
TextTextRemoveCallback ->
C_TextTextRemoveCallback
wrap_TextTextRemoveCallback :: TextTextInsertCallback -> C_TextTextInsertCallback
wrap_TextTextRemoveCallback _cb :: TextTextInsertCallback
_cb _ arg1 :: Int32
arg1 arg2 :: Int32
arg2 arg3 :: CString
arg3 _ = do
Text
arg3' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
arg3
TextTextInsertCallback
_cb Int32
arg1 Int32
arg2 Text
arg3'
onTextTextRemove :: (IsText a, MonadIO m) => a -> P.Maybe T.Text -> TextTextRemoveCallback -> m SignalHandlerId
onTextTextRemove :: a -> Maybe Text -> TextTextInsertCallback -> m SignalHandlerId
onTextTextRemove obj :: a
obj detail :: Maybe Text
detail cb :: TextTextInsertCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextInsertCallback
cb' = TextTextInsertCallback -> C_TextTextInsertCallback
wrap_TextTextRemoveCallback TextTextInsertCallback
cb
FunPtr C_TextTextInsertCallback
cb'' <- C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback)
mk_TextTextRemoveCallback C_TextTextInsertCallback
cb'
a
-> Text
-> FunPtr C_TextTextInsertCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-remove" FunPtr C_TextTextInsertCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
detail
afterTextTextRemove :: (IsText a, MonadIO m) => a -> P.Maybe T.Text -> TextTextRemoveCallback -> m SignalHandlerId
afterTextTextRemove :: a -> Maybe Text -> TextTextInsertCallback -> m SignalHandlerId
afterTextTextRemove obj :: a
obj detail :: Maybe Text
detail cb :: TextTextInsertCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextInsertCallback
cb' = TextTextInsertCallback -> C_TextTextInsertCallback
wrap_TextTextRemoveCallback TextTextInsertCallback
cb
FunPtr C_TextTextInsertCallback
cb'' <- C_TextTextInsertCallback -> IO (FunPtr C_TextTextInsertCallback)
mk_TextTextRemoveCallback C_TextTextInsertCallback
cb'
a
-> Text
-> FunPtr C_TextTextInsertCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-remove" FunPtr C_TextTextInsertCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
detail
#if defined(ENABLE_OVERLOADING)
data TextTextRemoveSignalInfo
instance SignalInfo TextTextRemoveSignalInfo where
type HaskellCallbackType TextTextRemoveSignalInfo = TextTextRemoveCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_TextTextRemoveCallback cb
cb'' <- mk_TextTextRemoveCallback cb'
connectSignalFunPtr obj "text-remove" cb'' connectMode detail
#endif
type TextTextSelectionChangedCallback =
IO ()
noTextTextSelectionChangedCallback :: Maybe TextTextSelectionChangedCallback
noTextTextSelectionChangedCallback :: Maybe TextTextAttributesChangedCallback
noTextTextSelectionChangedCallback = Maybe TextTextAttributesChangedCallback
forall a. Maybe a
Nothing
type C_TextTextSelectionChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTextSelectionChangedCallback :: C_TextTextSelectionChangedCallback -> IO (FunPtr C_TextTextSelectionChangedCallback)
genClosure_TextTextSelectionChanged :: MonadIO m => TextTextSelectionChangedCallback -> m (GClosure C_TextTextSelectionChangedCallback)
genClosure_TextTextSelectionChanged :: TextTextAttributesChangedCallback
-> m (GClosure C_TextTextAttributesChangedCallback)
genClosure_TextTextSelectionChanged cb :: TextTextAttributesChangedCallback
cb = IO (GClosure C_TextTextAttributesChangedCallback)
-> m (GClosure C_TextTextAttributesChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TextTextAttributesChangedCallback)
-> m (GClosure C_TextTextAttributesChangedCallback))
-> IO (GClosure C_TextTextAttributesChangedCallback)
-> m (GClosure C_TextTextAttributesChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextAttributesChangedCallback
cb' = TextTextAttributesChangedCallback
-> C_TextTextAttributesChangedCallback
wrap_TextTextSelectionChangedCallback TextTextAttributesChangedCallback
cb
C_TextTextAttributesChangedCallback
-> IO (FunPtr C_TextTextAttributesChangedCallback)
mk_TextTextSelectionChangedCallback C_TextTextAttributesChangedCallback
cb' IO (FunPtr C_TextTextAttributesChangedCallback)
-> (FunPtr C_TextTextAttributesChangedCallback
-> IO (GClosure C_TextTextAttributesChangedCallback))
-> IO (GClosure C_TextTextAttributesChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TextTextAttributesChangedCallback
-> IO (GClosure C_TextTextAttributesChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TextTextSelectionChangedCallback ::
TextTextSelectionChangedCallback ->
C_TextTextSelectionChangedCallback
wrap_TextTextSelectionChangedCallback :: TextTextAttributesChangedCallback
-> C_TextTextAttributesChangedCallback
wrap_TextTextSelectionChangedCallback _cb :: TextTextAttributesChangedCallback
_cb _ _ = do
TextTextAttributesChangedCallback
_cb
onTextTextSelectionChanged :: (IsText a, MonadIO m) => a -> TextTextSelectionChangedCallback -> m SignalHandlerId
onTextTextSelectionChanged :: a -> TextTextAttributesChangedCallback -> m SignalHandlerId
onTextTextSelectionChanged obj :: a
obj cb :: TextTextAttributesChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextAttributesChangedCallback
cb' = TextTextAttributesChangedCallback
-> C_TextTextAttributesChangedCallback
wrap_TextTextSelectionChangedCallback TextTextAttributesChangedCallback
cb
FunPtr C_TextTextAttributesChangedCallback
cb'' <- C_TextTextAttributesChangedCallback
-> IO (FunPtr C_TextTextAttributesChangedCallback)
mk_TextTextSelectionChangedCallback C_TextTextAttributesChangedCallback
cb'
a
-> Text
-> FunPtr C_TextTextAttributesChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-selection-changed" FunPtr C_TextTextAttributesChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterTextTextSelectionChanged :: (IsText a, MonadIO m) => a -> TextTextSelectionChangedCallback -> m SignalHandlerId
afterTextTextSelectionChanged :: a -> TextTextAttributesChangedCallback -> m SignalHandlerId
afterTextTextSelectionChanged obj :: a
obj cb :: TextTextAttributesChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_TextTextAttributesChangedCallback
cb' = TextTextAttributesChangedCallback
-> C_TextTextAttributesChangedCallback
wrap_TextTextSelectionChangedCallback TextTextAttributesChangedCallback
cb
FunPtr C_TextTextAttributesChangedCallback
cb'' <- C_TextTextAttributesChangedCallback
-> IO (FunPtr C_TextTextAttributesChangedCallback)
mk_TextTextSelectionChangedCallback C_TextTextAttributesChangedCallback
cb'
a
-> Text
-> FunPtr C_TextTextAttributesChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "text-selection-changed" FunPtr C_TextTextAttributesChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data TextTextSelectionChangedSignalInfo
instance SignalInfo TextTextSelectionChangedSignalInfo where
type HaskellCallbackType TextTextSelectionChangedSignalInfo = TextTextSelectionChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_TextTextSelectionChangedCallback cb
cb'' <- mk_TextTextSelectionChangedCallback cb'
connectSignalFunPtr obj "text-selection-changed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Text = TextSignalList
type TextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("textAttributesChanged", TextTextAttributesChangedSignalInfo), '("textCaretMoved", TextTextCaretMovedSignalInfo), '("textChanged", TextTextChangedSignalInfo), '("textInsert", TextTextInsertSignalInfo), '("textRemove", TextTextRemoveSignalInfo), '("textSelectionChanged", TextTextSelectionChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "atk_text_get_type"
c_atk_text_get_type :: IO GType
instance GObject Text where
gobjectType :: IO GType
gobjectType = IO GType
c_atk_text_get_type
instance B.GValue.IsGValue Text where
toGValue :: Text -> IO GValue
toGValue o :: Text
o = do
GType
gtype <- IO GType
c_atk_text_get_type
Text -> (Ptr Text -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Text
o (GType
-> (GValue -> Ptr Text -> TextTextAttributesChangedCallback)
-> Ptr Text
-> IO GValue
forall a.
GType
-> (GValue -> a -> TextTextAttributesChangedCallback)
-> a
-> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Text -> TextTextAttributesChangedCallback
forall a.
GObject a =>
GValue -> Ptr a -> TextTextAttributesChangedCallback
B.GValue.set_object)
fromGValue :: GValue -> IO Text
fromGValue gv :: GValue
gv = do
Ptr Text
ptr <- GValue -> IO (Ptr Text)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Text)
(ManagedPtr Text -> Text) -> Ptr Text -> IO Text
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Text -> Text
Text Ptr Text
ptr
class (GObject o, O.IsDescendantOf Text o) => IsText o
instance (GObject o, O.IsDescendantOf Text o) => IsText o
instance O.HasParentTypes Text
type instance O.ParentTypes Text = '[GObject.Object.Object]
toText :: (MonadIO m, IsText o) => o -> m Text
toText :: o -> m Text
toText = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> (o -> IO Text) -> o -> m Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Text -> Text) -> o -> IO Text
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Text -> Text
Text
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Text
type instance O.AttributeList Text = TextAttributeList
type TextAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTextMethod (t :: Symbol) (o :: *) :: * where
ResolveTextMethod "addSelection" o = TextAddSelectionMethodInfo
ResolveTextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTextMethod "removeSelection" o = TextRemoveSelectionMethodInfo
ResolveTextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTextMethod "scrollSubstringTo" o = TextScrollSubstringToMethodInfo
ResolveTextMethod "scrollSubstringToPoint" o = TextScrollSubstringToPointMethodInfo
ResolveTextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTextMethod "getBoundedRanges" o = TextGetBoundedRangesMethodInfo
ResolveTextMethod "getCaretOffset" o = TextGetCaretOffsetMethodInfo
ResolveTextMethod "getCharacterAtOffset" o = TextGetCharacterAtOffsetMethodInfo
ResolveTextMethod "getCharacterCount" o = TextGetCharacterCountMethodInfo
ResolveTextMethod "getCharacterExtents" o = TextGetCharacterExtentsMethodInfo
ResolveTextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTextMethod "getDefaultAttributes" o = TextGetDefaultAttributesMethodInfo
ResolveTextMethod "getNSelections" o = TextGetNSelectionsMethodInfo
ResolveTextMethod "getOffsetAtPoint" o = TextGetOffsetAtPointMethodInfo
ResolveTextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTextMethod "getRangeExtents" o = TextGetRangeExtentsMethodInfo
ResolveTextMethod "getRunAttributes" o = TextGetRunAttributesMethodInfo
ResolveTextMethod "getSelection" o = TextGetSelectionMethodInfo
ResolveTextMethod "getStringAtOffset" o = TextGetStringAtOffsetMethodInfo
ResolveTextMethod "getText" o = TextGetTextMethodInfo
ResolveTextMethod "getTextAfterOffset" o = TextGetTextAfterOffsetMethodInfo
ResolveTextMethod "getTextAtOffset" o = TextGetTextAtOffsetMethodInfo
ResolveTextMethod "getTextBeforeOffset" o = TextGetTextBeforeOffsetMethodInfo
ResolveTextMethod "setCaretOffset" o = TextSetCaretOffsetMethodInfo
ResolveTextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveTextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTextMethod "setSelection" o = TextSetSelectionMethodInfo
ResolveTextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTextMethod t Text, O.MethodInfo info Text p) => OL.IsLabel t (Text -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "atk_text_add_selection" atk_text_add_selection ::
Ptr Text ->
Int32 ->
Int32 ->
IO CInt
textAddSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Int32
-> m Bool
textAddSelection :: a -> Int32 -> Int32 -> m Bool
textAddSelection text :: a
text startOffset :: Int32
startOffset endOffset :: Int32
endOffset = 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 Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
CInt
result <- Ptr Text -> Int32 -> Int32 -> IO CInt
atk_text_add_selection Ptr Text
text' Int32
startOffset Int32
endOffset
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TextAddSelectionMethodInfo
instance (signature ~ (Int32 -> Int32 -> m Bool), MonadIO m, IsText a) => O.MethodInfo TextAddSelectionMethodInfo a signature where
overloadedMethod = textAddSelection
#endif
foreign import ccall "atk_text_get_bounded_ranges" atk_text_get_bounded_ranges ::
Ptr Text ->
Ptr Atk.TextRectangle.TextRectangle ->
CUInt ->
CUInt ->
CUInt ->
IO (Ptr (Ptr Atk.TextRange.TextRange))
textGetBoundedRanges ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Atk.TextRectangle.TextRectangle
-> Atk.Enums.CoordType
-> Atk.Enums.TextClipType
-> Atk.Enums.TextClipType
-> m [Atk.TextRange.TextRange]
textGetBoundedRanges :: a
-> TextRectangle
-> CoordType
-> TextClipType
-> TextClipType
-> m [TextRange]
textGetBoundedRanges text :: a
text rect :: TextRectangle
rect coordType :: CoordType
coordType xClipType :: TextClipType
xClipType yClipType :: TextClipType
yClipType = IO [TextRange] -> m [TextRange]
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
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
Ptr TextRectangle
rect' <- TextRectangle -> IO (Ptr TextRectangle)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextRectangle
rect
let coordType' :: CUInt
coordType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (CoordType -> Int) -> CoordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CoordType -> Int
forall a. Enum a => a -> Int
fromEnum) CoordType
coordType
let xClipType' :: CUInt
xClipType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TextClipType -> Int) -> TextClipType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TextClipType -> Int
forall a. Enum a => a -> Int
fromEnum) TextClipType
xClipType
let yClipType' :: CUInt
yClipType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TextClipType -> Int) -> TextClipType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TextClipType -> Int
forall a. Enum a => a -> Int
fromEnum) TextClipType
yClipType
Ptr (Ptr TextRange)
result <- Ptr Text
-> Ptr TextRectangle
-> CUInt
-> CUInt
-> CUInt
-> IO (Ptr (Ptr TextRange))
atk_text_get_bounded_ranges Ptr Text
text' Ptr TextRectangle
rect' CUInt
coordType' CUInt
xClipType' CUInt
yClipType'
Text -> Ptr (Ptr TextRange) -> TextTextAttributesChangedCallback
forall a.
HasCallStack =>
Text -> Ptr a -> TextTextAttributesChangedCallback
checkUnexpectedReturnNULL "textGetBoundedRanges" Ptr (Ptr TextRange)
result
[Ptr TextRange]
result' <- Ptr (Ptr TextRange) -> IO [Ptr TextRange]
forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr TextRange)
result
[TextRange]
result'' <- (Ptr TextRange -> IO TextRange)
-> [Ptr TextRange] -> IO [TextRange]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr TextRange -> TextRange)
-> Ptr TextRange -> IO TextRange
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextRange -> TextRange
Atk.TextRange.TextRange) [Ptr TextRange]
result'
Ptr (Ptr TextRange) -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr (Ptr TextRange)
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
TextRectangle -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr TextRectangle
rect
[TextRange] -> IO [TextRange]
forall (m :: * -> *) a. Monad m => a -> m a
return [TextRange]
result''
#if defined(ENABLE_OVERLOADING)
data TextGetBoundedRangesMethodInfo
instance (signature ~ (Atk.TextRectangle.TextRectangle -> Atk.Enums.CoordType -> Atk.Enums.TextClipType -> Atk.Enums.TextClipType -> m [Atk.TextRange.TextRange]), MonadIO m, IsText a) => O.MethodInfo TextGetBoundedRangesMethodInfo a signature where
overloadedMethod = textGetBoundedRanges
#endif
foreign import ccall "atk_text_get_caret_offset" atk_text_get_caret_offset ::
Ptr Text ->
IO Int32
textGetCaretOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> m Int32
textGetCaretOffset :: a -> m Int32
textGetCaretOffset text :: a
text = IO Int32 -> m Int32
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
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
Int32
result <- Ptr Text -> IO Int32
atk_text_get_caret_offset Ptr Text
text'
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextGetCaretOffsetMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsText a) => O.MethodInfo TextGetCaretOffsetMethodInfo a signature where
overloadedMethod = textGetCaretOffset
#endif
foreign import ccall "atk_text_get_character_at_offset" atk_text_get_character_at_offset ::
Ptr Text ->
Int32 ->
IO CInt
textGetCharacterAtOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> m Char
textGetCharacterAtOffset :: a -> Int32 -> m Char
textGetCharacterAtOffset text :: a
text offset :: Int32
offset = IO Char -> m Char
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Char -> m Char) -> IO Char -> m Char
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
CInt
result <- Ptr Text -> Int32 -> IO CInt
atk_text_get_character_at_offset Ptr Text
text' Int32
offset
let result' :: Char
result' = (Int -> Char
chr (Int -> Char) -> (CInt -> Int) -> CInt -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Char -> IO Char
forall (m :: * -> *) a. Monad m => a -> m a
return Char
result'
#if defined(ENABLE_OVERLOADING)
data TextGetCharacterAtOffsetMethodInfo
instance (signature ~ (Int32 -> m Char), MonadIO m, IsText a) => O.MethodInfo TextGetCharacterAtOffsetMethodInfo a signature where
overloadedMethod = textGetCharacterAtOffset
#endif
foreign import ccall "atk_text_get_character_count" atk_text_get_character_count ::
Ptr Text ->
IO Int32
textGetCharacterCount ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> m Int32
textGetCharacterCount :: a -> m Int32
textGetCharacterCount text :: a
text = IO Int32 -> m Int32
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
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
Int32
result <- Ptr Text -> IO Int32
atk_text_get_character_count Ptr Text
text'
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextGetCharacterCountMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsText a) => O.MethodInfo TextGetCharacterCountMethodInfo a signature where
overloadedMethod = textGetCharacterCount
#endif
foreign import ccall "atk_text_get_character_extents" atk_text_get_character_extents ::
Ptr Text ->
Int32 ->
Ptr Int32 ->
Ptr Int32 ->
Ptr Int32 ->
Ptr Int32 ->
CUInt ->
IO ()
textGetCharacterExtents ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Atk.Enums.CoordType
-> m ((Int32, Int32, Int32, Int32))
textGetCharacterExtents :: a -> Int32 -> CoordType -> m (Int32, Int32, Int32, Int32)
textGetCharacterExtents text :: a
text offset :: Int32
offset coords :: CoordType
coords = IO (Int32, Int32, Int32, Int32) -> m (Int32, Int32, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Int32, Int32) -> m (Int32, Int32, Int32, Int32))
-> IO (Int32, Int32, Int32, Int32)
-> m (Int32, Int32, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
Ptr Int32
x <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
y <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
width <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
height <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
let coords' :: CUInt
coords' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (CoordType -> Int) -> CoordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CoordType -> Int
forall a. Enum a => a -> Int
fromEnum) CoordType
coords
Ptr Text
-> Int32
-> Ptr Int32
-> Ptr Int32
-> Ptr Int32
-> Ptr Int32
-> CUInt
-> TextTextAttributesChangedCallback
atk_text_get_character_extents Ptr Text
text' Int32
offset Ptr Int32
x Ptr Int32
y Ptr Int32
width Ptr Int32
height CUInt
coords'
Int32
x' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
x
Int32
y' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
y
Int32
width' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
width
Int32
height' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
height
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
x
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
y
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
width
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
height
(Int32, Int32, Int32, Int32) -> IO (Int32, Int32, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x', Int32
y', Int32
width', Int32
height')
#if defined(ENABLE_OVERLOADING)
data TextGetCharacterExtentsMethodInfo
instance (signature ~ (Int32 -> Atk.Enums.CoordType -> m ((Int32, Int32, Int32, Int32))), MonadIO m, IsText a) => O.MethodInfo TextGetCharacterExtentsMethodInfo a signature where
overloadedMethod = textGetCharacterExtents
#endif
foreign import ccall "atk_text_get_default_attributes" atk_text_get_default_attributes ::
Ptr Text ->
IO (Ptr (GSList (Ptr ())))
textGetDefaultAttributes ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> m ([Ptr ()])
textGetDefaultAttributes :: a -> m [Ptr ()]
textGetDefaultAttributes text :: a
text = IO [Ptr ()] -> m [Ptr ()]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Ptr ()] -> m [Ptr ()]) -> IO [Ptr ()] -> m [Ptr ()]
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
Ptr (GSList (Ptr ()))
result <- Ptr Text -> IO (Ptr (GSList (Ptr ())))
atk_text_get_default_attributes Ptr Text
text'
[Ptr ()]
result' <- Ptr (GSList (Ptr ())) -> IO [Ptr ()]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr ()))
result
Ptr (GSList (Ptr ())) -> TextTextAttributesChangedCallback
forall a. Ptr (GSList a) -> TextTextAttributesChangedCallback
g_slist_free Ptr (GSList (Ptr ()))
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
[Ptr ()] -> IO [Ptr ()]
forall (m :: * -> *) a. Monad m => a -> m a
return [Ptr ()]
result'
#if defined(ENABLE_OVERLOADING)
data TextGetDefaultAttributesMethodInfo
instance (signature ~ (m ([Ptr ()])), MonadIO m, IsText a) => O.MethodInfo TextGetDefaultAttributesMethodInfo a signature where
overloadedMethod = textGetDefaultAttributes
#endif
foreign import ccall "atk_text_get_n_selections" atk_text_get_n_selections ::
Ptr Text ->
IO Int32
textGetNSelections ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> m Int32
textGetNSelections :: a -> m Int32
textGetNSelections text :: a
text = IO Int32 -> m Int32
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
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
Int32
result <- Ptr Text -> IO Int32
atk_text_get_n_selections Ptr Text
text'
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextGetNSelectionsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsText a) => O.MethodInfo TextGetNSelectionsMethodInfo a signature where
overloadedMethod = textGetNSelections
#endif
foreign import ccall "atk_text_get_offset_at_point" atk_text_get_offset_at_point ::
Ptr Text ->
Int32 ->
Int32 ->
CUInt ->
IO Int32
textGetOffsetAtPoint ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Int32
-> Atk.Enums.CoordType
-> m Int32
textGetOffsetAtPoint :: a -> Int32 -> Int32 -> CoordType -> m Int32
textGetOffsetAtPoint text :: a
text x :: Int32
x y :: Int32
y coords :: CoordType
coords = IO Int32 -> m Int32
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
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
let coords' :: CUInt
coords' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (CoordType -> Int) -> CoordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CoordType -> Int
forall a. Enum a => a -> Int
fromEnum) CoordType
coords
Int32
result <- Ptr Text -> Int32 -> Int32 -> CUInt -> IO Int32
atk_text_get_offset_at_point Ptr Text
text' Int32
x Int32
y CUInt
coords'
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TextGetOffsetAtPointMethodInfo
instance (signature ~ (Int32 -> Int32 -> Atk.Enums.CoordType -> m Int32), MonadIO m, IsText a) => O.MethodInfo TextGetOffsetAtPointMethodInfo a signature where
overloadedMethod = textGetOffsetAtPoint
#endif
foreign import ccall "atk_text_get_range_extents" atk_text_get_range_extents ::
Ptr Text ->
Int32 ->
Int32 ->
CUInt ->
Ptr Atk.TextRectangle.TextRectangle ->
IO ()
textGetRangeExtents ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Int32
-> Atk.Enums.CoordType
-> m (Atk.TextRectangle.TextRectangle)
textGetRangeExtents :: a -> Int32 -> Int32 -> CoordType -> m TextRectangle
textGetRangeExtents text :: a
text startOffset :: Int32
startOffset endOffset :: Int32
endOffset coordType :: CoordType
coordType = IO TextRectangle -> m TextRectangle
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
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
let coordType' :: CUInt
coordType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (CoordType -> Int) -> CoordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CoordType -> Int
forall a. Enum a => a -> Int
fromEnum) CoordType
coordType
Ptr TextRectangle
rect <- Int -> IO (Ptr TextRectangle)
forall a. Int -> IO (Ptr a)
callocBytes 16 :: IO (Ptr Atk.TextRectangle.TextRectangle)
Ptr Text
-> Int32
-> Int32
-> CUInt
-> Ptr TextRectangle
-> TextTextAttributesChangedCallback
atk_text_get_range_extents Ptr Text
text' Int32
startOffset Int32
endOffset CUInt
coordType' Ptr TextRectangle
rect
TextRectangle
rect' <- ((ManagedPtr TextRectangle -> TextRectangle)
-> Ptr TextRectangle -> IO TextRectangle
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr TextRectangle -> TextRectangle
Atk.TextRectangle.TextRectangle) Ptr TextRectangle
rect
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
TextRectangle -> IO TextRectangle
forall (m :: * -> *) a. Monad m => a -> m a
return TextRectangle
rect'
#if defined(ENABLE_OVERLOADING)
data TextGetRangeExtentsMethodInfo
instance (signature ~ (Int32 -> Int32 -> Atk.Enums.CoordType -> m (Atk.TextRectangle.TextRectangle)), MonadIO m, IsText a) => O.MethodInfo TextGetRangeExtentsMethodInfo a signature where
overloadedMethod = textGetRangeExtents
#endif
foreign import ccall "atk_text_get_run_attributes" atk_text_get_run_attributes ::
Ptr Text ->
Int32 ->
Ptr Int32 ->
Ptr Int32 ->
IO (Ptr (GSList (Ptr ())))
textGetRunAttributes ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> m (([Ptr ()], Int32, Int32))
textGetRunAttributes :: a -> Int32 -> m ([Ptr ()], Int32, Int32)
textGetRunAttributes text :: a
text offset :: Int32
offset = IO ([Ptr ()], Int32, Int32) -> m ([Ptr ()], Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ([Ptr ()], Int32, Int32) -> m ([Ptr ()], Int32, Int32))
-> IO ([Ptr ()], Int32, Int32) -> m ([Ptr ()], Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
Ptr Int32
startOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr (GSList (Ptr ()))
result <- Ptr Text
-> Int32 -> Ptr Int32 -> Ptr Int32 -> IO (Ptr (GSList (Ptr ())))
atk_text_get_run_attributes Ptr Text
text' Int32
offset Ptr Int32
startOffset Ptr Int32
endOffset
[Ptr ()]
result' <- Ptr (GSList (Ptr ())) -> IO [Ptr ()]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr ()))
result
Ptr (GSList (Ptr ())) -> TextTextAttributesChangedCallback
forall a. Ptr (GSList a) -> TextTextAttributesChangedCallback
g_slist_free Ptr (GSList (Ptr ()))
result
Int32
startOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startOffset
Int32
endOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endOffset
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
startOffset
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
endOffset
([Ptr ()], Int32, Int32) -> IO ([Ptr ()], Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return ([Ptr ()]
result', Int32
startOffset', Int32
endOffset')
#if defined(ENABLE_OVERLOADING)
data TextGetRunAttributesMethodInfo
instance (signature ~ (Int32 -> m (([Ptr ()], Int32, Int32))), MonadIO m, IsText a) => O.MethodInfo TextGetRunAttributesMethodInfo a signature where
overloadedMethod = textGetRunAttributes
#endif
foreign import ccall "atk_text_get_selection" atk_text_get_selection ::
Ptr Text ->
Int32 ->
Ptr Int32 ->
Ptr Int32 ->
IO CString
textGetSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> m ((T.Text, Int32, Int32))
textGetSelection :: a -> Int32 -> m (Text, Int32, Int32)
textGetSelection text :: a
text selectionNum :: Int32
selectionNum = IO (Text, Int32, Int32) -> m (Text, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Int32, Int32) -> m (Text, Int32, Int32))
-> IO (Text, Int32, Int32) -> m (Text, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
Ptr Int32
startOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CString
result <- Ptr Text -> Int32 -> Ptr Int32 -> Ptr Int32 -> IO CString
atk_text_get_selection Ptr Text
text' Int32
selectionNum Ptr Int32
startOffset Ptr Int32
endOffset
Text -> CString -> TextTextAttributesChangedCallback
forall a.
HasCallStack =>
Text -> Ptr a -> TextTextAttributesChangedCallback
checkUnexpectedReturnNULL "textGetSelection" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem CString
result
Int32
startOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startOffset
Int32
endOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endOffset
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
startOffset
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
endOffset
(Text, Int32, Int32) -> IO (Text, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Int32
startOffset', Int32
endOffset')
#if defined(ENABLE_OVERLOADING)
data TextGetSelectionMethodInfo
instance (signature ~ (Int32 -> m ((T.Text, Int32, Int32))), MonadIO m, IsText a) => O.MethodInfo TextGetSelectionMethodInfo a signature where
overloadedMethod = textGetSelection
#endif
foreign import ccall "atk_text_get_string_at_offset" atk_text_get_string_at_offset ::
Ptr Text ->
Int32 ->
CUInt ->
Ptr Int32 ->
Ptr Int32 ->
IO CString
textGetStringAtOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Atk.Enums.TextGranularity
-> m ((Maybe T.Text, Int32, Int32))
textGetStringAtOffset :: a -> Int32 -> TextGranularity -> m (Maybe Text, Int32, Int32)
textGetStringAtOffset text :: a
text offset :: Int32
offset granularity :: TextGranularity
granularity = IO (Maybe Text, Int32, Int32) -> m (Maybe Text, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text, Int32, Int32) -> m (Maybe Text, Int32, Int32))
-> IO (Maybe Text, Int32, Int32) -> m (Maybe Text, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
let granularity' :: CUInt
granularity' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (TextGranularity -> Int) -> TextGranularity -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TextGranularity -> Int
forall a. Enum a => a -> Int
fromEnum) TextGranularity
granularity
Ptr Int32
startOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CString
result <- Ptr Text -> Int32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO CString
atk_text_get_string_at_offset Ptr Text
text' Int32
offset CUInt
granularity' Ptr Int32
startOffset Ptr Int32
endOffset
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 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
Int32
startOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startOffset
Int32
endOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endOffset
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
startOffset
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
endOffset
(Maybe Text, Int32, Int32) -> IO (Maybe Text, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Text
maybeResult, Int32
startOffset', Int32
endOffset')
#if defined(ENABLE_OVERLOADING)
data TextGetStringAtOffsetMethodInfo
instance (signature ~ (Int32 -> Atk.Enums.TextGranularity -> m ((Maybe T.Text, Int32, Int32))), MonadIO m, IsText a) => O.MethodInfo TextGetStringAtOffsetMethodInfo a signature where
overloadedMethod = textGetStringAtOffset
#endif
foreign import ccall "atk_text_get_text" atk_text_get_text ::
Ptr Text ->
Int32 ->
Int32 ->
IO CString
textGetText ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Int32
-> m T.Text
textGetText :: a -> Int32 -> Int32 -> m Text
textGetText text :: a
text startOffset :: Int32
startOffset endOffset :: Int32
endOffset = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
CString
result <- Ptr Text -> Int32 -> Int32 -> IO CString
atk_text_get_text Ptr Text
text' Int32
startOffset Int32
endOffset
Text -> CString -> TextTextAttributesChangedCallback
forall a.
HasCallStack =>
Text -> Ptr a -> TextTextAttributesChangedCallback
checkUnexpectedReturnNULL "textGetText" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem CString
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data TextGetTextMethodInfo
instance (signature ~ (Int32 -> Int32 -> m T.Text), MonadIO m, IsText a) => O.MethodInfo TextGetTextMethodInfo a signature where
overloadedMethod = textGetText
#endif
foreign import ccall "atk_text_get_text_after_offset" atk_text_get_text_after_offset ::
Ptr Text ->
Int32 ->
CUInt ->
Ptr Int32 ->
Ptr Int32 ->
IO CString
{-# DEPRECATED textGetTextAfterOffset ["(Since version 2.9.3)","Please use 'GI.Atk.Interfaces.Text.textGetStringAtOffset' instead."] #-}
textGetTextAfterOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Atk.Enums.TextBoundary
-> m ((T.Text, Int32, Int32))
textGetTextAfterOffset :: a -> Int32 -> TextBoundary -> m (Text, Int32, Int32)
textGetTextAfterOffset text :: a
text offset :: Int32
offset boundaryType :: TextBoundary
boundaryType = IO (Text, Int32, Int32) -> m (Text, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Int32, Int32) -> m (Text, Int32, Int32))
-> IO (Text, Int32, Int32) -> m (Text, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
let boundaryType' :: CUInt
boundaryType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TextBoundary -> Int) -> TextBoundary -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TextBoundary -> Int
forall a. Enum a => a -> Int
fromEnum) TextBoundary
boundaryType
Ptr Int32
startOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CString
result <- Ptr Text -> Int32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO CString
atk_text_get_text_after_offset Ptr Text
text' Int32
offset CUInt
boundaryType' Ptr Int32
startOffset Ptr Int32
endOffset
Text -> CString -> TextTextAttributesChangedCallback
forall a.
HasCallStack =>
Text -> Ptr a -> TextTextAttributesChangedCallback
checkUnexpectedReturnNULL "textGetTextAfterOffset" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem CString
result
Int32
startOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startOffset
Int32
endOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endOffset
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
startOffset
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
endOffset
(Text, Int32, Int32) -> IO (Text, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Int32
startOffset', Int32
endOffset')
#if defined(ENABLE_OVERLOADING)
data TextGetTextAfterOffsetMethodInfo
instance (signature ~ (Int32 -> Atk.Enums.TextBoundary -> m ((T.Text, Int32, Int32))), MonadIO m, IsText a) => O.MethodInfo TextGetTextAfterOffsetMethodInfo a signature where
overloadedMethod = textGetTextAfterOffset
#endif
foreign import ccall "atk_text_get_text_at_offset" atk_text_get_text_at_offset ::
Ptr Text ->
Int32 ->
CUInt ->
Ptr Int32 ->
Ptr Int32 ->
IO CString
{-# DEPRECATED textGetTextAtOffset ["This method is deprecated since ATK version","2.9.4. Please use 'GI.Atk.Interfaces.Text.textGetStringAtOffset' instead."] #-}
textGetTextAtOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Atk.Enums.TextBoundary
-> m ((T.Text, Int32, Int32))
textGetTextAtOffset :: a -> Int32 -> TextBoundary -> m (Text, Int32, Int32)
textGetTextAtOffset text :: a
text offset :: Int32
offset boundaryType :: TextBoundary
boundaryType = IO (Text, Int32, Int32) -> m (Text, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Int32, Int32) -> m (Text, Int32, Int32))
-> IO (Text, Int32, Int32) -> m (Text, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
let boundaryType' :: CUInt
boundaryType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TextBoundary -> Int) -> TextBoundary -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TextBoundary -> Int
forall a. Enum a => a -> Int
fromEnum) TextBoundary
boundaryType
Ptr Int32
startOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CString
result <- Ptr Text -> Int32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO CString
atk_text_get_text_at_offset Ptr Text
text' Int32
offset CUInt
boundaryType' Ptr Int32
startOffset Ptr Int32
endOffset
Text -> CString -> TextTextAttributesChangedCallback
forall a.
HasCallStack =>
Text -> Ptr a -> TextTextAttributesChangedCallback
checkUnexpectedReturnNULL "textGetTextAtOffset" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem CString
result
Int32
startOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startOffset
Int32
endOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endOffset
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
startOffset
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
endOffset
(Text, Int32, Int32) -> IO (Text, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Int32
startOffset', Int32
endOffset')
#if defined(ENABLE_OVERLOADING)
data TextGetTextAtOffsetMethodInfo
instance (signature ~ (Int32 -> Atk.Enums.TextBoundary -> m ((T.Text, Int32, Int32))), MonadIO m, IsText a) => O.MethodInfo TextGetTextAtOffsetMethodInfo a signature where
overloadedMethod = textGetTextAtOffset
#endif
foreign import ccall "atk_text_get_text_before_offset" atk_text_get_text_before_offset ::
Ptr Text ->
Int32 ->
CUInt ->
Ptr Int32 ->
Ptr Int32 ->
IO CString
{-# DEPRECATED textGetTextBeforeOffset ["(Since version 2.9.3)","Please use 'GI.Atk.Interfaces.Text.textGetStringAtOffset' instead."] #-}
textGetTextBeforeOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Atk.Enums.TextBoundary
-> m ((T.Text, Int32, Int32))
textGetTextBeforeOffset :: a -> Int32 -> TextBoundary -> m (Text, Int32, Int32)
textGetTextBeforeOffset text :: a
text offset :: Int32
offset boundaryType :: TextBoundary
boundaryType = IO (Text, Int32, Int32) -> m (Text, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Text, Int32, Int32) -> m (Text, Int32, Int32))
-> IO (Text, Int32, Int32) -> m (Text, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
let boundaryType' :: CUInt
boundaryType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TextBoundary -> Int) -> TextBoundary -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TextBoundary -> Int
forall a. Enum a => a -> Int
fromEnum) TextBoundary
boundaryType
Ptr Int32
startOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endOffset <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CString
result <- Ptr Text -> Int32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO CString
atk_text_get_text_before_offset Ptr Text
text' Int32
offset CUInt
boundaryType' Ptr Int32
startOffset Ptr Int32
endOffset
Text -> CString -> TextTextAttributesChangedCallback
forall a.
HasCallStack =>
Text -> Ptr a -> TextTextAttributesChangedCallback
checkUnexpectedReturnNULL "textGetTextBeforeOffset" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem CString
result
Int32
startOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startOffset
Int32
endOffset' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endOffset
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
startOffset
Ptr Int32 -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr Int32
endOffset
(Text, Int32, Int32) -> IO (Text, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Text
result', Int32
startOffset', Int32
endOffset')
#if defined(ENABLE_OVERLOADING)
data TextGetTextBeforeOffsetMethodInfo
instance (signature ~ (Int32 -> Atk.Enums.TextBoundary -> m ((T.Text, Int32, Int32))), MonadIO m, IsText a) => O.MethodInfo TextGetTextBeforeOffsetMethodInfo a signature where
overloadedMethod = textGetTextBeforeOffset
#endif
foreign import ccall "atk_text_remove_selection" atk_text_remove_selection ::
Ptr Text ->
Int32 ->
IO CInt
textRemoveSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> m Bool
textRemoveSelection :: a -> Int32 -> m Bool
textRemoveSelection text :: a
text selectionNum :: Int32
selectionNum = 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 Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
CInt
result <- Ptr Text -> Int32 -> IO CInt
atk_text_remove_selection Ptr Text
text' Int32
selectionNum
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TextRemoveSelectionMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsText a) => O.MethodInfo TextRemoveSelectionMethodInfo a signature where
overloadedMethod = textRemoveSelection
#endif
foreign import ccall "atk_text_scroll_substring_to" atk_text_scroll_substring_to ::
Ptr Text ->
Int32 ->
Int32 ->
CUInt ->
IO CInt
textScrollSubstringTo ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Int32
-> Atk.Enums.ScrollType
-> m Bool
textScrollSubstringTo :: a -> Int32 -> Int32 -> ScrollType -> m Bool
textScrollSubstringTo text :: a
text startOffset :: Int32
startOffset endOffset :: Int32
endOffset type_ :: ScrollType
type_ = 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 Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ScrollType -> Int) -> ScrollType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ScrollType -> Int
forall a. Enum a => a -> Int
fromEnum) ScrollType
type_
CInt
result <- Ptr Text -> Int32 -> Int32 -> CUInt -> IO CInt
atk_text_scroll_substring_to Ptr Text
text' Int32
startOffset Int32
endOffset CUInt
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TextScrollSubstringToMethodInfo
instance (signature ~ (Int32 -> Int32 -> Atk.Enums.ScrollType -> m Bool), MonadIO m, IsText a) => O.MethodInfo TextScrollSubstringToMethodInfo a signature where
overloadedMethod = textScrollSubstringTo
#endif
foreign import ccall "atk_text_scroll_substring_to_point" atk_text_scroll_substring_to_point ::
Ptr Text ->
Int32 ->
Int32 ->
CUInt ->
Int32 ->
Int32 ->
IO CInt
textScrollSubstringToPoint ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Int32
-> Atk.Enums.CoordType
-> Int32
-> Int32
-> m Bool
textScrollSubstringToPoint :: a -> Int32 -> Int32 -> CoordType -> Int32 -> Int32 -> m Bool
textScrollSubstringToPoint text :: a
text startOffset :: Int32
startOffset endOffset :: Int32
endOffset coords :: CoordType
coords x :: Int32
x y :: Int32
y = 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 Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
let coords' :: CUInt
coords' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (CoordType -> Int) -> CoordType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CoordType -> Int
forall a. Enum a => a -> Int
fromEnum) CoordType
coords
CInt
result <- Ptr Text -> Int32 -> Int32 -> CUInt -> Int32 -> Int32 -> IO CInt
atk_text_scroll_substring_to_point Ptr Text
text' Int32
startOffset Int32
endOffset CUInt
coords' Int32
x Int32
y
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TextScrollSubstringToPointMethodInfo
instance (signature ~ (Int32 -> Int32 -> Atk.Enums.CoordType -> Int32 -> Int32 -> m Bool), MonadIO m, IsText a) => O.MethodInfo TextScrollSubstringToPointMethodInfo a signature where
overloadedMethod = textScrollSubstringToPoint
#endif
foreign import ccall "atk_text_set_caret_offset" atk_text_set_caret_offset ::
Ptr Text ->
Int32 ->
IO CInt
textSetCaretOffset ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> m Bool
textSetCaretOffset :: a -> Int32 -> m Bool
textSetCaretOffset text :: a
text offset :: Int32
offset = 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 Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
CInt
result <- Ptr Text -> Int32 -> IO CInt
atk_text_set_caret_offset Ptr Text
text' Int32
offset
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TextSetCaretOffsetMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsText a) => O.MethodInfo TextSetCaretOffsetMethodInfo a signature where
overloadedMethod = textSetCaretOffset
#endif
foreign import ccall "atk_text_set_selection" atk_text_set_selection ::
Ptr Text ->
Int32 ->
Int32 ->
Int32 ->
IO CInt
textSetSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsText a) =>
a
-> Int32
-> Int32
-> Int32
-> m Bool
textSetSelection :: a -> Int32 -> Int32 -> Int32 -> m Bool
textSetSelection text :: a
text selectionNum :: Int32
selectionNum startOffset :: Int32
startOffset endOffset :: Int32
endOffset = 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 Text
text' <- a -> IO (Ptr Text)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
text
CInt
result <- Ptr Text -> Int32 -> Int32 -> Int32 -> IO CInt
atk_text_set_selection Ptr Text
text' Int32
selectionNum Int32
startOffset Int32
endOffset
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr a
text
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TextSetSelectionMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> m Bool), MonadIO m, IsText a) => O.MethodInfo TextSetSelectionMethodInfo a signature where
overloadedMethod = textSetSelection
#endif
foreign import ccall "atk_text_free_ranges" atk_text_free_ranges ::
Ptr Atk.TextRange.TextRange ->
IO ()
textFreeRanges ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Atk.TextRange.TextRange]
-> m ()
textFreeRanges :: [TextRange] -> m ()
textFreeRanges ranges :: [TextRange]
ranges = TextTextAttributesChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (TextTextAttributesChangedCallback -> m ())
-> TextTextAttributesChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
[Ptr TextRange]
ranges' <- (TextRange -> IO (Ptr TextRange))
-> [TextRange] -> IO [Ptr TextRange]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM TextRange -> IO (Ptr TextRange)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [TextRange]
ranges
Ptr TextRange
ranges'' <- Int -> [Ptr TextRange] -> IO (Ptr TextRange)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray 32 [Ptr TextRange]
ranges'
Ptr TextRange -> TextTextAttributesChangedCallback
atk_text_free_ranges Ptr TextRange
ranges''
(TextRange -> TextTextAttributesChangedCallback)
-> [TextRange] -> TextTextAttributesChangedCallback
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ TextRange -> TextTextAttributesChangedCallback
forall a.
ManagedPtrNewtype a =>
a -> TextTextAttributesChangedCallback
touchManagedPtr [TextRange]
ranges
Ptr TextRange -> TextTextAttributesChangedCallback
forall a. Ptr a -> TextTextAttributesChangedCallback
freeMem Ptr TextRange
ranges''
() -> TextTextAttributesChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif