{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc) /No description available in the introspection data./ -} #define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \ && !defined(__HADDOCK_VERSION__)) module GI.GtkSource.Interfaces.StyleSchemeChooser ( -- * Exported types StyleSchemeChooser(..) , noStyleSchemeChooser , IsStyleSchemeChooser , toStyleSchemeChooser , -- * Methods -- ** getStyleScheme #method:getStyleScheme# #if ENABLE_OVERLOADING StyleSchemeChooserGetStyleSchemeMethodInfo, #endif styleSchemeChooserGetStyleScheme , -- ** setStyleScheme #method:setStyleScheme# #if ENABLE_OVERLOADING StyleSchemeChooserSetStyleSchemeMethodInfo, #endif styleSchemeChooserSetStyleScheme , -- * Properties -- ** styleScheme #attr:styleScheme# {- | The :style-scheme property contains the currently selected style scheme. The property can be set to change the current selection programmatically. /Since: 3.16/ -} #if ENABLE_OVERLOADING StyleSchemeChooserStyleSchemePropertyInfo, #endif constructStyleSchemeChooserStyleScheme , getStyleSchemeChooserStyleScheme , setStyleSchemeChooserStyleScheme , #if ENABLE_OVERLOADING styleSchemeChooserStyleScheme , #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 {-# SOURCE #-} qualified GI.GtkSource.Objects.StyleScheme as GtkSource.StyleScheme -- interface StyleSchemeChooser -- | Memory-managed wrapper type. newtype StyleSchemeChooser = StyleSchemeChooser (ManagedPtr StyleSchemeChooser) -- | A convenience alias for `Nothing` :: `Maybe` `StyleSchemeChooser`. noStyleSchemeChooser :: Maybe StyleSchemeChooser noStyleSchemeChooser = Nothing #if ENABLE_OVERLOADING type instance O.SignalList StyleSchemeChooser = StyleSchemeChooserSignalList type StyleSchemeChooserSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)]) #endif foreign import ccall "gtk_source_style_scheme_chooser_get_type" c_gtk_source_style_scheme_chooser_get_type :: IO GType instance GObject StyleSchemeChooser where gobjectType = c_gtk_source_style_scheme_chooser_get_type -- | Type class for types which can be safely cast to `StyleSchemeChooser`, for instance with `toStyleSchemeChooser`. class (GObject o, O.IsDescendantOf StyleSchemeChooser o) => IsStyleSchemeChooser o instance (GObject o, O.IsDescendantOf StyleSchemeChooser o) => IsStyleSchemeChooser o instance O.HasParentTypes StyleSchemeChooser type instance O.ParentTypes StyleSchemeChooser = '[GObject.Object.Object] -- | Cast to `StyleSchemeChooser`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`. toStyleSchemeChooser :: (MonadIO m, IsStyleSchemeChooser o) => o -> m StyleSchemeChooser toStyleSchemeChooser = liftIO . unsafeCastTo StyleSchemeChooser -- VVV Prop "style-scheme" -- Type: TInterface (Name {namespace = "GtkSource", name = "StyleScheme"}) -- Flags: [PropertyReadable,PropertyWritable] -- Nullable: (Just False,Just False) {- | Get the value of the “@style-scheme@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.get' styleSchemeChooser #styleScheme @ -} getStyleSchemeChooserStyleScheme :: (MonadIO m, IsStyleSchemeChooser o) => o -> m GtkSource.StyleScheme.StyleScheme getStyleSchemeChooserStyleScheme obj = liftIO $ checkUnexpectedNothing "getStyleSchemeChooserStyleScheme" $ B.Properties.getObjectPropertyObject obj "style-scheme" GtkSource.StyleScheme.StyleScheme {- | Set the value of the “@style-scheme@” property. When is enabled, this is equivalent to @ 'Data.GI.Base.Attributes.set' styleSchemeChooser [ #styleScheme 'Data.GI.Base.Attributes.:=' value ] @ -} setStyleSchemeChooserStyleScheme :: (MonadIO m, IsStyleSchemeChooser o, GtkSource.StyleScheme.IsStyleScheme a) => o -> a -> m () setStyleSchemeChooserStyleScheme obj val = liftIO $ B.Properties.setObjectPropertyObject obj "style-scheme" (Just val) {- | Construct a `GValueConstruct` with valid value for the “@style-scheme@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`. -} constructStyleSchemeChooserStyleScheme :: (IsStyleSchemeChooser o, GtkSource.StyleScheme.IsStyleScheme a) => a -> IO (GValueConstruct o) constructStyleSchemeChooserStyleScheme val = B.Properties.constructObjectPropertyObject "style-scheme" (Just val) #if ENABLE_OVERLOADING data StyleSchemeChooserStyleSchemePropertyInfo instance AttrInfo StyleSchemeChooserStyleSchemePropertyInfo where type AttrAllowedOps StyleSchemeChooserStyleSchemePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet] type AttrSetTypeConstraint StyleSchemeChooserStyleSchemePropertyInfo = GtkSource.StyleScheme.IsStyleScheme type AttrBaseTypeConstraint StyleSchemeChooserStyleSchemePropertyInfo = IsStyleSchemeChooser type AttrGetType StyleSchemeChooserStyleSchemePropertyInfo = GtkSource.StyleScheme.StyleScheme type AttrLabel StyleSchemeChooserStyleSchemePropertyInfo = "style-scheme" type AttrOrigin StyleSchemeChooserStyleSchemePropertyInfo = StyleSchemeChooser attrGet _ = getStyleSchemeChooserStyleScheme attrSet _ = setStyleSchemeChooserStyleScheme attrConstruct _ = constructStyleSchemeChooserStyleScheme attrClear _ = undefined #endif #if ENABLE_OVERLOADING instance O.HasAttributeList StyleSchemeChooser type instance O.AttributeList StyleSchemeChooser = StyleSchemeChooserAttributeList type StyleSchemeChooserAttributeList = ('[ '("styleScheme", StyleSchemeChooserStyleSchemePropertyInfo)] :: [(Symbol, *)]) #endif #if ENABLE_OVERLOADING styleSchemeChooserStyleScheme :: AttrLabelProxy "styleScheme" styleSchemeChooserStyleScheme = AttrLabelProxy #endif #if ENABLE_OVERLOADING type family ResolveStyleSchemeChooserMethod (t :: Symbol) (o :: *) :: * where ResolveStyleSchemeChooserMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo ResolveStyleSchemeChooserMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo ResolveStyleSchemeChooserMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo ResolveStyleSchemeChooserMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo ResolveStyleSchemeChooserMethod "getv" o = GObject.Object.ObjectGetvMethodInfo ResolveStyleSchemeChooserMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo ResolveStyleSchemeChooserMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo ResolveStyleSchemeChooserMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo ResolveStyleSchemeChooserMethod "ref" o = GObject.Object.ObjectRefMethodInfo ResolveStyleSchemeChooserMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo ResolveStyleSchemeChooserMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo ResolveStyleSchemeChooserMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo ResolveStyleSchemeChooserMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo ResolveStyleSchemeChooserMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo ResolveStyleSchemeChooserMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo ResolveStyleSchemeChooserMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo ResolveStyleSchemeChooserMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo ResolveStyleSchemeChooserMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo ResolveStyleSchemeChooserMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo ResolveStyleSchemeChooserMethod "getStyleScheme" o = StyleSchemeChooserGetStyleSchemeMethodInfo ResolveStyleSchemeChooserMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo ResolveStyleSchemeChooserMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo ResolveStyleSchemeChooserMethod "setStyleScheme" o = StyleSchemeChooserSetStyleSchemeMethodInfo ResolveStyleSchemeChooserMethod l o = O.MethodResolutionFailed l o instance (info ~ ResolveStyleSchemeChooserMethod t StyleSchemeChooser, O.MethodInfo info StyleSchemeChooser p) => OL.IsLabel t (StyleSchemeChooser -> 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 -- method StyleSchemeChooser::get_style_scheme -- method type : OrdinaryMethod -- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "GtkSource", name = "StyleSchemeChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceStyleSchemeChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "GtkSource", name = "StyleScheme"})) -- throws : False -- Skip return : False foreign import ccall "gtk_source_style_scheme_chooser_get_style_scheme" gtk_source_style_scheme_chooser_get_style_scheme :: Ptr StyleSchemeChooser -> -- chooser : TInterface (Name {namespace = "GtkSource", name = "StyleSchemeChooser"}) IO (Ptr GtkSource.StyleScheme.StyleScheme) {- | Gets the currently-selected scheme. /Since: 3.16/ -} styleSchemeChooserGetStyleScheme :: (B.CallStack.HasCallStack, MonadIO m, IsStyleSchemeChooser a) => a {- ^ /@chooser@/: a 'GI.GtkSource.Interfaces.StyleSchemeChooser.StyleSchemeChooser' -} -> m GtkSource.StyleScheme.StyleScheme {- ^ __Returns:__ the currently-selected scheme. -} styleSchemeChooserGetStyleScheme chooser = liftIO $ do chooser' <- unsafeManagedPtrCastPtr chooser result <- gtk_source_style_scheme_chooser_get_style_scheme chooser' checkUnexpectedReturnNULL "styleSchemeChooserGetStyleScheme" result result' <- (newObject GtkSource.StyleScheme.StyleScheme) result touchManagedPtr chooser return result' #if ENABLE_OVERLOADING data StyleSchemeChooserGetStyleSchemeMethodInfo instance (signature ~ (m GtkSource.StyleScheme.StyleScheme), MonadIO m, IsStyleSchemeChooser a) => O.MethodInfo StyleSchemeChooserGetStyleSchemeMethodInfo a signature where overloadedMethod _ = styleSchemeChooserGetStyleScheme #endif -- method StyleSchemeChooser::set_style_scheme -- method type : OrdinaryMethod -- Args : [Arg {argCName = "chooser", argType = TInterface (Name {namespace = "GtkSource", name = "StyleSchemeChooser"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceStyleSchemeChooser", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "scheme", argType = TInterface (Name {namespace = "GtkSource", name = "StyleScheme"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSourceStyleScheme", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "gtk_source_style_scheme_chooser_set_style_scheme" gtk_source_style_scheme_chooser_set_style_scheme :: Ptr StyleSchemeChooser -> -- chooser : TInterface (Name {namespace = "GtkSource", name = "StyleSchemeChooser"}) Ptr GtkSource.StyleScheme.StyleScheme -> -- scheme : TInterface (Name {namespace = "GtkSource", name = "StyleScheme"}) IO () {- | Sets the scheme. /Since: 3.16/ -} styleSchemeChooserSetStyleScheme :: (B.CallStack.HasCallStack, MonadIO m, IsStyleSchemeChooser a, GtkSource.StyleScheme.IsStyleScheme b) => a {- ^ /@chooser@/: a 'GI.GtkSource.Interfaces.StyleSchemeChooser.StyleSchemeChooser' -} -> b {- ^ /@scheme@/: a 'GI.GtkSource.Objects.StyleScheme.StyleScheme' -} -> m () styleSchemeChooserSetStyleScheme chooser scheme = liftIO $ do chooser' <- unsafeManagedPtrCastPtr chooser scheme' <- unsafeManagedPtrCastPtr scheme gtk_source_style_scheme_chooser_set_style_scheme chooser' scheme' touchManagedPtr chooser touchManagedPtr scheme return () #if ENABLE_OVERLOADING data StyleSchemeChooserSetStyleSchemeMethodInfo instance (signature ~ (b -> m ()), MonadIO m, IsStyleSchemeChooser a, GtkSource.StyleScheme.IsStyleScheme b) => O.MethodInfo StyleSchemeChooserSetStyleSchemeMethodInfo a signature where overloadedMethod _ = styleSchemeChooserSetStyleScheme #endif