Mercurial > emacs
comparison src/composite.h @ 97820:45062be75131
* composite.h (enum composition_method): Delete
COMPOSITION_WITH_GLYPH_STRING.
(COMPOSITION_METHOD): Dont' check COMPOSITION_WITH_GLYPH_STRING.
(Vcomposition_function_table): Extern it.
(LGSTRING_XXX, LGLYPH_XXX): Macros moved from font.h.
(composition_gstring_put_cache, composition_gstring_from_id)
(composition_gstring_p, composition_gstring_width)
(composition_compute_stop_pos, composition_reseat_it)
(composition_update_it, composition_adjust_point): Extern them.
(Fcomposition_get_gstring): EXFUN it.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 29 Aug 2008 07:53:47 +0000 |
parents | 29adfc9354e7 |
children | 2fb5b268febb |
comparison
equal
deleted
inserted
replaced
97819:23390849e8b8 | 97820:45062be75131 |
---|---|
36 COMPOSITION_WITH_RULE, | 36 COMPOSITION_WITH_RULE, |
37 /* Compose relatively with alternate characters. */ | 37 /* Compose relatively with alternate characters. */ |
38 COMPOSITION_WITH_ALTCHARS, | 38 COMPOSITION_WITH_ALTCHARS, |
39 /* Compose by specified composition rules with alternate characters. */ | 39 /* Compose by specified composition rules with alternate characters. */ |
40 COMPOSITION_WITH_RULE_ALTCHARS, | 40 COMPOSITION_WITH_RULE_ALTCHARS, |
41 /* Compose by specified lispy glyph-string. */ | |
42 COMPOSITION_WITH_GLYPH_STRING, | |
43 /* This is not a method. */ | 41 /* This is not a method. */ |
44 COMPOSITION_NO | 42 COMPOSITION_NO |
45 }; | 43 }; |
46 | 44 |
47 /* Maximum number of compoments a single composition can have. */ | 45 /* Maximum number of compoments a single composition can have. */ |
88 : (composition_temp = XCDR (XCAR (prop)), \ | 86 : (composition_temp = XCDR (XCAR (prop)), \ |
89 (NILP (composition_temp) \ | 87 (NILP (composition_temp) \ |
90 ? COMPOSITION_RELATIVE \ | 88 ? COMPOSITION_RELATIVE \ |
91 : (INTEGERP (composition_temp) || STRINGP (composition_temp)) \ | 89 : (INTEGERP (composition_temp) || STRINGP (composition_temp)) \ |
92 ? COMPOSITION_WITH_ALTCHARS \ | 90 ? COMPOSITION_WITH_ALTCHARS \ |
93 : (VECTORP (composition_temp) \ | |
94 && ASIZE (composition_temp) >= 2 \ | |
95 && VECTORP (AREF (composition_temp, 0))) \ | |
96 ? COMPOSITION_WITH_GLYPH_STRING \ | |
97 : COMPOSITION_WITH_RULE_ALTCHARS))) | 91 : COMPOSITION_WITH_RULE_ALTCHARS))) |
98 | 92 |
99 /* Return 1 if the composition is valid. It is valid if length of | 93 /* Return 1 if the composition is valid. It is valid if length of |
100 the composition equals to (END - START). */ | 94 the composition equals to (END - START). */ |
101 #define COMPOSITION_VALID_P(start, end, prop) \ | 95 #define COMPOSITION_VALID_P(start, end, prop) \ |
214 extern Lisp_Object Qcomposition; | 208 extern Lisp_Object Qcomposition; |
215 extern Lisp_Object composition_hash_table; | 209 extern Lisp_Object composition_hash_table; |
216 extern Lisp_Object Qauto_composed; | 210 extern Lisp_Object Qauto_composed; |
217 extern Lisp_Object Vauto_composition_function; | 211 extern Lisp_Object Vauto_composition_function; |
218 extern Lisp_Object Qauto_composition_function; | 212 extern Lisp_Object Qauto_composition_function; |
213 extern Lisp_Object Vcomposition_function_table; | |
219 | 214 |
220 extern int get_composition_id P_ ((int, int, int, Lisp_Object, Lisp_Object)); | 215 extern int get_composition_id P_ ((int, int, int, Lisp_Object, Lisp_Object)); |
221 extern int find_composition P_ ((int, int, EMACS_INT *, EMACS_INT *, Lisp_Object *, | 216 extern int find_composition P_ ((int, int, EMACS_INT *, EMACS_INT *, Lisp_Object *, |
222 Lisp_Object)); | 217 Lisp_Object)); |
223 extern void update_compositions P_ ((EMACS_INT, EMACS_INT, int)); | 218 extern void update_compositions P_ ((EMACS_INT, EMACS_INT, int)); |
226 Lisp_Object)); | 221 Lisp_Object)); |
227 extern void syms_of_composite P_ ((void)); | 222 extern void syms_of_composite P_ ((void)); |
228 extern void compose_text P_ ((int, int, Lisp_Object, Lisp_Object, | 223 extern void compose_text P_ ((int, int, Lisp_Object, Lisp_Object, |
229 Lisp_Object)); | 224 Lisp_Object)); |
230 | 225 |
226 /* Macros for lispy glyph-string. This is completely different from | |
227 struct glyph_string. */ | |
228 | |
229 #define LGSTRING_HEADER(lgs) AREF (lgs, 0) | |
230 #define LGSTRING_SET_HEADER(lgs, header) ASET (lgs, 0, header) | |
231 | |
232 #define LGSTRING_FONT(lgs) AREF (LGSTRING_HEADER (lgs), 0) | |
233 #define LGSTRING_CHAR(lgs, i) AREF (LGSTRING_HEADER (lgs), (i) + 1) | |
234 #define LGSTRING_CHAR_LEN(lgs) (ASIZE (LGSTRING_HEADER (lgs)) - 1) | |
235 | |
236 #define LGSTRING_SET_FONT(lgs, val) ASET (LGSTRING_HEADER (lgs), 0, (val)) | |
237 #define LGSTRING_SET_CHAR(lgs, i, c) ASET (LGSTRING_HEADER (lgs), (i) + 1, (c)) | |
238 | |
239 #define LGSTRING_ID(lgs) AREF (lgs, 1) | |
240 #define LGSTRING_SET_ID(lgs, id) ASET (lgs, 1, id) | |
241 | |
242 #define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2) | |
243 #define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2) | |
244 #define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val)) | |
245 | |
246 /* Vector size of Lispy glyph. */ | |
247 enum lglyph_indices | |
248 { | |
249 LGLYPH_IX_FROM, LGLYPH_IX_TO, LGLYPH_IX_CHAR, LGLYPH_IX_CODE, | |
250 LGLYPH_IX_WIDTH, LGLYPH_IX_LBEARING, LGLYPH_IX_RBEARING, | |
251 LGLYPH_IX_ASCENT, LGLYPH_IX_DESCENT, LGLYPH_IX_ADJUSTMENT, | |
252 /* Not an index. */ | |
253 LGLYPH_SIZE | |
254 }; | |
255 | |
256 #define LGLYPH_NEW() Fmake_vector (make_number (LGLYPH_SIZE), Qnil) | |
257 #define LGLYPH_FROM(g) XINT (AREF ((g), LGLYPH_IX_FROM)) | |
258 #define LGLYPH_TO(g) XINT (AREF ((g), LGLYPH_IX_TO)) | |
259 #define LGLYPH_CHAR(g) XINT (AREF ((g), LGLYPH_IX_CHAR)) | |
260 #define LGLYPH_CODE(g) \ | |
261 (NILP (AREF ((g), LGLYPH_IX_CODE)) \ | |
262 ? FONT_INVALID_CODE \ | |
263 : CONSP (AREF ((g), LGLYPH_IX_CODE)) \ | |
264 ? ((XFASTINT (XCAR (AREF ((g), LGLYPH_IX_CODE))) << 16) \ | |
265 | (XFASTINT (XCDR (AREF ((g), LGLYPH_IX_CODE))))) \ | |
266 : XFASTINT (AREF ((g), LGLYPH_IX_CODE))) | |
267 #define LGLYPH_WIDTH(g) XINT (AREF ((g), LGLYPH_IX_WIDTH)) | |
268 #define LGLYPH_LBEARING(g) XINT (AREF ((g), LGLYPH_IX_LBEARING)) | |
269 #define LGLYPH_RBEARING(g) XINT (AREF ((g), LGLYPH_IX_RBEARING)) | |
270 #define LGLYPH_ASCENT(g) XINT (AREF ((g), LGLYPH_IX_ASCENT)) | |
271 #define LGLYPH_DESCENT(g) XINT (AREF ((g), LGLYPH_IX_DESCENT)) | |
272 #define LGLYPH_ADJUSTMENT(g) AREF ((g), LGLYPH_IX_ADJUSTMENT) | |
273 #define LGLYPH_SET_FROM(g, val) ASET ((g), LGLYPH_IX_FROM, make_number (val)) | |
274 #define LGLYPH_SET_TO(g, val) ASET ((g), LGLYPH_IX_TO, make_number (val)) | |
275 #define LGLYPH_SET_CHAR(g, val) ASET ((g), LGLYPH_IX_CHAR, make_number (val)) | |
276 #define LGLYPH_SET_CODE(g, val) \ | |
277 do { \ | |
278 if (val == FONT_INVALID_CODE) \ | |
279 ASET ((g), LGLYPH_IX_CODE, Qnil); \ | |
280 else if (val > MOST_POSITIVE_FIXNUM) \ | |
281 ASET ((g), LGLYPH_IX_CODE, Fcons (make_number ((val) >> 16), \ | |
282 make_number ((val) & 0xFFFF))); \ | |
283 else \ | |
284 ASET ((g), LGLYPH_IX_CODE, make_number (val)); \ | |
285 } while (0) | |
286 | |
287 #define LGLYPH_SET_WIDTH(g, val) ASET ((g), LGLYPH_IX_WIDTH, make_number (val)) | |
288 #define LGLYPH_SET_LBEARING(g, val) ASET ((g), LGLYPH_IX_LBEARING, make_number (val)) | |
289 #define LGLYPH_SET_RBEARING(g, val) ASET ((g), LGLYPH_IX_RBEARING, make_number (val)) | |
290 #define LGLYPH_SET_ASCENT(g, val) ASET ((g), LGLYPH_IX_ASCENT, make_number (val)) | |
291 #define LGLYPH_SET_DESCENT(g, val) ASET ((g), LGLYPH_IX_DESCENT, make_number (val)) | |
292 #define LGLYPH_SET_ADJUSTMENT(g, val) ASET ((g), LGLYPH_IX_ADJUSTMENT, (val)) | |
293 | |
294 #define LGLYPH_XOFF(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \ | |
295 ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 0)) : 0) | |
296 #define LGLYPH_YOFF(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \ | |
297 ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 1)) : 0) | |
298 #define LGLYPH_WADJUST(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \ | |
299 ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 2)) : 0) | |
300 | |
301 struct composition_it; | |
302 struct face; | |
303 struct font_metrics; | |
304 | |
305 extern Lisp_Object composition_gstring_put_cache P_ ((Lisp_Object, int)); | |
306 extern Lisp_Object composition_gstring_from_id P_ ((int)); | |
307 extern int composition_gstring_p P_ ((Lisp_Object)); | |
308 extern int composition_gstring_width P_ ((Lisp_Object, int, int, | |
309 struct font_metrics *)); | |
310 | |
311 extern void composition_compute_stop_pos P_ ((struct composition_it *, | |
312 EMACS_INT, EMACS_INT, EMACS_INT, | |
313 Lisp_Object)); | |
314 extern int composition_reseat_it P_ ((struct composition_it *, | |
315 EMACS_INT, EMACS_INT, EMACS_INT, | |
316 struct window *, struct face *, | |
317 Lisp_Object)); | |
318 extern int composition_update_it P_ ((struct composition_it *, | |
319 EMACS_INT, EMACS_INT, Lisp_Object)); | |
320 | |
321 extern int composition_adjust_point P_ ((EMACS_INT)); | |
322 | |
231 EXFUN (Fcompose_region_internal, 4); | 323 EXFUN (Fcompose_region_internal, 4); |
232 EXFUN (Fcompose_string_internal, 5); | 324 EXFUN (Fcompose_string_internal, 5); |
325 EXFUN (Fcomposition_get_gstring, 4); | |
233 | 326 |
234 #endif /* not EMACS_COMPOSITE_H */ | 327 #endif /* not EMACS_COMPOSITE_H */ |
235 | 328 |
236 /* arch-tag: 59524d89-c645-47bd-b5e6-65e861690118 | 329 /* arch-tag: 59524d89-c645-47bd-b5e6-65e861690118 |
237 (do not change this comment) */ | 330 (do not change this comment) */ |