{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

You may wish to begin by reading the
[text widget conceptual overview][TextWidget]
which gives an overview of all the objects and data
types related to the text widget and how they work together.

A 'GI.Gtk.Objects.TextMark.TextMark' is like a bookmark in a text buffer; it preserves a position in
the text. You can convert the mark to an iterator using
'GI.Gtk.Objects.TextBuffer.textBufferGetIterAtMark'. Unlike iterators, marks remain valid across
buffer mutations, because their behavior is defined when text is inserted or
deleted. When text containing a mark is deleted, the mark remains in the
position originally occupied by the deleted text. When text is inserted at a
mark, a mark with “left gravity” will be moved to the
beginning of the newly-inserted text, and a mark with “right
gravity” will be moved to the end.

Note that “left” and “right” here refer to logical direction (left
is the toward the start of the buffer); in some languages such as
Hebrew the logically-leftmost text is not actually on the left when
displayed.

Marks are reference counted, but the reference count only controls the validity
of the memory; marks can be deleted from the buffer at any time with
'GI.Gtk.Objects.TextBuffer.textBufferDeleteMark'. Once deleted from the buffer, a mark is
essentially useless.

Marks optionally have names; these can be convenient to avoid passing the
'GI.Gtk.Objects.TextMark.TextMark' object around.

Marks are typically created using the 'GI.Gtk.Objects.TextBuffer.textBufferCreateMark' function.
-}

module GI.Gtk.Objects.TextMark
    ( 

-- * Exported types
    TextMark(..)                            ,
    IsTextMark                              ,
    toTextMark                              ,
    noTextMark                              ,


 -- * Methods
-- ** getBuffer #method:getBuffer#
    TextMarkGetBufferMethodInfo             ,
    textMarkGetBuffer                       ,


-- ** getDeleted #method:getDeleted#
    TextMarkGetDeletedMethodInfo            ,
    textMarkGetDeleted                      ,


-- ** getLeftGravity #method:getLeftGravity#
    TextMarkGetLeftGravityMethodInfo        ,
    textMarkGetLeftGravity                  ,


-- ** getName #method:getName#
    TextMarkGetNameMethodInfo               ,
    textMarkGetName                         ,


-- ** getVisible #method:getVisible#
    TextMarkGetVisibleMethodInfo            ,
    textMarkGetVisible                      ,


-- ** new #method:new#
    textMarkNew                             ,


-- ** setVisible #method:setVisible#
    TextMarkSetVisibleMethodInfo            ,
    textMarkSetVisible                      ,




 -- * Properties
-- ** leftGravity #attr:leftGravity#
    TextMarkLeftGravityPropertyInfo         ,
    constructTextMarkLeftGravity            ,
    getTextMarkLeftGravity                  ,
    textMarkLeftGravity                     ,


-- ** name #attr:name#
    TextMarkNamePropertyInfo                ,
    constructTextMarkName                   ,
    getTextMarkName                         ,
    textMarkName                            ,




    ) 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.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 {-# SOURCE #-} qualified GI.Gtk.Objects.TextBuffer as Gtk.TextBuffer

newtype TextMark = TextMark (ManagedPtr TextMark)
foreign import ccall "gtk_text_mark_get_type"
    c_gtk_text_mark_get_type :: IO GType

instance GObject TextMark where
    gobjectType _ = c_gtk_text_mark_get_type
    

class GObject o => IsTextMark o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError TextMark a) =>
    IsTextMark a
#endif
instance IsTextMark TextMark
instance GObject.Object.IsObject TextMark

toTextMark :: IsTextMark o => o -> IO TextMark
toTextMark = unsafeCastTo TextMark

noTextMark :: Maybe TextMark
noTextMark = Nothing

