{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) A 'GI.Pango.Structs.GlyphItem.GlyphItem' is a pair of a 'GI.Pango.Structs.Item.Item' and the glyphs resulting from shaping the text corresponding to an item. As an example of the usage of 'GI.Pango.Structs.GlyphItem.GlyphItem', the results of shaping text with 'GI.Pango.Objects.Layout.Layout' is a list of 'GI.Pango.Structs.LayoutLine.LayoutLine', each of which contains a list of 'GI.Pango.Structs.GlyphItem.GlyphItem'. -} module GI.Pango.Structs.GlyphItem ( -- * Exported types GlyphItem(..) , newZeroGlyphItem , noGlyphItem , -- * Methods -- ** applyAttrs #method:applyAttrs# GlyphItemApplyAttrsMethodInfo , glyphItemApplyAttrs , -- ** copy #method:copy# GlyphItemCopyMethodInfo , glyphItemCopy , -- ** free #method:free# GlyphItemFreeMethodInfo , glyphItemFree , -- ** getLogicalWidths #method:getLogicalWidths# GlyphItemGetLogicalWidthsMethodInfo , glyphItemGetLogicalWidths , -- ** letterSpace #method:letterSpace# GlyphItemLetterSpaceMethodInfo , glyphItemLetterSpace , -- ** split #method:split# GlyphItemSplitMethodInfo , glyphItemSplit , -- * Properties -- ** glyphs #attr:glyphs# clearGlyphItemGlyphs , getGlyphItemGlyphs , glyphItem_glyphs , setGlyphItemGlyphs , -- ** item #attr:item# clearGlyphItemItem , getGlyphItemItem , glyphItem_item , setGlyphItemItem , ) 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.GError as B.GError import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack 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 {-# SOURCE #-} qualified GI.Pango.Structs.AttrList as Pango.AttrList import {-# SOURCE #-} qualified GI.Pango.Structs.GlyphString as Pango.GlyphString import {-# SOURCE #-} qualified GI.Pango.Structs.Item as Pango.Item import {-# SOURCE #-} qualified GI.Pango.Structs.LogAttr as Pango.LogAttr newtype GlyphItem = GlyphItem (ManagedPtr GlyphItem) foreign import ccall "pango_glyph_item_get_type" c_pango_glyph_item_get_type :: IO GType instance BoxedObject GlyphItem where boxedType _ = c_pango_glyph_item_get_type -- | Construct a `GlyphItem` struct initialized to zero. newZeroGlyphItem :: MonadIO m => m GlyphItem newZeroGlyphItem = liftIO $ callocBoxedBytes 16 >>= wrapBoxed GlyphItem instance tag ~ 'AttrSet => Constructible GlyphItem tag where new _ attrs = do o <- newZeroGlyphItem GI.Attributes.set o attrs return o noGlyphItem :: Maybe GlyphItem noGlyphItem = Nothing getGlyphItemItem :: MonadIO m => GlyphItem -> m (Maybe Pango.Item.Item) getGlyphItemItem s = liftIO $ withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 0) :: IO (Ptr Pango.Item.Item) result <- SP.convertIfNonNull val $ \val' -> do val'' <- (newBoxed Pango.Item.Item) val' return val'' return result setGlyphItemItem :: MonadIO m => GlyphItem -> Ptr Pango.Item.Item -> m () setGlyphItemItem s val = liftIO $ withManagedPtr s $ \ptr -> do poke (ptr `plusPtr` 0) (val :: Ptr Pango.Item.Item) clearGlyphItemItem :: MonadIO m => GlyphItem -> m () clearGlyphItemItem s = liftIO $ withManagedPtr s $ \ptr -> do poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr Pango.Item.Item) data GlyphItemItemFieldInfo instance AttrInfo GlyphItemItemFieldInfo where type AttrAllowedOps GlyphItemItemFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint GlyphItemItemFieldInfo = (~) (Ptr Pango.Item.Item) type AttrBaseTypeConstraint GlyphItemItemFieldInfo = (~) GlyphItem type AttrGetType GlyphItemItemFieldInfo = Maybe Pango.Item.Item type AttrLabel GlyphItemItemFieldInfo = "item" type AttrOrigin GlyphItemItemFieldInfo = GlyphItem attrGet _ = getGlyphItemItem attrSet _ = setGlyphItemItem attrConstruct = undefined attrClear _ = clearGlyphItemItem glyphItem_item :: AttrLabelProxy "item" glyphItem_item = AttrLabelProxy getGlyphItemGlyphs :: MonadIO m => GlyphItem -> m (Maybe Pango.GlyphString.GlyphString) getGlyphItemGlyphs s = liftIO $ withManagedPtr s $ \ptr -> do val <- peek (ptr `plusPtr` 8) :: IO (Ptr Pango.GlyphString.GlyphString) result <- SP.convertIfNonNull val $ \val' -> do val'' <- (newBoxed Pango.GlyphString.GlyphString) val' return val'' return result setGlyphItemGlyphs :: MonadIO m => GlyphItem -> Ptr Pango.GlyphString.GlyphString -> m () setGlyphItemGlyphs s val = liftIO $ withManagedPtr s $ \ptr -> do poke (ptr `plusPtr` 8) (val :: Ptr Pango.GlyphString.GlyphString) clearGlyphItemGlyphs :: MonadIO m => GlyphItem -> m () clearGlyphItemGlyphs s = liftIO $ withManagedPtr s $ \ptr -> do poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr Pango.GlyphString.GlyphString) data GlyphItemGlyphsFieldInfo instance AttrInfo GlyphItemGlyphsFieldInfo where type AttrAllowedOps GlyphItemGlyphsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint GlyphItemGlyphsFieldInfo = (~) (Ptr Pango.GlyphString.GlyphString) type AttrBaseTypeConstraint GlyphItemGlyphsFieldInfo = (~) GlyphItem type AttrGetType GlyphItemGlyphsFieldInfo = Maybe Pango.GlyphString.GlyphString type AttrLabel GlyphItemGlyphsFieldInfo = "glyphs" type AttrOrigin GlyphItemGlyphsFieldInfo = GlyphItem attrGet _ = getGlyphItemGlyphs attrSet _ = setGlyphItemGlyphs attrConstruct = undefined attrClear _ = clearGlyphItemGlyphs glyphItem_glyphs :: AttrLabelProxy "glyphs" glyphItem_glyphs = AttrLabelProxy instance O.HasAttributeList GlyphItem type instance O.AttributeList GlyphItem = GlyphItemAttributeList type GlyphItemAttributeList = ('[ '("item", GlyphItemItemFieldInfo), '("glyphs", GlyphItemGlyphsFieldInfo)] :: [(Symbol, *)]) -- method GlyphItem::apply_attrs -- method type : OrdinaryMethod -- Args : [Arg {argCName = "glyph_item", argType = TInterface (Name {namespace = "Pango", name = "GlyphItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a shaped item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "text that @list applies to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "list", argType = TInterface (Name {namespace = "Pango", name = "AttrList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoAttrList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGSList (TInterface (Name {namespace = "Pango", name = "GlyphItem"}))) -- throws : False -- Skip return : False foreign import ccall "pango_glyph_item_apply_attrs" pango_glyph_item_apply_attrs :: Ptr GlyphItem -> -- glyph_item : TInterface (Name {namespace = "Pango", name = "GlyphItem"}) CString -> -- text : TBasicType TUTF8 Ptr Pango.AttrList.AttrList -> -- list : TInterface (Name {namespace = "Pango", name = "AttrList"}) IO (Ptr (GSList (Ptr GlyphItem))) {- | Splits a shaped item (PangoGlyphItem) into multiple items based on an attribute list. The idea is that if you have attributes that don\'t affect shaping, such as color or underline, to avoid affecting shaping, you filter them out ('GI.Pango.Structs.AttrList.attrListFilter'), apply the shaping process and then reapply them to the result using this function. All attributes that start or end inside a cluster are applied to that cluster; for instance, if half of a cluster is underlined and the other-half strikethrough, then the cluster will end up with both underline and strikethrough attributes. In these cases, it may happen that item->extra_attrs for some of the result items can have multiple attributes of the same type. This function takes ownership of /@glyphItem@/; it will be reused as one of the elements in the list. @since 1.2 -} glyphItemApplyAttrs :: (B.CallStack.HasCallStack, MonadIO m) => GlyphItem {- ^ /@glyphItem@/: a shaped item -} -> T.Text {- ^ /@text@/: text that /@list@/ applies to -} -> Pango.AttrList.AttrList {- ^ /@list@/: a 'GI.Pango.Structs.AttrList.AttrList' -} -> m [GlyphItem] {- ^ __Returns:__ a list of glyph items resulting from splitting /@glyphItem@/. Free the elements using 'GI.Pango.Structs.GlyphItem.glyphItemFree', the list using @/g_slist_free()/@. -} glyphItemApplyAttrs glyphItem text list = liftIO $ do glyphItem' <- unsafeManagedPtrGetPtr glyphItem text' <- textToCString text list' <- unsafeManagedPtrGetPtr list result <- pango_glyph_item_apply_attrs glyphItem' text' list' result' <- unpackGSList result result'' <- mapM (wrapBoxed GlyphItem) result' g_slist_free result touchManagedPtr glyphItem touchManagedPtr list freeMem text' return result'' data GlyphItemApplyAttrsMethodInfo instance (signature ~ (T.Text -> Pango.AttrList.AttrList -> m [GlyphItem]), MonadIO m) => O.MethodInfo GlyphItemApplyAttrsMethodInfo GlyphItem signature where overloadedMethod _ = glyphItemApplyAttrs -- method GlyphItem::copy -- method type : OrdinaryMethod -- Args : [Arg {argCName = "orig", argType = TInterface (Name {namespace = "Pango", name = "GlyphItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoGlyphItem, may be %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Pango", name = "GlyphItem"})) -- throws : False -- Skip return : False foreign import ccall "pango_glyph_item_copy" pango_glyph_item_copy :: Ptr GlyphItem -> -- orig : TInterface (Name {namespace = "Pango", name = "GlyphItem"}) IO (Ptr GlyphItem) {- | Make a deep copy of an existing 'GI.Pango.Structs.GlyphItem.GlyphItem' structure. @since 1.20 -} glyphItemCopy :: (B.CallStack.HasCallStack, MonadIO m) => GlyphItem {- ^ /@orig@/: a 'GI.Pango.Structs.GlyphItem.GlyphItem', may be 'Nothing' -} -> m (Maybe GlyphItem) {- ^ __Returns:__ the newly allocated 'GI.Pango.Structs.GlyphItem.GlyphItem', which should be freed with 'GI.Pango.Structs.GlyphItem.glyphItemFree', or 'Nothing' if /@orig@/ was 'Nothing'. -} glyphItemCopy orig = liftIO $ do orig' <- unsafeManagedPtrGetPtr orig result <- pango_glyph_item_copy orig' maybeResult <- convertIfNonNull result $ \result' -> do result'' <- (wrapBoxed GlyphItem) result' return result'' touchManagedPtr orig return maybeResult data GlyphItemCopyMethodInfo instance (signature ~ (m (Maybe GlyphItem)), MonadIO m) => O.MethodInfo GlyphItemCopyMethodInfo GlyphItem signature where overloadedMethod _ = glyphItemCopy -- method GlyphItem::free -- method type : OrdinaryMethod -- Args : [Arg {argCName = "glyph_item", argType = TInterface (Name {namespace = "Pango", name = "GlyphItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoGlyphItem, may be %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "pango_glyph_item_free" pango_glyph_item_free :: Ptr GlyphItem -> -- glyph_item : TInterface (Name {namespace = "Pango", name = "GlyphItem"}) IO () {- | Frees a 'GI.Pango.Structs.GlyphItem.GlyphItem' and resources to which it points. @since 1.6 -} glyphItemFree :: (B.CallStack.HasCallStack, MonadIO m) => GlyphItem {- ^ /@glyphItem@/: a 'GI.Pango.Structs.GlyphItem.GlyphItem', may be 'Nothing' -} -> m () glyphItemFree glyphItem = liftIO $ do glyphItem' <- unsafeManagedPtrGetPtr glyphItem pango_glyph_item_free glyphItem' touchManagedPtr glyphItem return () data GlyphItemFreeMethodInfo instance (signature ~ (m ()), MonadIO m) => O.MethodInfo GlyphItemFreeMethodInfo GlyphItem signature where overloadedMethod _ = glyphItemFree -- method GlyphItem::get_logical_widths -- method type : OrdinaryMethod -- Args : [Arg {argCName = "glyph_item", argType = TInterface (Name {namespace = "Pango", name = "GlyphItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoGlyphItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "text that @glyph_item corresponds to\n (glyph_item->item->offset is an offset from the\n start of @text)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "logical_widths", argType = TCArray False (-1) (-1) (TBasicType TInt), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an array whose length is the number of\n characters in glyph_item (equal to\n glyph_item->item->num_chars) to be filled in with\n the resulting character widths.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "pango_glyph_item_get_logical_widths" pango_glyph_item_get_logical_widths :: Ptr GlyphItem -> -- glyph_item : TInterface (Name {namespace = "Pango", name = "GlyphItem"}) CString -> -- text : TBasicType TUTF8 Ptr Int32 -> -- logical_widths : TCArray False (-1) (-1) (TBasicType TInt) IO () {- | Given a 'GI.Pango.Structs.GlyphItem.GlyphItem' and the corresponding text, determine the screen width corresponding to each character. When multiple characters compose a single cluster, the width of the entire cluster is divided equally among the characters. See also 'GI.Pango.Structs.GlyphString.glyphStringGetLogicalWidths'. @since 1.26 -} glyphItemGetLogicalWidths :: (B.CallStack.HasCallStack, MonadIO m) => GlyphItem {- ^ /@glyphItem@/: a 'GI.Pango.Structs.GlyphItem.GlyphItem' -} -> T.Text {- ^ /@text@/: text that /@glyphItem@/ corresponds to (glyph_item->item->offset is an offset from the start of /@text@/) -} -> Ptr Int32 {- ^ /@logicalWidths@/: an array whose length is the number of characters in glyph_item (equal to glyph_item->item->num_chars) to be filled in with the resulting character widths. -} -> m () glyphItemGetLogicalWidths glyphItem text logicalWidths = liftIO $ do glyphItem' <- unsafeManagedPtrGetPtr glyphItem text' <- textToCString text pango_glyph_item_get_logical_widths glyphItem' text' logicalWidths touchManagedPtr glyphItem freeMem text' return () data GlyphItemGetLogicalWidthsMethodInfo instance (signature ~ (T.Text -> Ptr Int32 -> m ()), MonadIO m) => O.MethodInfo GlyphItemGetLogicalWidthsMethodInfo GlyphItem signature where overloadedMethod _ = glyphItemGetLogicalWidths -- method GlyphItem::letter_space -- method type : OrdinaryMethod -- Args : [Arg {argCName = "glyph_item", argType = TInterface (Name {namespace = "Pango", name = "GlyphItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoGlyphItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "text that @glyph_item corresponds to\n (glyph_item->item->offset is an offset from the\n start of @text)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "log_attrs", argType = TCArray False (-1) (-1) (TInterface (Name {namespace = "Pango", name = "LogAttr"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "logical attributes for the item\n (the first logical attribute refers to the position\n before the first character in the item)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "letter_spacing", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "amount of letter spacing to add\n in Pango units. May be negative, though too large\n negative values will give ugly results.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "pango_glyph_item_letter_space" pango_glyph_item_letter_space :: Ptr GlyphItem -> -- glyph_item : TInterface (Name {namespace = "Pango", name = "GlyphItem"}) CString -> -- text : TBasicType TUTF8 Ptr (Ptr Pango.LogAttr.LogAttr) -> -- log_attrs : TCArray False (-1) (-1) (TInterface (Name {namespace = "Pango", name = "LogAttr"})) Int32 -> -- letter_spacing : TBasicType TInt IO () {- | Adds spacing between the graphemes of /@glyphItem@/ to give the effect of typographic letter spacing. @since 1.6 -} glyphItemLetterSpace :: (B.CallStack.HasCallStack, MonadIO m) => GlyphItem {- ^ /@glyphItem@/: a 'GI.Pango.Structs.GlyphItem.GlyphItem' -} -> T.Text {- ^ /@text@/: text that /@glyphItem@/ corresponds to (glyph_item->item->offset is an offset from the start of /@text@/) -} -> Ptr (Ptr Pango.LogAttr.LogAttr) {- ^ /@logAttrs@/: logical attributes for the item (the first logical attribute refers to the position before the first character in the item) -} -> Int32 {- ^ /@letterSpacing@/: amount of letter spacing to add in Pango units. May be negative, though too large negative values will give ugly results. -} -> m () glyphItemLetterSpace glyphItem text logAttrs letterSpacing = liftIO $ do glyphItem' <- unsafeManagedPtrGetPtr glyphItem text' <- textToCString text pango_glyph_item_letter_space glyphItem' text' logAttrs letterSpacing touchManagedPtr glyphItem freeMem text' return () data GlyphItemLetterSpaceMethodInfo instance (signature ~ (T.Text -> Ptr (Ptr Pango.LogAttr.LogAttr) -> Int32 -> m ()), MonadIO m) => O.MethodInfo GlyphItemLetterSpaceMethodInfo GlyphItem signature where overloadedMethod _ = glyphItemLetterSpace -- method GlyphItem::split -- method type : OrdinaryMethod -- Args : [Arg {argCName = "orig", argType = TInterface (Name {namespace = "Pango", name = "GlyphItem"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "text to which positions in @orig apply", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "split_index", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "byte index of position to split item, relative to the start of the item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Pango", name = "GlyphItem"})) -- throws : False -- Skip return : False foreign import ccall "pango_glyph_item_split" pango_glyph_item_split :: Ptr GlyphItem -> -- orig : TInterface (Name {namespace = "Pango", name = "GlyphItem"}) CString -> -- text : TBasicType TUTF8 Int32 -> -- split_index : TBasicType TInt IO (Ptr GlyphItem) {- | Modifies /@orig@/ to cover only the text after /@splitIndex@/, and returns a new item that covers the text before /@splitIndex@/ that used to be in /@orig@/. You can think of /@splitIndex@/ as the length of the returned item. /@splitIndex@/ may not be 0, and it may not be greater than or equal to the length of /@orig@/ (that is, there must be at least one byte assigned to each item, you can\'t create a zero-length item). This function is similar in function to 'GI.Pango.Structs.Item.itemSplit' (and uses it internally.) @since 1.2 -} glyphItemSplit :: (B.CallStack.HasCallStack, MonadIO m) => GlyphItem {- ^ /@orig@/: a 'GI.Pango.Structs.Item.Item' -} -> T.Text {- ^ /@text@/: text to which positions in /@orig@/ apply -} -> Int32 {- ^ /@splitIndex@/: byte index of position to split item, relative to the start of the item -} -> m GlyphItem {- ^ __Returns:__ the newly allocated item representing text before /@splitIndex@/, which should be freed with 'GI.Pango.Structs.GlyphItem.glyphItemFree'. -} glyphItemSplit orig text splitIndex = liftIO $ do orig' <- unsafeManagedPtrGetPtr orig text' <- textToCString text result <- pango_glyph_item_split orig' text' splitIndex checkUnexpectedReturnNULL "glyphItemSplit" result result' <- (wrapBoxed GlyphItem) result touchManagedPtr orig freeMem text' return result' data GlyphItemSplitMethodInfo instance (signature ~ (T.Text -> Int32 -> m GlyphItem), MonadIO m) => O.MethodInfo GlyphItemSplitMethodInfo GlyphItem signature where overloadedMethod _ = glyphItemSplit type family ResolveGlyphItemMethod (t :: Symbol) (o :: *) :: * where ResolveGlyphItemMethod "applyAttrs" o = GlyphItemApplyAttrsMethodInfo ResolveGlyphItemMethod "copy" o = GlyphItemCopyMethodInfo ResolveGlyphItemMethod "free" o = GlyphItemFreeMethodInfo ResolveGlyphItemMethod "letterSpace" o = GlyphItemLetterSpaceMethodInfo ResolveGlyphItemMethod "split" o = GlyphItemSplitMethodInfo ResolveGlyphItemMethod "getLogicalWidths" o = GlyphItemGetLogicalWidthsMethodInfo ResolveGlyphItemMethod l o = O.MethodResolutionFailed l o instance (info ~ ResolveGlyphItemMethod t GlyphItem, O.MethodInfo info GlyphItem p) => O.IsLabelProxy t (GlyphItem -> p) where fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #if MIN_VERSION_base(4,9,0) instance (info ~ ResolveGlyphItemMethod t GlyphItem, O.MethodInfo info GlyphItem p) => O.IsLabel t (GlyphItem -> p) where fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #endif