module GI.Gtk.Structs.TextAttributes
(
TextAttributes(..) ,
noTextAttributes ,
textAttributesCopy ,
textAttributesCopyValues ,
textAttributesNew ,
textAttributesRef ,
textAttributesUnref ,
textAttributesReadAppearance ,
textAttributesReadBgFullHeight ,
textAttributesReadDirection ,
textAttributesReadEditable ,
textAttributesReadFont ,
textAttributesReadFontScale ,
textAttributesReadIndent ,
textAttributesReadInvisible ,
textAttributesReadJustification ,
textAttributesReadLanguage ,
textAttributesReadLeftMargin ,
textAttributesReadLetterSpacing ,
textAttributesReadNoFallback ,
textAttributesReadPixelsAboveLines ,
textAttributesReadPixelsBelowLines ,
textAttributesReadPixelsInsideWrap ,
textAttributesReadRightMargin ,
textAttributesReadTabs ,
textAttributesReadWrapMode ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Gtk.Types
import GI.Gtk.Callbacks
import qualified GI.Pango as Pango
newtype TextAttributes = TextAttributes (ForeignPtr TextAttributes)
foreign import ccall "gtk_text_attributes_get_type" c_gtk_text_attributes_get_type ::
IO GType
instance BoxedObject TextAttributes where
boxedType _ = c_gtk_text_attributes_get_type
noTextAttributes :: Maybe TextAttributes
noTextAttributes = Nothing
textAttributesReadAppearance :: TextAttributes -> IO TextAppearance
textAttributesReadAppearance s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 4) :: IO (Ptr TextAppearance)
val' <- (newPtr 48 TextAppearance) val
return val'
textAttributesReadJustification :: TextAttributes -> IO Justification
textAttributesReadJustification s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 52) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
textAttributesReadDirection :: TextAttributes -> IO TextDirection
textAttributesReadDirection s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 56) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
textAttributesReadFont :: TextAttributes -> IO Pango.FontDescription
textAttributesReadFont s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 64) :: IO (Ptr Pango.FontDescription)
val' <- (newBoxed Pango.FontDescription) val
return val'
textAttributesReadFontScale :: TextAttributes -> IO Double
textAttributesReadFontScale s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 72) :: IO CDouble
let val' = realToFrac val
return val'
textAttributesReadLeftMargin :: TextAttributes -> IO Int32
textAttributesReadLeftMargin s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 80) :: IO Int32
return val
textAttributesReadRightMargin :: TextAttributes -> IO Int32
textAttributesReadRightMargin s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 84) :: IO Int32
return val
textAttributesReadIndent :: TextAttributes -> IO Int32
textAttributesReadIndent s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 88) :: IO Int32
return val
textAttributesReadPixelsAboveLines :: TextAttributes -> IO Int32
textAttributesReadPixelsAboveLines s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 92) :: IO Int32
return val
textAttributesReadPixelsBelowLines :: TextAttributes -> IO Int32
textAttributesReadPixelsBelowLines s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 96) :: IO Int32
return val
textAttributesReadPixelsInsideWrap :: TextAttributes -> IO Int32
textAttributesReadPixelsInsideWrap s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 100) :: IO Int32
return val
textAttributesReadTabs :: TextAttributes -> IO Pango.TabArray
textAttributesReadTabs s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 104) :: IO (Ptr Pango.TabArray)
val' <- (newBoxed Pango.TabArray) val
return val'
textAttributesReadWrapMode :: TextAttributes -> IO WrapMode
textAttributesReadWrapMode s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 112) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
textAttributesReadLanguage :: TextAttributes -> IO Pango.Language
textAttributesReadLanguage s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 120) :: IO (Ptr Pango.Language)
val' <- (newBoxed Pango.Language) val
return val'
textAttributesReadInvisible :: TextAttributes -> IO Word32
textAttributesReadInvisible s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 136) :: IO Word32
return val
textAttributesReadBgFullHeight :: TextAttributes -> IO Word32
textAttributesReadBgFullHeight s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 140) :: IO Word32
return val
textAttributesReadEditable :: TextAttributes -> IO Word32
textAttributesReadEditable s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 144) :: IO Word32
return val
textAttributesReadNoFallback :: TextAttributes -> IO Word32
textAttributesReadNoFallback s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 148) :: IO Word32
return val
textAttributesReadLetterSpacing :: TextAttributes -> IO Int32
textAttributesReadLetterSpacing s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 160) :: IO Int32
return val
foreign import ccall "gtk_text_attributes_new" gtk_text_attributes_new ::
IO (Ptr TextAttributes)
textAttributesNew ::
(MonadIO m) =>
m TextAttributes
textAttributesNew = liftIO $ do
result <- gtk_text_attributes_new
checkUnexpectedReturnNULL "gtk_text_attributes_new" result
result' <- (wrapBoxed TextAttributes) result
return result'
foreign import ccall "gtk_text_attributes_copy" gtk_text_attributes_copy ::
Ptr TextAttributes ->
IO (Ptr TextAttributes)
textAttributesCopy ::
(MonadIO m) =>
TextAttributes ->
m TextAttributes
textAttributesCopy _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
result <- gtk_text_attributes_copy _obj'
checkUnexpectedReturnNULL "gtk_text_attributes_copy" result
result' <- (wrapBoxed TextAttributes) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_text_attributes_copy_values" gtk_text_attributes_copy_values ::
Ptr TextAttributes ->
Ptr TextAttributes ->
IO ()
textAttributesCopyValues ::
(MonadIO m) =>
TextAttributes ->
TextAttributes ->
m ()
textAttributesCopyValues _obj dest = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
let dest' = unsafeManagedPtrGetPtr dest
gtk_text_attributes_copy_values _obj' dest'
touchManagedPtr _obj
touchManagedPtr dest
return ()
foreign import ccall "gtk_text_attributes_ref" gtk_text_attributes_ref ::
Ptr TextAttributes ->
IO (Ptr TextAttributes)
textAttributesRef ::
(MonadIO m) =>
TextAttributes ->
m TextAttributes
textAttributesRef _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
result <- gtk_text_attributes_ref _obj'
checkUnexpectedReturnNULL "gtk_text_attributes_ref" result
result' <- (wrapBoxed TextAttributes) result
touchManagedPtr _obj
return result'
foreign import ccall "gtk_text_attributes_unref" gtk_text_attributes_unref ::
Ptr TextAttributes ->
IO ()
textAttributesUnref ::
(MonadIO m) =>
TextAttributes ->
m ()
textAttributesUnref _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
gtk_text_attributes_unref _obj'
touchManagedPtr _obj
return ()