type family ResolveTextMarkMethod (t :: Symbol) (o :: *) :: * where
    ResolveTextMarkMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveTextMarkMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveTextMarkMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveTextMarkMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveTextMarkMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveTextMarkMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveTextMarkMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveTextMarkMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveTextMarkMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveTextMarkMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveTextMarkMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveTextMarkMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveTextMarkMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveTextMarkMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveTextMarkMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveTextMarkMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveTextMarkMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveTextMarkMethod "getBuffer" o = TextMarkGetBufferMethodInfo
    ResolveTextMarkMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveTextMarkMethod "getDeleted" o = TextMarkGetDeletedMethodInfo
    ResolveTextMarkMethod "getLeftGravity" o = TextMarkGetLeftGravityMethodInfo
    ResolveTextMarkMethod "getName" o = TextMarkGetNameMethodInfo
    ResolveTextMarkMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveTextMarkMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveTextMarkMethod "getVisible" o = TextMarkGetVisibleMethodInfo
    ResolveTextMarkMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveTextMarkMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveTextMarkMethod "setVisible" o = TextMarkSetVisibleMethodInfo
    ResolveTextMarkMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveTextMarkMethod t TextMark, O.MethodInfo info TextMark p) => O.IsLabelProxy t (TextMark -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveTextMarkMethod t TextMark, O.MethodInfo info TextMark p) => O.IsLabel t (TextMark -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "left-gravity"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getTextMarkLeftGravity :: (MonadIO m, IsTextMark o) => o -> m Bool
getTextMarkLeftGravity obj = liftIO $ getObjectPropertyBool obj "left-gravity"

constructTextMarkLeftGravity :: (IsTextMark o) => Bool -> IO (GValueConstruct o)
constructTextMarkLeftGravity val = constructObjectPropertyBool "left-gravity" val

data TextMarkLeftGravityPropertyInfo
instance AttrInfo TextMarkLeftGravityPropertyInfo where
    type AttrAllowedOps TextMarkLeftGravityPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint TextMarkLeftGravityPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint TextMarkLeftGravityPropertyInfo = IsTextMark
    type AttrGetType TextMarkLeftGravityPropertyInfo = Bool
    type AttrLabel TextMarkLeftGravityPropertyInfo = "left-gravity"
    type AttrOrigin TextMarkLeftGravityPropertyInfo = TextMark
    attrGet _ = getTextMarkLeftGravity
    attrSet _ = undefined
    attrConstruct _ = constructTextMarkLeftGravity
    attrClear _ = undefined

-- VVV Prop "name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getTextMarkName :: (MonadIO m, IsTextMark o) => o -> m T.Text
getTextMarkName obj = liftIO $ checkUnexpectedNothing "getTextMarkName" $ getObjectPropertyString obj "name"

constructTextMarkName :: (IsTextMark o) => T.Text -> IO (GValueConstruct o)
constructTextMarkName val = constructObjectPropertyString "name" (Just val)

data TextMarkNamePropertyInfo
instance AttrInfo TextMarkNamePropertyInfo where
    type AttrAllowedOps TextMarkNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TextMarkNamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint TextMarkNamePropertyInfo = IsTextMark
    type AttrGetType TextMarkNamePropertyInfo = T.Text
    type AttrLabel TextMarkNamePropertyInfo = "name"
    type AttrOrigin TextMarkNamePropertyInfo = TextMark
    attrGet _ = getTextMarkName
    attrSet _ = undefined
    attrConstruct _ = constructTextMarkName
    attrClear _ = undefined

instance O.HasAttributeList TextMark
type instance O.AttributeList TextMark = TextMarkAttributeList
type TextMarkAttributeList = ('[ '("leftGravity", TextMarkLeftGravityPropertyInfo), '("name", TextMarkNamePropertyInfo)] :: [(Symbol, *)])

textMarkLeftGravity :: AttrLabelProxy "leftGravity"
textMarkLeftGravity = AttrLabelProxy

textMarkName :: AttrLabelProxy "name"
textMarkName = AttrLabelProxy

type instance O.SignalList TextMark = TextMarkSignalList
type TextMarkSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method TextMark::new
-- method type : Constructor
-- Args : [Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "mark name or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "left_gravity", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether the mark should have left gravity", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "TextMark"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_text_mark_new" gtk_text_mark_new :: 
    CString ->                              -- name : TBasicType TUTF8
    CInt ->                                 -- left_gravity : TBasicType TBoolean
    IO (Ptr TextMark)

{- |
Creates a text mark. Add it to a buffer using 'GI.Gtk.Objects.TextBuffer.textBufferAddMark'.
If /@name@/ is 'Nothing', the mark is anonymous; otherwise, the mark can be
retrieved by name using 'GI.Gtk.Objects.TextBuffer.textBufferGetMark'. If a mark has left
gravity, and text is inserted at the mark’s current location, the mark
will be moved to the left of the newly-inserted text. If the mark has
right gravity (/@leftGravity@/ = 'False'), the mark will end up on the
right of newly-inserted text. The standard left-to-right cursor is a
mark with right gravity (when you type, the cursor stays on the right
side of the text you’re typing).

@since 2.12
-}
textMarkNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Maybe (T.Text)
    {- ^ /@name@/: mark name or 'Nothing' -}
    -> Bool
    {- ^ /@leftGravity@/: whether the mark should have left gravity -}
    -> m TextMark
    {- ^ __Returns:__ new 'GI.Gtk.Objects.TextMark.TextMark' -}
textMarkNew name leftGravity = liftIO $ do
    maybeName <- case name of
        Nothing -> return nullPtr
        Just jName -> do
            jName' <- textToCString jName
            return jName'
    let leftGravity' = (fromIntegral . fromEnum) leftGravity
    result <- gtk_text_mark_new maybeName leftGravity'
    checkUnexpectedReturnNULL "textMarkNew" result
    result' <- (wrapObject TextMark) result
    freeMem maybeName
    return result'

-- method TextMark::get_buffer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mark", argType = TInterface (Name {namespace = "Gtk", name = "TextMark"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTextMark", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "TextBuffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_text_mark_get_buffer" gtk_text_mark_get_buffer :: 
    Ptr TextMark ->                         -- mark : TInterface (Name {namespace = "Gtk", name = "TextMark"})
    IO (Ptr Gtk.TextBuffer.TextBuffer)

{- |
Gets the buffer this mark is located inside,
or 'Nothing' if the mark is deleted.
-}
textMarkGetBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsTextMark a) =>
    a
    {- ^ /@mark@/: a 'GI.Gtk.Objects.TextMark.TextMark' -}
    -> m Gtk.TextBuffer.TextBuffer
    {- ^ __Returns:__ the mark’s 'GI.Gtk.Objects.TextBuffer.TextBuffer' -}
textMarkGetBuffer mark = liftIO $ do
    mark' <- unsafeManagedPtrCastPtr mark
    result <- gtk_text_mark_get_buffer mark'
    checkUnexpectedReturnNULL "textMarkGetBuffer" result
    result' <- (newObject Gtk.TextBuffer.TextBuffer) result
    touchManagedPtr mark
    return result'

data TextMarkGetBufferMethodInfo
instance (signature ~ (m Gtk.TextBuffer.TextBuffer), MonadIO m, IsTextMark a) => O.MethodInfo TextMarkGetBufferMethodInfo a signature where
    overloadedMethod _ = textMarkGetBuffer

-- method TextMark::get_deleted
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mark", argType = TInterface (Name {namespace = "Gtk", name = "TextMark"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTextMark", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_text_mark_get_deleted" gtk_text_mark_get_deleted :: 
    Ptr TextMark ->                         -- mark : TInterface (Name {namespace = "Gtk", name = "TextMark"})
    IO CInt

{- |
Returns 'True' if the mark has been removed from its buffer
with 'GI.Gtk.Objects.TextBuffer.textBufferDeleteMark'. See 'GI.Gtk.Objects.TextBuffer.textBufferAddMark'
for a way to add it to a buffer again.
-}
textMarkGetDeleted ::
    (B.CallStack.HasCallStack, MonadIO m, IsTextMark a) =>
    a
    {- ^ /@mark@/: a 'GI.Gtk.Objects.TextMark.TextMark' -}
    -> m Bool
    {- ^ __Returns:__ whether the mark is deleted -}
textMarkGetDeleted mark = liftIO $ do
    mark' <- unsafeManagedPtrCastPtr mark
    result <- gtk_text_mark_get_deleted mark'
    let result' = (/= 0) result
    touchManagedPtr mark
    return result'

data TextMarkGetDeletedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsTextMark a) => O.MethodInfo TextMarkGetDeletedMethodInfo a signature where
    overloadedMethod _ = textMarkGetDeleted

-- method TextMark::get_left_gravity
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mark", argType = TInterface (Name {namespace = "Gtk", name = "TextMark"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTextMark", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_text_mark_get_left_gravity" gtk_text_mark_get_left_gravity :: 
    Ptr TextMark ->                         -- mark : TInterface (Name {namespace = "Gtk", name = "TextMark"})
    IO CInt

{- |
Determines whether the mark has left gravity.
-}
textMarkGetLeftGravity ::
    (B.CallStack.HasCallStack, MonadIO m, IsTextMark a) =>
    a
    {- ^ /@mark@/: a 'GI.Gtk.Objects.TextMark.TextMark' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the mark has left gravity, 'False' otherwise -}
textMarkGetLeftGravity mark = liftIO $ do
    mark' <- unsafeManagedPtrCastPtr mark
    result <- gtk_text_mark_get_left_gravity mark'
    let result' = (/= 0) result
    touchManagedPtr mark
    return result'

data TextMarkGetLeftGravityMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsTextMark a) => O.MethodInfo TextMarkGetLeftGravityMethodInfo a signature where
    overloadedMethod _ = textMarkGetLeftGravity

