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