*** empty log message ***
[m17n/m17n-lib.git] / src / ChangeLog
1 2006-08-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>  (tiny change)
2
3         * Makefile.am (libm17n_la_LIBADD, libm17n_gui_la_LIBADD)
4         (libm17n_X_la_LIBADD, libm17n_gd_la_LIBADD, linkcore_LDADD)
5         (linkshell_LDADD, linkgui_LDADD): Use ${top_builddir}.
6
7 2006-08-02  Kenichi Handa  <handa@m17n.org>
8
9         * plist.c (mdebug_dump_plist): Fix the 2nd arg to dump_plist_element.
10
11         * mtext.c (mdebug_dump_mtext): If not fullp, dump just text. 
12
13         * font-ft.c (ft_encapsulate): Add code for debugging.
14         (mfont__ft_drive_otf): Be sure to encode character before getting
15         metrics.
16
17 2006-07-21  Kenichi Handa  <handa@m17n.org>
18
19         * draw.c (mdraw_text_extents): Fix previous typo.
20
21 2006-07-19  Kenichi Handa  <handa@m17n.org>
22
23         * draw.c (gstring_width): New arg lbearing.
24         (render_glyph_string): Adjusted for the change of gstring_width.
25         (mdraw_text_extents): Fix lbearing of ink and line metrics.
26
27         * m17n-core.h (Mlanguage): Extern it.
28
29         * m17n.h (Mlanguage): Extern deleted. 
30
31         * mtext.c (mtext__init): Initialize Mlanguage.
32         (Mlanguage): Declaration moved from locale.c
33
34         * locale.c (mlocale__init): Don't initialize Mlanguage here.
35         (Mlanguage): Declaration moved to mtext.c.
36
37         * language.c (mlang__init): Don't initialize Mlanguage here.
38
39         * font.c (OTF_tag_name) [! HAVE_OTF]: New function.
40
41 2006-07-14  Kenichi Handa  <handa@m17n.org>
42
43         * font-ft.c: Use FT_BDF_H macro.  Include fontconfig/fcfreetype.h.
44         (MRealizedFontFT): New member face_encapsulated.
45         (free_ft_rfont): Pay attention to ft_rfont->face_encapsulated.
46         (ft_gen_font): New function.
47         (ft_add_font): Use ft_gen_font.
48         (ft_list_script): Store lists in ft_script_list.
49         (ft_check_otf): New arg ft_face.  Caller changed.
50         (ft_check_language): Likewise.
51         (ft_check_script): Likewise.
52         (ft_encapsulate, ft_close): New functions.
53         (mfont__ft_driver): Initialize members encapsulate and close.
54         (mfont__ft_drive_otf): Use OTF_open_ft_face if it is available.
55
56         * font.h (struct MRealizedFont): New member encapsulating.
57         (struct MFontDriver): New members encapsulate and close.
58
59         * font.c (mfont__match_p): If FONT is realized, check capability
60         by font drivers's check_capability method.
61         (mfont_match_p, mfont_open, mfont_encapsulate, mfont_close): New
62         functions.
63
64         * m17n-X.c (xfont_list_family_names): Delete unused var.  Fix
65         declarations of foundry and fam local vars.
66         (xft_driver): Make it static.
67
68         * m17n-gui.h (mfont_match_p, mfont_open, mfont_encapsulate)
69         (mfont_close): Extern them.
70
71         * m17n-gd.c (device_open): Don't specify foundry and family of the
72         default face.
73
74 2006-07-11  Kenichi Handa  <handa@m17n.org>
75
76         * m17n-gui.c (m17n_fini_win): Set null_interface.handle to NULL;
77
78 2006-07-13  Kenichi Handa  <handa@m17n.org>
79
80         * font-ft.c (fc_build_charset): Return NULL if FcCharSet can't be
81         created.
82         (ft_check_script): Delete unused var.
83         (ft_list_capability): Likewise.
84
85         * font.c (mfont__get_capability): Setup cap->otf.
86         (Motf): Make it global.
87         (mfont_get_prop): Accept Mlanguage, Mscript, and Motf as key arg.
88
89         * font.h (MFontCapability): New member otf.
90
91         * language.c (mlang__fini): Delete unused vars.
92
93         * m17n-gui.h (Motf): Extern it.
94
95         * database.c (update_database_list): Delete unused vars.
96
97 2006-07-07  Kenichi Handa  <handa@m17n.org>
98
99         * font-ft.c (DEVICE_DELTA): Fix typo.
100
101 2006-07-06  Kenichi Handa  <handa@m17n.org>
102
103         * fontset.c (mfont__lookup_fontset): Don't ignore family and
104         foundry of face.
105
106 2006-07-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
107
108         * database.c: Update comments.
109
110 2006-07-05  Kenichi Handa  <handa@m17n.org>
111
112         * database.c (PATH_MAX): Define it if not yet defined.
113         (PATH_SEPARATOR, USE_GEN_PATH, GEN_PATH, GEN_PATH_FROM_MT): New
114         macros.
115         (get_database_filename): Use GEN_PATH.
116         (get_dir_info): Don't include the last '/' in directory name.
117         (register_database): New function.
118         (update_database_list): Use register_database.  Search all
119         directories in mdatabase__dir_list for wildcard databases.
120         (mdatabase__init): Check "~/.m17n.d".
121
122 2006-07-03  Kenichi Handa  <handa@m17n.org>
123
124         * input-gui.c (win_callback): If is ic->candidate_show zero, don't
125         push reverse property.
126
127         * plist.c (dump_plist_element): Fix previous change.
128
129 2006-06-28  Kenichi Handa  <handa@m17n.org>
130
131         * font.c (xlfd_unparse_name): Suppress the heading '-' if not
132         necessary.
133
134         * draw.c (MbidiNSM): New variable.
135         (visual_order) [! HAVE_FRIBIDI]: Clear levels at first.  Pay
136         attention to bidi type NSM.
137         (mdraw__init): Initialize MbibiNSM.
138
139         * language.c (mscript__char_list): Fix finding a char-list element.
140
141         * plist.c (dump_string): Return number of printed characters.
142         (dump_plist_element): Print elements more compactly.
143
144 2006-06-23  Kenichi Handa  <handa@m17n.org>
145
146         * Makefile.am (BUILD_LIBS): Don't increment it conditionally.
147         (include_HEADERS): Likewise.
148
149 2006-06-23  TAKAHASHI Naoto  <ntakahas@m17n.org>
150
151         * language.c: Update documentation.
152
153 2006-06-23  Kenichi Handa  <handa@m17n.org>
154
155         * font-ft.c (struct MFontFT): Delete member lang.
156         (free_ft_info): Don't unref member lang.  Destroy members langset
157         and charset.
158         (fc_parse_pattern): Last argument changed to MFontFT *.  Callers
159         changed.  Set members langset and charset.
160         (fc_init_font_list, fc_list_pattern, fc_build_charset): New
161         functions.
162         (ft_init_font_list, ft_has_char_list_p, ft_list_char_list): New
163         functions.
164         (ft_list_family) [HAVE_FONTCONFIG]: Include FC_CHARSET on objset.
165         (ft_list_family) [! HAVE_FONTCONFIG]: Call ft_init_font_list.
166         (ft_list_language) [HAVE_FONTCONFIG]: Check representative
167         characters at first.  If it fails, try listing by language names.
168         (ft_list_language) [! HAVE_FONTCONFIG]: Call ft_list_char_list.
169         (ft_check_language): Renamed from ft_check_lang.  Adjusted for the
170         change of MFontCapability.
171         (ft_list_capability): Likewise.  Try listing by languages, then by
172         scripts.  Check OTF at last.
173         (ft_check_script): New function.
174         (ft_select): Adjusted for the check of MFontCapability.
175         (ft_list_family_names): New function.
176         (ft_check_capability): If cap->script is not Mnil, call
177         ft_check_script.
178         (mfont__ft_driver): Initialize with ft_list_family_names.
179
180         * font.h (struct MFontDriver): New member list_fmaily_names.
181         (struct): Change member "MSymbol *lang" to "MSymbol language".
182
183         * font.c: Include "language.h".
184         (Motf): New variable.
185         (otf_script_list, load_otf_script_list): Delete it.
186         (find_script_from_otf_tag): Delete it.
187         (merge_capability): New function.
188         (mfont__init): Init Motf.
189         (mfont__fini): Don't unref otf_script_list.
190         (free_font_capability): Check cap->script_tag to determine if
191         OTF-related capability is set.
192         (mfont__get_capability): Call mscript__from_otf_tag.  Adjusted for
193         the change of type MFontCapability.
194         (mfont_put_prop): Call merge_capability for Mlanguage, Mscript,
195         and Motf properties.
196         (mfont_list): Call merge_capability for LANGUAGE arg.
197         (mfont_list_family_names): New function.
198
199         * input-gui.c: Typo in comments fixed.
200
201         * input.c: Typo in comments fixed.
202
203         * language.h (mlanguage__list): Delete it.
204         (mscript__char_list, mscript__otf_tag, mscript__from_otf_tag): New
205         functions.
206
207         * language.c: Include "mtext.h".
208         (M_script_lang_list): Delete it.
209         (language_list, script_list): New variables.
210         (load_lang_script_list, init_language_list, init_script_list): New
211         functions.
212         (mlang__init): Don't load language database here.
213         (mlang__fini): Unref language_list and script_list if not NULL.
214         (mlanguage__list): Delete it.
215         (mlanguage__info, mscript__info, mscript__char_list)
216         (mscript__otf_tag, mscript__from_otf_tag): New functions.
217         (mlanguage_list, mlanguage_code, mlanguage_name, mlanguage_text)
218         (mscript_list, mscript_language_list): New functions.
219
220         * m17n-gui.h (mfont_list_family_names): Extern it.
221
222         * m17n.h (mlanguage_list, mlanguage_code, mlanguage_name)
223         (mlanguage_text, mscript_list, mscript_language_list): Extern
224         them.
225
226 2006-06-21  Kenichi Handa  <handa@m17n.org>
227
228         * m17n-X.c (xfont_driver): Initialize with
229         xfont_list_family_names.
230         (xfont_list_family_names): New function.
231         (xft_driver): Initialize with NULL for list_family_names member.
232         (device_init): Set list_family_names member of xft_driver to that
233         of mfont__ft_driver.
234
235 2006-06-06  Kenichi Handa  <handa@m17n.org>
236
237         * fontset.c (mfont__lookup_fontset): Don't set *num to 1 if it is 0.
238
239 2006-03-24  Kenichi Handa  <handa@m17n.org>
240
241         * font-ft.c (ft_open): Improve debug message.
242
243         * fontset.c (mfontset__get_font): Fix for the case that no font in
244         per_script list is available.
245
246 2006-02-06  Kenichi Handa  <handa@m17n.org>
247
248         * Version 1.3.3 released.
249
250 2006-02-22  Kenichi Handa  <handa@m17n.org>
251
252         * textprop.c: Fix some typos in documentation.
253
254         * plist.c: Fix some typos in documentation.
255
256         * m17n-core.h: Fix some typos in documentation.
257         (M17NLIB_PATCH_LEVEL): Updated to 3.
258         (M17NLIB_VERSION_NAME): Updated to "1.3.3".
259
260         * symbol.c: Fix some typos in documentation.
261
262         * mtext.c: Fix some typos in documentation.
263
264         * input.c: Fix several typos in documentation.
265
266 2006-02-06  Kenichi Handa  <handa@m17n.org>
267
268         * Version 1.3.2 released.
269
270 2006-02-03  Kenichi Handa  <handa@m17n.org>
271
272         * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 2.
273         (M17NLIB_VERSION_NAME): Updated to "1.3.2".
274
275         * font.c (xlfd_parse_name): Fix handling of the name "nil".
276
277         * draw.c (layout_glyphs): Fix handling left_padding of
278         composition's base.
279
280         * m17n-gd.c (read_rgb_txt): Support HTML 4.0 color names.
281
282 2006-02-02  Kenichi Handa  <handa@m17n.org>
283
284         * Makefile.am (include_HEADERS): Add m17n-gui.h and m17n-X.h only
285         if WITH_GUI is true.
286
287 2006-01-25  Kenichi Handa  <handa@m17n.org>
288
289         * input.c (resolve_expression): If the value of PLIST is a plist,
290         but the first element is not symbol, return 0.
291
292 2006-01-17  Kenichi Handa  <handa@m17n.org>
293
294         * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha only if
295         HAVE_GD is 2 or the greater.
296
297 2006-01-16  Kenichi Handa  <handa@m17n.org>
298
299         * Version 1.3.1 released.
300
301 2006-01-16  Kenichi Handa  <handa@m17n.org>
302
303         * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha instead of
304         simulating anti-aliasing.
305
306         * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 1.
307         (M17NLIB_VERSION_NAME): Updated to "1.3.1".
308
309 2006-01-12  Kenichi Handa  <handa@m17n.org>
310
311         * input.c (get_surrounding_text): Always pop ic->plist.
312         (reset_ic): Don't reset ic->plist.
313
314 2006-01-10  Kenichi Handa  <handa@m17n.org>
315
316         * input.c (preedit_commit): For debugging, print only commiting
317         charactes.  Don't set ic->candidate_show to 0.
318         (handle_key): Don't run branch-actions just by shifting to the
319         current state.
320         (reset_ic): Reset state_key_head and key_head of ic_info to 0.
321         Reset vars and plist.
322
323 2006-01-07  Kenichi Handa  <handa@m17n.org>
324
325         * input.c (load_branch): Confirm that maps is not NULL.
326
327 2006-01-05  Kenichi Handa  <handa@m17n.org>
328
329         * input-gui.c (win_filter): Try to convert arg to key only when
330         arg is not NULL.
331
332         * plist.c (read_integer_element): If '#' and '-' are followed by
333         non-integer-constituent, read them as a part of a symbol.
334         (read_symbol_element): New arg C.
335         (read_element): Adjust args to read_symbol_element.
336
337         * input.c (load_macros): On overwriting a macro, free the old
338         definition.
339         (minput__init): Store Mmap in load_im_info_keys.
340         (minput_get_title_icon): If the input method has no title, be sure
341         to return NULL.
342         (minput_get_description): If the input method has no description,
343         be sure to return NULL.
344         (minput_get_variables): Fix documentation.
345         (handle_key): Pay attention to the case that key is Mnil.
346         (filter): Likewise.  Fix handling of such symbol as S-A.
347
348 2005-12-22  Kenichi Handa  <handa@m17n.org>
349
350         * Version 1.3.0 released.
351
352 2005-12-22  Kenichi Handa  <handa@m17n.org>
353
354         * font-ft.c (ft_list): If the specified font has no property,
355         return all fonts.
356
357 2005-12-20  Kenichi Handa  <handa@m17n.org>
358
359         * character.c (mchar_get_prop): Check char_prop_list.
360         (mchar_put_prop, mchar_get_prop_table): Likewise.
361
362 2005-12-18  Kenichi Handa  <handa@m17n.org>
363
364         * input.c (minput_get_title_icon): If LANGUAGE is Mt, try also a
365         file name sans language.
366
367 2005-12-16  TAKAHASHI Naoto  <ntakahas@m17n.org>
368
369         * input.c: Fix typo in comments.
370
371 2005-12-14  Kenichi Handa  <handa@m17n.org>
372
373         * input.c (minput_get_title_icon): Check the default icon for the
374         input method.
375
376 2005-12-13  Kenichi Handa  <handa@m17n.org>
377
378         * input.c (Mless_equal, Mgreater_equal): New variables.
379         (parse_expression, resolve_expression, parse_action_list)
380         (take_action_list): Handle the aboves.
381         (filter): Treat key S-X as X.
382         (minput__init): Initialize Mless_equal and Mgreater_equal.
383         (minput_get_title_icon): New function.
384
385         * m17n.h (minput_get_title_icon): Extern it.
386
387         * database.c (get_database_filename): Return a filename instead of
388         file pointer.
389         (load_database): Adjusted for the above change.
390         (mdatabase__load_for_keys): Likewise.
391         (mdatabase__find_file): New function.
392
393         * database.h (mdatabase__find_file): Extern it.
394
395         * font.h (mfont__resize): Delete extern.
396
397         * font.c (mfont__list): Check resize ratio.
398         (mfont__resize): Delete it.
399         (mfont_resize_ratio): Include the code of mfont__resize.
400
401         * font-ft.c (ft_open): Check resize ratio.
402
403         * m17n-X.c (xfont_open): Check resize ratio.
404         (xft_open): Likewise.
405
406 2005-12-07  Kenichi Handa  <handa@m17n.org>
407
408         * input.c (take_action_list): If take_action_list return -1,
409         return -1.
410         (handle_key): Likewise.
411
412         * face.c (mface__for_chars): When font is specified and layouter
413         is found for it, if the layouter doesn't support one of a
414         character, use a face sans layouter for it.
415
416 2005-12-06  Kenichi Handa  <handa@m17n.org>
417
418         * fontset.c (mfont__lookup_fontset): If only a fallback font is
419         found, don't use it for more than one character.
420
421 2005-12-05  Kenichi Handa  <handa@m17n.org>
422
423         * face.c (mface__realize): Set rfont->layouter to Mnil.
424         (mface__for_chars): Fix handling of layouter.
425
426         * character.h (mchar__define_prop): Extern it.
427
428         * database.c (update_database_list): Call mchar__define_prop if
429         necessary.
430
431         * character.c (mchar__init): Don't call mchar_define_property.
432         Instead just initialize property keys.
433         (mchar__fini): Free char_prop_list only if it's not NULL.
434         (mchar__define_prop): New function.
435         (mchar_define_property): Call mchar__define_prop.
436
437         * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
438         mplist__fini.
439
440 2005-12-02  Kenichi Handa  <handa@m17n.org>
441
442         * language.c (mlang__init): Handle extra chars.
443
444         * m17n-gui.h (mfont_check): Adjust prototype.
445
446         * m17n-X.c (xfont_driver): Specify xfont_check_capability.
447         (xfont_check_capability): New function.
448         (xft_driver): Specify xft_check_capability.
449         (xft_check_capability): New function.
450
451         * font-ft.c (M0_3): Delete it.
452         (M0): New variable.
453         (ft_get_charmaps): Refer to M0.
454         (fc_parse_pattern): Fix previous change.
455         (ft_list_language): Check also extra chars.
456         (ft_check_otf): Define it even if HAVE_OTF is undef.
457         (ft_check_lang): Check the result of FcLangSetHasLang against
458         FcLangDifferentLang.  Check also extra chars.
459         (ft_list_capability): Delete ifdef HAVE_OTF.
460         (ft_select): Likewise.
461         (ft_open): Improve debug information.
462         (ft_check_capability): New function.
463         (mfont__ft_driver): Specify ft_check_capability.
464         (mfont__ft_init): Initialize M0.
465
466         * fontset.c (get_font_from_group): New function.
467         (mfontset__get_font): New function.
468
469         * fontset.h (mfontset__get_font): Extern it.
470
471         * font.c (OTF_tag): Define it if HAVE_OTF is undef.
472         (mfont__fini): Delete ifdef HAVE_OTF.
473         (free_font_capability): Likewise.
474         (mfont__get_capability): Likewise.
475         (mfont__check_capability): New function.
476         (mfont_check): Change the order of arguments.  Use
477         mfontset__get_font.
478
479         * font.h (struct MFontDriver): New member check_capability.
480         (MFontCapability): Delete ifdef HAVE_OTF.
481         (mfont__check_capability): Extern it.
482
483         * face.c (mface__realize): Fix handling of FONT arg.
484         (mface__for_chars): Fix handling of explicitly specified font.
485
486 2005-11-25  Kenichi Handa  <handa@m17n.org>
487
488         * font-flt.c (run_command): Print debug info for
489         left/rigth_padding
490
491         * draw.c (layout_glyphs): Fix handling of left/right_padding.
492
493         * face.c (mface__for_chars): Check rfont before accessing the
494         members.
495
496 2005-11-21  Kenichi Handa  <handa@m17n.org>
497
498         * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
499         WITH_GUI.
500
501         * fontset.c (fontset_table): New variable.
502         (free_fontset): Call M17N_OBJECT_UNREGISTER.
503         (mfont__fontset_init): Add fontset_table as an object array.
504         (mfont__realize_fontset): Ref FONTSET.
505         (mfont__free_realized_fontset): Unref REALIZED->fontset.
506         (mfontset): Call M17N_OBJECT_REGISTER.
507         (mfontset_copy): Likewise.
508
509         * input.c (handle_key): For debugging, print information about
510         alias key.
511         (filter): Add an alias for Meta and Alt modifiers.
512         (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
513         variables.
514         (minput__init): Initialize them.
515         (parse_expression): New function.
516         (resolve_expression): New function.
517         (parse_action_list): Handle expressions by parse_expression.
518         (take_action_list): Handle expressions by resolve_expression.
519         (parse_nested_list_value): Fix previous change.
520         (resolve_command): Fix handling of the return value of
521         get_nested_list.
522
523 2005-11-18  Kenichi Handa  <handa@m17n.org>
524
525         * font-ft.c (ft_check_otf, otf_script_list): Define only when
526         HAVE_OTF is defined.
527         (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
528         defined.
529         (ft_select): Likewise.
530
531         * font.c (mfont_list): Fix for the case that FONT is NULL.
532         (OTF_tag): Delete it.
533         (load_otf_script_list): Define only when HAVE_OTF is defined.
534         (mfont__fini): Unref otf_script_list only when HAVE_OTF is
535         defined.
536
537         * draw.c (truncate_gstring): Be sure to truncate at
538         glapheme-cluster boundary.
539
540 2005-11-11  Kenichi Handa  <handa@m17n.org>
541
542         * input.c (delete_surrounding_text): Clear cache if necessary.
543
544 2005-11-09  Kenichi Handa  <handa@m17n.org>
545
546         * draw.c (compose_glyph_string): Update prev->rface->rfont if the
547         glyph prev is also supported by the current flt.
548
549 2005-11-08  Kenichi Handa  <handa@m17n.org>
550
551         * m17n-X.c (xft_render): Cancel previous change.
552
553 2005-11-07  Kenichi Handa  <handa@m17n.org>
554
555         * input.c: Include <stdlib.h>.
556         (get_surrounding_text, delete_surrounding_text)
557         (get_preceding_char, get_following_char): New functions.
558         (integer_value): New arg surrounding.  If it is nonzero, try to
559         get a surrounding character.  Callers changed.
560         (take_action_list): Check `value' before setting an element.
561         (destroy_ic): Unref ic_info->preceding_text and
562         ic_info->following_text.
563         (minput__init): Initialize Minput_get_surrounding_text and
564         Minput_delete_surrounding_text.
565         (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
566         variables.
567         (filter): Unref ic_info->preceding_text and
568         ic_info->following_text.
569
570         * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
571         Extern them.
572
573         * input.h (MInputContextInfo): New members preceding_text and
574         following_text.
575
576 2005-11-04  Kenichi Handa  <handa@m17n.org>
577
578         * input.c (parse_nested_list_value): Fix handling of the global
579         definition.
580         (get_nested_list): Get global definitions by load_partial_im_info.
581         (preedit_commit): Set ic->candidates_changed to bitwise or of enum
582         MInputCandidatesChanged.
583         (take_action_list): Likewise.
584         (reset_ic): Likewise.
585         (create_ic): Don't pay special attention to
586         Mcandidates_group_size.
587         (load_partial_im_info): Call mdatabase_find with correct 4th arg.
588         (minput_set_variable): Get a definition of varible by
589         mplist_find_by_value, not mplist_get.
590
591         * m17n.h (enum MInputCandidatesChanged): New enum.
592
593 2005-11-01  Kenichi Handa  <handa@m17n.org>
594
595         * m17n-X.c (xft_render): Check xft_draw's drawable before changing
596         it.
597         (mwin__destroy_window): If xft_draw's drawable is win, change it
598         to device->drawable before destroying win.
599
600 2005-10-31  Kenichi Handa  <handa@m17n.org>
601
602         * input.c (load_im_info): Fix adding of state.
603
604         * m17n-core.c (m17n_fini_core): Fix reporting of module
605         finalization.
606
607         * m17n.c (m17n_fini): Fix reporting of module finalization.
608
609         * m17n-gui.c (m17n_init_win): Fix reporting of module
610         finalization.
611
612 2005-10-29  Kenichi Handa  <handa@m17n.org>
613
614         * input.c (get_candidate_list): Fix the timing of referring plist.
615
616 2005-10-28  Kenichi Handa  <handa@m17n.org>
617
618         * input.c (load_branch): Ignore an undefined map name.
619         (load_im_info): Set im_info->title from `name' only if it's not
620         Mnil.
621         (shift_state): Always update ic->status.
622         (adjust_candidates): Renamed from adjust_candidate_command.
623         Argument changed.  Caller changed.
624         (get_candidate_list, regularize_action): New functions.
625         (take_action_list): Use them.  On handling Munhandle, don't set
626         ic_info->used to 0.
627         (handle_key): If KEY is not handled by MAP, and MAP has
628         branch_actions, perform them.
629
630         * database.c (mdatabase__fini): Free dir_info->filename;
631
632 2005-10-20  Kenichi Handa  <handa@m17n.org>
633
634         * input.c (marker_code): Accept '@@'.
635         (integer_value): Handle '@@'.
636         (parse_action_list): Accept a symbol argument.
637         (take_action_list): Resolve the symbol argument.  Handle the
638         integer argument.
639
640 2005-10-18  Kenichi Handa  <handa@m17n.org>
641
642         * input.c: Include "charset.h".
643         (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
644         variables.
645         (MIMState): New member (M17NObject control).
646         (lookup_nested_list, set_nested_list, parse_nested_list_value)
647         (get_nested_list, resolve_variable): New functions.
648         (integer_value): New arg (MPlist **value).  Set it to the plist
649         element containing the value.
650         (resolve_command): New function.
651         (load_translation): New arg (MPlist *map_actions).
652         (load_branch): New args language and name.  If `keylist' is a
653         symbol, resolved that as a command name.
654         (free_map): New arg top.  Free map->map_actions only if top is
655         nonzero.
656         (free_state): New function.
657         (load_state): New arg name.
658         (im_info_list): New variable.
659         (free_im_info, get_im_info_by_tags): New functions.
660         (load_im_info): Arg key changed to plist.  Handle `include'.
661         Return (MInputMethodInfo *).
662         (preedit_commit): Ref ic->candidate_list.
663         (get_select_charset, adjust_candidate_command): New functions.
664         (take_action_list): Handle `include'.  Adjust candidate action
665         properly.  Handle control variables `candidates-charset' and
666         `candidates-group-size'.
667         (open_im): Use get_im_info.
668         (create_ic): Get global variables.
669         (load_partial_im_info): New function.
670         (get_im_info): New function.
671         (check_command_keyseq, check_command_list, check_variable_list):
672         New functions.
673         (minput__init): Don't handle M_database_hook and Mdetail_text.
674         Initialize M_candidates, Mcandidates_group_size,
675         Mcandidates_charset.
676         (parse_variable_list, get_variable_list, parse_command_list)
677         (get_command_list): Delete them.
678         (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
679         (minput__fini): Simply unref command_list and variable_list.
680         (minput_get_description): Adjusted for the new form of description.
681         (minput_get_commands): Use get_nested_list.
682         (minput_assign_command_keys): Likewise.
683         (minput_get_variables, minput_set_variable): Likewise.
684
685         * input.h (MInputMethodInfo): New members im and maps.
686
687         * database.h (M_database_hook): Delete extern.
688         (MDatabaseHookFunc): Delete extern.
689         (mdatabase__check): Extern it.
690
691         * database.c: Include <glob.h>.
692         (MAX_TIME): New macro.
693         (Masterisk): New variable.
694         (get_database_stream): Argument changed to (MDatabaseInfo *).
695         Callers changed.
696         (get_dir_info): Renamed from duplicate_dirname.  Callers changed.
697         (find_database): New function.
698         (update_database_list): New function.
699         (mdatabase__init): Initialize Masterisk.  Setup mdb_list by
700         calling update_database_list.
701         (mdatabase__check): New function.
702         (mdatabase_find): Use update_database and find_database.  Don't
703         handle MDatabaseHookFunc.
704         (mdatabase_list): Call update_database at first.
705         (mdatabase_define): Adjusted for the change of mdb->extra_info.
706         (MDatabaseList): New type.
707
708         * plist.h (mplist_conv, mplist__pop_unref): Extern them.
709
710         * m17n.h (Mdetail_text): Delete extern.
711
712         * m17n-core.h (mplist_conc): Delete extern.
713
714         * plist.c (mplist__conc): Renamed from mplist_conc.  Don't ref
715         tail.
716         (mplist_conc): Renamed to mplist__conc.
717         (mplist__pop_unref): New function.
718
719 2005-10-14  Kenichi Handa  <handa@m17n.org>
720
721         * plist.c (read_mtext_element): Ignore the sequence of '\\' and
722         newline.
723         (read_element): If keys is an empty plist, return any element
724         found first.
725         (dump_plist_element): Check if plist is nested.
726         (mplist_conc): Always ref tail.
727         (mplist_set): If key is a managing key, ref val in advance.
728
729         * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
730         (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
731         (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
732         macros.
733
734         * fontset.c (free_fontset): Unref fontset_list if necessary.
735         (mfont__fontset_fini): Don't free fontset_list.  Unref
736         default_fontset.
737         (mfont__realize_fontset): Initialize request.
738         (mfontset): Ref default_fontset or fontset only if necessary.
739         (mfontset_copy): Don't ref copy.
740
741         * draw.c (render_glyphs): Check gend->type before checking
742         gend->to.
743
744         * font-ft.c (mfont__ft_fini): Unref ft_default_list.  Set all
745         unrefed plists to NULL.
746
747 2005-10-04  Kenichi Handa  <handa@m17n.org>
748
749         * textprop.c (mtext_serialize): Be sure to make mt
750         MTEXT_FORMAT_UTF_8 and NULL terminated.
751
752         * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
753
754         * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
755
756 2005-10-03  Kenichi Handa  <handa@m17n.org>
757
758         * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
759         is not at the beginning of line.
760
761 2005-09-22  Kenichi Handa  <handa@m17n.org>
762
763         * input.c: Include <sys/stat.h> and <unistd.h>.
764         (Minclude, Mcommit, Munhandle): New variables.
765         (minput__init): Initialize them.  Push only Mstate to
766         load_im_info_keys.   Add aliases C-lowercase for C-uppercase.
767         (parse_action_list): Allow integer arg for undo.  Handle Mcommit
768         and Munhandle.
769         (load_input_method): Handle "include" directive.  If no states are
770         loaded, return -1.
771         (shift_state): If state_name is Mt, shift back to the previous
772         state.  Call preedit_commit to commit preedit text.
773         (preedit_commit): New function.
774         (take_action_list): Improve debug printing.  Handle commit and
775         unhandle commands.
776         (handle_key): Check the return value of take_action_list.  Don't
777         take branch_actions just after changing to the root map.
778         (reset_ic): Reset all ic_info members.
779         (filter): When a key is not handled, just move ic_info->keys
780         instead fo calling reset_ic.
781         (load_im_info): If key is not Mstate, push Mmap to
782         load_im_info_keys.
783         (MDatabaseStatList): New type.
784         (imdir_stat_list): New variable.
785         (input_method_hook): Don't cancel the hook.  Check the
786         modification time of directories.
787         (minput__fini): Free imdir_stat_list;
788
789         * input.h (MInputContextInfo): New member prev_state.
790
791         * m17n-core.h (mplist_conc): Extern it.
792
793         * plist.c (mplist_conc): New function.
794
795         * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
796
797         * font.h (MRealizedFont): New member average_width.
798
799         * font-ft.c (ft_open): Set rface->average_width.
800
801         * font.c (xlfd_unparse_name): Print '*' before registry name.
802
803         * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
804         (xfont_open): Set rfont->average_width.
805         (xft_open): Likewise.
806         (device_open): Initialize disp_info->AVERAGE_WIDTH.
807
808         * internal-gui.h (struct MFrame): New member average_width.
809
810         * m17n-gui.c (mframe): Fix setting of frame->rfont.
811         (mframe_get_prop): Return the average_width of a font.
812
813         * face.c (mface__realize): Set rface->average_width.
814         (mface__update_frame_face): Set frame->average_width.
815
816         * face.h (MRealizedFace): New member average_width.
817
818 2005-09-19  Kenichi Handa  <handa@m17n.org>
819
820         * font.c (xlfd_unparse_name): New arg full_xlfd.
821         (mfont__encode_char): Use shortcut only for X core fonts.
822         (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
823         (mfont_put_prop): Handle `language' property.
824         (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
825         Print file can capability info too.
826
827         * m17n-core.c (mdebug__output): New variable.
828         (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
829         (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
830         (m17n_fini_core): Close mdebug__output if it's not stderr.
831
832         * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
833         (xfont_open): Handle baseline_offset.
834         (xfont_find_metric): Likewise.
835         (xfont_render): Likewise.
836         (xft_open): Likewise.
837         (xft_render): Likewise.
838
839         * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
840         (mdebug__output): Extern it.
841         (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
842         (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
843         (MDEBUG_DUMP): New macro.
844         (MDEBUG_PRINT_TIME): Print to medebug__output.
845
846         * font.h (MRealizedFont): New member baseline_offset.
847
848         * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
849         characters.
850         (fc_weight_table): Add FC_WEIGHT_REGULAR.
851         (ft_list_family): Check alias.
852         (ft_list_language): If language is "en", don't try to the second
853         step.
854         (ft_default_list): New variable.
855         (ft_list_default): New function.
856         (ft_select): If family is not specified, try only the default
857         fonts.  Treat the weights normal and medium same.
858         (ft_open): Fix debug message.  If registry is not specified, try
859         unicode-bmp.  Handle _MULE_BASELINE_OFFSET property of BDF fonts.
860         (ft_find_metric): Likewise.
861         (ft_render): Likewise.
862         (ft_list): Fix debug message.  Accept the registring iso8859-1.
863         If family is not specified, try only the default fonts.
864
865         * face.c (mface__realize): Fix logic of opening a font.
866
867 2005-09-16  Kenichi Handa  <handa@m17n.org>
868
869         * face.c (mface__realize): 
870
871         * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
872         Extern them.
873
874         * input.c (shift_state): Fix the condition of taking init actions.
875         (take_action_list): Fix handling of pushback action.
876         (handle_key): Don't change key while checking its alias.
877         (minput__init): Initialize new variables.
878         (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
879         variables.
880
881 2005-09-12  Kenichi Handa  <handa@m17n.org>
882
883         * mtext.c (mtext__uppercase): Add proper open/close parens.
884         (mtext_titlecase): Add proper casting.
885
886         * input.c (parse_action_list): Handle the case that the arg is a
887         key sequence (MText or MPlist).
888         (take_action_list): Likewise.
889         (shift_state): Shorter debug message.
890         (handle_key): Terminate a debug message by "\n".
891         (reset_ic): Don't take initial actions here.
892         (minput_open_im): Print a debug message.
893         (minput_close_im): Likewise.
894         (minput_create_ic): Likewise.
895         (minput_destroy_ic): Likewise.
896
897 2005-09-09  TAKAHASHI Naoto  <ntakahas@m17n.org>
898
899         * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
900         Change API.
901
902 2005-09-07  TAKAHASHI Naoto  <ntakahas@m17n.org>
903         * character.c: Add "cased", "soft-dotted", and "case-mapping" in
904         mchar__init ().
905
906         * character.c: Add Japanese documentation for
907         mchar_get_prop_table ().
908
909 2005-09-06  TAKAHASHI Naoto  <ntakahas@m17n.org>
910
911         * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
912         (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
913         (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
914         New variables.
915         (init_case_conversion): New function.
916         (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
917         (uppercase_precheck, lowercase_precheck, final_sigma)
918         (after_soft_dotted, more_above, before_dot, after_i)
919         (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
920
921 2005-09-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
922
923         * plist.c (read_mtext_element): Fix previous change.
924
925 2005-09-05  Kenichi Handa  <handa@m17n.org>
926
927         * plist.c (read_mtext_element): Handle \uXXXX notation.
928
929         * internal.h (MTABLE_MALLOC): Don't use a local variable.
930         (MTABLE_ALLOCA): Change the name of local variable.
931
932         * m17n-gd.c (device_open): Define it even if HAVE_GD nor
933         HAVE_FREETYPE are defined.
934
935         * m17n-X.c: Check HAVE_X11.
936
937         * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
938         directory listing libraries.
939         (noinst_PROGRAMS): Define it only in maintainer mode.
940
941 2005-09-02  Kenichi Handa  <handa@m17n.org>
942
943         * m17n-gui.h (mdraw_line_break_option): Extern it.
944
945         * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
946         end of the first glyph.
947         (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
948         them.
949         (mdraw_line_break_option): New variable.
950         (mdraw_default_line_break): Use mtext_line_break.
951
952         * mtext.h (wordseg_func_table): Don't extern it.
953         (mtext__wseg_fini): Extern it.
954
955         * mtext.c: Don't include word-thai.h.
956         (wordseg_func_table): Delete this variable.
957         (mtext__init): Don't initialize above.  Don't call
958         mtext__word_thai_init.
959         (mtext__fini): Don't free wordseg_func_table.  Call
960         mtext__wseg_fini instead fo mtext__word_thai_fini.
961         (MTextWordsegFunc): Don't typedef it.
962         (mtext__word_segment): Moved to mtext-wseg.c.
963
964         * m17n-core.h (enum MTextLineBreakOption): New enum.
965         (mtext_line_break): Extern it.
966
967         * mtext-wseg.c: New file.
968
969         * mtext-lbrk.c: New file.
970
971         * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
972         add mtext-lbrk.c and mtext-wseg.c.
973
974         * textprop.c (mtext__adjust_plist_for_change): Pay attention for
975         the case that head is NULL.
976
977 2005-09-01  Kenichi Handa  <handa@m17n.org>
978
979         * word-thai.c (wordseg_propertize): If the property value is nil,
980         don't make the property no-merge.
981         (thai_wordseg): Don't require *from and *to are set a priori.  Pay
982         attention to the case that they are NULL.
983         (mtext__word_thai_init): Make the name of Mthai_wordseg starts
984         with two spaces.
985
986         * character.c (mchar_get_prop_table): New function.
987
988         * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
989
990         * m17n-core.h (mtext_insert, mtext_replace): Extern them.
991         (mchar_get_prop_table): Extern it.
992
993         * textprop.c (prepare_to_modify): New arg deleting.  Callers changed.
994         (mtext__adjust_plist_for_change): Argument changed.  Callers changed.
995
996         * internal.h (enum MTextCoverage): New enum.
997         (MText): New member coverage.
998
999         * mtext.c (FORMAT_COVERAGE): New macro.
1000         (insert): Copy mt2->coverage.
1001         (mtext__from_data): Initialize mt->coverage.
1002         (mtext__adjust_format): Update mt->coverage.
1003         (mtext): Initialize mt->coverage.
1004         (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
1005         Update mt->coverage if necessary.
1006         (mtext_duplicate): Copy mt->coverage.
1007         (mtext_insert, mtext_replace): New functions.
1008         (mtext_dup): Use mtext_duplicate.
1009         (mtext__word_segment): Don't set *from and *to if a word
1010         segmentation funcion is not found.
1011         (mtext_ins_char): Fix typo.
1012
1013 2005-08-25  Kenichi Handa  <handa@m17n.org>
1014
1015         * font.h (MFont): New member for_full_width.
1016
1017         * font.c (compare_font_score): Prefer a font of not
1018         for_full_width.
1019
1020         * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
1021         registry charset of a font is one of CJK charsets.
1022
1023         * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
1024         supports some of CJK.
1025
1026 2005-08-24  Kenichi Handa  <handa@m17n.org>
1027
1028         * m17n-gui.h (Mascent, Mdescent): Don't extern them.
1029
1030         * m17n-gui.c (null_device_open): Check Mresolution param and set
1031         frame->dpi.
1032
1033         * m17n-gd.c (device_open): Check Mresolution param and set
1034         frame->dpi.
1035
1036         * m17n-X.c (MWDevice): New member resy.
1037         (xfont_open): Set ascent, descent, and max_advance members of
1038         rfont.
1039         (xft_open): Likewise.
1040         (device_open): Compare also screen_num to find a device.  Set
1041         device->resy and frame->dpi.
1042
1043         * internal-gui.h (MFrame): New member dpi.
1044
1045         * font.h (MRealizedFont): New member max_advance.
1046
1047         * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
1048         (mfont__init): Don't initialize Mascent, Mdescent.
1049         (Mascent, Mdescent): Delete these variables.
1050         (mfont_get_prop): Fix previous change.  Check Mfont_ascent and
1051         Mfont_descent instead of Mascent and Mdescent.
1052         (mfont_put_prop): Allow negative size.
1053         (mfont_find): Handle the case of spec->size < 0.  Fix previous
1054         change.
1055         (mfont_list): Handle the case of spec->size < 0.
1056         (mfont_check): Likewise.
1057
1058         * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
1059         (fc_get_pattern): Handle the case of font->size < 0.
1060         (ft_open): Set ascent, descent, and max_advance members of rfont.
1061         (ft_find_metric): Improve rounding.
1062         (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
1063         FC_SIZE.
1064
1065         * face.c (mface__realize): Handle the case of font->size < 0.
1066
1067 2005-08-22  Kenichi Handa  <handa@m17n.org>
1068
1069         * coding.c (MConverterStatus): Change the member buf to union.
1070         (mconv_buffer_converter): Add const to the arg buf.
1071         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
1072         (mconv_decode): Adjusted for the change of MConverterStatus.
1073         (mconv_encode_range): Likewise.
1074
1075         * m17n.h (mconv_buffer_converter): Prototype adjusted.
1076         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
1077
1078 2005-08-20  Kenichi Handa  <handa@m17n.org>
1079
1080         * m17n-gui.h (mfont_from_name): Prototype adjusted.
1081         (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
1082
1083         * m17n-X.c (xfont_open): Set members ascent, descent, and
1084         max_advance of rfont.
1085         (xft_open): Likewise.
1086
1087         * font-ft.c (ft_open): Set members ascent, descent, and max_advance
1088         of rfont.
1089         (mfont__ft_parse_name): Add const to the arg name.
1090
1091         * font.c (xlfd_parse_name): Add const to the arg name.  Call
1092         mfont__set_property instead of mfont_set_spec.  Set font->spacing.
1093         (xlfd_unparse_name): Handle spacing.
1094         (mfont__init): Initialize new variables.
1095         (mfont__id): Handle spacing.
1096         (mfont__merge): Likewise.
1097         (mfont__set_spec): This function deleted.
1098         (mfont__parse_name_into_font): Add const to the arg name.  Fix the
1099         condition of calling mfont__ft_parse_name.
1100         (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
1101         (mfont_get_prop): Handle properties spacing, ascent, descent,
1102         and max-advance.
1103         (mfont_find): Return a realized font.
1104         (mfont_from_name): Add const to the arg name.
1105
1106         * font.h (enum MFontProperty): New member MFONT_SPACING.
1107         (enum MFontSpacing): New enum.
1108         (MFont): New members spacing and max_advance.
1109         (mfont__ft_parse_name): Prototype adjusted.
1110         (mfont__set_spec): Extern deleted.
1111         (mfont__parse_name_into_font): Prototype adjusted.
1112
1113 2005-08-19  Kenichi Handa  <handa@m17n.org>
1114
1115         * m17n-gui.h (mfont_parse_name): Prototype adjusted.
1116
1117         * font.c (mfont_list): If FONT is null, use a temporary font.
1118         (mfont_parse_name): Add const to the arg name.
1119
1120 2005-08-18  Kenichi Handa  <handa@m17n.org>
1121
1122         * word-thai.c: Surround code by #ifdef and #endif to escape from
1123         doxygen.
1124
1125         * font-ft.c: Mostly re-written.
1126
1127         * font-flt.c (FontLayoutCmdOTF): This type deleted.
1128         (FontLayoutCmd): Type of the member otf changed..
1129         (load_otf_command): Adjusted for the format change of otf command.
1130         (load_command): Likewise.
1131         (free_flt_command): Unref cmd->body.otf.
1132         (run_otf): Ajusted for the type change of otf_cmd.
1133         (run_command): Ajusted for the type change of otf_cmd.  On
1134         debugging, print ctx->combining_code.
1135         (mfont__flt_run): Initialize ctx's members code_offset,
1136         combining_code, and left_padding to 0.
1137
1138         * face.h (struct MRealizedFace): New member font.
1139         (mface__realize): Prototype adjusted.
1140
1141         * face.c (find_realized_face): New arg font.
1142         (find_realized_face): Adjusted for the change of MFont.
1143         (mface__init): Call M17N_OBJECT_ADD_ARRAY.
1144         (mface__fini): Don't call mdebug__report_object.
1145         (mface__realize): New arg font.
1146         (mface__for_chars): Adjusted for the change of mfont__encode_char.
1147         Optimize the latin case.
1148         (mface__free_realized): Free rface->font.
1149         (mface__update_frame_face): Adjusted for the change of mface__realize.
1150         (mface_equal): New function.
1151
1152         * draw.c (Mcommon): New variable.
1153         (visual_order): Args to mfont__encode_char changed.
1154         (compose_glyph_string): Handle Mfont text property.
1155         (layout_glyphs): Adjusted for the change of MFont.
1156         (mdraw__init): Initialize Mcommon.
1157         (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
1158
1159         * font.h (enum MFontType): Members completely changed.
1160         (enum MFontProperty): Move MFONT_SIZE to the tail.
1161         (enum MFontSource): New enum.
1162         (struct MFont): New members type, source, sizes, file, capability,
1163         and encoding.
1164         (struct MRealizedFont): Type of member font changed. Members
1165         score, status, and encoding deleted.
1166         (MFontScore): New type.
1167         (MFontList): Member changed.
1168         (struct MFontDriver): New member has_char.  Types of members
1169         changed.
1170         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
1171         (Mapple_roman): Extern them.
1172         (OTF_Tag): Typedefed if not HAVE_OTF.
1173         (enum MFontOpenTypeTable): New enum.
1174         (MFontCapability): New type.
1175         (mfont__ft_drive_otf): Prototype adjusted.
1176         (mfont__score): Extern deleted.
1177         (mfont__merge): Extern it.
1178         (mfont__has_char): Extern it.
1179         (mfont__encode_char): Prototype adjusted.
1180         (mfont__open): Extern it.
1181         (mfont__set_spec): Prototype adjusted.
1182         (mfont__get_capability): Extern it.
1183
1184         * font.c: Include "fontset.h".
1185         (M_font_capability, M_font_list, M_font_list_len): New variables.
1186         (font_score_priority): Change order of initial elements.
1187         (font_score_shift_bits): Fix array size.
1188         (common_weight): Add "thin", "semibold", and "heavy".
1189         (common_stretch): Add "ultracondensed", "extracondensed",
1190         "extraexpanded", and "utltraexpand".
1191         (font_weight_regular, font_weight_normal, font_weight_medium): New
1192         variables.
1193         (gen_font_name): This function deleted.
1194         (find_encoding): Set font->encoding.
1195         (OTF_tag): New function.
1196         (otf_script_list): New variable.
1197         (load_otf_script_list): New function.
1198         (find_script_from_otf_tag): New function.
1199         (xlfd_parse_name): Set font->type and font->source.
1200         (mfont__free_realized): Free chains rfonts.
1201         (font_score): Renamed from mfont__score.
1202         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
1203         (Mapple_roman): New variables.
1204         (mfont__init): Initilize new variables.  Initalize
1205         default_encoding.encoding_name and
1206         default_encoding.encoding_charset to Municode_full and
1207         mcharset__unicode.  Use SAFE* macros for allocating filepath
1208         buffer.
1209         (mfont__fini): Free otf_script_list.
1210         (mfont__id): New function.
1211         (mfont__match_p): Check also capability member of MFont.
1212         (mfont__merge): New funciton.
1213         (mfont__set_spec_from_face): Set type and source members.
1214         (mfont__set_spec_from_plist): Set capability and type members.
1215         (mfont__select): Argument changed.
1216         (mfont__available): New function.
1217         (compare_font_score): New function.
1218         (mfont__list): New function.
1219         (mfont__open): Return a realized font.
1220         (mfont__resize): Adjusted for the change of MFont.
1221         (mfont__has_char): New function.
1222         (mfont__encode_char): Argument changed.
1223         (mfont__set_spec): Argument changed.
1224         (free_font_capability): New function.
1225         (mfont__get_capability): New function.
1226         (MFontfile): New variable.
1227         (mfont_get_prop): Adjusted for the change of MFont.
1228         (mfont_put_prop): Likewise.
1229         (mfont_set_selection_priority): Fix the way of setting
1230         font_score_priority[].
1231         (mfont_find): Use mfont__list instead of mfont__select.
1232         (mfont_resize_ratio): Adjusted for the change of MFont.
1233         (mfont_list): Use mfont__list.
1234         (mfont_check): New function.
1235         (font_score): Make it static.
1236
1237         * fontset.h (mfont__realize_fontset): Prototype adjusted.
1238         (mfont__lookup_fontset): Likewise.
1239
1240         * fontset.c (struct MFontset): Delete member font_spec_list.
1241         (struct MRealizedFontset): Type of member spec changed.  New
1242         member request.
1243         (load_font_group): Arg spec_list deleted.
1244         (load_fontset_contents): Adjusted for the change of fontset_def.
1245         (free_fontset): Fix the way of freeing fontset elements.
1246         (realize_fontset_elements): Argument changed.
1247         (get_per_script): New function.
1248         (free_realized_fontset_elements): Fix the way of feeing rfontset
1249         elements.
1250         (update_fontset_elements): Fix args to realize_fontset_elements.
1251         (mfont__realize_fontset): New arg spec.
1252         (try_font_list): New function.
1253         (try_font_group): New arg request.  Use try_font_list.
1254         (mfont__lookup_fontset): New arg ignore_fallback.  Fix arg to
1255         try_font_group.
1256         (mfontset): Adjusted for the change of MFontset.
1257         (mfontset_copy): Likewise.  Don't share plists.
1258         (mfontset_modify_entry): Adjusted for the change of MFontset.
1259         (mfontset_lookup): Call get_per_script.
1260         (mdebug_dump_fontset): Print also the address of fonts.
1261
1262         * input.c (shift_state): Don't reset ic_info->vars.
1263         (take_action_list): Call MDEBUG_PRINT fore calling
1264         take_action_list.
1265
1266         * internal-gui.h (MFontDriver): Don't typedef it here.
1267
1268         * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
1269         (MXFont): This type deleted.
1270         (MFontX): New type.
1271         (struct _MFontX): New struct.
1272         (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
1273         (MDisplayInfo): Member base_font_list deleted.
1274         (DEFAULT_FONT): Definition changed.
1275         (FALLBACK_FONT): This maclr deleted.
1276         (free_display_info): Adjusted for the change of MDisplayInfo.
1277         (free_device): Argument to mfont__free_realized changed.
1278         (xfont_driver): Adjusted for the change of MFontDriver.
1279         (xfont_registry_list): Use MFontX instead of MXFont.
1280         (MRealizedFontX): Renamed from MXFontInfo.
1281         (xfont_select): Return the font found first.
1282         (close_xfont): Change MXFontInfo to MRealizedFontX.
1283         (xfont_open): Return the realized font.
1284         (xfont_find_metric): Get xfont from rfont->fontp.
1285         (xfont_has_char): New function.
1286         (xfont_encode_char): Adjusted for the argument change.
1287         (xfont_render): Get xfont from rfont->fontp.
1288         (xfont_list): Adjusted for the argument change.
1289         (MRealizedFontXft): Renamed from MXftFontInfo.
1290         (xft_driver): Ajusted for the change of MFontDriver.
1291         (close_xft): Change MXtfFontInfo to MRealizedFontXft
1292         (xft_open_font): Argument changed.
1293         (xft_open): Argument changed.  Return the realized font.
1294         (xft_find_metric): Get xft_font from rfont->fontp.
1295         (xft_has_char, xft_encode_char): New functions.
1296         (xft_render): Change MXftFontInfo to MRealizedFontXft.  Open a
1297         font if not yet opened.
1298         (device_open): Don't set frame->font.
1299
1300         * m17n-gd.c (gd_font_driver): Adjusted for the change of
1301         MFontDriver.
1302         (gd_font_open): New function.
1303         (gd_render): Don't use the local variable ft_info.
1304         (device_init): Adjusted for the change of gd_font_driver.
1305
1306         * textprop.c (mtext__prop_init): Initialize text_property_table.
1307         Call M17N_OBJECT_ADD_ARRAY.
1308         (mtext__prop_fini): Don't call mdebug__report_object.
1309
1310         * plist.c (mplist__init): Initialize plist_table.
1311         (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
1312         (mplist__fini): Don't call mdebug__report_object.
1313
1314         * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
1315         (mtext__fini): Don't call mdebug__report_object.
1316         (MTEXT_FORMAT_UTF_16): Correct type.
1317         (mtext_data): New function.
1318         (mtext_text): Fix calculation of limit and args to
1319         find_char_backward.
1320
1321         * language.c: Include "plist.h".
1322         (M_script_lang_list): New variable.
1323         (mlang__init): Read languages and their information from m17n
1324         database.
1325         (mlanguage__list): New function.
1326         (Miso639_1, Miso639_2): New variables.
1327
1328         * language.h (mlanguage__list): Extern it.
1329
1330         * database.c (get_database_stream): Use SAFE_* macros for
1331         allocating and freeing path.
1332         (mdatabase__init): Likewise.
1333
1334         * symbol.c (msymbol__fini): Don't free symbols here.
1335         (msymbol__free_table): New function.
1336         (msymbol_is_managing_key): New function.
1337
1338         * symbol.h (msymbol__free_table): Extern it.
1339         (msymbol__list): Extern it.
1340
1341         * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
1342         New macros.
1343         (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
1344         (struct _M17NObjectArray): New member name and next.
1345         (mdebug__add_object_array): Extern it.
1346         (M17N_OBJECT_ADD_ARRAY): New macro.
1347         (mdebug__report_object): Don't extern it.
1348
1349         * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
1350
1351         * m17n-gui.c (free_frame): Don't free frame->font.
1352         (null_device_fini): Fix code for freeing
1353         null_device.realized_font_list.
1354         (m17n_fini_win): Free interface.
1355         (mframe): Cast the return value of dlsym.  Set frame->font here.
1356         (mframe_get_prop): Check frame->rface->rfont before accessing the
1357         member font.
1358
1359         * m17n-gui.h (Mfontfile): Extern it.
1360         (mfont_check): Extern it.
1361         (mface_equal): Extern it.
1362
1363         * m17n-core.c: Include "symbol.h".
1364         (report_header_printed): This variable deleted.
1365         (object_array_root): New variable.
1366         (report_object_array): New function.
1367         (mdebug__report_object): This function deleted.
1368         (mdebug__add_object_array): New function.
1369         (m17n_init_core): Call mchartable_init () before mtext_init ().
1370         (m17n_fini_core): Call report_object_array (if necessary) and
1371         msymbol__free_atable at the end.
1372
1373         * m17n-core.h (msymbol_is_managing_key): Extern it.
1374         (mtext_data): Extern it.
1375         (MTEXT_FORMAT_UTF_16): Correct type.
1376         (M17NLIB_MINOR_VERSION): Changed to 3.
1377         (M17NLIB_VERSION_NAME): Changed to "1.3.0".
1378         
1379         * chartab.c (mchartable__init): Initalize chartable_table.count.
1380         (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
1381         mdebug__report_object.
1382
1383 2005-05-26  Kenichi Handa  <handa@m17n.org>
1384
1385         * m17n.h (Miso639_1, Miso639_2): Extern them.
1386
1387         * symbol.h (msymbol__list): Extern it.
1388
1389         * symbol.c (msymbol__list): New function.
1390
1391 2005-05-19  Kenichi Handa  <handa@m17n.org>
1392
1393         * input-gui.c (minput__win_init): Don't change the value of
1394         minput_driver.
1395
1396 2005-05-16  Kenichi Handa  <handa@m17n.org>
1397
1398         * m17n-core.c (m17n_object): Be sure to initialize all members.
1399
1400         * font-ft.c (fc_decode_prop): Fix args to msymbol.
1401
1402 2005-05-09  Kenichi Handa  <handa@m17n.org>
1403
1404         * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
1405
1406 2005-04-27  Kenichi Handa  <handa@m17n.org>
1407
1408         * language.c (mlang__init): Add "an" (Aragonese).
1409
1410         * word-thai.c: Add support for libthai.
1411         (mtext__word_thai_init): Initialize wordseg library conditionaly.
1412         (mtext__word_thai_fini): Finalize wordseg library conditionaly.
1413
1414         * mtext.c: Include "word-thai.h" conditionaly.
1415         (mtext__init): Call mtext__word_thai_init conditionaly.
1416         (mtext__fini): Call mtext__word_thai_fini conditionaly.
1417
1418         * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
1419         not WORDCUT_LD_FLAGS.
1420
1421 2005-04-19  Kenichi Handa  <handa@m17n.org>
1422
1423         * word-thai.c (wordseg_propertize): Always unref the attached
1424         property.
1425         (thai_wordseg): Don't unref the property.
1426
1427 2005-04-18  Kenichi Handa  <handa@m17n.org>
1428
1429         * word-thai.c: Include stdlib.h.
1430         (wordseg_propertize): Add dummy function for the case that wordcut
1431         library doesn't exist.
1432         (wordseg_propertize): Fix for old wordcut library.
1433
1434 2005-04-16  Kenichi Handa  <handa@m17n.org>
1435
1436         * word-thai.c: Include <stdio.h>.
1437
1438 2005-04-15  Kenichi Handa  <handa@m17n.org>
1439
1440         * draw.c: Include mtext.h.
1441         (linebreak_table, M_break_at_space, M_break_at_word)
1442         (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
1443         (compose_glyph_string): Check POS before getting Mface text
1444         property.
1445         (truncate_gstring): Give correct TO arg to line_break function.
1446         (GET_LB_TYPE): New macro.
1447         (find_break_backward, find_break_forward): New functions.
1448         (mdraw__init): Initialize the above new variables.
1449         (mdraw__fini): Free linebreak_table.
1450         (mdraw_default_line_break): Use find_break_backward and
1451         find_break_forward.
1452
1453         * word-thai.c: New file.
1454
1455         * word-thai.h: New file.
1456
1457         * mtext.c: Include word-thai.h.
1458         (wordseg_func_table): New variable.
1459         (mtext__init): Initialize wordseg_func_table and call
1460         mtext__word_thai_init.
1461         (mtext__fini): Call mtext__word_thai_fini, free
1462         wordseg_func_table.
1463         (MTextWordsegFunc): New type.
1464         (mtext__word_segment): New function.
1465
1466         * mtext.h (wordseg_func_table): Extern it.
1467         (mtext__word_segment): Extern it.
1468
1469         * m17n.c (m17n_init): Fix typo (== -> =).
1470
1471         * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
1472         (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
1473
1474         * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
1475         (MTEXTPROP_VAL): New macros.
1476
1477         * input.c (DLOPEN_SHLIB_EXT): Don't define it.
1478
1479 2005-04-07  Kenichi Handa  <handa@m17n.org>
1480
1481         * database.c (load_chartable): Fix pursing of symbol name.
1482
1483 2005-03-24  Kenichi Handa  <handa@m17n.org>
1484
1485         * m17n.c (m17n_init): Fix typo (== -> =).
1486
1487 2005-03-11  Kenichi Handa  <handa@m17n.org>
1488
1489         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
1490
1491         * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
1492
1493         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
1494         first.
1495
1496 2005-03-09  handa  <handa@m17n.org>
1497
1498         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
1499         calling m17n_init ().
1500
1501         * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
1502         calling m17n_init_core ().
1503
1504 2005-02-28  Kenichi Handa  <handa@m17n.org>
1505
1506         * font-flt.c (mfont__flt_run): Add resulting code sequence in
1507         debug info.
1508
1509 2005-02-17  Kenichi Handa  <handa@m17n.org>
1510
1511         * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
1512         (M_description, M_command, M_variable): New variables.
1513         (load_im_info_keys): New variables.
1514         (load_im_info, check_command_keyseq, get_description_advance)
1515         (parse_command_list, get_command_list, parse_variable_list)
1516         (get_variable_list, input_method_hook): New functions.
1517         (command_list, variable_list): New variables.
1518         (minput__init): Put input_method_hook to Minput_method.
1519         Initialize M_description, M_command, M_variable, Mdetail_text,
1520         load_im_info_keys, command_list, variable_list.
1521         (minput__fini): Unref command_list, variable_list, load_im_info_keys.
1522         (Mdetail_text): New variable.
1523         (minput_get_description, minput_get_commands)
1524         (minput_assign_command_keys, minput_get_variables)
1525         (minput_set_variable): New functions.
1526
1527         * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
1528         (minput_assign_command_keys, minput_get_variables)
1529         (minput_set_variable): Extern them.
1530
1531         * plist.c (UNGETC): Just decrement st->p.
1532         (read_mtext_element): New arg skip.
1533         (read_integer_element): Likewise.
1534         (read_symbol_element): Likewise.
1535         (read_element): New arg KEYS.
1536         (mplist__from_plist): Don't increment ref-count of NULL object.
1537         (mplist__from_file): New arg KEYS.
1538         (mplist_put): Don't increment ref-count of NULL object.
1539         (mplist_add): Likewise.
1540         (mplist_push): Likewise.
1541         (mplist_set): Likewise.  Call M17N_OBJECT_UNREF unconditionally.
1542
1543         * plist.h (mplist__from_file): Prototype adjusted.
1544
1545         * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
1546         (get_database_stream): New function.
1547         (load_database): Use get_database_stream.
1548         (M_database_hook): New variable
1549         (mdatabase__init): Initialize M_database_hook.
1550         (mdatabase__load_for_keys): New function.
1551         (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
1552         function.
1553         (mdatabase_define): Free mdb->extra_info if necessary.
1554
1555         * database.h (mdatabase__dir_list, M_database_hook)
1556         (mdatabase__load_for_keys): Extern them.
1557         (MDatabaseHookFunc): New type.
1558
1559         * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
1560
1561 2004-12-27  Kenichi Handa  <handa@m17n.org>
1562
1563         * Version 1.2.0 released.
1564
1565 2004-12-27  Kenichi Handa  <handa@m17n.org>
1566
1567         * input.c (minput_filter): Don't reset ic->xxx_changed.
1568
1569         * mtext.c (mtext_from_data): Fix documentation.
1570
1571 2004-12-25  Kenichi Handa  <handa@m17n.org>
1572
1573         * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
1574         (M17NLIB_VERSION_NAME): Update to "1.2.".
1575
1576 2004-12-24  Kenichi Handa  <handa@m17n.org>
1577
1578         * input.c (reset_ic): Set key_unhandled to 0.
1579
1580 2004-12-21  Kenichi Handa  <handa@m17n.org>
1581
1582         * m17n-gui.h (mfont_from_spec): Delete extern.
1583
1584         * input-gui.c (win_callback): Handle Minput_reset.
1585         (minput__win_init): Register reset_ic as a callback for
1586         Minput_reset.
1587
1588         * input.c (reset_ic): New arg IGNORE which is ignored.  Caller
1589         changed.  At first, shift to the initial state.
1590         (minput__init): Initialize Minput_reset.  Register reset_ic as a
1591         callback for Minput_reset.
1592         (Minput_reset): New variable.
1593         (minput_filter): Always set ic->xxx_changed to 0.
1594         (minput_reset_ic): New function.
1595         (integer_value): Fix typo ('>' -> '<') and calculation of length
1596         of preedit text.
1597
1598         * m17n-core.c (merror_code): Change type to `int'.
1599
1600         * m17n-misc.h (merror_code): Adjust type.
1601
1602         * m17n.h (Minput_reset, minput_reset_ic): Extern them.
1603
1604         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
1605         (mtext_change_prop): Delete extern.
1606
1607         * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
1608         to `int'.  Move the documents to m17n-core.h.
1609
1610 2004-12-13  Kenichi Handa  <handa@m17n.org>
1611
1612         * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1613         (MTextProperty): Document it.
1614
1615 2004-12-09  Kenichi Handa  <handa@m17n.org>
1616
1617         * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1618
1619 2004-12-03  Kenichi Handa  <handa@m17n.org>
1620
1621         * internal.h (m17n__core_initialized, m17n__shell_initialized,
1622         m17n__gui_initialized): New externs.
1623
1624         * m17n-core.h (enum M17NStatus): New enum.
1625         (m17n_status): Extern it.
1626
1627         * m17n-core.c (core_initialized): Delete this variable.
1628         (m17n__core_initialized, m17n__shell_initialized,
1629         m17n__gui_initialized): New variables.
1630         (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1631         instead of core_initialized.
1632         (m17n_status): New function.
1633
1634         * m17n.c (shell_initialized): Delete this variable.
1635         (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1636         shell_initialized.
1637
1638         * m17n-gui.h (m17n_init_win): Adjust the prototype.
1639
1640         * m17n-gui.c (win_initialized): Delete this variable.
1641         (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1642         instead of gui_initialized.
1643
1644 2004-11-19  Kenichi Handa  <handa@m17n.org>
1645
1646         * input.c (reset_ic): Check if ic_info->state is NULL.
1647         (filter): If ic_info->state is NULL, return 0.
1648         (load_input_method): Don't unref `maps' it it's not created.
1649
1650 2004-11-15  Kenichi Handa  <handa@m17n.org>
1651
1652         * input.c (find_candidates_group): If INDEX is -1, find the last
1653         candidate group.
1654         (take_action_list): If the previous of the first candidate is
1655         requested, select the last candidate.
1656
1657 2004-11-08  Kenichi Handa  <handa@m17n.org>
1658
1659         * m17n-X.c (device_open): Try at most 32 fonts to find a
1660         non-autoscaled font.
1661
1662         * font.c (xlfd_parse_name): Fix previous change.
1663
1664 2004-11-05  Kenichi Handa  <handa@m17n.org>
1665
1666         * font.c: (commont_style): Include dummy elements "slanted" and
1667         "rslanted" to prefer "o" to "r" if "i" is requested.
1668
1669         * font-ft.c (ft_to_prop): Fix "oblique" entry.
1670
1671 2004-10-29  Kenichi Handa  <handa@m17n.org>
1672
1673         * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1674
1675         * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1676         New members smallest and larger.
1677         (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1678         (xfont_registry_list): Likewise.
1679         (xfont_select): Likewise.
1680         
1681
1682 2004-10-28  Kenichi Handa  <handa@m17n.org>
1683
1684         * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1685         font name comparison.
1686         (xfont_select): Fix logic for selecting a larger size font.
1687
1688 2004-10-25  Kenichi Handa  <handa@m17n.org>
1689
1690         * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1691         ">" actions.
1692
1693 2004-10-22  Kenichi Handa  <handa@m17n.org>
1694
1695         * input.c (update_candidate): Renamed from udpate_candidate.
1696         (take_action_list): Show more debugging info on arithmetic commands.
1697
1698         * m17n-X.c (device_open): Fix previous change.
1699
1700         * draw.c (compose_glyph_string): Don't get face property at the
1701         end of M-text.
1702
1703 2004-10-21  Kenichi Handa  <handa@m17n.org>
1704
1705         * draw.c (compose_glyph_string): Fix for the case of category
1706         being Mnil.
1707
1708 2004-10-19  Kenichi Handa  <handa@m17n.org>
1709
1710         * input.c (mdebug_mask): New variable.
1711         (shift_state): Print debug information.
1712         (take_action_list): Likewise.
1713         (handle_key): Likewise.
1714
1715 2004-10-14  Kenichi Handa  <handa@m17n.org>
1716
1717         * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1718
1719 2004-10-13  Kenichi Handa  <handa@m17n.org>
1720
1721         * m17n-X.c (device_open): Be sure to register at least one font
1722         driver.
1723
1724         * font-ft.c: Include <freetype/ftbdf.h> conditionally.  Check
1725         HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1726
1727 2004-10-12  Kenichi Handa  <handa@m17n.org>
1728
1729         * draw.c (alloc_gstring): Fix previous change.
1730
1731         * font-ft.c (ft_list_generic): Fix for the case of not
1732         HAVE_FONTCONFIG.
1733
1734         * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1735
1736         * font.c (mfont_list): If no font is found, return NULL.
1737         (load_font_encoding_table): Put entries of nil registry first.
1738         (find_encoding): Adjust for the above change.
1739
1740 2004-10-11  Kenichi Handa  <handa@m17n.org>
1741
1742         * m17n-gui.h (mfont_list): Adjust prototype.
1743
1744         * m17n-X.c (xfont_list): New arg maxnum.
1745
1746         * font.h (struct MFontDriver): Change prototype of <list>.
1747
1748         * font-ft.c (fc_generic_family_list): Delete it.
1749         (Mserif, Msans_serif, Mmonospace): Delete them.
1750         (M_generic_family_info): New variable.
1751         (enum GenericFamilyType): New enum.
1752         (struct GenericFamilyInfo): New struct.
1753         (generic_family_table): New variable.
1754         (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1755         iso8859-1.
1756         (add_font_info): Get style here.
1757         (ft_list_family): Don't initialize fc_config here.  Don't list
1758         generic families.
1759         (ft_list_generic): New function.
1760         (ft_select): Pay attention to generic familes here.
1761         (ft_open): Fix calculation of ascent and descent.
1762         (ft_list): Pay attention to generic families.
1763         (mfont__ft_init): Initialize M_generic_family_info,
1764         generic_family_table, and fc_config..
1765         (mfont__ft_fini): Finalize generic_family_table.
1766
1767         * draw.c (compose_glyph_string): Use more constant font for
1768         glyphs.  Adjust for the member change in MGlyph.
1769         (layout_glyph_string): Adjust for the member change in MGlyph.
1770         (alloc_gstring): Intilize scracth_glyph to avoid
1771         compose_glyph_string on it.
1772         (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1773         (mdraw_coordinates_position): Fix previous change.
1774
1775         * internal-gui.h (glyph_category): New enum.
1776         (MGlyph): Change type of <category> to enum glyph_category.
1777
1778         * face.c (mface__realize): Delete args langauge and charset.
1779         (mface__for_chars): Fix for the case that glyphs have different
1780         rfaces.
1781         (mface__update_frame_face): Adjust for mface__realize change.
1782
1783         * face.h (mface__realize): Adjust prototype.
1784
1785 2004-10-05  Kenichi Handa  <handa@m17n.org>
1786
1787         * language.c (mlang__init): Add Akan.
1788
1789 2004-10-04  Kenichi Handa  <handa@m17n.org>
1790
1791         * font-ft.c (add_font_info): Add instead of push the element.
1792         (ft_list_family): For generic fonts, try all
1793         substituted. families.
1794
1795         * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
1796         (run_rule): Don't update cluster range here.
1797         (run_command): Update cluster range on appending a glyph.
1798         (run_otf): Update cluster range for glyphs generated by OTF.
1799
1800 2004-10-02  Kenichi Handa  <handa@m17n.org>
1801
1802         * m17n-X.c (device_open): Handle Mfont key in PLIST.
1803
1804 2004-09-30  Kenichi Handa  <handa@m17n.org>
1805
1806         * font-ft.c (ft_select): Ignore family on calling mfont__score.
1807
1808 2004-09-30  Kenichi Handa  <handa@m17n.org>
1809
1810         * font.h: Include <fontconfig/fontconfig.h>.
1811         (MFTInfo): New member langset.
1812         (mfont__encoding_list): Extern it.
1813
1814         * font.c (mfont__encoding_list): New function.
1815         (mdebug_dump_font_list): New function.
1816
1817         * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
1818         (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
1819         variables.
1820         (ft_family_list): New variable.
1821         (set_font_info): New arg basep.  Callers changed.
1822         (fc_list): Check the return value of FcPatternGetString.
1823         (add_font_info): New arg plist.  Callers changed. Update
1824         ft_family_list.
1825         (ft_list_family): New function (merged fc_list and ft_list_all).
1826         (ft_select): Use ft_list_family.
1827         (ft_list): Likewise.  If FONT is not NULL, check all fonts.  Fix
1828         typo (== -> !=).
1829         (mfont__ft_init): Initialize above new variables.
1830         (mfont__ft_fini): Free ft_family_list.
1831         (STRDUP_LOWER): New macro.
1832         (set_font_info): Use STRDUP_LOWER.
1833         (ft_list_family): Avoid duplicate addition of font path.  Use
1834         STRDUP_LOWER.
1835         (fc_decode_prop): Fix typo.
1836
1837         * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
1838         (xfont_registry_list): Change argument disp_info to frame.
1839         Callers changed.
1840         (xfont_list_all): New function.
1841         (xfont_list): If FONT is not NULL, check all fonts.
1842
1843 2004-09-28  Kenichi Handa  <handa@m17n.org>
1844
1845         * m17n-X.c (MXFont, MXFontList): New types.
1846         (MDisplayInfo): Delete members font_registry_list,
1847         iso8859_1_family_list, iso10646_1_family_list, new members
1848         font_list, base_font_list.
1849         (free_display_info): Adusted for the change of MDisplayInfo.
1850         (xfont_driver): Initialize with xfont_list.
1851         (font_compare): New function.
1852         (build_font_list): Deleted.
1853         (xfont_registry_list): New function.
1854         (xfont_select): Use xfont_registry_list.
1855         (xfont_list): New function.
1856         (device_open): Adusted for the change of MDisplayInfo.
1857
1858         * font-ft.c (add_font_info): New arg languages.  Callers changed.
1859         (fc_list): Get languages from fonts..
1860         (ft_list_all): Renamed from ft_list.  Callers changed.
1861         (ft_list): New function.
1862         (mfont__ft_driver): Initalize with ft_list.
1863
1864         * font.c (mfont_list): New function.
1865
1866         * font.h (struct MFontDriver): New member `list'.
1867         (MFTInfo): New member languages.
1868
1869         * m17n-gui.h (mfont_list): Extern it.
1870
1871 2004-09-27  Kenichi Handa  <handa@m17n.org>
1872
1873         * internal-gui.h (struct MGlyphString): Delete members mt,
1874         sub_width, sub_lbrearing, sub_rbearing, and region.
1875
1876         * draw.c (MSubTextExtents): New type.
1877         (layout_glyphs): New arg extents.  Set its members.
1878         (layout_glyph_string): Adjusted for the above change.
1879         (alloc_gstring): Don't set gstring->mt.
1880         (truncate_gstring): Call line_break function with mt instead of
1881         gstring->mt.
1882
1883 2004-09-22  Kenichi Handa  <handa@m17n.org>
1884
1885         * mtext.c (count_utf_16_chars): Count each code of invalid
1886         surrogates as one.
1887
1888 2004-09-19  Kenichi Handa  <handa@m17n.org>
1889
1890         * mtext.c (default_utf_16, default_utf_32): Rename them to
1891         MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively.  Caller
1892         changed.
1893
1894         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
1895         them.
1896
1897 2004-09-13  Kenichi Handa  <handa@m17n.org>
1898
1899         * draw.c (Mlatin): Don't declare it here.
1900         (visual_order): Fix reordering of combining characters.
1901         (compose_glyph_string): Fix detection of script.
1902         (layout_glyphs): Don't fix reordering of combining characters
1903         here.
1904         (layout_glyph_string): Pay attention to
1905         control->disable_overlapping_adjustment.
1906         (truncate_gstring): Include at least on character in a line.
1907         (get_gstring): Always scan one full line.
1908         (mdraw__init): Don't initialize Mlatin here.
1909         (mdraw_text_per_char_extents): Fix iteration.  If a glyph doesn't
1910         have a font, use ascent/descent of an ASCII font.  Allow
1911         ink_array_return and logical_array_return to be NULL.
1912         (mdraw_coordinates_position): Fix iteration.
1913
1914         * font-ft.c (MFTtoProp): Member completely changed.
1915         (ft_to_prop): Adjusted for the above change.
1916         (ft_to_prop_size): Likewise.
1917         (set_font_info): Adjusted for the change of MFTtoProp.
1918         (fc_generic_family_list): New variable.
1919         (fc_list): Add special handling of generic font names.
1920         (mfont__ft_init): Adjusted for the change of MFTtoProp.
1921         Initialize fc_generic_family_list.
1922         (mfont__ft_fini): Don't free ft_to_prop.  Free
1923         fc_generic_family_list.
1924         (FC_vs_M17N_font_prop): New type.
1925         (fc_weight_table, fc_slant_table, fc_width_table): New variables.
1926         (fc_decode_prop, fc_encode_prop): New functions.
1927         (mfont__ft_parse_name): Use fc_decode_prop.
1928         (mfont__ft_unparse_name): Use fc_encode_prop.
1929
1930         * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
1931         (MWDevice): Add member realized_font_list.
1932         (free_display_info): Don't free disp_info->realized_font_list.
1933         (free_device): Free device->realized_fontset_list.
1934         (xft_find_metric): Use gstring->frame instead of rfont->frame.
1935         (device_open): Don't initialize disp_info->realized_font_list.
1936         (device_open): Initialize device->realized_font_list and set it to
1937         frame->realized_font_list.
1938
1939         * fontset.c (try_font_group): New function.
1940         (mfont__lookup_fontset): Use try_font_group.
1941
1942         * font.c (common_weight): Change the order of "regular".
1943
1944         * face.c (Mlatin): Don't make it static.
1945         (mface__realize): Be sure to set work_gstring.frame.
1946         (mface__for_chars): Likewise.
1947
1948         * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
1949         MTEXT_FORMAT_UTF_8.
1950
1951         * internal-gui.h (Mlatin): Extern it.
1952
1953         * m17n-gui.h (MDrawControl): New member
1954         disable_overlapping_adjustment.
1955
1956 2004-09-06  Kenichi Handa  <handa@m17n.org>
1957
1958         * font-flt.c (run_otf): Fix typo ('}'->']').
1959
1960         * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
1961         (COMBINING_PRECOMPUTED_P): New macros.
1962
1963         * draw.c (layout_glyphs): Handle precomputed combining code.
1964
1965         * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
1966         precomupted combining code.
1967
1968 2004-09-03  Kenichi Handa  <handa@m17n.org>
1969
1970         * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
1971         otf_gstring.glyphs.
1972
1973 2004-08-27  Kenichi Handa  <handa@m17n.org>
1974
1975         * face.c (mface_put_prop): If the new value is the same as the
1976         current one, don't increment frame->tick.
1977
1978 2004-08-25  Kenichi Handa  <handa@m17n.org>
1979
1980         * fontset.c (mfontset): Initialize font_spec_list member.
1981         (mfontset_copy): Load fontset if necessary.
1982
1983         * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
1984         'metrics' to for C++.
1985
1986         * draw.c (mdraw_glyph_info): Adjusted for the member name change
1987         (this -> metics).
1988
1989 2004-08-16  Kenichi Handa  <handa@m17n.org>
1990
1991         * Version 1.1.0 released.
1992
1993 2004-08-13  Kenichi Handa  <handa@m17n.org>
1994
1995         * language.c (mlang__init): Add Dhivehi.
1996
1997         * m17n-gui.c (Mx, Mfreetype): Delete it.
1998         (m17n_init_win): Don't initialize Mx and Mfreetype here.
1999
2000         * m17n-gui.h (Mfreetype, Mxft): Extern them.
2001         (mfont_resize_ratio): Extern it.
2002         (MDrawGlyphInfo): New member logical_width;
2003         (MDrawGlyph): New type.
2004         (mdraw_glyph_list): Prototype adjusted.
2005
2006         * m17n-X.c (xfont_open): Set type and fontp members.
2007         (xft_open): Likewise.
2008
2009         * internal-gui.h (Mx, Mfreetype): Delete extern.
2010
2011         * font.h (struct MRealizedFont): New member type and fontp.
2012
2013         * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
2014         (Mx, Mfreetype): Declare here.
2015         (Mxft): New variable.
2016         (mfont_resize_ratio): New function.
2017
2018         * font-ft.c (ft_open): Set type and fontp members.
2019
2020         * draw.c (mdraw_glyph_list): Argument type changed.  Don't set
2021         glyph_code member.
2022
2023 2004-08-11  Kenichi Handa  <handa@m17n.org>
2024
2025         * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
2026         FT_LOAD_DEFAULT.
2027
2028 2004-08-06  Kenichi Handa  <handa@m17n.org>
2029
2030         * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
2031         feature to apply.
2032
2033         * font-flt.c (run_otf): Print debugging information if necessary.
2034
2035 2004-08-05  Kenichi Handa  <handa@m17n.org>
2036
2037         * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff.  Support
2038         positioning_type 5 and 6.  Switch simplified.
2039
2040 2004-08-04  Kenichi Handa  <handa@m17n.org>
2041
2042         * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
2043
2044 2004-08-02  Kenichi Handa  <handa@m17n.org>
2045
2046         * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
2047         set val to 1 even if it is greater than 1.
2048
2049         * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
2050
2051 2004-07-29  Kenichi Handa  <handa@m17n.org>
2052
2053         * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
2054         debugging information.
2055
2056         * internal.h (MDEBUG_PRINT5): New macro.
2057
2058         * draw.c (layout_glyphs): Don't combine a zero width glyph with
2059         the previous one if the zero width glyph has left or right
2060         padding.
2061
2062 2004-07-26  Kenichi Handa  <handa@m17n.org>
2063
2064         * m17n-X.c (xft_render): Pay attention to members left_padding and
2065         right_padding of MGlyph.
2066
2067         * draw.c (visual_order): Allocate one more elements for arrays as
2068         a workaround of fribidi bug.
2069         (layout_glyphs): Fix previous change. Check MGlyph->combining_code
2070         instead of MGlyph->bidi_sensitive.
2071         (layout_glyph_string): Pay attentinon to
2072         control->orientation_reversed when padding at the head or tail.
2073         Fix adjustment of space glyph width.
2074         (get_gstring): If cursor_width or cursor_bidi is changed, don't
2075         use a cache.
2076
2077         * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
2078         instead of MGlyph->bidi_sensitive.
2079
2080         * internal-gui.h (MGlyph): Delete member bidi_sensitive.
2081
2082 2004-07-26  Kenichi Handa  <handa@m17n.org>
2083
2084         * draw.c (visual_order): Don't treat combined glyphs specially.
2085         (layout_glyphs): Don't get metrics glyphs that are already ready.
2086         Pay attention to MGlyph->bidi_sensitive.  Combine a glyph of zero
2087         width with the previous one. 
2088         (draw_background): Fix bar cursor position on a r2l glyph.
2089
2090         * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
2091         (run_rule): Fix place of updating cluster_begin_pos and
2092         cluster_end_pos here.
2093         (run_otf): Don't set left_padding.
2094
2095         * font-ft.c (adjust_anchor): Type of argument `code' changed.
2096         Caller changed.
2097         (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
2098         Fix handling of GPOS.
2099         (mfont__ft_drive_gpos): Delete this function.
2100
2101         * font.h (mfont__ft_drive_otf): Renamed back from
2102         mfont__ft_drive_gsub.
2103         (mfont__ft_drive_gpos): Delete extern.
2104
2105         * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
2106         (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
2107
2108 2004-07-23  Kenichi Handa  <handa@m17n.org>
2109
2110         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
2111         the same bidi level.
2112
2113         * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
2114
2115 2004-07-22  Kenichi Handa  <handa@m17n.org>
2116
2117         * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
2118
2119 2004-07-20  Kenichi Handa  <handa@m17n.org>
2120
2121         * draw.c (render_glyphs): Fix checking of g->code validity.
2122
2123         * face.c (mface__realize): Set g.type.
2124
2125 2004-07-18  Kenichi Handa  <handa@m17n.org>
2126
2127         * Makefile.am: Prepend ${top_srcdir} to all *.la in
2128         *_LIBADD/*_LDADD.
2129
2130         * m17n-gui.c (mframe): Print error message give by dlopen to
2131         stderr.
2132
2133 2004-07-16  Kenichi Handa  <handa@m17n.org>
2134
2135         * draw.c (compose_glyph_string): Improve the way of deciding a
2136         script.  For a character that doesn't have script property, use
2137         the last non-latin script.
2138
2139         * font-ft.c (fc_list): Cancel previous change.
2140         (mfont__ft_init): Add more entries in ft_to_prop_name.
2141
2142 2004-07-15  Kenichi Handa  <handa@m17n.org>
2143
2144         * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
2145         previous or next character glyphs.
2146
2147 2004-07-14  Kenichi Handa  <handa@m17n.org>
2148
2149         * draw.c (compose_glyph_string): Be sure to set codes for glyphs
2150         of type GLYPH_SPACE.
2151
2152         * fontset.c (mfont__lookup_fontset): If glyph type is
2153         GLYPH_SPACE, get codes for SPACE.
2154
2155         * internal-gui.h (Mfont): Delete extern.
2156
2157         * m17n-gui.h (Mfont): Delete duplicated extern.
2158
2159 2004-07-13  Kenichi Handa  <handa@m17n.org>
2160
2161         * font-ft.c (DEVICE_DELTA): New macro.
2162         (adjust_anchor): New function.
2163         (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf.  Drive
2164         only GSUB.
2165         (mfont__ft_drive_gpos): New function.
2166
2167         * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
2168         (FontLayoutContext): Delete member `rfont'.
2169         (run_otf): Set g->otf_cmd.  Call 
2170         (mfont__flt_run): Don't set ctx.rfont.  Call mfont__ft_decode_otf
2171         only whne HAVE_OTF is defined.
2172
2173         * fontset.c: Include "config.h".
2174
2175         * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
2176         (MGlyph): New member otf_cmd.
2177
2178         * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
2179         (mfont__ft_drive_gpos): Extern it.
2180
2181         * face.c: Include "config.h".
2182
2183         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
2184
2185         * input-gui.c: Include "config.h".
2186
2187         * plist.c: Include "config.h".
2188
2189 2004-07-06  Kenichi Handa  <handa@m17n.org>
2190
2191         * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
2192         internal-gui.h: Cancel previous changes.
2193
2194         * m17n-gd.h: Delete it.
2195
2196         * Makefile.am (libm17n_core_la_LIBADD): New variable.
2197         (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
2198         @XML2_LD_FLAGS@ to above.
2199         (libm17n_la_LIBADD): Add -ldl.
2200         (libm17n_la_LDFLAGS): Add -export-dynamic.
2201         (X_LD_FLAGS): Fix the order of linking.
2202         (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
2203         (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
2204         (libm17n_X_la_LDFLAGS): Add -module.
2205         (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
2206         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
2207         (libm17n_gd_la_LDFLAGS): Add -module.
2208         (include_HEADERS): Delete m17n-gd.h.
2209
2210 2004-06-30  Kenichi Handa  <handa@m17n.org>
2211
2212         * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
2213         (MDeviceLibraryInterface): Delete it.
2214         (register_device_library): Delete it.
2215         (m17n__device_library_list): Renamed from device_library_list.
2216
2217         * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
2218         (m17n_init_win): Adjust prototype.
2219
2220         * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
2221         (m17n_init_gd): New function. 
2222
2223         * m17n-gd.h: New file.
2224
2225         * m17n-X.h: Include <m17n-gui.h>.
2226         (m17n_init_X): Extern it.
2227         (M17N_INIT): Redefine it.
2228
2229         * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
2230         (m17n_init_X): New function.
2231
2232         * internal-gui.h (m17n__device_library_list): Extern it.
2233         (struct MDeviceDriver): New members initialized, init, and fini.
2234
2235         * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
2236         @XFT2_LD_FLAGS@.
2237         (libm17n_X_la_LIBADD): Delete aboves.
2238         (libm17n_gd_la_SOURCES): Add m17n-gd.h.
2239         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
2240         (libm17n_gd_la_LDFLAGS): Delete it.
2241         (include_HEADERS): Add m17n-gd.h.
2242
2243 2004-06-25  Kenichi Handa  <handa@m17n.org>
2244
2245         * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
2246         (libm17n_gd_la_LDFLAGS): Cancel previous change.
2247
2248         * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
2249
2250         * font-ft.c (fc_list): If FcFontList finds no font, try
2251         FcFontMatch.
2252
2253         * draw.c (compose_glyph_string): Terminate the last loop after
2254         doing default combining if necessary.
2255
2256 2004-06-24  Kenichi Handa  <handa@m17n.org>
2257
2258         * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
2259
2260         * character.c (mchar_define_property): Add const to an arg.
2261
2262         * charset.c (mchar_define_charset): Add const to an arg.
2263
2264         * coding.c (MCodingSystem): Add const to an arg or decoder.
2265         (finish_decoding): Add const to an arg.
2266         (decode_coding_charset, decode_coding_utf_8)
2267         (decode_coding_utf_16, decode_coding_utf_32)
2268         (decode_coding_iso_2022, decode_coding_sjis)
2269         (mconv_define_coding): Likewise.
2270
2271         * m17n-X.c (xft_find_metric): Delete unused variable.
2272
2273         * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
2274         prototypes.
2275
2276         * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
2277         prototypes.
2278
2279         * mtext.c (count_utf_8_chars, count_utf_16_chars)
2280         (mtext__from_data, mtext_from_data): Add `const' to an arg.
2281
2282         * mtext.h (mtext__from_data): Ajust prototype.
2283
2284 2004-06-23  Kenichi Handa  <handa@m17n.org>
2285
2286         * draw.c (compose_glyph_string): Always get glyph codes by
2287         mface__for_char.
2288         (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
2289         (mdraw_glyph_list): New function.
2290
2291         * font-flt.c (mfont__flt_run): Be sure to call
2292         rfont->driver->encode_char.
2293
2294         * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
2295         (ft_encode_char): Delete arg C.
2296         (ft_render): Don't call FT_Get_Char_Index.
2297
2298         * font.c (mfont__encodable_p): Delete it.
2299         (mfont__encode_char): Be sure to call rfont->driver->encode_char.
2300
2301         * font.h (struct MFontDriver): Delete arg C of encode_char.
2302         (mfont__encodable_p): Delete extern.
2303
2304         * m17n-X.c (xfont_encode_char): Delete arg C.
2305         (xft_find_metric): Don't cal FT_Get_Char_Index.
2306         (xft_render): Likewise.
2307
2308         * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
2309         logical_width.
2310         (mdraw_glyph_list): Extern it.
2311
2312         * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
2313
2314 2004-06-22  Kenichi Handa  <handa@m17n.org>
2315
2316         * m17n-gui.h (mfontset_lookup): Extern it.
2317
2318         * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
2319
2320         * fontset.c (realize_fontset_elements)
2321         (free_realized_fontset_elements, update_fontset_elements): New
2322         functions.
2323         (mfont__realize_fontset): Call realize_fontset_elements.
2324         (mfont__free_realized_fontset): Call free_realized_fontset_elements.
2325         (mfont__lookup_fontset): If a fontset was modified, update
2326         the realized fontset.
2327         (mfontset_modify_entry): Increment fontset->tick.
2328         (mfontset_lookup): New function.
2329
2330 2004-06-21  Kenichi Handa  <handa@m17n.org>
2331
2332         * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
2333
2334         * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
2335         (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
2336         length of source text 0.
2337
2338 2004-06-21  Kenichi Handa  <handa@m17n.org>
2339
2340         * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
2341         (compare): Pay attention to format other than utf-8.
2342         (copy): Delete this function.
2343         (count_by_utf_8, count_by_utf_16, insert): New functions.
2344         (count_utf_16_chars): Fix handling of a surrogate pair.
2345         (find_char_forward, find_char_backward): Likewise.
2346         (mtext__from_data): Delete unnecessary check.  Fix number of
2347         allocated bytes.
2348         (mtext_from_data): Don't count items.
2349         (mtext_ref_char): Optimize the code.
2350         (mtext_set_char): Pay attention to format other than utf-8.
2351         (mtext_cat_char): Likewise.
2352         (mtext_dup): Don't call copy, instead do allocation here.
2353         (mtext_cat): Call insert instead of copy.
2354         (mtext_ncat): Likewise.
2355         (mtext_cpy): Delete character at first and call insert instead of
2356         copy.
2357         (mtext_ncpy): Likewise.
2358         (mtext_copy): Likewise.
2359         (mtext_duplicate): Call insert instead of copy.
2360         (mtext_del): Pay attention to format other than utf-8.
2361         (mtext_ins): Simply call insert.
2362         (mtext_ins_char): Pay attention to format other than utf-8.
2363         (mtext_tok): Call insert instead of copy.
2364         (mtext_text): Call UNIT_BYTES.
2365
2366         * textprop.c (mtext__adjust_plist_for_change): New function.
2367
2368         * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
2369         (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
2370         (CHAR_UNITS_AT): Fix typo.
2371         (CHAR_UNITS_BY_HEAD): Fix typo.
2372         (STRING_CHAR_AND_UNITS): Fix typo.
2373
2374         * internal.h (MTEXT_READ_ONLY_P): New macro. 
2375
2376         * mtext.h (mtext__replace): Delete the extern.
2377         (mtext__adjust_foramt): Adjust prototype.
2378
2379         * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
2380         if possible.  Otherwise make a copy of mmt.
2381
2382         * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
2383         utf-8.
2384
2385 2004-06-18  Kenichi Handa  <handa@m17n.org>
2386
2387         * character.h (CHAR_STRING_UTF16): Fix syntax.
2388
2389 2004-06-16  Kenichi Handa  <handa@m17n.org>
2390
2391         * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
2392         (libm17n_X_la_LIBADD): Delete it.
2393         (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
2394
2395         * m17n-X.c (device_open): Add parens in `if' condition.
2396
2397         * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
2398         (DEC_POSITION): Likewise.
2399         (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
2400
2401 2004-06-15  Kenichi Handa  <handa@m17n.org>
2402
2403         * fontset.c (mfont__lookup_fontset): Fix selection of font groups
2404         by language.
2405
2406         * draw.c (compose_glyph_string): If langauge is specified, call
2407         mface__for_chars even if a text is all latin.  Fix condition for
2408         setting non_ascii_found.
2409
2410         * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
2411
2412         * m17n.h (minput_char_to_key): Delete extern.
2413
2414         * m17n-gui.h (minput_event_to_key): Cancel previous change.
2415
2416         * m17n-gui.c (null_device_open): Set several members of frame.
2417
2418 2004-06-14  Kenichi Handa  <handa@m17n.org>
2419
2420         * m17n-gui.h (minput_event_to_key): Delete extern.
2421
2422         * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
2423
2424         * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
2425
2426         * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
2427
2428 2004-06-08  Kenichi Handa  <handa@m17n.org>
2429
2430         * character.c (mchar_put_prop): Don't increment the ref-count of
2431         record->table.
2432
2433 2004-06-04  Kenichi Handa  <handa@m17n.org>
2434
2435         * m17n-core.c (mdebug__register_object): New function.
2436         (mdebug__unregister_object): Likewise.
2437
2438         * internal.h (mdebug__register_object, mdebug__unregister_object):
2439         Extern them.
2440         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
2441         respectively.
2442
2443         * charset.c (mcharset__load_from_database): Don't call
2444         mconv__register_charset_coding here.
2445
2446         * coding.c (find_coding): Get a real name from an element of
2447         coding_definition_list.
2448         (mconv__register_charset_coding): Set the real name at the top of
2449         param.
2450         (mcoding__load_from_database): Likewise.
2451         (mconv_list_codings): Adjusted for the above change.
2452
2453 2004-06-03  Kenichi Handa  <handa@m17n.org>
2454
2455         * coding.c (find_coding): Find by canonicalized name.  Don't have
2456         to modify the element of coding_definition_list by
2457         mplist__from_plist.
2458         (mconv__define_coding_from_charset): Delete it.
2459         (mconv__register_charset_coding): Canonicalize sym.
2460         (mcoding__load_from_database): Register plist modified by
2461         mplist__from_plist.
2462
2463         * coding.h (mconv__define_coding_from_charset): Don't extern it.
2464
2465         * font-ft.c (ft_open): Fix setting of rfont->descent.
2466
2467 2004-06-02  Kenichi Handa  <handa@m17n.org>
2468
2469         * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
2470         (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
2471         (xlfd_unparse_name): Renamed from xfont_build_name.
2472         (mfont__init): Initialized Mfontconfig.
2473         (mfont__free_realized): Unconditionally unref rfont->info.
2474         (mfont__select): Free `this' if it's not best.
2475         (mfont__open): Don't check frame->realized_font_list.
2476         (mfont__parse_name_into_font): New function.
2477         (Mfontconfig): New variable.
2478         (mfont_from_name): Call mfont_parse_name.
2479         (mfont_name): Call mfont_unparse_name.
2480         (mdebug_dump_font): Likewise.
2481
2482         * font.h (struct MFontDriver): Delete members parse_name and
2483         build_name.
2484         (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
2485         (mfont__parse_name_into_font): Extern it.
2486
2487         * font-ft.c: Include "symbol.h".
2488         (close_ft): Unconditionally free filename and charmap_list of
2489         ft_into.
2490         (ft_open): Duplicate base->filename.  Increment ref-count of
2491         ft_info->charmap_list.  Free ft_info->charmap_list and
2492         ft_info->filename on error.
2493         (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
2494
2495         * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
2496         xfont_build_name.
2497         (enum xlfd_field_idx): Moved to font.c.
2498         (split_font_name, build_font_name): Likewise.
2499         (build_font_list): Call mfont__parse_name_info_font.
2500         (xfont_open): Call mfont__unparse_name.  Free name.
2501         (xfont_parse_name, xfont_build_name): Moved to font.c
2502         (xft_select): Prototype deleted.
2503         (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
2504         Call mfont_pase_name.
2505
2506         * m17n-gui.c (free_frame): Unref frame->font_driver_list.
2507         (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
2508         (mframe): Likewise.
2509
2510         * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
2511         Extern them.
2512
2513         * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
2514
2515 2004-06-01  Kenichi Handa  <handa@m17n.org>
2516
2517         * fontset.c (mfontset_modify_entry): Pay attention to the case
2518         that fontset->font_spec_list is NULL.
2519
2520 2004-05-31  Kenichi Handa  <handa@m17n.org>
2521
2522         * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2523
2524         * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
2525
2526         * font.c (mfont__select): Print score the a font for debugging.
2527
2528         * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
2529
2530         * coding.c (reset_coding_sjis): Check kanji and kana instead of
2531         kanji_sym and kana_sym.
2532
2533 2004-05-28  Kenichi Handa  <handa@m17n.org>
2534
2535         * Makefile.am (VINFO): New variable.
2536         (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
2537         (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
2538
2539 2004-05-27  Kenichi Handa  <handa@m17n.org>
2540
2541         The following chanages are to make device dependent functions
2542         accessible only from MDeviceDriver structure, and to add GD and
2543         null device drivers.  Font drivers get also device dependent.
2544
2545         * m17n.c (m17n_init): Increament shell_initialized.
2546         (m17n_fini): Decremented shell_initialized.
2547
2548         * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
2549
2550         * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
2551         (Mwidget, Mcolormap, Mx): Extern them.
2552
2553         * m17n-gui.c: Include <dlfcn.h> and "config.h".
2554         (free_frame): Call frame->driver->close instead of
2555         mwin__close_device.
2556         (DLOPEN_SHLIB_EXT): New macro.
2557         (MDeviceLibraryInterface): New type.
2558         (device_library_list): New variable.
2559         (register_device_library): New function.
2560         (null_device): New variable.
2561         (null_device_close, null_device_get_prop)
2562         (null_device_realize_face, null_device_free_realized_face): New
2563         function.
2564         (null_driver): New variable.
2565         (null_device_init, null_device_fini, null_device_open): New
2566         functions.
2567         (null_interface): New variable.
2568         (Mfreetype, Mdevice): Declare them.
2569         (m17n_init_win): Increment win_initialized.  Initialize Mx, Mgd,
2570         Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
2571         Mwin__Close_Device.  Register drivers for Mx and Mgd.
2572         (m17n_fini_win): Decremented win_initialized.  Call "fini"
2573         function of all opened devices.  Don't call mwin__fini.
2574         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
2575         Declare them here.
2576         (mframe): Handle Mdevice key of PLIST.
2577         (mframe_get_prop): Call frame->device->get_prop instead of
2578         mwin__device_get_prop.
2579
2580         * m17n-gd.c: New file.
2581
2582         * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
2583         (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
2584
2585         * m17n-core.c (m17n_init_core): Increate core_initialized.
2586         (m17n_fini_core): Decremented core_initialized.
2587
2588         * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
2589         (Mcolormap): Don't extern them here.
2590
2591         * m17n-X.c (FRAME_DEVICE): New macro.
2592         (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
2593         (free_display_info): Use MPLIST_DO.
2594         (free_device): Free rface->info.
2595         (xft_close): Delete it.
2596         (device_init): Renamed from mwin__init.
2597         (device_fini): Renamed from mwin__fini.
2598         (device_open): Renamed from mwin__open_device.
2599         (x_driver): New variable.
2600         (MXFontInfo): Delete member frame, add member display.
2601         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
2602         Don't declare them here.
2603
2604         * internal-gui.h (MDeviceType): New enum.
2605         (MWDefice): Delete it.
2606         (struct MFrame): Change type of device to void *.  New members
2607         device_type, driver, font_driver_list.
2608         (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
2609         (MDeviceDriver): New type.
2610         (Mx, Mgd, Mfreetype): Extern them.
2611         (mwin__XXX): Delete all of them.
2612
2613         * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2614         mwin__XXX.
2615         (win_destroy_ic): Likewise.
2616         (adjust_window_and_draw): Likewise.
2617         (win_callback): Likewise.
2618         (Mxim): Declare it here.
2619         (minput_event_to_key): Call M_CHECK_READABLE.
2620
2621         * fontset.c (mfont__lookup_fontset): Delete local variable
2622         font_group.
2623
2624         * font.h (struct MFontDriver): Delete member close, add members
2625         parse_name and build_name.
2626         (mfont__driver_list): Delete extern.
2627         (mfont__close): Delete extern.
2628
2629         * font.c (mfont__init): Don't set mfont__driver_list.
2630         (mfont__fini): Don't unref mfont__driver_list.
2631         (mfont__select): Try font drivers in frame->font_driver_list.  Set
2632         driver member of a realized font.
2633         (mfont__close): Delete it.
2634         (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2635         functions of the default frame.
2636
2637         * font-ft.c (close_ft): Check ft_info->ft_face and work
2638         differently.
2639         (add_font_info): Allocate ft_info by M17N_OBJECT.
2640         (ft_close): Delete it.
2641         (mfont__ft_driver): Don't set ft_close.
2642         (ft_select): Increment ref-count of best_font.
2643         (ft_open): Decremented ref-count of base.  On error, call
2644         FT_Done_Face and free ft_info.
2645         (ft_find_metric): Always use XXX_MONO in load_flags.
2646         (ft_render): Fix setting of width.  Call
2647         frame->driver->draw_points instead of mwin__draw_points.
2648         (ft_to_prop): Don't set mfont__driver_list.
2649         (mfont__ft_fini): Just unref ft_info.
2650
2651         * face.c (mface__init): Exchange foreground and background of
2652         mface__default.  Call mface_put_prop to set hline of
2653         mface_underline,
2654         (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2655         (mface__free_realized): Don't call mwin__free_realized_face.
2656
2657         * draw.c (Mdepth): Don't declare it here.
2658         (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2659         (render_glyphs, render_glyph_string): Likewise.
2660         (mdraw__init): Don't set Mdepth.
2661         (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2662         M_CHECK_WRITABLE.
2663         (mdraw_text_per_char_extents): Return 0 on success and -1 on
2664         error.
2665         (mdraw_text_items): Check FRAME is writable.
2666         (mdraw_per_char_extents): Implement body.
2667
2668         * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2669         libm17n-gd.la.
2670         (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2671         (GUI_SOURCES): Delete it.
2672         (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2673         (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2674         (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2675         (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2676         (linkgui_LDADD): Set to libm17n-gui.la
2677         (linkgui_LDFLAGS): New target.
2678         (SRC): Include ${libm17n_gui_la_SOURCES} and
2679         ${libm17n_gd_la_SOURCES}.
2680
2681 2004-05-24  Kenichi Handa  <handa@m17n.org>
2682
2683         * draw.c (draw_background): Don't draw background even if
2684         rface->face.property[MFACE_BACKGROUND] is not Mnil.
2685
2686 2004-05-22  Kenichi Handa  <handa@m17n.org>
2687
2688         * m17n-X.c (xft_open_font): Fix anti_alias setting.
2689
2690 2004-05-20  Kenichi Handa  <handa@m17n.org>
2691
2692         * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2693
2694         * m17n-gui.c: Include "plist.h".
2695         (mframe): If PLIST is NULL, initialize it to emply plist.
2696
2697         * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2698         (xft_driver): New variable.
2699         (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2700         (xft_find_metric, xft_render): New function.
2701         (mwin__init): Adjusted for the new mfont__driver_list.
2702         (mwin__open_device): Assume arg PARAM is not NULL.  Push a newly
2703         generated face to PARAM.
2704         (mwin__realize_face): Fix setting of box colors.  Don't call hook
2705         function here.
2706         (mwin__draw_hline): New function.
2707         (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2708         (mwin__xft_render): Delete these function.
2709
2710         * internal-gui.h (struct MFrame): New member tick.
2711         (struct MGlyphString): New member tick.
2712         (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2713         (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2714         (mwin__xft_render): Delete extern.
2715
2716         * fontset.c (mfont__lookup_fontset): Make the code simpler.
2717         (mfontset): Always increment the reference count of returned
2718         object.
2719
2720         * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2721         (MFTInfo): Moved to font.h.
2722         (ft_iso8859_1_font_list): Delete this variable.
2723         (set_font_info): Don't set font->property[MFONT_TYPE].
2724         (set_font_info): Don't udpate ft_iso8859_1_font_list.
2725         (add_font_info): Change type to void.
2726         (fc_list): Change anme from xft_list.  Caller changed.  Include
2727         FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2728         (mfont__ft_driver): Change name from ft_driver.  Caller changed.
2729         (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2730         (close_ft): Don't call mwin__xft_close.  Unref
2731         ft_info->extra_info.
2732         (ft_open): Don't setup ft_info->fontname.  Don't call
2733         mwin__xft_open.
2734         (ft_find_metric): Don't call mwin__xft_get_metric.
2735         (ft_encode_char): Call rfont->driver->open instead of ft_open.
2736         (ft_render): Don't check HAVE_XFT2.  Don't call mwin__xft_render.
2737         (mfont__ft_init): Adjusted for new mfont__driver_list.
2738         (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2739
2740         * font.c (mfont__driver_list): Make it MPlist.
2741         (mfont__init): Adjust initialization of mfont__driver_list.
2742         (mfont__fini): Free mfont__driver_list.
2743         (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2744         (mfont__select): Adjusted for the new mfont__driver_list.
2745
2746         * font.h (enum MFontProperty): Delete MFONT_TYPE.
2747         (mfont__drirver_list): Adjust prototype.
2748         (MFTInfo): Move to here from fron.c.  Deleve member fontname.
2749
2750         * face.h (struct MFace): Delete member realized_face_list, add
2751         member frame_list.
2752         (struct MRealizedFace): Delete member need_update
2753         andnofont_rface, add member non_ascii_list.
2754         (mface__update_frame_face): Extern it.
2755
2756         * face.c (hline_prop_list, box_prop_list, noop_hook): New
2757         variables.
2758         (get_hline_create, get_box_create): New functions.
2759         (find_realized_face): Cancel previous change.  Arg RFONT deleted.
2760         Use memcmp.
2761         (free_face): Cancep previous change.  Free face->frame_list.
2762         (serialize_hline): Do nothing if hline->width is zero.
2763         (serialize_box): Do nothing if box->width is zero.
2764         (mface__init): Setup all properties of mface__default.
2765         (mface__fini): Free hline_prop_list and box_prop_list.
2766         (mface__realize): Cancel previous change.  Update
2767         face->frame_list.  Setup rface->non_ascii_list.
2768         (mface__for_chars): Update rface->non_ascii_list.
2769         (mface__free_realized): Free rface->non_ascii_list.
2770         (mface__update_frame_face): New function.
2771         (mface): Initialize face->frame_list.
2772         (mface_copy): Likewise.  Just copy MFACE_HLINE and MFACE_BOX
2773         properties.
2774         (mface_merge): Likewise.
2775         (mface_put_prop): If key is Mhline or Mbox, get value by
2776         get_hline_create or get_box_create respectively.
2777         (mface_put_prop): Update frame->tick and call
2778         mface__update_frame_face if necessary.
2779         (mface_update): Do nothing if func is noop_hook.
2780
2781         * draw.c (render_glyphs): If a font is not found, use
2782         mwin__draw_empty_boxes.
2783         (alloc_gstring): Initialize gstring->tick.
2784         (get_gstring): Check gstring->tick.
2785
2786 2004-05-17  Kenichi Handa  <handa@m17n.org>
2787
2788         * face.c (find_realized_face): Return value changed.  If RFONT is
2789         NULL, avoid unnecessary checking.
2790         (free_face): Free face->realized_face_list.
2791         (mface__realize): Adjusted for the change of find_realized_face.
2792         If it returns a realized face that needs update, free it and
2793         realize a new one.  Push a new realized face to
2794         frame->realized_face_list instead of appending.
2795         (mface__for_chars): Adjusted for the change of find_realized_face.
2796         Short cut if the required font is in rface->ascii_rface.
2797         (mface_put_prop): Free old value if necessary.  Set need_update
2798         member of realized faces to 1.
2799
2800         * face.h (struct MFace): Delete member tick, add member
2801         realized_face_list.
2802         (struct MRealizedFace): Delete member tick, add member
2803         need_update.
2804
2805 2004-05-13  Kenichi Handa  <handa@m17n.org>
2806
2807         * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
2808
2809 2004-05-12  Kenichi Handa  <handa@m17n.org>
2810
2811         * internal-gui.h (mwin__xft_open): Arguemnt name changed.
2812
2813         * m17n-X.c (mwin__xft_open): Argument changed to fontname and
2814         parse it XftNameParse.
2815
2816         * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
2817         (all_fonts_scaned): New variable.
2818         (set_font_info): FAMILY may be Mnil.
2819         (add_font_info): Argument changed.
2820         (xft_list): Call add_font_info in it.
2821         (ft_list): Likewise.
2822         (ft_select): Make it work in the case family is Mnil.
2823         (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
2824         (mfont__ft_fini): Set all_fonts_scaned to 0.
2825
2826         * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
2827         that is failed to open.
2828
2829 2004-05-10  Kenichi Handa  <handa@m17n.org>
2830
2831         * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
2832         device's depth is 1 (i.e. monochrome).
2833
2834         * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
2835         to work around the problem of libtool.
2836
2837         * font-ft.c: Include <freetype/ftbdf.h>.
2838         (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
2839         variables.
2840         (mfont__ft_init): Initialize them.
2841         (ft_iso8859_1_font_list): New variable.
2842         (set_font_info): Detect a font containing iso8859-1 glyphs and
2843         register it in ft_iso8859_1_font_list.  If the font is not
2844         scalable, assume it as BDF or PCF font and setup SIZE and RESY
2845         properties of the font from its properties.
2846         (add_font_list): If the font is not scalable, check if it is BDF
2847         or PCF font.  If not, ignore it.
2848         (ft_select): If FAMILY is Mnil, return NULL only if the requested
2849         registry is not iso8859-1.
2850         (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
2851         ft_iso8859_1_font_list.
2852         (ft_find_metric): If the font is not scalable, assume it as BDF
2853         or PCF, and get a metric from its properties.
2854         (mfont__ft_fini): Free ft_iso8859_1_font_list.
2855
2856 2004-05-07  Kenichi Handa  <handa@redhat.m17n.org>
2857
2858         * Makefile.am (libm17n_la_LIBADD): Include -ldl.
2859         (libm17n_la_LDFLAGS): Delete it.
2860         (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
2861         (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
2862
2863 2004-05-06  Kenichi Handa  <handa@m17n.org>
2864
2865         * draw.c (compose_glyph_string): Fix previous change.
2866
2867 2004-04-30  Kenichi Handa  <handa@m17n.org>
2868
2869         * font-ft.c (ft_list): Delete unused variable `result'.
2870         (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
2871
2872 2004-04-27  Kenichi Handa  <handa@m17n.org>
2873
2874         * m17n-X.c: Include config.h
2875         [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
2876         (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
2877         (MWDevice) [HAVE_XFT2]: New member xft_draw.
2878         (FRAME_CMAP, FRAME_VISUAL): New macros.
2879         (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
2880         (xfont_driver): Make it static.
2881         (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
2882         (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
2883         info->xft_color_back.
2884         (MXftFontInfo) [HAVE_XFT2]: New type.
2885         (mwin__xft_close) [HAVE_XFT2]: New function.
2886         (mwin__xft_open) [HAVE_XFT2]: New function.
2887         (mwin__xft_get_metric) [HAVE_XFT2]: New function.
2888         (mwin__xft_render) [HAVE_XFT2]: New function.
2889
2890         * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2891         (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
2892         (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
2893         externs.
2894
2895         * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2896
2897         * font-ft.c: Don't include FT_FREETYPE_H here.
2898         [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
2899         (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
2900         (MFTInfo): New member charmap_index.
2901         (MFTInfo) [HAVE_XFT2]: New member xft_info.
2902         (check_otf_filename): Renamed from check_filename.  Return value
2903         changed.
2904         (ft_set_property): This function deleted.
2905         (set_font_info): New function.
2906         (add_font_list): Argument changed.  Add multiple fonts.
2907         (xft_list) [HAVE_XFT2]: New function.
2908         (ft_list) [not HAVE_XFT2]: New function.
2909         (ft_select): Add code for Xft.
2910         (close_ft): Likewise.
2911         (ft_open): Likewise.
2912         (ft_find_metric): Likewise.
2913         (ft_encode_char): Likewise.
2914         (ft_render): Likewise.
2915
2916         * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
2917
2918 2004-04-26  Kenichi Handa  <handa@m17n.org>
2919
2920         * textprop.c (mtext_attach_property): Declare the return type as
2921         `int'.
2922
2923 2004-04-21  Kenichi Handa  <handa@m17n.org>
2924
2925         * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
2926
2927 2004-04-09  Kenichi Handa  <handa@m17n.org>
2928
2929         * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
2930         seq_to.
2931         (load_command): Setup above members.
2932
2933 2004-04-05  Kenichi Handa  <handa@m17n.org>
2934
2935         * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
2936
2937 2004-03-30  Kenichi Handa  <handa@m17n.org>
2938
2939         * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
2940         >= 0x10000.
2941
2942         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
2943         (M17NLIB_VERSION_NAME): Changed to 1.0.2.
2944
2945 2004-03-29  Kenichi Handa  <handa@m17n.org>
2946
2947         * Version 1.0 Patch Level 2 released.
2948
2949 2004-03-29  Kenichi Handa  <handa@m17n.org>
2950
2951         * charset.c (make_charset): Set charset->fully_loaded and
2952         charset->simple correctly.  Don't try to get charset->min_char and
2953         charset->max_char for a charset of method subset and superset.
2954         Don't load a mapping file here.
2955         (mcharset__init): Set unified_max.
2956         (mcharset__load_from_database): Free a working plist.
2957
2958         * coding.c (mcoding__fini): Free all malloced data.
2959
2960         * input-gui.c (win_create_ic): Set control.as_image for preediting
2961         to 0.
2962
2963         * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
2964         `count') to initialize the array.
2965
2966         * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
2967         M17N_OBJECT_UNREF.
2968
2969         * m17n-X.c (xfont_render): If rface->rfont is null, draw a
2970         rectangle.
2971         (mwin__create_window): Fix bug of setting a background pixel of a
2972         new window.
2973         (mwin__adjust_window): Clear the window before drawing.
2974
2975         * m17n-core.c (mdebug__report_object): Free array->objectes if
2976         necessary.
2977         (m17n_init_core): Don't set report_header_printed to 0 here.
2978         Fix debugging information.
2979         (m17n_fini_core): Set report_header_printed to 0 here.
2980
2981         * m17n-core.h (mplist_deserialize): Extern it.
2982
2983         * m17n-gui.c (m17n_fini_win): Fix debugging information.
2984
2985         * m17n.c (m17n_fini): Fix debugging information.
2986
2987         * mtext.c (mtext__adjust_foramt): New function.
2988
2989         * mtext.h (mtext__adjust_foramt): Extern it.
2990
2991         * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
2992
2993         * plist.h (mplist__deserialize): Don't extern it.
2994
2995         * symbol.c (msymbol__fini): Set freed_symbols to 0.  Set all
2996         elements of symbol_table to NULL.  Report about created and freed
2997         symbols if MDEBUG_FINI is set.
2998
2999 2004-03-22  Kenichi Handa  <handa@m17n.org>
3000
3001         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
3002
3003         * m17n.c (m17n_init): Fix the way of checking merror_code.
3004
3005         * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
3006
3007 2004-03-22  Kenichi Handa  <handa@m17n.org>
3008
3009         * fontset.c (realize_font_group): Adjust the font size by
3010         mfont__resize before selecting a font.
3011
3012         * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
3013
3014 2004-03-19  Kenichi Handa  <handa@m17n.org>
3015
3016         * Version 1.0 Patch Level 1 released.
3017
3018 2004-03-19  Kenichi Handa  <handa@m17n.org>
3019
3020         * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
3021
3022         * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
3023
3024 2004-03-19  Kenichi Handa  <handa@m17n.org>
3025
3026         Re-apply the changes forgotten in the released version.
3027
3028         * charset.c (mcharset__load_from_database): Call
3029         mchar_define_charset.
3030
3031         * coding.c (encode_unsupporeted_char): Put Mcoding text property.
3032         (mconv_encode_range): Put Mcoding text property.
3033
3034 2004-03-18  Kenichi Handa  <handa@m17n.org>
3035
3036         * draw.c (Mdepth): New variable.
3037         (visual_order): Delete unused local var `pos'.
3038         (compose_glyph_string): Fix for the case that gstring->glyphs is
3039         realloced.  Stop generating glyphs at TO.  Fix handling of
3040         control charaters.
3041         (layout_glyphs): Get metrics of all glyphs in advance.  Set
3042         lbearing and rbearing of base of composition glyph correctly.
3043         Handle left-overhang glyphs correctly.
3044         (alloc_gstring): New arg frame.  Set gstring->anti_alias.  Caller
3045         changed.
3046         (dump_combining_code): Change the defualt off_x character to ".".
3047         (mdraw__init): Initialize Mdepth.
3048
3049         * face.c (work_gstring): New variable
3050         (mface__init): Initialize work_gstring.
3051         (mface__fini): Free work_gstring.glyphs.
3052         (mface__realize): Don't handle videomode property here.  Adjusted
3053         for the change of mfont__get_metric.
3054         (mface__for_chars): Adjusted for the change of mfont__get_metric.
3055
3056         * face.h (enum face_gc): Moved to m17n-X.c.
3057
3058         * font.h (struct MFontDriver): Arguments of find_metric changed.
3059         (mfont__select): Prototype adjusted.
3060         (mfont__get_metric): Likewise.
3061         (mfont__ft_drive_otf): Likewise.
3062         (mfont__flt_run): Likewise.
3063         
3064         * font.c (mfont__select): New argument layouter.  If layouter is
3065         different in the registered font, make a new copy of realized
3066         font.
3067         (mfont__get_metric): Argument changed.  Get metrics of multiple
3068         glyphs.
3069         (mfont_find): Call mfont__select with layouter as Mnil.
3070
3071         * font-flt.c (FontLayoutContext): New member rfont.
3072         (run_otf): Adjusted for the change of mfont__ft_drive_otf.
3073         (mfont__flt_run): Argument changed.  Initialize ctx.rfont.
3074
3075         * font-ft.c (ft_find_metric): Arguments changed.  Get metrics of
3076         multiple glyphs.
3077         (NUM_POINTS): New macro.
3078         (MPointTable): New type.
3079         (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
3080         (mfont__ft_drive_otf): New argument rfont.
3081
3082         * fontset.c (realize_font_group): Adjusted for the changed of
3083         mfont__select.
3084         (check_fontset_element): This function deleted.
3085
3086         * input-gui.c (adjust_window_and_draw): Locate a preedit window
3087         off the parent window if the preedit text is zero length.
3088
3089         * internal-gui.h (struct MFrame): New members foreground,
3090         background, videomode, font.
3091         (struct MGlyphString): New member anti_alias.
3092         (MDrawPoint): New type.
3093         (mwin__draw_bitmap): Prototype deleted.
3094         (mwin__draw_points): Prototype added.
3095
3096         * m17n-gui.h (MDrawControl): New member anti_alias.
3097
3098         * m17n-gui.c (free_frame): Free frame->font.
3099         (mframe): Set the fontset of frame->face to the default fontset.
3100
3101         * m17n-X.c (RGB_GC): New type.
3102         (enum gc_index): Renamed from enum face_gc.  Member names changed.
3103         (GCInfo): New typel
3104         (struct MWDevice): Members foreground and background deleted.  New
3105         member scratch_gc, gc_list.
3106         (DEFAULT_FONT, FALLBACK_FONT): New macros.
3107         (free_device): Free GCs in device->gc_list.
3108         (get_rgb_gc): New function.
3109         (get_gc): Renamed and argument changed from get_color.
3110         (get_gc_for_anti_alias): New function.
3111         (xfont_find_metric): Arguments changed.  Get metrics of multiple
3112         glyphs.
3113         (set_region): Argument changed.  Caller changed.
3114         (xfont_render): Allways set a font in gc.
3115         (x_error_handler, x_io_error_handler): Define only if
3116         X_SET_ERROR_HANDLER is defined.
3117         (mwin__open_device): Create device->scratch_gc.  Set members
3118         foreground, background, and videomode of frame.  Call
3119         XSetErrorHandler and XSetIOErrorHandler only if
3120         X_SET_ERROR_HANDLER is defined.
3121         (struct gc_list): Deleted.
3122         (REGISTER_GC, UNREGISTER_GC): These macros deleted.
3123         (mwin__realize_face): Adjusted for the change of the format of
3124         rface->info and the charge of set_region.
3125         (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
3126         (mwin__draw_box): Likewise.
3127         (mwin__draw_bitmap): This function deleted.
3128         (mwin__draw_points): New function.
3129         (mwin__verify_region): Adjusted for the change of the format of
3130         rface->info and the charge of set_region.
3131         (mwin__create_window): Inherit backgound pixel from parent.
3132         (mwin__dump_gc): Adjusted for the change of the format of
3133         rface->info.
3134
3135 2004-03-16  Kenichi Handa  <handa@m17n.org>
3136
3137         * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
3138
3139         * input.c (M_key_alias): New variable.
3140         (handle_key): Try M_key_alias property of a key too.
3141         (minput__init): Initialize M_key_alias.  Give that property to
3142         symbols in one_char_symbol.  Fix bug of initializing
3143         one_char_symbol.
3144
3145         * draw.c (compose_glyph_string): Don't handle
3146         ignore_formatting_char here.  Include formatting characters in the
3147         range processed by a FTL.
3148         (layout_glyph_string): Handle ignore_formatting_char here.
3149
3150 2004-03-12  Kenichi Handa  <handa@m17n.org>
3151
3152         * input-gui.c (win_create_ic): Enable bidi in status control.
3153
3154         * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
3155
3156 2004-03-09  Kenichi Handa  <handa@m17n.org>
3157
3158         * input.c (load_input_method): If title is not specified, use the
3159         input method name as title.
3160
3161         * m17n-X.c (get_color): Make it static.
3162         (xim_create_ic, xim_destroy_ic, x_error_handler)
3163         (x_io_error_handler): Likewise.
3164
3165 2004-03-01  Kenichi Handa  <handa@m17n.org>
3166
3167         * Version 1.0 released.
3168
3169 \f
3170 Copyright (C) 2003, 2004
3171   National Institute of Advanced Industrial Science and Technology (AIST)
3172   Registration Number H15PRO112
3173
3174 This file is part of the m17n library.
3175
3176 The m17n library is free software; you can redistribute it and/or
3177 modify it under the terms of the GNU Lesser General Public License
3178 as published by the Free Software Foundation; either version 2.1 of
3179 the License, or (at your option) any later version.
3180
3181 The m17n library is distributed in the hope that it will be useful,
3182 but WITHOUT ANY WARRANTY; without even the implied warranty of
3183 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3184 Lesser General Public License for more details.
3185
3186 You should have received a copy of the GNU Lesser General Public
3187 License along with the m17n library; if not, write to the Free
3188 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
3189 02111-1307, USA.