module GI.GtkSource.Objects.StyleScheme
(
StyleScheme(..) ,
IsStyleScheme ,
toStyleScheme ,
noStyleScheme ,
StyleSchemeGetAuthorsMethodInfo ,
styleSchemeGetAuthors ,
StyleSchemeGetDescriptionMethodInfo ,
styleSchemeGetDescription ,
StyleSchemeGetFilenameMethodInfo ,
styleSchemeGetFilename ,
StyleSchemeGetIdMethodInfo ,
styleSchemeGetId ,
StyleSchemeGetNameMethodInfo ,
styleSchemeGetName ,
StyleSchemeGetStyleMethodInfo ,
styleSchemeGetStyle ,
StyleSchemeDescriptionPropertyInfo ,
getStyleSchemeDescription ,
styleSchemeDescription ,
StyleSchemeFilenamePropertyInfo ,
getStyleSchemeFilename ,
styleSchemeFilename ,
StyleSchemeIdPropertyInfo ,
constructStyleSchemeId ,
getStyleSchemeId ,
styleSchemeId ,
StyleSchemeNamePropertyInfo ,
getStyleSchemeName ,
styleSchemeName ,
) 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 qualified GI.GtkSource.Objects.Style as GtkSource.Style
newtype StyleScheme = StyleScheme (ManagedPtr StyleScheme)
foreign import ccall "gtk_source_style_scheme_get_type"
c_gtk_source_style_scheme_get_type :: IO GType
instance GObject StyleScheme where
gobjectType _ = c_gtk_source_style_scheme_get_type
class GObject o => IsStyleScheme o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError StyleScheme a) =>
IsStyleScheme a
#endif
instance IsStyleScheme StyleScheme
instance GObject.Object.IsObject StyleScheme
toStyleScheme :: IsStyleScheme o => o -> IO StyleScheme
toStyleScheme = unsafeCastTo StyleScheme
noStyleScheme :: Maybe StyleScheme
noStyleScheme = Nothing
type family ResolveStyleSchemeMethod (t :: Symbol) (o :: *) :: * where
ResolveStyleSchemeMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveStyleSchemeMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveStyleSchemeMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveStyleSchemeMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveStyleSchemeMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveStyleSchemeMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveStyleSchemeMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveStyleSchemeMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveStyleSchemeMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveStyleSchemeMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveStyleSchemeMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveStyleSchemeMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveStyleSchemeMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveStyleSchemeMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveStyleSchemeMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveStyleSchemeMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveStyleSchemeMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveStyleSchemeMethod "getAuthors" o = StyleSchemeGetAuthorsMethodInfo
ResolveStyleSchemeMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveStyleSchemeMethod "getDescription" o = StyleSchemeGetDescriptionMethodInfo
ResolveStyleSchemeMethod "getFilename" o = StyleSchemeGetFilenameMethodInfo
ResolveStyleSchemeMethod "getId" o = StyleSchemeGetIdMethodInfo
ResolveStyleSchemeMethod "getName" o = StyleSchemeGetNameMethodInfo
ResolveStyleSchemeMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveStyleSchemeMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveStyleSchemeMethod "getStyle" o = StyleSchemeGetStyleMethodInfo
ResolveStyleSchemeMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveStyleSchemeMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveStyleSchemeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveStyleSchemeMethod t StyleScheme, O.MethodInfo info StyleScheme p) => O.IsLabelProxy t (StyleScheme -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveStyleSchemeMethod t StyleScheme, O.MethodInfo info StyleScheme p) => O.IsLabel t (StyleScheme -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
getStyleSchemeDescription :: (MonadIO m, IsStyleScheme o) => o -> m (Maybe T.Text)
getStyleSchemeDescription obj = liftIO $ getObjectPropertyString obj "description"
data StyleSchemeDescriptionPropertyInfo
instance AttrInfo StyleSchemeDescriptionPropertyInfo where
type AttrAllowedOps StyleSchemeDescriptionPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StyleSchemeDescriptionPropertyInfo = (~) ()
type AttrBaseTypeConstraint StyleSchemeDescriptionPropertyInfo = IsStyleScheme
type AttrGetType StyleSchemeDescriptionPropertyInfo = (Maybe T.Text)
type AttrLabel StyleSchemeDescriptionPropertyInfo = "description"
type AttrOrigin StyleSchemeDescriptionPropertyInfo = StyleScheme
attrGet _ = getStyleSchemeDescription
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
getStyleSchemeFilename :: (MonadIO m, IsStyleScheme o) => o -> m (Maybe T.Text)
getStyleSchemeFilename obj = liftIO $ getObjectPropertyString obj "filename"
data StyleSchemeFilenamePropertyInfo
instance AttrInfo StyleSchemeFilenamePropertyInfo where
type AttrAllowedOps StyleSchemeFilenamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StyleSchemeFilenamePropertyInfo = (~) ()
type AttrBaseTypeConstraint StyleSchemeFilenamePropertyInfo = IsStyleScheme
type AttrGetType StyleSchemeFilenamePropertyInfo = (Maybe T.Text)
type AttrLabel StyleSchemeFilenamePropertyInfo = "filename"
type AttrOrigin StyleSchemeFilenamePropertyInfo = StyleScheme
attrGet _ = getStyleSchemeFilename
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
getStyleSchemeId :: (MonadIO m, IsStyleScheme o) => o -> m T.Text
getStyleSchemeId obj = liftIO $ checkUnexpectedNothing "getStyleSchemeId" $ getObjectPropertyString obj "id"
constructStyleSchemeId :: (IsStyleScheme o) => T.Text -> IO (GValueConstruct o)
constructStyleSchemeId val = constructObjectPropertyString "id" (Just val)
data StyleSchemeIdPropertyInfo
instance AttrInfo StyleSchemeIdPropertyInfo where
type AttrAllowedOps StyleSchemeIdPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StyleSchemeIdPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint StyleSchemeIdPropertyInfo = IsStyleScheme
type AttrGetType StyleSchemeIdPropertyInfo = T.Text
type AttrLabel StyleSchemeIdPropertyInfo = "id"
type AttrOrigin StyleSchemeIdPropertyInfo = StyleScheme
attrGet _ = getStyleSchemeId
attrSet _ = undefined
attrConstruct _ = constructStyleSchemeId
attrClear _ = undefined
getStyleSchemeName :: (MonadIO m, IsStyleScheme o) => o -> m T.Text
getStyleSchemeName obj = liftIO $ checkUnexpectedNothing "getStyleSchemeName" $ getObjectPropertyString obj "name"
data StyleSchemeNamePropertyInfo
instance AttrInfo StyleSchemeNamePropertyInfo where
type AttrAllowedOps StyleSchemeNamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StyleSchemeNamePropertyInfo = (~) ()
type AttrBaseTypeConstraint StyleSchemeNamePropertyInfo = IsStyleScheme
type AttrGetType StyleSchemeNamePropertyInfo = T.Text
type AttrLabel StyleSchemeNamePropertyInfo = "name"
type AttrOrigin StyleSchemeNamePropertyInfo = StyleScheme
attrGet _ = getStyleSchemeName
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
instance O.HasAttributeList StyleScheme
type instance O.AttributeList StyleScheme = StyleSchemeAttributeList
type StyleSchemeAttributeList = ('[ '("description", StyleSchemeDescriptionPropertyInfo), '("filename", StyleSchemeFilenamePropertyInfo), '("id", StyleSchemeIdPropertyInfo), '("name", StyleSchemeNamePropertyInfo)] :: [(Symbol, *)])
styleSchemeDescription :: AttrLabelProxy "description"
styleSchemeDescription = AttrLabelProxy
styleSchemeFilename :: AttrLabelProxy "filename"
styleSchemeFilename = AttrLabelProxy
styleSchemeId :: AttrLabelProxy "id"
styleSchemeId = AttrLabelProxy
styleSchemeName :: AttrLabelProxy "name"
styleSchemeName = AttrLabelProxy
type instance O.SignalList StyleScheme = StyleSchemeSignalList
type StyleSchemeSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "gtk_source_style_scheme_get_authors" gtk_source_style_scheme_get_authors ::
Ptr StyleScheme ->
IO (Ptr CString)
styleSchemeGetAuthors ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleScheme a) =>
a
-> m (Maybe [T.Text])
styleSchemeGetAuthors scheme = liftIO $ do
scheme' <- unsafeManagedPtrCastPtr scheme
result <- gtk_source_style_scheme_get_authors scheme'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- unpackZeroTerminatedUTF8CArray result'
return result''
touchManagedPtr scheme
return maybeResult
data StyleSchemeGetAuthorsMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsStyleScheme a) => O.MethodInfo StyleSchemeGetAuthorsMethodInfo a signature where
overloadedMethod _ = styleSchemeGetAuthors
foreign import ccall "gtk_source_style_scheme_get_description" gtk_source_style_scheme_get_description ::
Ptr StyleScheme ->
IO CString
styleSchemeGetDescription ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleScheme a) =>
a
-> m (Maybe T.Text)
styleSchemeGetDescription scheme = liftIO $ do
scheme' <- unsafeManagedPtrCastPtr scheme
result <- gtk_source_style_scheme_get_description scheme'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr scheme
return maybeResult
data StyleSchemeGetDescriptionMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsStyleScheme a) => O.MethodInfo StyleSchemeGetDescriptionMethodInfo a signature where
overloadedMethod _ = styleSchemeGetDescription
foreign import ccall "gtk_source_style_scheme_get_filename" gtk_source_style_scheme_get_filename ::
Ptr StyleScheme ->
IO CString
styleSchemeGetFilename ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleScheme a) =>
a
-> m (Maybe T.Text)
styleSchemeGetFilename scheme = liftIO $ do
scheme' <- unsafeManagedPtrCastPtr scheme
result <- gtk_source_style_scheme_get_filename scheme'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr scheme
return maybeResult
data StyleSchemeGetFilenameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsStyleScheme a) => O.MethodInfo StyleSchemeGetFilenameMethodInfo a signature where
overloadedMethod _ = styleSchemeGetFilename
foreign import ccall "gtk_source_style_scheme_get_id" gtk_source_style_scheme_get_id ::
Ptr StyleScheme ->
IO CString
styleSchemeGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleScheme a) =>
a
-> m T.Text
styleSchemeGetId scheme = liftIO $ do
scheme' <- unsafeManagedPtrCastPtr scheme
result <- gtk_source_style_scheme_get_id scheme'
checkUnexpectedReturnNULL "styleSchemeGetId" result
result' <- cstringToText result
touchManagedPtr scheme
return result'
data StyleSchemeGetIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsStyleScheme a) => O.MethodInfo StyleSchemeGetIdMethodInfo a signature where
overloadedMethod _ = styleSchemeGetId
foreign import ccall "gtk_source_style_scheme_get_name" gtk_source_style_scheme_get_name ::
Ptr StyleScheme ->
IO CString
styleSchemeGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleScheme a) =>
a
-> m T.Text
styleSchemeGetName scheme = liftIO $ do
scheme' <- unsafeManagedPtrCastPtr scheme
result <- gtk_source_style_scheme_get_name scheme'
checkUnexpectedReturnNULL "styleSchemeGetName" result
result' <- cstringToText result
touchManagedPtr scheme
return result'
data StyleSchemeGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsStyleScheme a) => O.MethodInfo StyleSchemeGetNameMethodInfo a signature where
overloadedMethod _ = styleSchemeGetName
foreign import ccall "gtk_source_style_scheme_get_style" gtk_source_style_scheme_get_style ::
Ptr StyleScheme ->
CString ->
IO (Ptr GtkSource.Style.Style)
styleSchemeGetStyle ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleScheme a) =>
a
-> T.Text
-> m (Maybe GtkSource.Style.Style)
styleSchemeGetStyle scheme styleId = liftIO $ do
scheme' <- unsafeManagedPtrCastPtr scheme
styleId' <- textToCString styleId
result <- gtk_source_style_scheme_get_style scheme' styleId'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject GtkSource.Style.Style) result'
return result''
touchManagedPtr scheme
freeMem styleId'
return maybeResult
data StyleSchemeGetStyleMethodInfo
instance (signature ~ (T.Text -> m (Maybe GtkSource.Style.Style)), MonadIO m, IsStyleScheme a) => O.MethodInfo StyleSchemeGetStyleMethodInfo a signature where
overloadedMethod _ = styleSchemeGetStyle