*** empty log message ***
[m17n/m17n-lib.git] / src / textprop.h
1 /* textproc.h -- header file for the text property module.
2    Copyright (C) 2003, 2004
3      National Institute of Advanced Industrial Science and Technology (AIST)
4      Registration Number H15PRO112
5
6    This file is part of the m17n library.
7
8    The m17n library is free software; you can redistribute it and/or
9    modify it under the terms of the GNU Lesser General Public License
10    as published by the Free Software Foundation; either version 2.1 of
11    the License, or (at your option) any later version.
12
13    The m17n library is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Lesser General Public License for more details.
17
18    You should have received a copy of the GNU Lesser General Public
19    License along with the m17n library; if not, write to the Free
20    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21    02111-1307, USA.  */
22
23 #ifndef _M17N_TEXTPROP_H_
24 #define _M17N_TEXTPROP_H_
25
26 /** MTextProperty is the structure for a text property object.  While
27     attached, it is stored in the stacks of intervals covering the
28     range from MTextProperty->start to MTextProperty->end.  */
29
30 struct MTextProperty
31 {
32   /** Common header for a managed object.  */
33   M17NObject control;
34
35   /** Number of intervals the property is attached.  When it becomes
36       zero, the property is detached.  */
37   unsigned attach_count;
38
39   /** M-text to which the property is attaced.  The value NULL means
40       that the property is detached.  */
41   MText *mt;
42
43   /** Region of <mt> if the property is attached to it.  */
44   int start, end;
45
46   /** Key of the property.  */
47   MSymbol key;
48
49   /** Value of the property.  */
50   void *val;
51 };
52
53
54 extern struct MTextPlist *mtext__copy_plist (struct MTextPlist *, 
55                                              int from, int to,
56                                              MText *mt, int pos);
57
58 extern void mtext__free_plist (MText *mt);
59
60 extern void mtext__adjust_plist_for_delete (MText *, int, int);
61
62 extern void mtext__adjust_plist_for_insert (MText *, int, int,
63                                             struct MTextPlist *);
64
65 extern void mtext__adjust_plist_for_change (MText *mt, int from, int to);
66
67 extern void dump_textplist (struct MTextPlist *plist, int indent);
68
69 #endif /* _M17N_TEXTPROP_H_ */