---
name: "m17nTextProperty"
section: "3m17n"
platform: "linux"
package: "m17n-docs"
version: "1.8.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/m17nTextProperty"
---

# m17nTextProperty(3m17n)

\- Function to handle text properties.

## NAME

m17nTextProperty\_-\_Text\_Prop -  - Function to handle text properties.

## SYNOPSIS

### Typedefs

typedef **MPlist** \*(\* **MTextPropSerializeFunc**) (void \*val)\
 Type of serializer functions.  typedef void \*(\* **MTextPropDeserializeFunc**) (**MPlist** \*plist)\
 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.

Each character in an M-text can have properties called *text* *properties*. Text properties store various kinds of information attached to parts of an M-text to provide application programs with a unified view of those information. As rich information can be stored in M-texts in the form of text properties, functions in application programs can be simple.

A text property consists of a *key* and *values*, where key is a symbol and values are anything that can be cast to `(void *) `. Unlike other types of properties, a text property can have multiple values. 'The text property whose key is K' may be shortened to 'K property'. \

## 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.

**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.

**SEE ALSO**

**mtext\_deserialize()**, **Mtext\_prop\_deserializer**

## Enumeration Type Documentation

### enum MTextPropertyControl

Flag bits to control text property. The **mtext\_property()** function accepts logical OR of these flag bits as an argument. They control the behaviour of the created text property as described in the documentation of each flag bit. \

**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.* \

- *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.* \

- *MTEXTPROP\_VOLATILE\_WEAK*

  *If this flag bit is on, the text property is removed if a text in its region is modified.* \

- *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.* \

- *MTEXTPROP\_NO\_MERGE*

  *If this flag bit is on, the text property is not automatically merged with the others.* \

- *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. This is done by giving a symbol property whose key is* **Mtext\_prop\_serializer** *and value is a pointer to an appropriate serializer function.*

**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. This is done by giving a symbol property whose key is **Mtext\_prop\_deserializer** and value is a pointer to an appropriate deserializer function.

**SEE ALSO**

**mtext\_deserialize()**, **MTextPropSerializeFunc**

## Author

Generated automatically by Doxygen for The m17n Library from the source code.

## COPYRIGHT

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\>.
