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