{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) Using #GtkTextAttributes directly should rarely be necessary. It’s primarily useful with gtk_text_iter_get_attributes(). As with most GTK+ structs, the fields in this struct should only be read, never modified directly. -} module GI.Gtk.Structs.TextAttributes ( -- * Exported types TextAttributes(..) , noTextAttributes , -- * Methods -- ** textAttributesCopy textAttributesCopy , -- ** textAttributesCopyValues textAttributesCopyValues , -- ** textAttributesNew textAttributesNew , -- ** textAttributesRef textAttributesRef , -- ** textAttributesUnref textAttributesUnref , -- * Properties -- ** Appearance textAttributesReadAppearance , -- ** BgFullHeight textAttributesReadBgFullHeight , -- ** Direction textAttributesReadDirection , -- ** Editable textAttributesReadEditable , -- ** Font textAttributesReadFont , -- ** FontScale textAttributesReadFontScale , -- ** Indent textAttributesReadIndent , -- ** Invisible textAttributesReadInvisible , -- ** Justification textAttributesReadJustification , -- ** Language textAttributesReadLanguage , -- ** LeftMargin textAttributesReadLeftMargin , -- ** LetterSpacing textAttributesReadLetterSpacing , -- ** NoFallback textAttributesReadNoFallback , -- ** PixelsAboveLines textAttributesReadPixelsAboveLines , -- ** PixelsBelowLines textAttributesReadPixelsBelowLines , -- ** PixelsInsideWrap textAttributesReadPixelsInsideWrap , -- ** RightMargin textAttributesReadRightMargin , -- ** Tabs textAttributesReadTabs , -- ** WrapMode 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 -- method TextAttributes::new -- method type : Constructor -- Args : [] -- Lengths : [] -- hInArgs : [] -- returnType : TInterface "Gtk" "TextAttributes" -- throws : False -- Skip return : False 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' -- method TextAttributes::copy -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "Gtk" "TextAttributes" -- throws : False -- Skip return : False foreign import ccall "gtk_text_attributes_copy" gtk_text_attributes_copy :: Ptr TextAttributes -> -- _obj : TInterface "Gtk" "TextAttributes" IO (Ptr TextAttributes) textAttributesCopy :: (MonadIO m) => TextAttributes -> -- _obj 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' -- method TextAttributes::copy_values -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "dest", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "dest", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "gtk_text_attributes_copy_values" gtk_text_attributes_copy_values :: Ptr TextAttributes -> -- _obj : TInterface "Gtk" "TextAttributes" Ptr TextAttributes -> -- dest : TInterface "Gtk" "TextAttributes" IO () textAttributesCopyValues :: (MonadIO m) => TextAttributes -> -- _obj TextAttributes -> -- dest 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 () -- method TextAttributes::ref -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "Gtk" "TextAttributes" -- throws : False -- Skip return : False foreign import ccall "gtk_text_attributes_ref" gtk_text_attributes_ref :: Ptr TextAttributes -> -- _obj : TInterface "Gtk" "TextAttributes" IO (Ptr TextAttributes) textAttributesRef :: (MonadIO m) => TextAttributes -> -- _obj 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' -- method TextAttributes::unref -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "TextAttributes", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "gtk_text_attributes_unref" gtk_text_attributes_unref :: Ptr TextAttributes -> -- _obj : TInterface "Gtk" "TextAttributes" IO () textAttributesUnref :: (MonadIO m) => TextAttributes -> -- _obj m () textAttributesUnref _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj gtk_text_attributes_unref _obj' touchManagedPtr _obj return ()