{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Pango.Structs.TabArray
(
TabArray(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveTabArrayMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TabArrayCopyMethodInfo ,
#endif
tabArrayCopy ,
#if defined(ENABLE_OVERLOADING)
TabArrayFreeMethodInfo ,
#endif
tabArrayFree ,
tabArrayFromString ,
#if defined(ENABLE_OVERLOADING)
TabArrayGetDecimalPointMethodInfo ,
#endif
tabArrayGetDecimalPoint ,
#if defined(ENABLE_OVERLOADING)
TabArrayGetPositionsInPixelsMethodInfo ,
#endif
tabArrayGetPositionsInPixels ,
#if defined(ENABLE_OVERLOADING)
TabArrayGetSizeMethodInfo ,
#endif
tabArrayGetSize ,
#if defined(ENABLE_OVERLOADING)
TabArrayGetTabMethodInfo ,
#endif
tabArrayGetTab ,
tabArrayNew ,
#if defined(ENABLE_OVERLOADING)
TabArrayResizeMethodInfo ,
#endif
tabArrayResize ,
#if defined(ENABLE_OVERLOADING)
TabArraySetDecimalPointMethodInfo ,
#endif
tabArraySetDecimalPoint ,
#if defined(ENABLE_OVERLOADING)
TabArraySetPositionsInPixelsMethodInfo ,
#endif
tabArraySetPositionsInPixels ,
#if defined(ENABLE_OVERLOADING)
TabArraySetTabMethodInfo ,
#endif
tabArraySetTab ,
#if defined(ENABLE_OVERLOADING)
TabArraySortMethodInfo ,
#endif
tabArraySort ,
#if defined(ENABLE_OVERLOADING)
TabArrayToStringMethodInfo ,
#endif
tabArrayToString ,
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
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 Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
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 GHC.Records as R
import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
newtype TabArray = TabArray (SP.ManagedPtr TabArray)
deriving (TabArray -> TabArray -> Bool
(TabArray -> TabArray -> Bool)
-> (TabArray -> TabArray -> Bool) -> Eq TabArray
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TabArray -> TabArray -> Bool
$c/= :: TabArray -> TabArray -> Bool
== :: TabArray -> TabArray -> Bool
$c== :: TabArray -> TabArray -> Bool
Eq)
instance SP.ManagedPtrNewtype TabArray where
toManagedPtr :: TabArray -> ManagedPtr TabArray
toManagedPtr (TabArray ManagedPtr TabArray
p) = ManagedPtr TabArray
p
foreign import ccall "pango_tab_array_get_type" c_pango_tab_array_get_type ::
IO GType
type instance O.ParentTypes TabArray = '[]
instance O.HasParentTypes TabArray
instance B.Types.TypedObject TabArray where
glibType :: IO GType
glibType = IO GType
c_pango_tab_array_get_type
instance B.Types.GBoxed TabArray
instance B.GValue.IsGValue (Maybe TabArray) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_pango_tab_array_get_type
gvalueSet_ :: Ptr GValue -> Maybe TabArray -> IO ()
gvalueSet_ Ptr GValue
gv Maybe TabArray
P.Nothing = Ptr GValue -> Ptr TabArray -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr TabArray
forall a. Ptr a
FP.nullPtr :: FP.Ptr TabArray)
gvalueSet_ Ptr GValue
gv (P.Just TabArray
obj) = TabArray -> (Ptr TabArray -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TabArray
obj (Ptr GValue -> Ptr TabArray -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe TabArray)
gvalueGet_ Ptr GValue
gv = do
Ptr TabArray
ptr <- Ptr GValue -> IO (Ptr TabArray)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr TabArray)
if Ptr TabArray
ptr Ptr TabArray -> Ptr TabArray -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr TabArray
forall a. Ptr a
FP.nullPtr
then TabArray -> Maybe TabArray
forall a. a -> Maybe a
P.Just (TabArray -> Maybe TabArray) -> IO TabArray -> IO (Maybe TabArray)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr TabArray -> TabArray) -> Ptr TabArray -> IO TabArray
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr TabArray -> TabArray
TabArray Ptr TabArray
ptr
else Maybe TabArray -> IO (Maybe TabArray)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TabArray
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TabArray
type instance O.AttributeList TabArray = TabArrayAttributeList
type TabArrayAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "pango_tab_array_new" pango_tab_array_new ::
Int32 ->
CInt ->
IO (Ptr TabArray)
tabArrayNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Int32
-> Bool
-> m TabArray
tabArrayNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Int32 -> Bool -> m TabArray
tabArrayNew Int32
initialSize Bool
positionsInPixels = IO TabArray -> m TabArray
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TabArray -> m TabArray) -> IO TabArray -> m TabArray
forall a b. (a -> b) -> a -> b
$ do
let positionsInPixels' :: CInt
positionsInPixels' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
positionsInPixels
Ptr TabArray
result <- Int32 -> CInt -> IO (Ptr TabArray)
pango_tab_array_new Int32
initialSize CInt
positionsInPixels'
Text -> Ptr TabArray -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"tabArrayNew" Ptr TabArray
result
TabArray
result' <- ((ManagedPtr TabArray -> TabArray) -> Ptr TabArray -> IO TabArray
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TabArray -> TabArray
TabArray) Ptr TabArray
result
TabArray -> IO TabArray
forall (m :: * -> *) a. Monad m => a -> m a
return TabArray
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "pango_tab_array_copy" pango_tab_array_copy ::
Ptr TabArray ->
IO (Ptr TabArray)
tabArrayCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> m TabArray
tabArrayCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> m TabArray
tabArrayCopy TabArray
src = IO TabArray -> m TabArray
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TabArray -> m TabArray) -> IO TabArray -> m TabArray
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
src' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
src
Ptr TabArray
result <- Ptr TabArray -> IO (Ptr TabArray)
pango_tab_array_copy Ptr TabArray
src'
Text -> Ptr TabArray -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"tabArrayCopy" Ptr TabArray
result
TabArray
result' <- ((ManagedPtr TabArray -> TabArray) -> Ptr TabArray -> IO TabArray
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TabArray -> TabArray
TabArray) Ptr TabArray
result
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
src
TabArray -> IO TabArray
forall (m :: * -> *) a. Monad m => a -> m a
return TabArray
result'
#if defined(ENABLE_OVERLOADING)
data TabArrayCopyMethodInfo
instance (signature ~ (m TabArray), MonadIO m) => O.OverloadedMethod TabArrayCopyMethodInfo TabArray signature where
overloadedMethod = tabArrayCopy
instance O.OverloadedMethodInfo TabArrayCopyMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArrayCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArrayCopy"
})
#endif
foreign import ccall "pango_tab_array_free" pango_tab_array_free ::
Ptr TabArray ->
IO ()
tabArrayFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> m ()
tabArrayFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => TabArray -> m ()
tabArrayFree TabArray
tabArray = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
Ptr TabArray -> IO ()
pango_tab_array_free Ptr TabArray
tabArray'
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TabArrayFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod TabArrayFreeMethodInfo TabArray signature where
overloadedMethod = tabArrayFree
instance O.OverloadedMethodInfo TabArrayFreeMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArrayFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArrayFree"
})
#endif
foreign import ccall "pango_tab_array_get_decimal_point" pango_tab_array_get_decimal_point ::
Ptr TabArray ->
Int32 ->
IO CInt
tabArrayGetDecimalPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> Int32
-> m Char
tabArrayGetDecimalPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> Int32 -> m Char
tabArrayGetDecimalPoint TabArray
tabArray Int32
tabIndex = IO Char -> m Char
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Char -> m Char) -> IO Char -> m Char
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
CInt
result <- Ptr TabArray -> Int32 -> IO CInt
pango_tab_array_get_decimal_point Ptr TabArray
tabArray' Int32
tabIndex
let result' :: Char
result' = (Int -> Char
chr (Int -> Char) -> (CInt -> Int) -> CInt -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
Char -> IO Char
forall (m :: * -> *) a. Monad m => a -> m a
return Char
result'
#if defined(ENABLE_OVERLOADING)
data TabArrayGetDecimalPointMethodInfo
instance (signature ~ (Int32 -> m Char), MonadIO m) => O.OverloadedMethod TabArrayGetDecimalPointMethodInfo TabArray signature where
overloadedMethod = tabArrayGetDecimalPoint
instance O.OverloadedMethodInfo TabArrayGetDecimalPointMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArrayGetDecimalPoint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArrayGetDecimalPoint"
})
#endif
foreign import ccall "pango_tab_array_get_positions_in_pixels" pango_tab_array_get_positions_in_pixels ::
Ptr TabArray ->
IO CInt
tabArrayGetPositionsInPixels ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> m Bool
tabArrayGetPositionsInPixels :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> m Bool
tabArrayGetPositionsInPixels TabArray
tabArray = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
CInt
result <- Ptr TabArray -> IO CInt
pango_tab_array_get_positions_in_pixels Ptr TabArray
tabArray'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data TabArrayGetPositionsInPixelsMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod TabArrayGetPositionsInPixelsMethodInfo TabArray signature where
overloadedMethod = tabArrayGetPositionsInPixels
instance O.OverloadedMethodInfo TabArrayGetPositionsInPixelsMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArrayGetPositionsInPixels",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArrayGetPositionsInPixels"
})
#endif
foreign import ccall "pango_tab_array_get_size" pango_tab_array_get_size ::
Ptr TabArray ->
IO Int32
tabArrayGetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> m Int32
tabArrayGetSize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> m Int32
tabArrayGetSize TabArray
tabArray = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
Int32
result <- Ptr TabArray -> IO Int32
pango_tab_array_get_size Ptr TabArray
tabArray'
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data TabArrayGetSizeMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.OverloadedMethod TabArrayGetSizeMethodInfo TabArray signature where
overloadedMethod = tabArrayGetSize
instance O.OverloadedMethodInfo TabArrayGetSizeMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArrayGetSize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArrayGetSize"
})
#endif
foreign import ccall "pango_tab_array_get_tab" pango_tab_array_get_tab ::
Ptr TabArray ->
Int32 ->
Ptr CUInt ->
Ptr Int32 ->
IO ()
tabArrayGetTab ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> Int32
-> m ((Pango.Enums.TabAlign, Int32))
tabArrayGetTab :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> Int32 -> m (TabAlign, Int32)
tabArrayGetTab TabArray
tabArray Int32
tabIndex = IO (TabAlign, Int32) -> m (TabAlign, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (TabAlign, Int32) -> m (TabAlign, Int32))
-> IO (TabAlign, Int32) -> m (TabAlign, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
Ptr CUInt
alignment <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
Ptr Int32
location <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr TabArray -> Int32 -> Ptr CUInt -> Ptr Int32 -> IO ()
pango_tab_array_get_tab Ptr TabArray
tabArray' Int32
tabIndex Ptr CUInt
alignment Ptr Int32
location
CUInt
alignment' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
alignment
let alignment'' :: TabAlign
alignment'' = (Int -> TabAlign
forall a. Enum a => Int -> a
toEnum (Int -> TabAlign) -> (CUInt -> Int) -> CUInt -> TabAlign
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
alignment'
Int32
location' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
location
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
alignment
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
location
(TabAlign, Int32) -> IO (TabAlign, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (TabAlign
alignment'', Int32
location')
#if defined(ENABLE_OVERLOADING)
data TabArrayGetTabMethodInfo
instance (signature ~ (Int32 -> m ((Pango.Enums.TabAlign, Int32))), MonadIO m) => O.OverloadedMethod TabArrayGetTabMethodInfo TabArray signature where
overloadedMethod = tabArrayGetTab
instance O.OverloadedMethodInfo TabArrayGetTabMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArrayGetTab",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArrayGetTab"
})
#endif
foreign import ccall "pango_tab_array_resize" pango_tab_array_resize ::
Ptr TabArray ->
Int32 ->
IO ()
tabArrayResize ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> Int32
-> m ()
tabArrayResize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> Int32 -> m ()
tabArrayResize TabArray
tabArray Int32
newSize = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
Ptr TabArray -> Int32 -> IO ()
pango_tab_array_resize Ptr TabArray
tabArray' Int32
newSize
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TabArrayResizeMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m) => O.OverloadedMethod TabArrayResizeMethodInfo TabArray signature where
overloadedMethod = tabArrayResize
instance O.OverloadedMethodInfo TabArrayResizeMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArrayResize",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArrayResize"
})
#endif
foreign import ccall "pango_tab_array_set_decimal_point" pango_tab_array_set_decimal_point ::
Ptr TabArray ->
Int32 ->
CInt ->
IO ()
tabArraySetDecimalPoint ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> Int32
-> Char
-> m ()
tabArraySetDecimalPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> Int32 -> Char -> m ()
tabArraySetDecimalPoint TabArray
tabArray Int32
tabIndex Char
decimalPoint = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
let decimalPoint' :: CInt
decimalPoint' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Char -> Int) -> Char -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
ord) Char
decimalPoint
Ptr TabArray -> Int32 -> CInt -> IO ()
pango_tab_array_set_decimal_point Ptr TabArray
tabArray' Int32
tabIndex CInt
decimalPoint'
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TabArraySetDecimalPointMethodInfo
instance (signature ~ (Int32 -> Char -> m ()), MonadIO m) => O.OverloadedMethod TabArraySetDecimalPointMethodInfo TabArray signature where
overloadedMethod = tabArraySetDecimalPoint
instance O.OverloadedMethodInfo TabArraySetDecimalPointMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArraySetDecimalPoint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArraySetDecimalPoint"
})
#endif
foreign import ccall "pango_tab_array_set_positions_in_pixels" pango_tab_array_set_positions_in_pixels ::
Ptr TabArray ->
CInt ->
IO ()
tabArraySetPositionsInPixels ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> Bool
-> m ()
tabArraySetPositionsInPixels :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> Bool -> m ()
tabArraySetPositionsInPixels TabArray
tabArray Bool
positionsInPixels = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
let positionsInPixels' :: CInt
positionsInPixels' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
positionsInPixels
Ptr TabArray -> CInt -> IO ()
pango_tab_array_set_positions_in_pixels Ptr TabArray
tabArray' CInt
positionsInPixels'
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TabArraySetPositionsInPixelsMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.OverloadedMethod TabArraySetPositionsInPixelsMethodInfo TabArray signature where
overloadedMethod = tabArraySetPositionsInPixels
instance O.OverloadedMethodInfo TabArraySetPositionsInPixelsMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArraySetPositionsInPixels",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArraySetPositionsInPixels"
})
#endif
foreign import ccall "pango_tab_array_set_tab" pango_tab_array_set_tab ::
Ptr TabArray ->
Int32 ->
CUInt ->
Int32 ->
IO ()
tabArraySetTab ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> Int32
-> Pango.Enums.TabAlign
-> Int32
-> m ()
tabArraySetTab :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> Int32 -> TabAlign -> Int32 -> m ()
tabArraySetTab TabArray
tabArray Int32
tabIndex TabAlign
alignment Int32
location = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
let alignment' :: CUInt
alignment' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TabAlign -> Int) -> TabAlign -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TabAlign -> Int
forall a. Enum a => a -> Int
fromEnum) TabAlign
alignment
Ptr TabArray -> Int32 -> CUInt -> Int32 -> IO ()
pango_tab_array_set_tab Ptr TabArray
tabArray' Int32
tabIndex CUInt
alignment' Int32
location
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TabArraySetTabMethodInfo
instance (signature ~ (Int32 -> Pango.Enums.TabAlign -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod TabArraySetTabMethodInfo TabArray signature where
overloadedMethod = tabArraySetTab
instance O.OverloadedMethodInfo TabArraySetTabMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArraySetTab",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArraySetTab"
})
#endif
foreign import ccall "pango_tab_array_sort" pango_tab_array_sort ::
Ptr TabArray ->
IO ()
tabArraySort ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> m ()
tabArraySort :: forall (m :: * -> *). (HasCallStack, MonadIO m) => TabArray -> m ()
tabArraySort TabArray
tabArray = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
Ptr TabArray -> IO ()
pango_tab_array_sort Ptr TabArray
tabArray'
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TabArraySortMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod TabArraySortMethodInfo TabArray signature where
overloadedMethod = tabArraySort
instance O.OverloadedMethodInfo TabArraySortMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArraySort",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArraySort"
})
#endif
foreign import ccall "pango_tab_array_to_string" pango_tab_array_to_string ::
Ptr TabArray ->
IO CString
tabArrayToString ::
(B.CallStack.HasCallStack, MonadIO m) =>
TabArray
-> m T.Text
tabArrayToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TabArray -> m Text
tabArrayToString TabArray
tabArray = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr TabArray
tabArray' <- TabArray -> IO (Ptr TabArray)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TabArray
tabArray
CString
result <- Ptr TabArray -> IO CString
pango_tab_array_to_string Ptr TabArray
tabArray'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"tabArrayToString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
TabArray -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TabArray
tabArray
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data TabArrayToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod TabArrayToStringMethodInfo TabArray signature where
overloadedMethod = tabArrayToString
instance O.OverloadedMethodInfo TabArrayToStringMethodInfo TabArray where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.TabArray.tabArrayToString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.25/docs/GI-Pango-Structs-TabArray.html#v:tabArrayToString"
})
#endif
foreign import ccall "pango_tab_array_from_string" pango_tab_array_from_string ::
CString ->
IO (Ptr TabArray)
tabArrayFromString ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe TabArray)
tabArrayFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe TabArray)
tabArrayFromString Text
text = IO (Maybe TabArray) -> m (Maybe TabArray)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe TabArray) -> m (Maybe TabArray))
-> IO (Maybe TabArray) -> m (Maybe TabArray)
forall a b. (a -> b) -> a -> b
$ do
CString
text' <- Text -> IO CString
textToCString Text
text
Ptr TabArray
result <- CString -> IO (Ptr TabArray)
pango_tab_array_from_string CString
text'
Maybe TabArray
maybeResult <- Ptr TabArray
-> (Ptr TabArray -> IO TabArray) -> IO (Maybe TabArray)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr TabArray
result ((Ptr TabArray -> IO TabArray) -> IO (Maybe TabArray))
-> (Ptr TabArray -> IO TabArray) -> IO (Maybe TabArray)
forall a b. (a -> b) -> a -> b
$ \Ptr TabArray
result' -> do
TabArray
result'' <- ((ManagedPtr TabArray -> TabArray) -> Ptr TabArray -> IO TabArray
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TabArray -> TabArray
TabArray) Ptr TabArray
result'
TabArray -> IO TabArray
forall (m :: * -> *) a. Monad m => a -> m a
return TabArray
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
Maybe TabArray -> IO (Maybe TabArray)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TabArray
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTabArrayMethod (t :: Symbol) (o :: *) :: * where
ResolveTabArrayMethod "copy" o = TabArrayCopyMethodInfo
ResolveTabArrayMethod "free" o = TabArrayFreeMethodInfo
ResolveTabArrayMethod "resize" o = TabArrayResizeMethodInfo
ResolveTabArrayMethod "sort" o = TabArraySortMethodInfo
ResolveTabArrayMethod "toString" o = TabArrayToStringMethodInfo
ResolveTabArrayMethod "getDecimalPoint" o = TabArrayGetDecimalPointMethodInfo
ResolveTabArrayMethod "getPositionsInPixels" o = TabArrayGetPositionsInPixelsMethodInfo
ResolveTabArrayMethod "getSize" o = TabArrayGetSizeMethodInfo
ResolveTabArrayMethod "getTab" o = TabArrayGetTabMethodInfo
ResolveTabArrayMethod "setDecimalPoint" o = TabArraySetDecimalPointMethodInfo
ResolveTabArrayMethod "setPositionsInPixels" o = TabArraySetPositionsInPixelsMethodInfo
ResolveTabArrayMethod "setTab" o = TabArraySetTabMethodInfo
ResolveTabArrayMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTabArrayMethod t TabArray, O.OverloadedMethod info TabArray p) => OL.IsLabel t (TabArray -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveTabArrayMethod t TabArray, O.OverloadedMethod info TabArray p, R.HasField t TabArray p) => R.HasField t TabArray p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveTabArrayMethod t TabArray, O.OverloadedMethodInfo info TabArray) => OL.IsLabel t (O.MethodProxy info TabArray) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif