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