1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
|
.\" 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 "Text Property" 3m17n "12 Jan 2011" "Version 1.6.2" "The m17n Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Text_Property \- Function to handle text properties.
.SS "Typedefs"
.in +1c
.ti -1c
.RI "typedef \fBMPlist\fP *(* \fBMTextPropSerializeFunc\fP )(void *val)"
.br
.RI "\fIType of serializer functions. \fP"
.ti -1c
.RI "typedef void *(* \fBMTextPropDeserializeFunc\fP )(\fBMPlist\fP *plist)"
.br
.RI "\fIType of deserializer functions. \fP"
.ti -1c
.RI "typedef struct \fBMTextProperty\fP \fBMTextProperty\fP"
.br
.RI "\fIType of text properties. \fP"
.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 "\fIFlag bits to control text property. \fP"
.in -1c
.SS "Functions"
.in +1c
.ti -1c
.RI "void * \fBmtext_get_prop\fP (\fBMText\fP *mt, int pos, \fBMSymbol\fP key)"
.br
.RI "\fIGet the value of the topmost text property. \fP"
.ti -1c
.RI "int \fBmtext_get_prop_values\fP (\fBMText\fP *mt, int pos, \fBMSymbol\fP key, void **values, int num)"
.br
.RI "\fIGet multiple values of a text property. \fP"
.ti -1c
.RI "int \fBmtext_get_prop_keys\fP (\fBMText\fP *mt, int pos, \fBMSymbol\fP **keys)"
.br
.RI "\fIGet a list of text property keys at a position of an M-text. \fP"
.ti -1c
.RI "int \fBmtext_put_prop\fP (\fBMText\fP *mt, int from, int to, \fBMSymbol\fP key, void *val)"
.br
.RI "\fISet a text property. \fP"
.ti -1c
.RI "int \fBmtext_put_prop_values\fP (\fBMText\fP *mt, int from, int to, \fBMSymbol\fP key, void **values, int num)"
.br
.RI "\fISet multiple text properties with the same key. \fP"
.ti -1c
.RI "int \fBmtext_push_prop\fP (\fBMText\fP *mt, int from, int to, \fBMSymbol\fP key, void *val)"
.br
.RI "\fIPush a text property. \fP"
.ti -1c
.RI "int \fBmtext_pop_prop\fP (\fBMText\fP *mt, int from, int to, \fBMSymbol\fP key)"
.br
.RI "\fIPop a text property. \fP"
.ti -1c
.RI "int \fBmtext_prop_range\fP (\fBMText\fP *mt, \fBMSymbol\fP key, int pos, int *from, int *to, int deeper)"
.br
.RI "\fIFind the range where the value of a text property is the same. \fP"
.ti -1c
.RI "\fBMTextProperty\fP * \fBmtext_property\fP (\fBMSymbol\fP key, void *val, int control_bits)"
.br
.RI "\fICreate a text property. \fP"
.ti -1c
.RI "\fBMText\fP * \fBmtext_property_mtext\fP (\fBMTextProperty\fP *prop)"
.br
.RI "\fIReturn the M-text of a text property. \fP"
.ti -1c
.RI "\fBMSymbol\fP \fBmtext_property_key\fP (\fBMTextProperty\fP *prop)"
.br
.RI "\fIReturn the key of a text property. \fP"
.ti -1c
.RI "void * \fBmtext_property_value\fP (\fBMTextProperty\fP *prop)"
.br
.RI "\fIReturn the value of a text property. \fP"
.ti -1c
.RI "int \fBmtext_property_start\fP (\fBMTextProperty\fP *prop)"
.br
.RI "\fIReturn the start position of a text property. \fP"
.ti -1c
.RI "int \fBmtext_property_end\fP (\fBMTextProperty\fP *prop)"
.br
.RI "\fIReturn the end position of a text property. \fP"
.ti -1c
.RI "\fBMTextProperty\fP * \fBmtext_get_property\fP (\fBMText\fP *mt, int pos, \fBMSymbol\fP key)"
.br
.RI "\fIGet the topmost text property. \fP"
.ti -1c
.RI "int \fBmtext_get_properties\fP (\fBMText\fP *mt, int pos, \fBMSymbol\fP key, \fBMTextProperty\fP **props, int num)"
.br
.RI "\fIGet multiple text properties. \fP"
.ti -1c
.RI "int \fBmtext_attach_property\fP (\fBMText\fP *mt, int from, int to, \fBMTextProperty\fP *prop)"
.br
.RI "\fIAttach a text property to an M-text. \fP"
.ti -1c
.RI "int \fBmtext_detach_property\fP (\fBMTextProperty\fP *prop)"
.br
.RI "\fIDetach a text property from an M-text. \fP"
.ti -1c
.RI "int \fBmtext_push_property\fP (\fBMText\fP *mt, int from, int to, \fBMTextProperty\fP *prop)"
.br
.RI "\fIPush a text property onto an M-text. \fP"
.ti -1c
.RI "\fBMText\fP * \fBmtext_serialize\fP (\fBMText\fP *mt, int from, int to, \fBMPlist\fP *property_list)"
.br
.RI "\fISerialize text properties in an M-text. \fP"
.ti -1c
.RI "\fBMText\fP * \fBmtext_deserialize\fP (\fBMText\fP *mt)"
.br
.RI "\fIDeserialize text properties in an M-text. \fP"
.in -1c
.SS "Variables"
.in +1c
.ti -1c
.RI "\fBMSymbol\fP \fBMtext_prop_serializer\fP"
.br
.RI "\fISymbol for specifying serializer functions. \fP"
.ti -1c
.RI "\fBMSymbol\fP \fBMtext_prop_deserializer\fP"
.br
.RI "\fISymbol for specifying deserializer functions. \fP"
.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'.
.SH "Typedef Documentation"
.PP
.SS "typedef \fBMPlist\fP*(* \fBMTextPropSerializeFunc\fP)(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*(* \fBMTextPropDeserializeFunc\fP)(\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
.SS "typedef struct \fBMTextProperty\fP \fBMTextProperty\fP"
.PP
Type of text properties. The type \fBMTextProperty\fP is for a \fItext\fP \fIproperty\fP objects. Its internal structure is concealed from application programs.
.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.
.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.
.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.
.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.
.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.
.TP
\fB\fIMTEXTPROP_NO_MERGE \fP\fP
If this flag bit is on, the text property is not automatically merged with the others.
.TP
\fB\fIMTEXTPROP_CONTROL_MAX \fP\fP
.SH "Variable Documentation"
.PP
.SS "\fBMSymbol\fP \fBMtext_prop_serializer\fP"
.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 "\fBMSymbol\fP \fBMtext_prop_deserializer\fP"
.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
<http://www.gnu.org/licenses/fdl.html>.
|