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