-- method TextMark::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mark", argType = TInterface (Name {namespace = "Gtk", name = "TextMark"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTextMark", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_text_mark_get_name" gtk_text_mark_get_name :: 
    Ptr TextMark ->                         -- mark : TInterface (Name {namespace = "Gtk", name = "TextMark"})
    IO CString

{- |
Returns the mark name; returns NULL for anonymous marks.
-}
textMarkGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsTextMark a) =>
    a
    {- ^ /@mark@/: a 'GI.Gtk.Objects.TextMark.TextMark' -}
    -> m T.Text
    {- ^ __Returns:__ mark name -}
textMarkGetName mark = liftIO $ do
    mark' <- unsafeManagedPtrCastPtr mark
    result <- gtk_text_mark_get_name mark'
    checkUnexpectedReturnNULL "textMarkGetName" result
    result' <- cstringToText result
    touchManagedPtr mark
    return result'

data TextMarkGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsTextMark a) => O.MethodInfo TextMarkGetNameMethodInfo a signature where
    overloadedMethod _ = textMarkGetName

-- method TextMark::get_visible
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mark", argType = TInterface (Name {namespace = "Gtk", name = "TextMark"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTextMark", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_text_mark_get_visible" gtk_text_mark_get_visible :: 
    Ptr TextMark ->                         -- mark : TInterface (Name {namespace = "Gtk", name = "TextMark"})
    IO CInt

