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