{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.TextAppearance
(
TextAppearance(..) ,
newZeroTextAppearance ,
noTextAppearance ,
#if defined(ENABLE_OVERLOADING)
ResolveTextAppearanceMethod ,
#endif
getTextAppearanceBgColor ,
#if defined(ENABLE_OVERLOADING)
textAppearance_bgColor ,
#endif
getTextAppearanceDrawBg ,
setTextAppearanceDrawBg ,
#if defined(ENABLE_OVERLOADING)
textAppearance_drawBg ,
#endif
getTextAppearanceFgColor ,
#if defined(ENABLE_OVERLOADING)
textAppearance_fgColor ,
#endif
getTextAppearanceInsideSelection ,
setTextAppearanceInsideSelection ,
#if defined(ENABLE_OVERLOADING)
textAppearance_insideSelection ,
#endif
getTextAppearanceIsText ,
setTextAppearanceIsText ,
#if defined(ENABLE_OVERLOADING)
textAppearance_isText ,
#endif
getTextAppearanceRise ,
setTextAppearanceRise ,
#if defined(ENABLE_OVERLOADING)
textAppearance_rise ,
#endif
getTextAppearanceStrikethrough ,
setTextAppearanceStrikethrough ,
#if defined(ENABLE_OVERLOADING)
textAppearance_strikethrough ,
#endif
getTextAppearanceUnderline ,
setTextAppearanceUnderline ,
#if defined(ENABLE_OVERLOADING)
textAppearance_underline ,
#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.GI.Base.Signals as B.Signals
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.Gdk.Structs.Color as Gdk.Color
newtype TextAppearance = TextAppearance (ManagedPtr TextAppearance)
deriving (Eq)
instance WrappedPtr TextAppearance where
wrappedPtrCalloc = callocBytes 48
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 48 >=> wrapPtr TextAppearance)
wrappedPtrFree = Just ptr_to_g_free
newZeroTextAppearance :: MonadIO m => m TextAppearance
newZeroTextAppearance = liftIO $ wrappedPtrCalloc >>= wrapPtr TextAppearance
instance tag ~ 'AttrSet => Constructible TextAppearance tag where
new _ attrs = do
o <- newZeroTextAppearance
GI.Attributes.set o attrs
return o
noTextAppearance :: Maybe TextAppearance
noTextAppearance = Nothing
getTextAppearanceBgColor :: MonadIO m => TextAppearance -> m Gdk.Color.Color
getTextAppearanceBgColor s = liftIO $ withManagedPtr s $ \ptr -> do
let val = ptr `plusPtr` 0 :: (Ptr Gdk.Color.Color)
val' <- (newBoxed Gdk.Color.Color) val
return val'
#if defined(ENABLE_OVERLOADING)
data TextAppearanceBgColorFieldInfo
instance AttrInfo TextAppearanceBgColorFieldInfo where
type AttrBaseTypeConstraint TextAppearanceBgColorFieldInfo = (~) TextAppearance
type AttrAllowedOps TextAppearanceBgColorFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint TextAppearanceBgColorFieldInfo = (~) (Ptr Gdk.Color.Color)
type AttrTransferTypeConstraint TextAppearanceBgColorFieldInfo = (~)(Ptr Gdk.Color.Color)
type AttrTransferType TextAppearanceBgColorFieldInfo = (Ptr Gdk.Color.Color)
type AttrGetType TextAppearanceBgColorFieldInfo = Gdk.Color.Color
type AttrLabel TextAppearanceBgColorFieldInfo = "bg_color"
type AttrOrigin TextAppearanceBgColorFieldInfo = TextAppearance
attrGet = getTextAppearanceBgColor
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
attrTransfer = undefined
textAppearance_bgColor :: AttrLabelProxy "bgColor"
textAppearance_bgColor = AttrLabelProxy
#endif
getTextAppearanceFgColor :: MonadIO m => TextAppearance -> m Gdk.Color.Color
getTextAppearanceFgColor s = liftIO $ withManagedPtr s $ \ptr -> do
let val = ptr `plusPtr` 12 :: (Ptr Gdk.Color.Color)
val' <- (newBoxed Gdk.Color.Color) val
return val'
#if defined(ENABLE_OVERLOADING)
data TextAppearanceFgColorFieldInfo
instance AttrInfo TextAppearanceFgColorFieldInfo where
type AttrBaseTypeConstraint TextAppearanceFgColorFieldInfo = (~) TextAppearance
type AttrAllowedOps TextAppearanceFgColorFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint TextAppearanceFgColorFieldInfo = (~) (Ptr Gdk.Color.Color)
type AttrTransferTypeConstraint TextAppearanceFgColorFieldInfo = (~)(Ptr Gdk.Color.Color)
type AttrTransferType TextAppearanceFgColorFieldInfo = (Ptr Gdk.Color.Color)
type AttrGetType TextAppearanceFgColorFieldInfo = Gdk.Color.Color
type AttrLabel TextAppearanceFgColorFieldInfo = "fg_color"
type AttrOrigin TextAppearanceFgColorFieldInfo = TextAppearance
attrGet = getTextAppearanceFgColor
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
attrTransfer = undefined
textAppearance_fgColor :: AttrLabelProxy "fgColor"
textAppearance_fgColor = AttrLabelProxy
#endif
getTextAppearanceRise :: MonadIO m => TextAppearance -> m Int32
getTextAppearanceRise s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO Int32
return val
setTextAppearanceRise :: MonadIO m => TextAppearance -> Int32 -> m ()
setTextAppearanceRise s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Int32)
#if defined(ENABLE_OVERLOADING)
data TextAppearanceRiseFieldInfo
instance AttrInfo TextAppearanceRiseFieldInfo where
type AttrBaseTypeConstraint TextAppearanceRiseFieldInfo = (~) TextAppearance
type AttrAllowedOps TextAppearanceRiseFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TextAppearanceRiseFieldInfo = (~) Int32
type AttrTransferTypeConstraint TextAppearanceRiseFieldInfo = (~)Int32
type AttrTransferType TextAppearanceRiseFieldInfo = Int32
type AttrGetType TextAppearanceRiseFieldInfo = Int32
type AttrLabel TextAppearanceRiseFieldInfo = "rise"
type AttrOrigin TextAppearanceRiseFieldInfo = TextAppearance
attrGet = getTextAppearanceRise
attrSet = setTextAppearanceRise
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
textAppearance_rise :: AttrLabelProxy "rise"
textAppearance_rise = AttrLabelProxy
#endif
getTextAppearanceUnderline :: MonadIO m => TextAppearance -> m Word32
getTextAppearanceUnderline s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 28) :: IO Word32
return val
setTextAppearanceUnderline :: MonadIO m => TextAppearance -> Word32 -> m ()
setTextAppearanceUnderline s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 28) (val :: Word32)
#if defined(ENABLE_OVERLOADING)
data TextAppearanceUnderlineFieldInfo
instance AttrInfo TextAppearanceUnderlineFieldInfo where
type AttrBaseTypeConstraint TextAppearanceUnderlineFieldInfo = (~) TextAppearance
type AttrAllowedOps TextAppearanceUnderlineFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TextAppearanceUnderlineFieldInfo = (~) Word32
type AttrTransferTypeConstraint TextAppearanceUnderlineFieldInfo = (~)Word32
type AttrTransferType TextAppearanceUnderlineFieldInfo = Word32
type AttrGetType TextAppearanceUnderlineFieldInfo = Word32
type AttrLabel TextAppearanceUnderlineFieldInfo = "underline"
type AttrOrigin TextAppearanceUnderlineFieldInfo = TextAppearance
attrGet = getTextAppearanceUnderline
attrSet = setTextAppearanceUnderline
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
textAppearance_underline :: AttrLabelProxy "underline"
textAppearance_underline = AttrLabelProxy
#endif
getTextAppearanceStrikethrough :: MonadIO m => TextAppearance -> m Word32
getTextAppearanceStrikethrough s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO Word32
return val
setTextAppearanceStrikethrough :: MonadIO m => TextAppearance -> Word32 -> m ()
setTextAppearanceStrikethrough s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Word32)
#if defined(ENABLE_OVERLOADING)
data TextAppearanceStrikethroughFieldInfo
instance AttrInfo TextAppearanceStrikethroughFieldInfo where
type AttrBaseTypeConstraint TextAppearanceStrikethroughFieldInfo = (~) TextAppearance
type AttrAllowedOps TextAppearanceStrikethroughFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TextAppearanceStrikethroughFieldInfo = (~) Word32
type AttrTransferTypeConstraint TextAppearanceStrikethroughFieldInfo = (~)Word32
type AttrTransferType TextAppearanceStrikethroughFieldInfo = Word32
type AttrGetType TextAppearanceStrikethroughFieldInfo = Word32
type AttrLabel TextAppearanceStrikethroughFieldInfo = "strikethrough"
type AttrOrigin TextAppearanceStrikethroughFieldInfo = TextAppearance
attrGet = getTextAppearanceStrikethrough
attrSet = setTextAppearanceStrikethrough
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
textAppearance_strikethrough :: AttrLabelProxy "strikethrough"
textAppearance_strikethrough = AttrLabelProxy
#endif
getTextAppearanceDrawBg :: MonadIO m => TextAppearance -> m Word32
getTextAppearanceDrawBg s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 36) :: IO Word32
return val
setTextAppearanceDrawBg :: MonadIO m => TextAppearance -> Word32 -> m ()
setTextAppearanceDrawBg s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 36) (val :: Word32)
#if defined(ENABLE_OVERLOADING)
data TextAppearanceDrawBgFieldInfo
instance AttrInfo TextAppearanceDrawBgFieldInfo where
type AttrBaseTypeConstraint TextAppearanceDrawBgFieldInfo = (~) TextAppearance
type AttrAllowedOps TextAppearanceDrawBgFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TextAppearanceDrawBgFieldInfo = (~) Word32
type AttrTransferTypeConstraint TextAppearanceDrawBgFieldInfo = (~)Word32
type AttrTransferType TextAppearanceDrawBgFieldInfo = Word32
type AttrGetType TextAppearanceDrawBgFieldInfo = Word32
type AttrLabel TextAppearanceDrawBgFieldInfo = "draw_bg"
type AttrOrigin TextAppearanceDrawBgFieldInfo = TextAppearance
attrGet = getTextAppearanceDrawBg
attrSet = setTextAppearanceDrawBg
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
textAppearance_drawBg :: AttrLabelProxy "drawBg"
textAppearance_drawBg = AttrLabelProxy
#endif
getTextAppearanceInsideSelection :: MonadIO m => TextAppearance -> m Word32
getTextAppearanceInsideSelection s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 40) :: IO Word32
return val
setTextAppearanceInsideSelection :: MonadIO m => TextAppearance -> Word32 -> m ()
setTextAppearanceInsideSelection s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 40) (val :: Word32)
#if defined(ENABLE_OVERLOADING)
data TextAppearanceInsideSelectionFieldInfo
instance AttrInfo TextAppearanceInsideSelectionFieldInfo where
type AttrBaseTypeConstraint TextAppearanceInsideSelectionFieldInfo = (~) TextAppearance
type AttrAllowedOps TextAppearanceInsideSelectionFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TextAppearanceInsideSelectionFieldInfo = (~) Word32
type AttrTransferTypeConstraint TextAppearanceInsideSelectionFieldInfo = (~)Word32
type AttrTransferType TextAppearanceInsideSelectionFieldInfo = Word32
type AttrGetType TextAppearanceInsideSelectionFieldInfo = Word32
type AttrLabel TextAppearanceInsideSelectionFieldInfo = "inside_selection"
type AttrOrigin TextAppearanceInsideSelectionFieldInfo = TextAppearance
attrGet = getTextAppearanceInsideSelection
attrSet = setTextAppearanceInsideSelection
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
textAppearance_insideSelection :: AttrLabelProxy "insideSelection"
textAppearance_insideSelection = AttrLabelProxy
#endif
getTextAppearanceIsText :: MonadIO m => TextAppearance -> m Word32
getTextAppearanceIsText s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 44) :: IO Word32
return val
setTextAppearanceIsText :: MonadIO m => TextAppearance -> Word32 -> m ()
setTextAppearanceIsText s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 44) (val :: Word32)
#if defined(ENABLE_OVERLOADING)
data TextAppearanceIsTextFieldInfo
instance AttrInfo TextAppearanceIsTextFieldInfo where
type AttrBaseTypeConstraint TextAppearanceIsTextFieldInfo = (~) TextAppearance
type AttrAllowedOps TextAppearanceIsTextFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint TextAppearanceIsTextFieldInfo = (~) Word32
type AttrTransferTypeConstraint TextAppearanceIsTextFieldInfo = (~)Word32
type AttrTransferType TextAppearanceIsTextFieldInfo = Word32
type AttrGetType TextAppearanceIsTextFieldInfo = Word32
type AttrLabel TextAppearanceIsTextFieldInfo = "is_text"
type AttrOrigin TextAppearanceIsTextFieldInfo = TextAppearance
attrGet = getTextAppearanceIsText
attrSet = setTextAppearanceIsText
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
textAppearance_isText :: AttrLabelProxy "isText"
textAppearance_isText = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TextAppearance
type instance O.AttributeList TextAppearance = TextAppearanceAttributeList
type TextAppearanceAttributeList = ('[ '("bgColor", TextAppearanceBgColorFieldInfo), '("fgColor", TextAppearanceFgColorFieldInfo), '("rise", TextAppearanceRiseFieldInfo), '("underline", TextAppearanceUnderlineFieldInfo), '("strikethrough", TextAppearanceStrikethroughFieldInfo), '("drawBg", TextAppearanceDrawBgFieldInfo), '("insideSelection", TextAppearanceInsideSelectionFieldInfo), '("isText", TextAppearanceIsTextFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTextAppearanceMethod (t :: Symbol) (o :: *) :: * where
ResolveTextAppearanceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTextAppearanceMethod t TextAppearance, O.MethodInfo info TextAppearance p) => OL.IsLabel t (TextAppearance -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif