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