m17nTextProperty(3m17n)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

m17nTextProperty πŸ’– (the m17n Library, bestie)

okay so this is the 3m17n manual page for m17nTextProperty and I'm gonna walk you through it like we're texting at 2am, except every single fact stays exactly where it is. no cap. 🫢


✨ NAME ✨

m17nTextProperty_-_Text_Prop β€” Function to handle text properties. that's it, that's the name, she's serving simplicity πŸ’…


✨ SYNOPSIS ✨

🌸 Typedefs

  • typedef MPlist *(* MTextPropSerializeFunc) (void *val) β€” the type of serializer functions πŸ’«
  • typedef void *(* MTextPropDeserializeFunc) (MPlist *plist) β€” the type of deserializer functions πŸ’«

🌸 Enumerations

  • enum MTextPropertyControl { MTEXTPROP_FRONT_STICKY = 0x01, MTEXTPROP_REAR_STICKY = 0x02, MTEXTPROP_VOLATILE_WEAK = 0x04, MTEXTPROP_VOLATILE_STRONG = 0x08, MTEXTPROP_NO_MERGE = 0x10, MTEXTPROP_CONTROL_MAX = 0x1F } β€” flag bits to control text property. πŸ”₯

🌸 Functions

  • void * mtext_get_prop (MText *mt, int pos, MSymbol key) β€” get the value of the topmost text property πŸ‘‘
  • int mtext_get_prop_values (MText *mt, int pos, MSymbol key, void **values, int num) β€” get multiple values of a text property 🌈
  • int mtext_get_prop_keys (MText *mt, int pos, MSymbol **keys) β€” get a list of text property keys at a position of an M-text πŸ”‘
  • int mtext_put_prop (MText *mt, int from, int to, MSymbol key, void *val)
  • int mtext_put_prop_values (MText *mt, int from, int to, MSymbol key, void **values, int num) β€” set multiple text properties with the same key ✨
  • int mtext_push_prop (MText *mt, int from, int to, MSymbol key, void *val)
  • int mtext_pop_prop (MText *mt, int from, int to, MSymbol key)
  • int mtext_prop_range (MText *mt, MSymbol key, int pos, int *from, int *to, int deeper) β€” find the range where the value of a text property is the same πŸ”
  • MTextProperty * mtext_property (MSymbol key, void *val, int control_bits) β€” create a text property πŸŽ€
  • MText * mtext_property_mtext (MTextProperty *prop) β€” return the M-text of a text property πŸ“„
  • MSymbol mtext_property_key (MTextProperty *prop) β€” return the key of a text property πŸ”‘
  • void * mtext_property_value (MTextProperty *prop) β€” return the value of a text property πŸ’Ž
  • int mtext_property_start (MTextProperty *prop) β€” return the start position of a text property 🏁
  • int mtext_property_end (MTextProperty *prop) β€” return the end position of a text property 🏁
  • MTextProperty * mtext_get_property (MText *mt, int pos, MSymbol key) β€” get the topmost text property πŸ‘‘
  • int mtext_get_properties (MText *mt, int pos, MSymbol key, MTextProperty **props, int num) β€” get multiple text properties 🌈
  • int mtext_attach_property (MText *mt, int from, int to, MTextProperty *prop) β€” attach a text property to an M-text 🩹
  • int mtext_detach_property (MTextProperty *prop) β€” detach a text property from an M-text βœ‚οΈ
  • int mtext_push_property (MText *mt, int from, int to, MTextProperty *prop) β€” push a text property onto an M-text ⬆️
  • MText * mtext_serialize (MText *mt, int from, int to, MPlist *property_list)
  • MText * mtext_deserialize (MText *mt)

🌸 Variables

  • MSymbol Mtext_prop_serializer β€” symbol for specifying serializer functions πŸ“¦
  • MSymbol Mtext_prop_deserializer β€” symbol for specifying deserializer functions πŸ“¬

