#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GtkSource.Objects.Mark
(
Mark(..) ,
IsMark ,
toMark ,
noMark ,
#if ENABLE_OVERLOADING
MarkGetCategoryMethodInfo ,
#endif
markGetCategory ,
markNew ,
#if ENABLE_OVERLOADING
MarkNextMethodInfo ,
#endif
markNext ,
#if ENABLE_OVERLOADING
MarkPrevMethodInfo ,
#endif
markPrev ,
#if ENABLE_OVERLOADING
MarkCategoryPropertyInfo ,
#endif
constructMarkCategory ,
getMarkCategory ,
#if ENABLE_OVERLOADING
markCategory ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.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.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 qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Objects.TextMark as Gtk.TextMark
newtype Mark = Mark (ManagedPtr Mark)
foreign import ccall "gtk_source_mark_get_type"
c_gtk_source_mark_get_type :: IO GType
instance GObject Mark where
gobjectType = c_gtk_source_mark_get_type
class (GObject o, O.IsDescendantOf Mark o) => IsMark o
instance (GObject o, O.IsDescendantOf Mark o) => IsMark o
instance O.HasParentTypes Mark
type instance O.ParentTypes Mark = '[Gtk.TextMark.TextMark, GObject.Object.Object]
toMark :: (MonadIO m, IsMark o) => o -> m Mark
toMark = liftIO . unsafeCastTo Mark
noMark :: Maybe Mark
noMark = Nothing
#if ENABLE_OVERLOADING
type family ResolveMarkMethod (t :: Symbol) (o :: *) :: * where
ResolveMarkMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMarkMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMarkMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMarkMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMarkMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMarkMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMarkMethod "next" o = MarkNextMethodInfo
ResolveMarkMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMarkMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMarkMethod "prev" o = MarkPrevMethodInfo
ResolveMarkMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMarkMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMarkMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMarkMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMarkMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMarkMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMarkMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMarkMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMarkMethod "getBuffer" o = Gtk.TextMark.TextMarkGetBufferMethodInfo
ResolveMarkMethod "getCategory" o = MarkGetCategoryMethodInfo
ResolveMarkMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMarkMethod "getDeleted" o = Gtk.TextMark.TextMarkGetDeletedMethodInfo
ResolveMarkMethod "getLeftGravity" o = Gtk.TextMark.TextMarkGetLeftGravityMethodInfo
ResolveMarkMethod "getName" o = Gtk.TextMark.TextMarkGetNameMethodInfo
ResolveMarkMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMarkMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMarkMethod "getVisible" o = Gtk.TextMark.TextMarkGetVisibleMethodInfo
ResolveMarkMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMarkMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMarkMethod "setVisible" o = Gtk.TextMark.TextMarkSetVisibleMethodInfo
ResolveMarkMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMarkMethod t Mark, O.MethodInfo info Mark p) => OL.IsLabel t (Mark -> 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
getMarkCategory :: (MonadIO m, IsMark o) => o -> m T.Text
getMarkCategory obj = liftIO $ checkUnexpectedNothing "getMarkCategory" $ B.Properties.getObjectPropertyString obj "category"
constructMarkCategory :: (IsMark o) => T.Text -> IO (GValueConstruct o)
constructMarkCategory val = B.Properties.constructObjectPropertyString "category" (Just val)
#if ENABLE_OVERLOADING
data MarkCategoryPropertyInfo
instance AttrInfo MarkCategoryPropertyInfo where
type AttrAllowedOps MarkCategoryPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MarkCategoryPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint MarkCategoryPropertyInfo = IsMark
type AttrGetType MarkCategoryPropertyInfo = T.Text
type AttrLabel MarkCategoryPropertyInfo = "category"
type AttrOrigin MarkCategoryPropertyInfo = Mark
attrGet _ = getMarkCategory
attrSet _ = undefined
attrConstruct _ = constructMarkCategory
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList Mark
type instance O.AttributeList Mark = MarkAttributeList
type MarkAttributeList = ('[ '("category", MarkCategoryPropertyInfo), '("leftGravity", Gtk.TextMark.TextMarkLeftGravityPropertyInfo), '("name", Gtk.TextMark.TextMarkNamePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
markCategory :: AttrLabelProxy "category"
markCategory = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Mark = MarkSignalList
type MarkSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_source_mark_new" gtk_source_mark_new ::
CString ->
CString ->
IO (Ptr Mark)
markNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> m Mark
markNew name category = liftIO $ do
name' <- textToCString name
category' <- textToCString category
result <- gtk_source_mark_new name' category'
checkUnexpectedReturnNULL "markNew" result
result' <- (wrapObject Mark) result
freeMem name'
freeMem category'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_source_mark_get_category" gtk_source_mark_get_category ::
Ptr Mark ->
IO CString
markGetCategory ::
(B.CallStack.HasCallStack, MonadIO m, IsMark a) =>
a
-> m T.Text
markGetCategory mark = liftIO $ do
mark' <- unsafeManagedPtrCastPtr mark
result <- gtk_source_mark_get_category mark'
checkUnexpectedReturnNULL "markGetCategory" result
result' <- cstringToText result
touchManagedPtr mark
return result'
#if ENABLE_OVERLOADING
data MarkGetCategoryMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMark a) => O.MethodInfo MarkGetCategoryMethodInfo a signature where
overloadedMethod _ = markGetCategory
#endif
foreign import ccall "gtk_source_mark_next" gtk_source_mark_next ::
Ptr Mark ->
CString ->
IO (Ptr Mark)
markNext ::
(B.CallStack.HasCallStack, MonadIO m, IsMark a) =>
a
-> Maybe (T.Text)
-> m (Maybe Mark)
markNext mark category = liftIO $ do
mark' <- unsafeManagedPtrCastPtr mark
maybeCategory <- case category of
Nothing -> return nullPtr
Just jCategory -> do
jCategory' <- textToCString jCategory
return jCategory'
result <- gtk_source_mark_next mark' maybeCategory
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Mark) result'
return result''
touchManagedPtr mark
freeMem maybeCategory
return maybeResult
#if ENABLE_OVERLOADING
data MarkNextMethodInfo
instance (signature ~ (Maybe (T.Text) -> m (Maybe Mark)), MonadIO m, IsMark a) => O.MethodInfo MarkNextMethodInfo a signature where
overloadedMethod _ = markNext
#endif
foreign import ccall "gtk_source_mark_prev" gtk_source_mark_prev ::
Ptr Mark ->
CString ->
IO (Ptr Mark)
markPrev ::
(B.CallStack.HasCallStack, MonadIO m, IsMark a) =>
a
-> T.Text
-> m (Maybe Mark)
markPrev mark category = liftIO $ do
mark' <- unsafeManagedPtrCastPtr mark
category' <- textToCString category
result <- gtk_source_mark_prev mark' category'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Mark) result'
return result''
touchManagedPtr mark
freeMem category'
return maybeResult
#if ENABLE_OVERLOADING
data MarkPrevMethodInfo
instance (signature ~ (T.Text -> m (Maybe Mark)), MonadIO m, IsMark a) => O.MethodInfo MarkPrevMethodInfo a signature where
overloadedMethod _ = markPrev
#endif