{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Interfaces.Editable
(
Editable(..) ,
IsEditable ,
toEditable ,
#if defined(ENABLE_OVERLOADING)
ResolveEditableMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
EditableCopyClipboardMethodInfo ,
#endif
editableCopyClipboard ,
#if defined(ENABLE_OVERLOADING)
EditableCutClipboardMethodInfo ,
#endif
editableCutClipboard ,
#if defined(ENABLE_OVERLOADING)
EditableDeleteSelectionMethodInfo ,
#endif
editableDeleteSelection ,
#if defined(ENABLE_OVERLOADING)
EditableDeleteTextMethodInfo ,
#endif
editableDeleteText ,
#if defined(ENABLE_OVERLOADING)
EditableGetCharsMethodInfo ,
#endif
editableGetChars ,
#if defined(ENABLE_OVERLOADING)
EditableGetEditableMethodInfo ,
#endif
editableGetEditable ,
#if defined(ENABLE_OVERLOADING)
EditableGetPositionMethodInfo ,
#endif
editableGetPosition ,
#if defined(ENABLE_OVERLOADING)
EditableGetSelectionBoundsMethodInfo ,
#endif
editableGetSelectionBounds ,
#if defined(ENABLE_OVERLOADING)
EditableInsertTextMethodInfo ,
#endif
editableInsertText ,
#if defined(ENABLE_OVERLOADING)
EditablePasteClipboardMethodInfo ,
#endif
editablePasteClipboard ,
#if defined(ENABLE_OVERLOADING)
EditableSelectRegionMethodInfo ,
#endif
editableSelectRegion ,
#if defined(ENABLE_OVERLOADING)
EditableSetEditableMethodInfo ,
#endif
editableSetEditable ,
#if defined(ENABLE_OVERLOADING)
EditableSetPositionMethodInfo ,
#endif
editableSetPosition ,
EditableChangedCallback ,
#if defined(ENABLE_OVERLOADING)
EditableChangedSignalInfo ,
#endif
afterEditableChanged ,
onEditableChanged ,
EditableDeleteTextCallback ,
#if defined(ENABLE_OVERLOADING)
EditableDeleteTextSignalInfo ,
#endif
afterEditableDeleteText ,
onEditableDeleteText ,
EditableInsertTextCallback ,
#if defined(ENABLE_OVERLOADING)
EditableInsertTextSignalInfo ,
#endif
afterEditableInsertText ,
onEditableInsertText ,
) 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 GI.GObject.Objects.Object as GObject.Object
newtype Editable = Editable (SP.ManagedPtr Editable)
deriving (Editable -> Editable -> Bool
(Editable -> Editable -> Bool)
-> (Editable -> Editable -> Bool) -> Eq Editable
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Editable -> Editable -> Bool
== :: Editable -> Editable -> Bool
$c/= :: Editable -> Editable -> Bool
/= :: Editable -> Editable -> Bool
Eq)
instance SP.ManagedPtrNewtype Editable where
toManagedPtr :: Editable -> ManagedPtr Editable
toManagedPtr (Editable ManagedPtr Editable
p) = ManagedPtr Editable
p
foreign import ccall "gtk_editable_get_type"
c_gtk_editable_get_type :: IO B.Types.GType
instance B.Types.TypedObject Editable where
glibType :: IO GType
glibType = IO GType
c_gtk_editable_get_type
instance B.Types.GObject Editable
class (SP.GObject o, O.IsDescendantOf Editable o) => IsEditable o
instance (SP.GObject o, O.IsDescendantOf Editable o) => IsEditable o
instance O.HasParentTypes Editable
type instance O.ParentTypes Editable = '[GObject.Object.Object]
toEditable :: (MIO.MonadIO m, IsEditable o) => o -> m Editable
toEditable :: forall (m :: * -> *) o.
(MonadIO m, IsEditable o) =>
o -> m Editable
toEditable = IO Editable -> m Editable
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Editable -> m Editable)
-> (o -> IO Editable) -> o -> m Editable
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Editable -> Editable) -> o -> IO Editable
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Editable -> Editable
Editable
instance B.GValue.IsGValue (Maybe Editable) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_editable_get_type
gvalueSet_ :: Ptr GValue -> Maybe Editable -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Editable
P.Nothing = Ptr GValue -> Ptr Editable -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Editable
forall a. Ptr a
FP.nullPtr :: FP.Ptr Editable)
gvalueSet_ Ptr GValue
gv (P.Just Editable
obj) = Editable -> (Ptr Editable -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Editable
obj (Ptr GValue -> Ptr Editable -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Editable)
gvalueGet_ Ptr GValue
gv = do
Ptr Editable
ptr <- Ptr GValue -> IO (Ptr Editable)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Editable)
if Ptr Editable
ptr Ptr Editable -> Ptr Editable -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Editable
forall a. Ptr a
FP.nullPtr
then Editable -> Maybe Editable
forall a. a -> Maybe a
P.Just (Editable -> Maybe Editable) -> IO Editable -> IO (Maybe Editable)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Editable -> Editable) -> Ptr Editable -> IO Editable
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Editable -> Editable
Editable Ptr Editable
ptr
else Maybe Editable -> IO (Maybe Editable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Editable
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Editable
type instance O.AttributeList Editable = EditableAttributeList
type EditableAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveEditableMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveEditableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveEditableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveEditableMethod "copyClipboard" o = EditableCopyClipboardMethodInfo
ResolveEditableMethod "cutClipboard" o = EditableCutClipboardMethodInfo
ResolveEditableMethod "deleteSelection" o = EditableDeleteSelectionMethodInfo
ResolveEditableMethod "deleteText" o = EditableDeleteTextMethodInfo
ResolveEditableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveEditableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveEditableMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveEditableMethod "insertText" o = EditableInsertTextMethodInfo
ResolveEditableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveEditableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveEditableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveEditableMethod "pasteClipboard" o = EditablePasteClipboardMethodInfo
ResolveEditableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveEditableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveEditableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveEditableMethod "selectRegion" o = EditableSelectRegionMethodInfo
ResolveEditableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveEditableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveEditableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveEditableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveEditableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveEditableMethod "getChars" o = EditableGetCharsMethodInfo
ResolveEditableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveEditableMethod "getEditable" o = EditableGetEditableMethodInfo
ResolveEditableMethod "getPosition" o = EditableGetPositionMethodInfo
ResolveEditableMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveEditableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveEditableMethod "getSelectionBounds" o = EditableGetSelectionBoundsMethodInfo
ResolveEditableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveEditableMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveEditableMethod "setEditable" o = EditableSetEditableMethodInfo
ResolveEditableMethod "setPosition" o = EditableSetPositionMethodInfo
ResolveEditableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveEditableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEditableMethod t Editable, O.OverloadedMethod info Editable p) => OL.IsLabel t (Editable -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveEditableMethod t Editable, O.OverloadedMethod info Editable p, R.HasField t Editable p) => R.HasField t Editable p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveEditableMethod t Editable, O.OverloadedMethodInfo info Editable) => OL.IsLabel t (O.MethodProxy info Editable) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "gtk_editable_copy_clipboard" gtk_editable_copy_clipboard ::
Ptr Editable ->
IO ()
editableCopyClipboard ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> m ()
editableCopyClipboard :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> m ()
editableCopyClipboard a
editable = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Ptr Editable -> IO ()
gtk_editable_copy_clipboard Ptr Editable
editable'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EditableCopyClipboardMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEditable a) => O.OverloadedMethod EditableCopyClipboardMethodInfo a signature where
overloadedMethod = editableCopyClipboard
instance O.OverloadedMethodInfo EditableCopyClipboardMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableCopyClipboard",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableCopyClipboard"
})
#endif
foreign import ccall "gtk_editable_cut_clipboard" gtk_editable_cut_clipboard ::
Ptr Editable ->
IO ()
editableCutClipboard ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> m ()
editableCutClipboard :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> m ()
editableCutClipboard a
editable = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Ptr Editable -> IO ()
gtk_editable_cut_clipboard Ptr Editable
editable'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EditableCutClipboardMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEditable a) => O.OverloadedMethod EditableCutClipboardMethodInfo a signature where
overloadedMethod = editableCutClipboard
instance O.OverloadedMethodInfo EditableCutClipboardMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableCutClipboard",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableCutClipboard"
})
#endif
foreign import ccall "gtk_editable_delete_selection" gtk_editable_delete_selection ::
Ptr Editable ->
IO ()
editableDeleteSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> m ()
editableDeleteSelection :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> m ()
editableDeleteSelection a
editable = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Ptr Editable -> IO ()
gtk_editable_delete_selection Ptr Editable
editable'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EditableDeleteSelectionMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEditable a) => O.OverloadedMethod EditableDeleteSelectionMethodInfo a signature where
overloadedMethod = editableDeleteSelection
instance O.OverloadedMethodInfo EditableDeleteSelectionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableDeleteSelection",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableDeleteSelection"
})
#endif
foreign import ccall "gtk_editable_delete_text" gtk_editable_delete_text ::
Ptr Editable ->
Int32 ->
Int32 ->
IO ()
editableDeleteText ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> Int32
-> Int32
-> m ()
editableDeleteText :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> Int32 -> Int32 -> m ()
editableDeleteText a
editable Int32
startPos Int32
endPos = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Ptr Editable -> Int32 -> Int32 -> IO ()
gtk_editable_delete_text Ptr Editable
editable' Int32
startPos Int32
endPos
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EditableDeleteTextMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsEditable a) => O.OverloadedMethod EditableDeleteTextMethodInfo a signature where
overloadedMethod = editableDeleteText
instance O.OverloadedMethodInfo EditableDeleteTextMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableDeleteText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableDeleteText"
})
#endif
foreign import ccall "gtk_editable_get_chars" gtk_editable_get_chars ::
Ptr Editable ->
Int32 ->
Int32 ->
IO CString
editableGetChars ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> Int32
-> Int32
-> m T.Text
editableGetChars :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> Int32 -> Int32 -> m Text
editableGetChars a
editable Int32
startPos Int32
endPos = IO Text -> m Text
forall a. IO a -> m a
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 Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
CString
result <- Ptr Editable -> Int32 -> Int32 -> IO CString
gtk_editable_get_chars Ptr Editable
editable' Int32
startPos Int32
endPos
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"editableGetChars" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data EditableGetCharsMethodInfo
instance (signature ~ (Int32 -> Int32 -> m T.Text), MonadIO m, IsEditable a) => O.OverloadedMethod EditableGetCharsMethodInfo a signature where
overloadedMethod = editableGetChars
instance O.OverloadedMethodInfo EditableGetCharsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableGetChars",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableGetChars"
})
#endif
foreign import ccall "gtk_editable_get_editable" gtk_editable_get_editable ::
Ptr Editable ->
IO CInt
editableGetEditable ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> m Bool
editableGetEditable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> m Bool
editableGetEditable a
editable = IO Bool -> m Bool
forall a. IO a -> m a
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 Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
CInt
result <- Ptr Editable -> IO CInt
gtk_editable_get_editable Ptr Editable
editable'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data EditableGetEditableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsEditable a) => O.OverloadedMethod EditableGetEditableMethodInfo a signature where
overloadedMethod = editableGetEditable
instance O.OverloadedMethodInfo EditableGetEditableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableGetEditable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableGetEditable"
})
#endif
foreign import ccall "gtk_editable_get_position" gtk_editable_get_position ::
Ptr Editable ->
IO Int32
editableGetPosition ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> m Int32
editableGetPosition :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> m Int32
editableGetPosition a
editable = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Int32
result <- Ptr Editable -> IO Int32
gtk_editable_get_position Ptr Editable
editable'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data EditableGetPositionMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsEditable a) => O.OverloadedMethod EditableGetPositionMethodInfo a signature where
overloadedMethod = editableGetPosition
instance O.OverloadedMethodInfo EditableGetPositionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableGetPosition",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableGetPosition"
})
#endif
foreign import ccall "gtk_editable_get_selection_bounds" gtk_editable_get_selection_bounds ::
Ptr Editable ->
Ptr Int32 ->
Ptr Int32 ->
IO CInt
editableGetSelectionBounds ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> m ((Bool, Int32, Int32))
editableGetSelectionBounds :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> m (Bool, Int32, Int32)
editableGetSelectionBounds a
editable = IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32))
-> IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Ptr Int32
startPos <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endPos <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr Editable -> Ptr Int32 -> Ptr Int32 -> IO CInt
gtk_editable_get_selection_bounds Ptr Editable
editable' Ptr Int32
startPos Ptr Int32
endPos
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Int32
startPos' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startPos
Int32
endPos' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endPos
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
startPos
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
endPos
(Bool, Int32, Int32) -> IO (Bool, Int32, Int32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
startPos', Int32
endPos')
#if defined(ENABLE_OVERLOADING)
data EditableGetSelectionBoundsMethodInfo
instance (signature ~ (m ((Bool, Int32, Int32))), MonadIO m, IsEditable a) => O.OverloadedMethod EditableGetSelectionBoundsMethodInfo a signature where
overloadedMethod = editableGetSelectionBounds
instance O.OverloadedMethodInfo EditableGetSelectionBoundsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableGetSelectionBounds",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableGetSelectionBounds"
})
#endif
foreign import ccall "gtk_editable_insert_text" gtk_editable_insert_text ::
Ptr Editable ->
CString ->
Int32 ->
Ptr Int32 ->
IO ()
editableInsertText ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> T.Text
-> Int32
-> Int32
-> m (Int32)
editableInsertText :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> Text -> Int32 -> Int32 -> m Int32
editableInsertText a
editable Text
newText Int32
newTextLength Int32
position = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
CString
newText' <- Text -> IO CString
textToCString Text
newText
Ptr Int32
position' <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
position' Int32
position
Ptr Editable -> CString -> Int32 -> Ptr Int32 -> IO ()
gtk_editable_insert_text Ptr Editable
editable' CString
newText' Int32
newTextLength Ptr Int32
position'
Int32
position'' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
position'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
newText'
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
position'
Int32 -> IO Int32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
position''
#if defined(ENABLE_OVERLOADING)
data EditableInsertTextMethodInfo
instance (signature ~ (T.Text -> Int32 -> Int32 -> m (Int32)), MonadIO m, IsEditable a) => O.OverloadedMethod EditableInsertTextMethodInfo a signature where
overloadedMethod = editableInsertText
instance O.OverloadedMethodInfo EditableInsertTextMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableInsertText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableInsertText"
})
#endif
foreign import ccall "gtk_editable_paste_clipboard" gtk_editable_paste_clipboard ::
Ptr Editable ->
IO ()
editablePasteClipboard ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> m ()
editablePasteClipboard :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> m ()
editablePasteClipboard a
editable = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Ptr Editable -> IO ()
gtk_editable_paste_clipboard Ptr Editable
editable'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EditablePasteClipboardMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEditable a) => O.OverloadedMethod EditablePasteClipboardMethodInfo a signature where
overloadedMethod = editablePasteClipboard
instance O.OverloadedMethodInfo EditablePasteClipboardMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editablePasteClipboard",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editablePasteClipboard"
})
#endif
foreign import ccall "gtk_editable_select_region" gtk_editable_select_region ::
Ptr Editable ->
Int32 ->
Int32 ->
IO ()
editableSelectRegion ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> Int32
-> Int32
-> m ()
editableSelectRegion :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> Int32 -> Int32 -> m ()
editableSelectRegion a
editable Int32
startPos Int32
endPos = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Ptr Editable -> Int32 -> Int32 -> IO ()
gtk_editable_select_region Ptr Editable
editable' Int32
startPos Int32
endPos
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EditableSelectRegionMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsEditable a) => O.OverloadedMethod EditableSelectRegionMethodInfo a signature where
overloadedMethod = editableSelectRegion
instance O.OverloadedMethodInfo EditableSelectRegionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableSelectRegion",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableSelectRegion"
})
#endif
foreign import ccall "gtk_editable_set_editable" gtk_editable_set_editable ::
Ptr Editable ->
CInt ->
IO ()
editableSetEditable ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> Bool
-> m ()
editableSetEditable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> Bool -> m ()
editableSetEditable a
editable Bool
isEditable = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
let isEditable' :: CInt
isEditable' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
isEditable
Ptr Editable -> CInt -> IO ()
gtk_editable_set_editable Ptr Editable
editable' CInt
isEditable'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EditableSetEditableMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsEditable a) => O.OverloadedMethod EditableSetEditableMethodInfo a signature where
overloadedMethod = editableSetEditable
instance O.OverloadedMethodInfo EditableSetEditableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableSetEditable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableSetEditable"
})
#endif
foreign import ccall "gtk_editable_set_position" gtk_editable_set_position ::
Ptr Editable ->
Int32 ->
IO ()
editableSetPosition ::
(B.CallStack.HasCallStack, MonadIO m, IsEditable a) =>
a
-> Int32
-> m ()
editableSetPosition :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsEditable a) =>
a -> Int32 -> m ()
editableSetPosition a
editable Int32
position = 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
$ do
Ptr Editable
editable' <- a -> IO (Ptr Editable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
editable
Ptr Editable -> Int32 -> IO ()
gtk_editable_set_position Ptr Editable
editable' Int32
position
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
editable
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data EditableSetPositionMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsEditable a) => O.OverloadedMethod EditableSetPositionMethodInfo a signature where
overloadedMethod = editableSetPosition
instance O.OverloadedMethodInfo EditableSetPositionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable.editableSetPosition",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#v:editableSetPosition"
})
#endif
type EditableChangedCallback =
IO ()
type C_EditableChangedCallback =
Ptr Editable ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_EditableChangedCallback :: C_EditableChangedCallback -> IO (FunPtr C_EditableChangedCallback)
wrap_EditableChangedCallback ::
GObject a => (a -> EditableChangedCallback) ->
C_EditableChangedCallback
wrap_EditableChangedCallback :: forall a. GObject a => (a -> IO ()) -> C_EditableChangedCallback
wrap_EditableChangedCallback a -> IO ()
gi'cb Ptr Editable
gi'selfPtr Ptr ()
_ = do
Ptr Editable -> (Editable -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Editable
gi'selfPtr ((Editable -> IO ()) -> IO ()) -> (Editable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Editable
gi'self -> a -> IO ()
gi'cb (Editable -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Editable
gi'self)
onEditableChanged :: (IsEditable a, MonadIO m) => a -> ((?self :: a) => EditableChangedCallback) -> m SignalHandlerId
onEditableChanged :: forall a (m :: * -> *).
(IsEditable a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onEditableChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_EditableChangedCallback
wrapped' = (a -> IO ()) -> C_EditableChangedCallback
forall a. GObject a => (a -> IO ()) -> C_EditableChangedCallback
wrap_EditableChangedCallback a -> IO ()
wrapped
FunPtr C_EditableChangedCallback
wrapped'' <- C_EditableChangedCallback -> IO (FunPtr C_EditableChangedCallback)
mk_EditableChangedCallback C_EditableChangedCallback
wrapped'
a
-> Text
-> FunPtr C_EditableChangedCallback
-> 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_EditableChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterEditableChanged :: (IsEditable a, MonadIO m) => a -> ((?self :: a) => EditableChangedCallback) -> m SignalHandlerId
afterEditableChanged :: forall a (m :: * -> *).
(IsEditable a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterEditableChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_EditableChangedCallback
wrapped' = (a -> IO ()) -> C_EditableChangedCallback
forall a. GObject a => (a -> IO ()) -> C_EditableChangedCallback
wrap_EditableChangedCallback a -> IO ()
wrapped
FunPtr C_EditableChangedCallback
wrapped'' <- C_EditableChangedCallback -> IO (FunPtr C_EditableChangedCallback)
mk_EditableChangedCallback C_EditableChangedCallback
wrapped'
a
-> Text
-> FunPtr C_EditableChangedCallback
-> 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_EditableChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data EditableChangedSignalInfo
instance SignalInfo EditableChangedSignalInfo where
type HaskellCallbackType EditableChangedSignalInfo = EditableChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_EditableChangedCallback cb
cb'' <- mk_EditableChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable::changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#g:signal:changed"})
#endif
type EditableDeleteTextCallback =
Int32
-> Int32
-> IO ()
type C_EditableDeleteTextCallback =
Ptr Editable ->
Int32 ->
Int32 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_EditableDeleteTextCallback :: C_EditableDeleteTextCallback -> IO (FunPtr C_EditableDeleteTextCallback)
wrap_EditableDeleteTextCallback ::
GObject a => (a -> EditableDeleteTextCallback) ->
C_EditableDeleteTextCallback
wrap_EditableDeleteTextCallback :: forall a.
GObject a =>
(a -> Int32 -> Int32 -> IO ()) -> C_EditableDeleteTextCallback
wrap_EditableDeleteTextCallback a -> Int32 -> Int32 -> IO ()
gi'cb Ptr Editable
gi'selfPtr Int32
startPos Int32
endPos Ptr ()
_ = do
Ptr Editable -> (Editable -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Editable
gi'selfPtr ((Editable -> IO ()) -> IO ()) -> (Editable -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Editable
gi'self -> a -> Int32 -> Int32 -> IO ()
gi'cb (Editable -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Editable
gi'self) Int32
startPos Int32
endPos
onEditableDeleteText :: (IsEditable a, MonadIO m) => a -> ((?self :: a) => EditableDeleteTextCallback) -> m SignalHandlerId
onEditableDeleteText :: forall a (m :: * -> *).
(IsEditable a, MonadIO m) =>
a -> ((?self::a) => Int32 -> Int32 -> IO ()) -> m SignalHandlerId
onEditableDeleteText a
obj (?self::a) => Int32 -> Int32 -> IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> Int32 -> Int32 -> IO ()
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => Int32 -> Int32 -> IO ()
Int32 -> Int32 -> IO ()
cb
let wrapped' :: C_EditableDeleteTextCallback
wrapped' = (a -> Int32 -> Int32 -> IO ()) -> C_EditableDeleteTextCallback
forall a.
GObject a =>
(a -> Int32 -> Int32 -> IO ()) -> C_EditableDeleteTextCallback
wrap_EditableDeleteTextCallback a -> Int32 -> Int32 -> IO ()
wrapped
FunPtr C_EditableDeleteTextCallback
wrapped'' <- C_EditableDeleteTextCallback
-> IO (FunPtr C_EditableDeleteTextCallback)
mk_EditableDeleteTextCallback C_EditableDeleteTextCallback
wrapped'
a
-> Text
-> FunPtr C_EditableDeleteTextCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"delete-text" FunPtr C_EditableDeleteTextCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterEditableDeleteText :: (IsEditable a, MonadIO m) => a -> ((?self :: a) => EditableDeleteTextCallback) -> m SignalHandlerId
afterEditableDeleteText :: forall a (m :: * -> *).
(IsEditable a, MonadIO m) =>
a -> ((?self::a) => Int32 -> Int32 -> IO ()) -> m SignalHandlerId
afterEditableDeleteText a
obj (?self::a) => Int32 -> Int32 -> IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> Int32 -> Int32 -> IO ()
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => Int32 -> Int32 -> IO ()
Int32 -> Int32 -> IO ()
cb
let wrapped' :: C_EditableDeleteTextCallback
wrapped' = (a -> Int32 -> Int32 -> IO ()) -> C_EditableDeleteTextCallback
forall a.
GObject a =>
(a -> Int32 -> Int32 -> IO ()) -> C_EditableDeleteTextCallback
wrap_EditableDeleteTextCallback a -> Int32 -> Int32 -> IO ()
wrapped
FunPtr C_EditableDeleteTextCallback
wrapped'' <- C_EditableDeleteTextCallback
-> IO (FunPtr C_EditableDeleteTextCallback)
mk_EditableDeleteTextCallback C_EditableDeleteTextCallback
wrapped'
a
-> Text
-> FunPtr C_EditableDeleteTextCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"delete-text" FunPtr C_EditableDeleteTextCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data EditableDeleteTextSignalInfo
instance SignalInfo EditableDeleteTextSignalInfo where
type HaskellCallbackType EditableDeleteTextSignalInfo = EditableDeleteTextCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_EditableDeleteTextCallback cb
cb'' <- mk_EditableDeleteTextCallback cb'
connectSignalFunPtr obj "delete-text" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable::delete-text"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#g:signal:deleteText"})
#endif
type EditableInsertTextCallback =
T.Text
-> Int32
-> Int32
-> IO (Int32)
type C_EditableInsertTextCallback =
Ptr Editable ->
CString ->
Int32 ->
Ptr Int32 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_EditableInsertTextCallback :: C_EditableInsertTextCallback -> IO (FunPtr C_EditableInsertTextCallback)
wrap_EditableInsertTextCallback ::
GObject a => (a -> EditableInsertTextCallback) ->
C_EditableInsertTextCallback
wrap_EditableInsertTextCallback :: forall a.
GObject a =>
(a -> EditableInsertTextCallback) -> C_EditableInsertTextCallback
wrap_EditableInsertTextCallback a -> EditableInsertTextCallback
gi'cb Ptr Editable
gi'selfPtr CString
newText Int32
newTextLength Ptr Int32
position Ptr ()
_ = do
Text
newText' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
newText
Int32
position' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
position
Int32
outposition <- Ptr Editable -> (Editable -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Editable
gi'selfPtr ((Editable -> IO Int32) -> IO Int32)
-> (Editable -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \Editable
gi'self -> a -> EditableInsertTextCallback
gi'cb (Editable -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Editable
gi'self) Text
newText' Int32
newTextLength Int32
position'
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
position Int32
outposition
onEditableInsertText :: (IsEditable a, MonadIO m) => a -> ((?self :: a) => EditableInsertTextCallback) -> m SignalHandlerId
onEditableInsertText :: forall a (m :: * -> *).
(IsEditable a, MonadIO m) =>
a
-> ((?self::a) => EditableInsertTextCallback) -> m SignalHandlerId
onEditableInsertText a
obj (?self::a) => EditableInsertTextCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> EditableInsertTextCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => EditableInsertTextCallback
EditableInsertTextCallback
cb
let wrapped' :: C_EditableInsertTextCallback
wrapped' = (a -> EditableInsertTextCallback) -> C_EditableInsertTextCallback
forall a.
GObject a =>
(a -> EditableInsertTextCallback) -> C_EditableInsertTextCallback
wrap_EditableInsertTextCallback a -> EditableInsertTextCallback
wrapped
FunPtr C_EditableInsertTextCallback
wrapped'' <- C_EditableInsertTextCallback
-> IO (FunPtr C_EditableInsertTextCallback)
mk_EditableInsertTextCallback C_EditableInsertTextCallback
wrapped'
a
-> Text
-> FunPtr C_EditableInsertTextCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"insert-text" FunPtr C_EditableInsertTextCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterEditableInsertText :: (IsEditable a, MonadIO m) => a -> ((?self :: a) => EditableInsertTextCallback) -> m SignalHandlerId
afterEditableInsertText :: forall a (m :: * -> *).
(IsEditable a, MonadIO m) =>
a
-> ((?self::a) => EditableInsertTextCallback) -> m SignalHandlerId
afterEditableInsertText a
obj (?self::a) => EditableInsertTextCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> EditableInsertTextCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => EditableInsertTextCallback
EditableInsertTextCallback
cb
let wrapped' :: C_EditableInsertTextCallback
wrapped' = (a -> EditableInsertTextCallback) -> C_EditableInsertTextCallback
forall a.
GObject a =>
(a -> EditableInsertTextCallback) -> C_EditableInsertTextCallback
wrap_EditableInsertTextCallback a -> EditableInsertTextCallback
wrapped
FunPtr C_EditableInsertTextCallback
wrapped'' <- C_EditableInsertTextCallback
-> IO (FunPtr C_EditableInsertTextCallback)
mk_EditableInsertTextCallback C_EditableInsertTextCallback
wrapped'
a
-> Text
-> FunPtr C_EditableInsertTextCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"insert-text" FunPtr C_EditableInsertTextCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data EditableInsertTextSignalInfo
instance SignalInfo EditableInsertTextSignalInfo where
type HaskellCallbackType EditableInsertTextSignalInfo = EditableInsertTextCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_EditableInsertTextCallback cb
cb'' <- mk_EditableInsertTextCallback cb'
connectSignalFunPtr obj "insert-text" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Interfaces.Editable::insert-text"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Interfaces-Editable.html#g:signal:insertText"})
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Editable = EditableSignalList
type EditableSignalList = ('[ '("changed", EditableChangedSignalInfo), '("deleteText", EditableDeleteTextSignalInfo), '("insertText", EditableInsertTextSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif