#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Objects.TextTagTable
(
TextTagTable(..) ,
IsTextTagTable ,
toTextTagTable ,
noTextTagTable ,
#if ENABLE_OVERLOADING
TextTagTableAddMethodInfo ,
#endif
textTagTableAdd ,
#if ENABLE_OVERLOADING
TextTagTableForeachMethodInfo ,
#endif
textTagTableForeach ,
#if ENABLE_OVERLOADING
TextTagTableGetSizeMethodInfo ,
#endif
textTagTableGetSize ,
#if ENABLE_OVERLOADING
TextTagTableLookupMethodInfo ,
#endif
textTagTableLookup ,
textTagTableNew ,
#if ENABLE_OVERLOADING
TextTagTableRemoveMethodInfo ,
#endif
textTagTableRemove ,
C_TextTagTableTagAddedCallback ,
TextTagTableTagAddedCallback ,
#if ENABLE_OVERLOADING
TextTagTableTagAddedSignalInfo ,
#endif
afterTextTagTableTagAdded ,
genClosure_TextTagTableTagAdded ,
mk_TextTagTableTagAddedCallback ,
noTextTagTableTagAddedCallback ,
onTextTagTableTagAdded ,
wrap_TextTagTableTagAddedCallback ,
C_TextTagTableTagChangedCallback ,
TextTagTableTagChangedCallback ,
#if ENABLE_OVERLOADING
TextTagTableTagChangedSignalInfo ,
#endif
afterTextTagTableTagChanged ,
genClosure_TextTagTableTagChanged ,
mk_TextTagTableTagChangedCallback ,
noTextTagTableTagChangedCallback ,
onTextTagTableTagChanged ,
wrap_TextTagTableTagChangedCallback ,
C_TextTagTableTagRemovedCallback ,
TextTagTableTagRemovedCallback ,
#if ENABLE_OVERLOADING
TextTagTableTagRemovedSignalInfo ,
#endif
afterTextTagTableTagRemoved ,
genClosure_TextTagTableTagRemoved ,
mk_TextTagTableTagRemovedCallback ,
noTextTagTableTagRemovedCallback ,
onTextTagTableTagRemoved ,
wrap_TextTagTableTagRemovedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextTag as Gtk.TextTag
newtype TextTagTable = TextTagTable (ManagedPtr TextTagTable)
foreign import ccall "gtk_text_tag_table_get_type"
c_gtk_text_tag_table_get_type :: IO GType
instance GObject TextTagTable where
gobjectType _ = c_gtk_text_tag_table_get_type
class GObject o => IsTextTagTable o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError TextTagTable a) =>
IsTextTagTable a
#endif
instance IsTextTagTable TextTagTable
instance GObject.Object.IsObject TextTagTable
instance Gtk.Buildable.IsBuildable TextTagTable
toTextTagTable :: (MonadIO m, IsTextTagTable o) => o -> m TextTagTable
toTextTagTable = liftIO . unsafeCastTo TextTagTable
noTextTagTable :: Maybe TextTagTable
noTextTagTable = Nothing
#if ENABLE_OVERLOADING
type family ResolveTextTagTableMethod (t :: Symbol) (o :: *) :: * where
ResolveTextTagTableMethod "add" o = TextTagTableAddMethodInfo
ResolveTextTagTableMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
ResolveTextTagTableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTextTagTableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTextTagTableMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
ResolveTextTagTableMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
ResolveTextTagTableMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
ResolveTextTagTableMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
ResolveTextTagTableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTextTagTableMethod "foreach" o = TextTagTableForeachMethodInfo
ResolveTextTagTableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTextTagTableMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTextTagTableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTextTagTableMethod "lookup" o = TextTagTableLookupMethodInfo
ResolveTextTagTableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTextTagTableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTextTagTableMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
ResolveTextTagTableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTextTagTableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTextTagTableMethod "remove" o = TextTagTableRemoveMethodInfo
ResolveTextTagTableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTextTagTableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTextTagTableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTextTagTableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTextTagTableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTextTagTableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTextTagTableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTextTagTableMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
ResolveTextTagTableMethod "getName" o = Gtk.Buildable.BuildableGetNameMethodInfo
ResolveTextTagTableMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTextTagTableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTextTagTableMethod "getSize" o = TextTagTableGetSizeMethodInfo
ResolveTextTagTableMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
ResolveTextTagTableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTextTagTableMethod "setName" o = Gtk.Buildable.BuildableSetNameMethodInfo
ResolveTextTagTableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTextTagTableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTextTagTableMethod t TextTagTable, O.MethodInfo info TextTagTable p) => O.IsLabelProxy t (TextTagTable -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveTextTagTableMethod t TextTagTable, O.MethodInfo info TextTagTable p) => O.IsLabel t (TextTagTable -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
type TextTagTableTagAddedCallback =
Gtk.TextTag.TextTag
-> IO ()
noTextTagTableTagAddedCallback :: Maybe TextTagTableTagAddedCallback
noTextTagTableTagAddedCallback = Nothing
type C_TextTagTableTagAddedCallback =
Ptr () ->
Ptr Gtk.TextTag.TextTag ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTagTableTagAddedCallback :: C_TextTagTableTagAddedCallback -> IO (FunPtr C_TextTagTableTagAddedCallback)
genClosure_TextTagTableTagAdded :: TextTagTableTagAddedCallback -> IO Closure
genClosure_TextTagTableTagAdded cb = do
let cb' = wrap_TextTagTableTagAddedCallback cb
mk_TextTagTableTagAddedCallback cb' >>= newCClosure
wrap_TextTagTableTagAddedCallback ::
TextTagTableTagAddedCallback ->
C_TextTagTableTagAddedCallback
wrap_TextTagTableTagAddedCallback _cb _ tag _ = do
tag' <- (newObject Gtk.TextTag.TextTag) tag
_cb tag'
onTextTagTableTagAdded :: (IsTextTagTable a, MonadIO m) => a -> TextTagTableTagAddedCallback -> m SignalHandlerId
onTextTagTableTagAdded obj cb = liftIO $ do
let cb' = wrap_TextTagTableTagAddedCallback cb
cb'' <- mk_TextTagTableTagAddedCallback cb'
connectSignalFunPtr obj "tag-added" cb'' SignalConnectBefore
afterTextTagTableTagAdded :: (IsTextTagTable a, MonadIO m) => a -> TextTagTableTagAddedCallback -> m SignalHandlerId
afterTextTagTableTagAdded obj cb = liftIO $ do
let cb' = wrap_TextTagTableTagAddedCallback cb
cb'' <- mk_TextTagTableTagAddedCallback cb'
connectSignalFunPtr obj "tag-added" cb'' SignalConnectAfter
type TextTagTableTagChangedCallback =
Gtk.TextTag.TextTag
-> Bool
-> IO ()
noTextTagTableTagChangedCallback :: Maybe TextTagTableTagChangedCallback
noTextTagTableTagChangedCallback = Nothing
type C_TextTagTableTagChangedCallback =
Ptr () ->
Ptr Gtk.TextTag.TextTag ->
CInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTagTableTagChangedCallback :: C_TextTagTableTagChangedCallback -> IO (FunPtr C_TextTagTableTagChangedCallback)
genClosure_TextTagTableTagChanged :: TextTagTableTagChangedCallback -> IO Closure
genClosure_TextTagTableTagChanged cb = do
let cb' = wrap_TextTagTableTagChangedCallback cb
mk_TextTagTableTagChangedCallback cb' >>= newCClosure
wrap_TextTagTableTagChangedCallback ::
TextTagTableTagChangedCallback ->
C_TextTagTableTagChangedCallback
wrap_TextTagTableTagChangedCallback _cb _ tag sizeChanged _ = do
tag' <- (newObject Gtk.TextTag.TextTag) tag
let sizeChanged' = (/= 0) sizeChanged
_cb tag' sizeChanged'
onTextTagTableTagChanged :: (IsTextTagTable a, MonadIO m) => a -> TextTagTableTagChangedCallback -> m SignalHandlerId
onTextTagTableTagChanged obj cb = liftIO $ do
let cb' = wrap_TextTagTableTagChangedCallback cb
cb'' <- mk_TextTagTableTagChangedCallback cb'
connectSignalFunPtr obj "tag-changed" cb'' SignalConnectBefore
afterTextTagTableTagChanged :: (IsTextTagTable a, MonadIO m) => a -> TextTagTableTagChangedCallback -> m SignalHandlerId
afterTextTagTableTagChanged obj cb = liftIO $ do
let cb' = wrap_TextTagTableTagChangedCallback cb
cb'' <- mk_TextTagTableTagChangedCallback cb'
connectSignalFunPtr obj "tag-changed" cb'' SignalConnectAfter
type TextTagTableTagRemovedCallback =
Gtk.TextTag.TextTag
-> IO ()
noTextTagTableTagRemovedCallback :: Maybe TextTagTableTagRemovedCallback
noTextTagTableTagRemovedCallback = Nothing
type C_TextTagTableTagRemovedCallback =
Ptr () ->
Ptr Gtk.TextTag.TextTag ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_TextTagTableTagRemovedCallback :: C_TextTagTableTagRemovedCallback -> IO (FunPtr C_TextTagTableTagRemovedCallback)
genClosure_TextTagTableTagRemoved :: TextTagTableTagRemovedCallback -> IO Closure
genClosure_TextTagTableTagRemoved cb = do
let cb' = wrap_TextTagTableTagRemovedCallback cb
mk_TextTagTableTagRemovedCallback cb' >>= newCClosure
wrap_TextTagTableTagRemovedCallback ::
TextTagTableTagRemovedCallback ->
C_TextTagTableTagRemovedCallback
wrap_TextTagTableTagRemovedCallback _cb _ tag _ = do
tag' <- (newObject Gtk.TextTag.TextTag) tag
_cb tag'
onTextTagTableTagRemoved :: (IsTextTagTable a, MonadIO m) => a -> TextTagTableTagRemovedCallback -> m SignalHandlerId
onTextTagTableTagRemoved obj cb = liftIO $ do
let cb' = wrap_TextTagTableTagRemovedCallback cb
cb'' <- mk_TextTagTableTagRemovedCallback cb'
connectSignalFunPtr obj "tag-removed" cb'' SignalConnectBefore
afterTextTagTableTagRemoved :: (IsTextTagTable a, MonadIO m) => a -> TextTagTableTagRemovedCallback -> m SignalHandlerId
afterTextTagTableTagRemoved obj cb = liftIO $ do
let cb' = wrap_TextTagTableTagRemovedCallback cb
cb'' <- mk_TextTagTableTagRemovedCallback cb'
connectSignalFunPtr obj "tag-removed" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
instance O.HasAttributeList TextTagTable
type instance O.AttributeList TextTagTable = TextTagTableAttributeList
type TextTagTableAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
data TextTagTableTagAddedSignalInfo
instance SignalInfo TextTagTableTagAddedSignalInfo where
type HaskellCallbackType TextTagTableTagAddedSignalInfo = TextTagTableTagAddedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_TextTagTableTagAddedCallback cb
cb'' <- mk_TextTagTableTagAddedCallback cb'
connectSignalFunPtr obj "tag-added" cb'' connectMode
data TextTagTableTagChangedSignalInfo
instance SignalInfo TextTagTableTagChangedSignalInfo where
type HaskellCallbackType TextTagTableTagChangedSignalInfo = TextTagTableTagChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_TextTagTableTagChangedCallback cb
cb'' <- mk_TextTagTableTagChangedCallback cb'
connectSignalFunPtr obj "tag-changed" cb'' connectMode
data TextTagTableTagRemovedSignalInfo
instance SignalInfo TextTagTableTagRemovedSignalInfo where
type HaskellCallbackType TextTagTableTagRemovedSignalInfo = TextTagTableTagRemovedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_TextTagTableTagRemovedCallback cb
cb'' <- mk_TextTagTableTagRemovedCallback cb'
connectSignalFunPtr obj "tag-removed" cb'' connectMode
type instance O.SignalList TextTagTable = TextTagTableSignalList
type TextTagTableSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("tagAdded", TextTagTableTagAddedSignalInfo), '("tagChanged", TextTagTableTagChangedSignalInfo), '("tagRemoved", TextTagTableTagRemovedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_text_tag_table_new" gtk_text_tag_table_new ::
IO (Ptr TextTagTable)
textTagTableNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m TextTagTable
textTagTableNew = liftIO $ do
result <- gtk_text_tag_table_new
checkUnexpectedReturnNULL "textTagTableNew" result
result' <- (wrapObject TextTagTable) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_text_tag_table_add" gtk_text_tag_table_add ::
Ptr TextTagTable ->
Ptr Gtk.TextTag.TextTag ->
IO CInt
textTagTableAdd ::
(B.CallStack.HasCallStack, MonadIO m, IsTextTagTable a, Gtk.TextTag.IsTextTag b) =>
a
-> b
-> m Bool
textTagTableAdd table tag = liftIO $ do
table' <- unsafeManagedPtrCastPtr table
tag' <- unsafeManagedPtrCastPtr tag
result <- gtk_text_tag_table_add table' tag'
let result' = (/= 0) result
touchManagedPtr table
touchManagedPtr tag
return result'
#if ENABLE_OVERLOADING
data TextTagTableAddMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsTextTagTable a, Gtk.TextTag.IsTextTag b) => O.MethodInfo TextTagTableAddMethodInfo a signature where
overloadedMethod _ = textTagTableAdd
#endif
foreign import ccall "gtk_text_tag_table_foreach" gtk_text_tag_table_foreach ::
Ptr TextTagTable ->
FunPtr Gtk.Callbacks.C_TextTagTableForeach ->
Ptr () ->
IO ()
textTagTableForeach ::
(B.CallStack.HasCallStack, MonadIO m, IsTextTagTable a) =>
a
-> Gtk.Callbacks.TextTagTableForeach
-> m ()
textTagTableForeach table func = liftIO $ do
table' <- unsafeManagedPtrCastPtr table
func' <- Gtk.Callbacks.mk_TextTagTableForeach (Gtk.Callbacks.wrap_TextTagTableForeach Nothing (Gtk.Callbacks.drop_closures_TextTagTableForeach func))
let data_ = nullPtr
gtk_text_tag_table_foreach table' func' data_
safeFreeFunPtr $ castFunPtrToPtr func'
touchManagedPtr table
return ()
#if ENABLE_OVERLOADING
data TextTagTableForeachMethodInfo
instance (signature ~ (Gtk.Callbacks.TextTagTableForeach -> m ()), MonadIO m, IsTextTagTable a) => O.MethodInfo TextTagTableForeachMethodInfo a signature where
overloadedMethod _ = textTagTableForeach
#endif
foreign import ccall "gtk_text_tag_table_get_size" gtk_text_tag_table_get_size ::
Ptr TextTagTable ->
IO Int32
textTagTableGetSize ::
(B.CallStack.HasCallStack, MonadIO m, IsTextTagTable a) =>
a
-> m Int32
textTagTableGetSize table = liftIO $ do
table' <- unsafeManagedPtrCastPtr table
result <- gtk_text_tag_table_get_size table'
touchManagedPtr table
return result
#if ENABLE_OVERLOADING
data TextTagTableGetSizeMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsTextTagTable a) => O.MethodInfo TextTagTableGetSizeMethodInfo a signature where
overloadedMethod _ = textTagTableGetSize
#endif
foreign import ccall "gtk_text_tag_table_lookup" gtk_text_tag_table_lookup ::
Ptr TextTagTable ->
CString ->
IO (Ptr Gtk.TextTag.TextTag)
textTagTableLookup ::
(B.CallStack.HasCallStack, MonadIO m, IsTextTagTable a) =>
a
-> T.Text
-> m (Maybe Gtk.TextTag.TextTag)
textTagTableLookup table name = liftIO $ do
table' <- unsafeManagedPtrCastPtr table
name' <- textToCString name
result <- gtk_text_tag_table_lookup table' name'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gtk.TextTag.TextTag) result'
return result''
touchManagedPtr table
freeMem name'
return maybeResult
#if ENABLE_OVERLOADING
data TextTagTableLookupMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gtk.TextTag.TextTag)), MonadIO m, IsTextTagTable a) => O.MethodInfo TextTagTableLookupMethodInfo a signature where
overloadedMethod _ = textTagTableLookup
#endif
foreign import ccall "gtk_text_tag_table_remove" gtk_text_tag_table_remove ::
Ptr TextTagTable ->
Ptr Gtk.TextTag.TextTag ->
IO ()
textTagTableRemove ::
(B.CallStack.HasCallStack, MonadIO m, IsTextTagTable a, Gtk.TextTag.IsTextTag b) =>
a
-> b
-> m ()
textTagTableRemove table tag = liftIO $ do
table' <- unsafeManagedPtrCastPtr table
tag' <- unsafeManagedPtrCastPtr tag
gtk_text_tag_table_remove table' tag'
touchManagedPtr table
touchManagedPtr tag
return ()
#if ENABLE_OVERLOADING
data TextTagTableRemoveMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsTextTagTable a, Gtk.TextTag.IsTextTag b) => O.MethodInfo TextTagTableRemoveMethodInfo a signature where
overloadedMethod _ = textTagTableRemove
#endif