{- |
Returns 'True' if the mark is visible (i.e. a cursor is displayed
for it).
-}
textMarkGetVisible ::
    (B.CallStack.HasCallStack, MonadIO m, IsTextMark a) =>
    a
    {- ^ /@mark@/: a 'GI.Gtk.Objects.TextMark.TextMark' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if visible -}
textMarkGetVisible mark = liftIO $ do
    mark' <- unsafeManagedPtrCastPtr mark
    result <- gtk_text_mark_get_visible mark'
    let result' = (/= 0) result
    touchManagedPtr mark
    return result'

data TextMarkGetVisibleMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsTextMark a) => O.MethodInfo TextMarkGetVisibleMethodInfo a signature where
    overloadedMethod _ = textMarkGetVisible

-- method TextMark::set_visible
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mark", argType = TInterface (Name {namespace = "Gtk", name = "TextMark"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTextMark", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "setting", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "visibility of mark", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_text_mark_set_visible" gtk_text_mark_set_visible :: 
    Ptr TextMark ->                         -- mark : TInterface (Name {namespace = "Gtk", name = "TextMark"})
    CInt ->                                 -- setting : TBasicType TBoolean
    IO ()

{- |
Sets the visibility of /@mark@/; the insertion point is normally
visible, i.e. you can see it as a vertical bar. Also, the text
widget uses a visible mark to indicate where a drop will occur when
dragging-and-dropping text. Most other marks are not visible.
Marks are not visible by default.
-}
textMarkSetVisible ::
    (B.CallStack.HasCallStack, MonadIO m, IsTextMark a) =>
    a
    {- ^ /@mark@/: a 'GI.Gtk.Objects.TextMark.TextMark' -}
    -> Bool
    {- ^ /@setting@/: visibility of mark -}
    -> m ()
textMarkSetVisible mark setting = liftIO $ do
    mark' <- unsafeManagedPtrCastPtr mark
    let setting' = (fromIntegral . fromEnum) setting
    gtk_text_mark_set_visible mark' setting'
    touchManagedPtr mark
    return ()

data TextMarkSetVisibleMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsTextMark a) => O.MethodInfo TextMarkSetVisibleMethodInfo a signature where
    overloadedMethod _ = textMarkSetVisible