428
+ − 1 /* Copyright (c) 1994, 1995 Free Software Foundation.
872
+ − 2 Copyright (c) 1995, 1996, 2002 Ben Wing.
428
+ − 3
+ − 4 This file is part of XEmacs.
+ − 5
+ − 6 XEmacs is free software; you can redistribute it and/or modify it
+ − 7 under the terms of the GNU General Public License as published by the
+ − 8 Free Software Foundation; either version 2, or (at your option) any
+ − 9 later version.
+ − 10
+ − 11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ − 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ − 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ − 14 for more details.
+ − 15
+ − 16 You should have received a copy of the GNU General Public License
+ − 17 along with XEmacs; see the file COPYING. If not, write to
+ − 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ − 19 Boston, MA 02111-1307, USA. */
+ − 20
+ − 21 /* Synched up with: Not in FSF. */
+ − 22
440
+ − 23 #ifndef INCLUDED_extents_h_
+ − 24 #define INCLUDED_extents_h_
428
+ − 25
+ − 26 DECLARE_LRECORD (extent, struct extent);
+ − 27 #define XEXTENT(x) XRECORD (x, extent, struct extent)
617
+ − 28 #define wrap_extent(p) wrap_record (p, extent)
428
+ − 29 #define EXTENTP(x) RECORDP (x, extent)
+ − 30 #define CHECK_EXTENT(x) CHECK_RECORD (x, extent)
+ − 31 #define CONCHECK_EXTENT(x) CONCHECK_RECORD (x, extent)
+ − 32
872
+ − 33 struct extent_auxiliary;
428
+ − 34
+ − 35 DECLARE_LRECORD (extent_auxiliary, struct extent_auxiliary);
+ − 36 #define XEXTENT_AUXILIARY(x) \
+ − 37 XRECORD (x, extent_auxiliary, struct extent_auxiliary)
617
+ − 38 #define wrap_extent_auxiliary(p) wrap_record (p, extent_auxiliary)
428
+ − 39 #define EXTENT_AUXILIARYP(x) RECORDP (x, extent_auxiliary)
+ − 40 #define CHECK_EXTENT_AUXILIARY(x) CHECK_RECORD (x, extent_auxiliary)
+ − 41 #define CONCHECK_EXTENT_AUXILIARY(x) CONCHECK_RECORD (x, extent_auxiliary)
+ − 42
872
+ − 43 struct extent_info;
428
+ − 44
+ − 45 DECLARE_LRECORD (extent_info, struct extent_info);
+ − 46 #define XEXTENT_INFO(x) XRECORD (x, extent_info, struct extent_info)
617
+ − 47 #define wrap_extent_info(p) wrap_record (p, extent_info)
428
+ − 48 #define EXTENT_INFOP(x) RECORDP (x, extent_info)
+ − 49 #define CHECK_EXTENT_INFO(x) CHECK_RECORD (x, extent_info)
+ − 50 #define CONCHECK_EXTENT_INFO(x) CONCHECK_RECORD (x, extent_info)
+ − 51
872
+ − 52 /* the layouts for glyphs (extent->flags.glyph_layout). Must fit in 2 bits. */
+ − 53 typedef enum glyph_layout
826
+ − 54 {
872
+ − 55 GL_TEXT,
+ − 56 GL_OUTSIDE_MARGIN,
+ − 57 GL_INSIDE_MARGIN,
+ − 58 GL_WHITESPACE
+ − 59 } glyph_layout;
428
+ − 60
872
+ − 61 struct extent;
428
+ − 62
872
+ − 63 void set_extent_endpoints (EXTENT extent, Bytexpos s, Bytexpos e,
+ − 64 Lisp_Object object);
428
+ − 65
872
+ − 66
+ − 67 void flush_cached_extent_info (Lisp_Object extent_info);
647
+ − 68
826
+ − 69 void set_extent_glyph (EXTENT extent, Lisp_Object glyph, int endp,
+ − 70 glyph_layout layout);
+ − 71
428
+ − 72
+ − 73 /* flags for map_extents() and friends */
+ − 74 #define ME_END_CLOSED (1 << 0)
+ − 75 #define ME_START_OPEN (1 << 1)
+ − 76 #define ME_ALL_EXTENTS_CLOSED (1 << 2)
+ − 77 #define ME_ALL_EXTENTS_OPEN (2 << 2)
+ − 78 #define ME_ALL_EXTENTS_CLOSED_OPEN (3 << 2)
+ − 79 #define ME_ALL_EXTENTS_OPEN_CLOSED (4 << 2)
+ − 80 #define ME_ALL_EXTENTS_MASK (7 << 2)
+ − 81 #define ME_START_IN_REGION (1 << 5)
+ − 82 #define ME_END_IN_REGION (2 << 5)
+ − 83 #define ME_START_AND_END_IN_REGION (3 << 5)
+ − 84 #define ME_START_OR_END_IN_REGION (4 << 5)
+ − 85 #define ME_IN_REGION_MASK (7 << 5)
+ − 86 #define ME_NEGATE_IN_REGION (1 << 8)
+ − 87 /* the following flags are internal-only */
+ − 88 #define ME_INCLUDE_INTERNAL (1 << 9)
+ − 89 #define ME_MIGHT_THROW (1 << 10)
+ − 90 #define ME_MIGHT_MODIFY_TEXT (1 << 11)
+ − 91 #define ME_MIGHT_MODIFY_EXTENTS (1 << 12)
+ − 92 #define ME_MIGHT_MOVE_SOE (1 << 13)
+ − 93 #define ME_MIGHT_CALL_ELISP (ME_MIGHT_THROW | ME_MIGHT_MODIFY_TEXT | \
+ − 94 ME_MIGHT_MODIFY_EXTENTS | ME_MIGHT_MOVE_SOE)
+ − 95
+ − 96
+ − 97 extern int inside_undo;
442
+ − 98 extern int in_modeline_generation;
428
+ − 99
872
+ − 100 EXFUN (Fextent_at, 5);
+ − 101 EXFUN (Fextent_property, 3);
+ − 102 EXFUN (Fput_text_property, 5);
+ − 103
+ − 104 EXFUN (Fdetach_extent, 1);
+ − 105 EXFUN (Fextent_end_position, 1);
+ − 106 EXFUN (Fextent_object, 1);
+ − 107 EXFUN (Fextent_properties, 1);
+ − 108 EXFUN (Fextent_start_position, 1);
+ − 109 EXFUN (Fget_char_property, 4);
+ − 110 EXFUN (Fmake_extent, 3);
+ − 111 EXFUN (Fnext_extent_change, 2);
+ − 112 EXFUN (Fprevious_extent_change, 2);
2506
+ − 113 EXFUN (Fprevious_single_char_property_change, 4);
872
+ − 114 EXFUN (Fset_extent_endpoints, 4);
+ − 115 EXFUN (Fset_extent_parent, 2);
+ − 116 EXFUN (Fset_extent_property, 3);
+ − 117
+ − 118 enum extent_at_flag
+ − 119 {
+ − 120 EXTENT_AT_DEFAULT = 0,
+ − 121 EXTENT_AT_AFTER = 0,
+ − 122 EXTENT_AT_BEFORE,
+ − 123 EXTENT_AT_AT
+ − 124 };
+ − 125
+ − 126 Bytexpos extent_endpoint_byte (EXTENT extent, int endp);
+ − 127 Charxpos extent_endpoint_char (EXTENT extent, int endp);
2506
+ − 128 Bytexpos next_previous_single_property_change (Bytexpos pos, Lisp_Object prop,
+ − 129 Lisp_Object object,
+ − 130 Bytexpos limit,
+ − 131 Boolint next,
+ − 132 Boolint text_props_only);
872
+ − 133 Lisp_Object get_char_property (Bytexpos position, Lisp_Object prop,
+ − 134 Lisp_Object object, enum extent_at_flag fl,
+ − 135 int text_props_only);
+ − 136 void adjust_extents (Lisp_Object object, Memxpos from,
+ − 137 Memxpos to, int amount);
+ − 138 void adjust_extents_for_deletion (Lisp_Object object, Bytexpos from,
+ − 139 Bytexpos to, int gapsize,
+ − 140 int numdel, int movegapsize);
+ − 141 void verify_extent_modification (Lisp_Object object, Bytexpos from,
+ − 142 Bytexpos to,
+ − 143 Lisp_Object inhibit_read_only_value);
+ − 144 void process_extents_for_insertion (Lisp_Object object,
+ − 145 Bytexpos opoint, Bytecount length);
+ − 146 void process_extents_for_deletion (Lisp_Object object, Bytexpos from,
+ − 147 Bytexpos to, int destroy_them);
+ − 148 /* Note the following function is in Charbpos's */
+ − 149 void report_extent_modification (Lisp_Object buffer, Charbpos start,
+ − 150 Charbpos end, int afterp);
+ − 151 void add_string_extents (Lisp_Object string, struct buffer *buf,
+ − 152 Bytexpos opoint, Bytecount length);
+ − 153 void splice_in_string_extents (Lisp_Object string, struct buffer *buf,
+ − 154 Bytexpos opoint, Bytecount length,
+ − 155 Bytecount pos);
+ − 156 void copy_string_extents (Lisp_Object new_string,
+ − 157 Lisp_Object old_string,
+ − 158 Bytecount new_pos, Bytecount old_pos,
+ − 159 Bytecount length);
+ − 160 void detach_all_extents (Lisp_Object object);
+ − 161 Lisp_Object extent_at (Bytexpos position, Lisp_Object object,
+ − 162 Lisp_Object property, EXTENT before,
+ − 163 enum extent_at_flag at_flag, int all_extents);
+ − 164
+ − 165
428
+ − 166 struct extent_fragment *extent_fragment_new (Lisp_Object buffer_or_string,
+ − 167 struct frame *frm);
+ − 168 face_index extent_fragment_update (struct window *w,
+ − 169 struct extent_fragment *ef,
826
+ − 170 Bytexpos pos, Lisp_Object last_glyph);
428
+ − 171 void extent_fragment_delete (struct extent_fragment *ef);
+ − 172
+ − 173 /* from alloc.c */
+ − 174 struct extent *allocate_extent (void);
+ − 175
+ − 176 void allocate_extent_auxiliary (EXTENT ext);
+ − 177 void init_buffer_extents (struct buffer *b);
+ − 178 void uninit_buffer_extents (struct buffer *b);
+ − 179
+ − 180 #ifdef ERROR_CHECK_EXTENTS
+ − 181 void sledgehammer_extent_check (Lisp_Object obj);
+ − 182 #endif
+ − 183
+ − 184 #ifdef MEMORY_USAGE_STATS
+ − 185 int compute_buffer_extent_usage (struct buffer *b,
+ − 186 struct overhead_stats *ovstats);
+ − 187 #endif
+ − 188
440
+ − 189 #endif /* INCLUDED_extents_h_ */