.\" Copyright (C) 2001 Information-technology Promotion Agency (IPA) .\" Copyright (C) 2001-2011 .\" National Institute of Advanced Industrial Science and Technology (AIST) .\" This file is part of the m17n library documentation. .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Section, no Front-Cover Texts, .\" and no Back-Cover Texts. A copy of the license is included in the .\" appendix entitled "GNU Free Documentation License". .TH "m17nTextProperty" 3m17n "Mon Sep 25 2023" "Version 1.8.4" "The m17n Library" \" -*- nroff -*- .ad l .nh .SH NAME m17nTextProperty_\-_Text_Prop \- \- Function to handle text properties\&. .SH SYNOPSIS .br .PP .SS "Typedefs" .in +1c .ti -1c .RI "typedef \fBMPlist\fP *(* \fBMTextPropSerializeFunc\fP) (void *val)" .br .RI "Type of serializer functions\&. " .ti -1c .RI "typedef void *(* \fBMTextPropDeserializeFunc\fP) (\fBMPlist\fP *plist)" .br .RI "Type of deserializer functions\&. " .in -1c .SS "Enumerations" .in +1c .ti -1c .RI "enum \fBMTextPropertyControl\fP { \fBMTEXTPROP_FRONT_STICKY\fP = 0x01, \fBMTEXTPROP_REAR_STICKY\fP = 0x02, \fBMTEXTPROP_VOLATILE_WEAK\fP = 0x04, \fBMTEXTPROP_VOLATILE_STRONG\fP = 0x08, \fBMTEXTPROP_NO_MERGE\fP = 0x10, \fBMTEXTPROP_CONTROL_MAX\fP = 0x1F }" .br .RI "Flag bits to control text property\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "void * \fBmtext_get_prop\fP (\fBMText\fP *mt, int pos, MSymbol key)" .br .RI "Get the value of the topmost text property\&. " .ti -1c .RI "int \fBmtext_get_prop_values\fP (\fBMText\fP *mt, int pos, MSymbol key, void **values, int num)" .br .RI "Get multiple values of a text property\&. " .ti -1c .RI "int \fBmtext_get_prop_keys\fP (\fBMText\fP *mt, int pos, MSymbol **keys)" .br .RI "Get a list of text property keys at a position of an M-text\&. " .ti -1c .RI "int \fBmtext_put_prop\fP (\fBMText\fP *mt, int from, int to, MSymbol key, void *val)" .br .ti -1c .RI "int \fBmtext_put_prop_values\fP (\fBMText\fP *mt, int from, int to, MSymbol key, void **values, int num)" .br .RI "Set multiple text properties with the same key\&. " .ti -1c .RI "int \fBmtext_push_prop\fP (\fBMText\fP *mt, int from, int to, MSymbol key, void *val)" .br .ti -1c .RI "int \fBmtext_pop_prop\fP (\fBMText\fP *mt, int from, int to, MSymbol key)" .br .ti -1c .RI "int \fBmtext_prop_range\fP (\fBMText\fP *mt, MSymbol key, int pos, int *from, int *to, int deeper)" .br .RI "Find the range where the value of a text property is the same\&. " .ti -1c .RI "\fBMTextProperty\fP * \fBmtext_property\fP (MSymbol key, void *val, int control_bits)" .br .RI "Create a text property\&. " .ti -1c .RI "\fBMText\fP * \fBmtext_property_mtext\fP (\fBMTextProperty\fP *prop)" .br .RI "Return the M-text of a text property\&. " .ti -1c .RI "MSymbol \fBmtext_property_key\fP (\fBMTextProperty\fP *prop)" .br .RI "Return the key of a text property\&. " .ti -1c .RI "void * \fBmtext_property_value\fP (\fBMTextProperty\fP *prop)" .br .RI "Return the value of a text property\&. " .ti -1c .RI "int \fBmtext_property_start\fP (\fBMTextProperty\fP *prop)" .br .RI "Return the start position of a text property\&. " .ti -1c .RI "int \fBmtext_property_end\fP (\fBMTextProperty\fP *prop)" .br .RI "Return the end position of a text property\&. " .ti -1c .RI "\fBMTextProperty\fP * \fBmtext_get_property\fP (\fBMText\fP *mt, int pos, MSymbol key)" .br .RI "Get the topmost text property\&. " .ti -1c .RI "int \fBmtext_get_properties\fP (\fBMText\fP *mt, int pos, MSymbol key, \fBMTextProperty\fP **props, int num)" .br .RI "Get multiple text properties\&. " .ti -1c .RI "int \fBmtext_attach_property\fP (\fBMText\fP *mt, int from, int to, \fBMTextProperty\fP *prop)" .br .RI "Attach a text property to an M-text\&. " .ti -1c .RI "int \fBmtext_detach_property\fP (\fBMTextProperty\fP *prop)" .br .RI "Detach a text property from an M-text\&. " .ti -1c .RI "int \fBmtext_push_property\fP (\fBMText\fP *mt, int from, int to, \fBMTextProperty\fP *prop)" .br .RI "Push a text property onto an M-text\&. " .ti -1c .RI "\fBMText\fP * \fBmtext_serialize\fP (\fBMText\fP *mt, int from, int to, \fBMPlist\fP *property_list)" .br .ti -1c .RI "\fBMText\fP * \fBmtext_deserialize\fP (\fBMText\fP *mt)" .br .in -1c .SS "Variables" .in +1c .ti -1c .RI "MSymbol \fBMtext_prop_serializer\fP" .br .RI "Symbol for specifying serializer functions\&. " .ti -1c .RI "MSymbol \fBMtext_prop_deserializer\fP" .br .RI "Symbol for specifying deserializer functions\&. " .in -1c .SH "Detailed Description" .PP Function to handle text properties\&. Each character in an M\-text can have properties called \fItext\fP \fIproperties\fP\&. 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\&. .PP A text property consists of a \fIkey\fP and \fIvalues\fP, where key is a symbol and values are anything that can be cast to \fC(void *) \fP\&. 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'\&. .br .SH "Typedef Documentation" .PP .SS "typedef \fBMPlist\fP*(* MTextPropSerializeFunc) (void *val)" .PP Type of serializer functions\&. This is the type of serializer functions\&. If the key of a symbol property is \fBMtext_prop_serializer\fP, the value must be of this type\&. .PP \fBSEE ALSO\fp .RS 4 \fBmtext_serialize()\fP, \fBMtext_prop_serializer\fP .RE .PP .SS "typedef void*(* MTextPropDeserializeFunc) (\fBMPlist\fP *plist)" .PP Type of deserializer functions\&. This is the type of deserializer functions\&. If the key of a symbol property is \fBMtext_prop_deserializer\fP, the value must be of this type\&. .PP \fBSEE ALSO\fp .RS 4 \fBmtext_deserialize()\fP, \fBMtext_prop_deserializer\fP .RE .PP .SH "Enumeration Type Documentation" .PP .SS "enum \fBMTextPropertyControl\fP" .PP Flag bits to control text property\&. The \fBmtext_property()\fP 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\&. .br .PP \fBEnumerator\fP .in +1c .TP \fB\fIMTEXTPROP_FRONT_STICKY \fP\fP 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\&. .br .TP \fB\fIMTEXTPROP_REAR_STICKY \fP\fP 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\&. .br .TP \fB\fIMTEXTPROP_VOLATILE_WEAK \fP\fP If this flag bit is on, the text property is removed if a text in its region is modified\&. .br .TP \fB\fIMTEXTPROP_VOLATILE_STRONG \fP\fP If this flag bit is on, the text property is removed if a text or the other text property in its region is modified\&. .br .TP \fB\fIMTEXTPROP_NO_MERGE \fP\fP If this flag bit is on, the text property is not automatically merged with the others\&. .br .TP \fB\fIMTEXTPROP_CONTROL_MAX \fP\fP .SH "Variable Documentation" .PP .SS "MSymbol Mtext_prop_serializer" .PP 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 \fBMtext_prop_serializer\fP and value is a pointer to an appropriate serializer function\&. .PP \fBSEE ALSO\fp .RS 4 \fBmtext_serialize()\fP, \fBMTextPropSerializeFunc\fP .RE .PP .SS "MSymbol Mtext_prop_deserializer" .PP 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 \fBMtext_prop_deserializer\fP and value is a pointer to an appropriate deserializer function\&. .PP \fBSEE ALSO\fp .RS 4 \fBmtext_deserialize()\fP, \fBMTextPropSerializeFunc\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for The m17n Library from the source code\&. .SH COPYRIGHT Copyright (C) 2001 Information\-technology Promotion Agency (IPA) .br Copyright (C) 2001\-2011 National Institute of Advanced Industrial Science and Technology (AIST) .br Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License .