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