✨ Detailed Description ✨

Function to handle text properties. πŸ¦‹

so every single character in an M-text can have properties, and those are literally called text properties. they store all kinds of information attached to parts of an M-text, so that application programs get a unified view of all that info. and the way that rich information can just live inside M-texts as text properties means the functions in your application programs get to stay simple. iconic behaviour honestly 😌

a text property is made of a key and values, where the key is a symbol and the values are anything that can be cast to (void *). and here's the thing β€” unlike other types of properties, a text property can have multiple values. also, 'The text property whose key is K' may be shortened to 'K property'. periodt πŸ’…


✨ Typedef Documentation ✨

🌸 typedef MPlist*(* MTextPropSerializeFunc) (void *val)

Type of serializer functions. this is the type of serializer functions. if the key of a symbol property is Mtext_prop_serializer, the value must be of this type. no exceptions bestie πŸ’–

SEE ALSO

  • mtext_serialize(), Mtext_prop_serializer

🌸 typedef void*(* MTextPropDeserializeFunc) (MPlist *plist)

Type of deserializer functions. this is the type of deserializer functions. if the key of a symbol property is Mtext_prop_deserializer, the value must be of this type. again, no exceptions 🫢

SEE ALSO

  • mtext_deserialize(), Mtext_prop_deserializer

✨ Enumeration Type Documentation ✨

🌸 enum MTextPropertyControl

Flag bits to control text property. the mtext_property() function accepts a logical OR of these flag bits as an argument. they control the behaviour of the created text property, exactly as described in the documentation of each flag bit down below πŸ‘‡

Enumerator

  • MTEXTPROP_FRONT_STICKY β€” if this flag bit is on, an M-text inserted at the start position or at the middle of the text property inherits the text property. sticky in the front, fr fr πŸ“
  • MTEXTPROP_REAR_STICKY β€” if this flag bit is on, an M-text inserted at the end position or at the middle of the text property inherits the text property. sticky in the back now πŸ“
  • MTEXTPROP_VOLATILE_WEAK β€” if this flag bit is on, the text property is removed if a text in its region is modified. bye bestie πŸ’€
  • MTEXTPROP_VOLATILE_STRONG β€” if this flag bit is on, the text property is removed if a text or the other text property in its region is modified. even more sensitive, she's fragile 😭
  • MTEXTPROP_NO_MERGE β€” if this flag bit is on, the text property is not automatically merged with the others. she stays in her own lane πŸ’…
  • MTEXTPROP_CONTROL_MAX

✨ Variable Documentation ✨

🌸 MSymbol Mtext_prop_serializer

Symbol for specifying serializer functions. to serialize a text property, the user must supply a serializer function for that text property. you do this by giving a symbol property whose key is Mtext_prop_serializer and whose value is a pointer to an appropriate serializer function. that's the whole vibe πŸ“¦βœ¨

SEE ALSO

  • mtext_serialize(), MTextPropSerializeFunc

🌸 MSymbol Mtext_prop_deserializer

Symbol for specifying deserializer functions. to deserialize a text property, the user must supply a deserializer function for that text property. you do this by giving a symbol property whose key is Mtext_prop_deserializer and whose value is a pointer to an appropriate deserializer function. symmetry, we love to see it πŸ“¬πŸ’–

SEE ALSO

  • mtext_deserialize(), MTextPropSerializeFunc

✨ Author ✨

Generated automatically by Doxygen for The m17n Library from the source code. the robot wrote it, not me πŸ™ˆ


Copyright (C) 2001 Information-technology Promotion Agency (IPA)

Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.


okay bestie that's the whole page, every flag and typedef and copyright line intact, nothing skipped, we ate and left no crumbs πŸ‘‘πŸŒΈ

Version 1.8.4 β€” Mon Sep 25 2023 β€” m17nTextProperty(3m17n) πŸ’– bye love u, go read a text property πŸ¦‹

πŸ“¦ where this page comes from