*** empty log message ***
[m17n/m17n-lib.git] / src / ChangeLog
1 2005-10-29  Kenichi Handa  <handa@m17n.org>
2
3         * input.c (get_candidate_list): Fix the timing of refering plist.
4
5 2005-10-28  Kenichi Handa  <handa@m17n.org>
6
7         * input.c (load_branch): Ignore an undefined map name.
8         (load_im_info): Set im_info->title from `name' only if it's not
9         Mnil.
10         (shift_state): Always update ic->status.
11         (adjust_candidates): Renamed from adjust_candidate_command.
12         Argument changed.  Caller changed.
13         (get_candidate_list, regularize_action): New functions.
14         (take_action_list): Use them.  On handling Munhandle, don't set
15         ic_info->used to 0.
16         (handle_key): If KEY is not handled by MAP, and MAP has
17         branch_actions, perform them.
18
19         * database.c (mdatabase__fini): Free dir_info->filename;
20
21 2005-10-20  Kenichi Handa  <handa@m17n.org>
22
23         * input.c (marker_code): Accept '@@'.
24         (integer_value): Handle '@@'.
25         (parse_action_list): Accept a symbol argument.
26         (take_action_list): Resolve the symbol argument.  Handle the
27         integer argument.
28
29 2005-10-18  Kenichi Handa  <handa@m17n.org>
30
31         * input.c: Include "charset.h".
32         (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
33         variables.
34         (MIMState): New member (M17NObject control).
35         (lookup_nested_list, set_nested_list, parse_nested_list_value)
36         (get_nested_list, resolve_variable): New functions.
37         (integer_value): New arg (MPlist **value).  Set it to the plist
38         element containing the value.
39         (resolve_command): New function.
40         (load_translation): New arg (MPlist *map_actions).
41         (load_branch): New args language and name.  If `keylist' is a
42         symbol, resolved that as a command name.
43         (free_map): New arg top.  Free map->map_actions only if top is
44         nonzero.
45         (free_state): New function.
46         (load_state): New arg name.
47         (im_info_list): New variable.
48         (free_im_info, get_im_info_by_tags): New functions.
49         (load_im_info): Arg key changed to plist.  Handle `include'.
50         Return (MInputMethodInfo *).
51         (preedit_commit): Ref ic->candidate_list.
52         (get_select_charset, adjust_candidate_command): New functions.
53         (take_action_list): Handle `include'.  Adjust candidate action
54         properly.  Handle control variables `candidates-charset' and
55         `candidates-group-size'.
56         (open_im): Use get_im_info.
57         (create_ic): Get global variables.
58         (load_partial_im_info): New function.
59         (get_im_info): New function.
60         (check_command_keyseq, check_command_list, check_variable_list):
61         New functions.
62         (minput__init): Don't handle M_database_hook and Mdetail_text.
63         Initialize M_candidates, Mcandidates_group_size,
64         Mcandidates_charset.
65         (parse_variable_list, get_variable_list, parse_command_list)
66         (get_command_list): Delete them.
67         (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
68         (minput__fini): Simply unref command_list and variable_list.
69         (minput_get_description): Adjusted for the new form of description.
70         (minput_get_commands): Use get_nested_list.
71         (minput_assign_command_keys): Likewise.
72         (minput_get_variables, minput_set_variable): Likewise.
73
74         * input.h (MInputMethodInfo): New members im and maps.
75
76         * database.h (M_database_hook): Delete extern.
77         (MDatabaseHookFunc): Delete extern.
78         (mdatabase__check): Extern it.
79
80         * database.c: Include <glob.h>.
81         (MAX_TIME): New macro.
82         (Masterisk): New variable.
83         (get_database_stream): Argument changed to (MDatabaseInfo *).
84         Callers changed.
85         (get_dir_info): Renamed from duplicate_dirname.  Callers changed.
86         (find_database): New function.
87         (update_database_list): New function.
88         (mdatabase__init): Initialize Masterisk.  Setup mdb_list by
89         calling update_database_list.
90         (mdatabase__check): New function.
91         (mdatabase_find): Use update_database and find_database.  Don't
92         handle MDatabaseHookFunc.
93         (mdatabase_list): Call update_database at first.
94         (mdatabase_define): Adjusted for the change of mdb->extra_info.
95         (MDatabaseList): New type.
96
97         * plist.h (mplist_conv, mplist__pop_unref): Extern them.
98
99         * m17n.h (Mdetail_text): Delete extern.
100
101         * m17n-core.h (mplist_conc): Delete extern.
102
103         * plist.c (mplist__conc): Renamed from mplist_conc.  Don't ref
104         tail.
105         (mplist_conc): Renamed to mplist__conc.
106         (mplist__pop_unref): New function.
107
108 2005-10-14  Kenichi Handa  <handa@m17n.org>
109
110         * plist.c (read_mtext_element): Ignore the sequence of '\\' and
111         newline.
112         (read_element): If keys is an empty plist, return any element
113         found first.
114         (dump_plist_element): Check if plist is nested.
115         (mplist_conc): Always ref tail.
116         (mplist_set): If key is a managing key, ref val in advance.
117
118         * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
119         (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
120         (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
121         macros.
122
123         * fontset.c (free_fontset): Unref fontset_list if necessary.
124         (mfont__fontset_fini): Don't free fontset_list.  Unref
125         default_fontset.
126         (mfont__realize_fontset): Initialize request.
127         (mfontset): Ref default_fontset or fontset only if necessary.
128         (mfontset_copy): Don't ref copy.
129
130         * draw.c (render_glyphs): Check gend->type before checking
131         gend->to.
132
133         * font-ft.c (mfont__ft_fini): Unref ft_default_list.  Set all
134         unrefed plists to NULL.
135
136 2005-10-04  Kenichi Handa  <handa@m17n.org>
137
138         * textprop.c (mtext_serialize): Be sure to make mt
139         MTEXT_FORMAT_UTF_8 and NULL terminated.
140
141         * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
142
143         * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
144
145 2005-10-03  Kenichi Handa  <handa@m17n.org>
146
147         * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
148         is not at the beginning of line.
149
150 2005-09-22  Kenichi Handa  <handa@m17n.org>
151
152         * input.c: Include <sys/stat.h> and <unistd.h>.
153         (Minclude, Mcommit, Munhandle): New variables.
154         (minput__init): Initialize them.  Push only Mstate to
155         load_im_info_keys.   Add aliases C-lowercase for C-uppercase.
156         (parse_action_list): Allow integer arg for undo.  Handle Mcommit
157         and Munhandle.
158         (load_input_method): Handle "include" directive.  If no states are
159         loaded, return -1.
160         (shift_state): If state_name is Mt, shift back to the previous
161         state.  Call preedit_commit to commit preedit text.
162         (preedit_commit): New function.
163         (take_action_list): Improve debug printing.  Handle commit and
164         unhandle commands.
165         (handle_key): Check the return value of take_action_list.  Don't
166         take branch_actions just after changing to the root map.
167         (reset_ic): Reset all ic_info members.
168         (filter): When a key is not handled, just move ic_info->keys
169         instead fo calling reset_ic.
170         (load_im_info): If key is not Mstate, push Mmap to
171         load_im_info_keys.
172         (MDatabaseStatList): New type.
173         (imdir_stat_list): New variable.
174         (input_method_hook): Don't cancel the hook.  Check the
175         modification time of directories.
176         (minput__fini): Free imdir_stat_list;
177
178         * input.h (MInputContextInfo): New member prev_state.
179
180         * m17n-core.h (mplist_conc): Extern it.
181
182         * plist.c (mplist_conc): New function.
183
184         * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
185
186         * font.h (MRealizedFont): New member average_width.
187
188         * font-ft.c (ft_open): Set rface->average_width.
189
190         * font.c (xlfd_unparse_name): Print '*' before registry name.
191
192         * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
193         (xfont_open): Set rfont->average_width.
194         (xft_open): Likewise.
195         (device_open): Initialize disp_info->AVERAGE_WIDTH.
196
197         * internal-gui.h (struct MFrame): New member average_width.
198
199         * m17n-gui.c (mframe): Fix setting of frame->rfont.
200         (mframe_get_prop): Return the average_width of a font.
201
202         * face.c (mface__realize): Set rface->average_width.
203         (mface__update_frame_face): Set frame->average_width.
204
205         * face.h (MRealizedFace): New member average_width.
206
207 2005-09-19  Kenichi Handa  <handa@m17n.org>
208
209         * font.c (xlfd_unparse_name): New arg full_xlfd.
210         (mfont__encode_char): Use shortcut only for X core fonts.
211         (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
212         (mfont_put_prop): Handle `language' property.
213         (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
214         Print file can capability info too.
215
216         * m17n-core.c (mdebug__output): New variable.
217         (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
218         (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
219         (m17n_fini_core): Close mdebug__output if it's not stderr.
220
221         * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
222         (xfont_open): Handle baseline_offset.
223         (xfont_find_metric): Likewise.
224         (xfont_render): Likewise.
225         (xft_open): Likewise.
226         (xft_render): Likewise.
227
228         * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
229         (mdebug__output): Extern it.
230         (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
231         (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
232         (MDEBUG_DUMP): New macro.
233         (MDEBUG_PRINT_TIME): Print to medebug__output.
234
235         * font.h (MRealizedFont): New member baseline_offset.
236
237         * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
238         characters.
239         (fc_weight_table): Add FC_WEIGHT_REGULAR.
240         (ft_list_family): Check alias.
241         (ft_list_language): If language is "en", don't try to the second
242         step.
243         (ft_default_list): New variable.
244         (ft_list_default): New function.
245         (ft_select): If family is not specified, try only the default
246         fonts.  Treat the weights normal and medium same.
247         (ft_open): Fix debug message.  If registry is not specified, try
248         unicode-bmp.  Handle _MULE_BASELINE_OFFSET property of BDF fonts.
249         (ft_find_metric): Likewise.
250         (ft_render): Likewise.
251         (ft_list): Fix debug message.  Accept the registring iso8859-1.
252         If family is not specified, try only the default fonts.
253
254         * face.c (mface__realize): Fix logic of opening a font.
255
256 2005-09-16  Kenichi Handa  <handa@m17n.org>
257
258         * face.c (mface__realize): 
259
260         * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
261         Extern them.
262
263         * input.c (shift_state): Fix the condition of taking init actions.
264         (take_action_list): Fix handling of pushback action.
265         (handle_key): Don't change key while checking its alias.
266         (minput__init): Initialize new variables.
267         (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
268         variables.
269
270 2005-09-12  Kenichi Handa  <handa@m17n.org>
271
272         * mtext.c (mtext__uppercase): Add proper open/close parens.
273         (mtext_titlecase): Add proper casting.
274
275         * input.c (parse_action_list): Handle the case that the arg is a
276         key sequence (MText or MPlist).
277         (take_action_list): Likewise.
278         (shift_state): Shorter debug message.
279         (handle_key): Terminate a debug message by "\n".
280         (reset_ic): Don't take initial actions here.
281         (minput_open_im): Print a debug message.
282         (minput_close_im): Likewise.
283         (minput_create_ic): Likewise.
284         (minput_destroy_ic): Likewise.
285
286 2005-09-09  TAKAHASHI Naoto  <ntakahas@m17n.org>
287
288         * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
289         Change API.
290
291 2005-09-07  TAKAHASHI Naoto  <ntakahas@m17n.org>
292         * character.c: Add "cased", "soft-dotted", and "case-mapping" in
293         mchar__init ().
294
295         * character.c: Add Japanese documentation for
296         mchar_get_prop_table ().
297
298 2005-09-06  TAKAHASHI Naoto  <ntakahas@m17n.org>
299
300         * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
301         (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
302         (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
303         New variables.
304         (init_case_conversion): New function.
305         (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
306         (uppercase_precheck, lowercase_precheck, final_sigma)
307         (after_soft_dotted, more_above, before_dot, after_i)
308         (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
309
310 2005-09-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
311
312         * plist.c (read_mtext_element): Fix previous change.
313
314 2005-09-05  Kenichi Handa  <handa@m17n.org>
315
316         * plist.c (read_mtext_element): Handle \uXXXX notation.
317
318         * internal.h (MTABLE_MALLOC): Don't use a local variable.
319         (MTABLE_ALLOCA): Change the name of local variable.
320
321         * m17n-gd.c (device_open): Define it even if HAVE_GD nor
322         HAVE_FREETYPE are defined.
323
324         * m17n-X.c: Check HAVE_X11.
325
326         * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
327         directory listing libraries.
328         (noinst_PROGRAMS): Define it only in maintainer mode.
329
330 2005-09-02  Kenichi Handa  <handa@m17n.org>
331
332         * m17n-gui.h (mdraw_line_break_option): Extern it.
333
334         * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
335         end of the first glyph.
336         (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
337         them.
338         (mdraw_line_break_option): New variable.
339         (mdraw_default_line_break): Use mtext_line_break.
340
341         * mtext.h (wordseg_func_table): Don't extern it.
342         (mtext__wseg_fini): Extern it.
343
344         * mtext.c: Don't include word-thai.h.
345         (wordseg_func_table): Delete this variable.
346         (mtext__init): Don't initialize above.  Don't call
347         mtext__word_thai_init.
348         (mtext__fini): Don't free wordseg_func_table.  Call
349         mtext__wseg_fini instead fo mtext__word_thai_fini.
350         (MTextWordsegFunc): Don't typedef it.
351         (mtext__word_segment): Moved to mtext-wseg.c.
352
353         * m17n-core.h (enum MTextLineBreakOption): New enum.
354         (mtext_line_break): Extern it.
355
356         * mtext-wseg.c: New file.
357
358         * mtext-lbrk.c: New file.
359
360         * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
361         add mtext-lbrk.c and mtext-wseg.c.
362
363         * textprop.c (mtext__adjust_plist_for_change): Pay attention for
364         the case that head is NULL.
365
366 2005-09-01  Kenichi Handa  <handa@m17n.org>
367
368         * word-thai.c (wordseg_propertize): If the property value is nil,
369         don't make the property no-merge.
370         (thai_wordseg): Don't require *from and *to are set a priori.  Pay
371         attention to the case that they are NULL.
372         (mtext__word_thai_init): Make the name of Mthai_wordseg starts
373         with two spaces.
374
375         * character.c (mchar_get_prop_table): New function.
376
377         * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
378
379         * m17n-core.h (mtext_insert, mtext_replace): Extern them.
380         (mchar_get_prop_table): Extern it.
381
382         * textprop.c (prepare_to_modify): New arg deleting.  Callers changed.
383         (mtext__adjust_plist_for_change): Argument changed.  Callers changed.
384
385         * internal.h (enum MTextCoverage): New enum.
386         (MText): New member coverage.
387
388         * mtext.c (FORMAT_COVERAGE): New macro.
389         (insert): Copy mt2->coverage.
390         (mtext__from_data): Initialize mt->coverage.
391         (mtext__adjust_format): Update mt->coverage.
392         (mtext): Initialize mt->coverage.
393         (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
394         Update mt->coverage if necessary.
395         (mtext_duplicate): Copy mt->coverage.
396         (mtext_insert, mtext_replace): New functions.
397         (mtext_dup): Use mtext_duplicate.
398         (mtext__word_segment): Don't set *from and *to if a word
399         segmentation funcion is not found.
400         (mtext_ins_char): Fix typo.
401
402 2005-08-25  Kenichi Handa  <handa@m17n.org>
403
404         * font.h (MFont): New member for_full_width.
405
406         * font.c (compare_font_score): Prefer a font of not
407         for_full_width.
408
409         * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
410         registry charset of a font is one of CJK charsets.
411
412         * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
413         supports some of CJK.
414
415 2005-08-24  Kenichi Handa  <handa@m17n.org>
416
417         * m17n-gui.h (Mascent, Mdescent): Don't extern them.
418
419         * m17n-gui.c (null_device_open): Check Mresolution param and set
420         frame->dpi.
421
422         * m17n-gd.c (device_open): Check Mresolution param and set
423         frame->dpi.
424
425         * m17n-X.c (MWDevice): New member resy.
426         (xfont_open): Set ascent, descent, and max_advance members of
427         rfont.
428         (xft_open): Likewise.
429         (device_open): Compare also screen_num to find a device.  Set
430         device->resy and frame->dpi.
431
432         * internal-gui.h (MFrame): New member dpi.
433
434         * font.h (MRealizedFont): New member max_advance.
435
436         * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
437         (mfont__init): Don't initialize Mascent, Mdescent.
438         (Mascent, Mdescent): Delete these variables.
439         (mfont_get_prop): Fix previous change.  Check Mfont_ascent and
440         Mfont_descent instead of Mascent and Mdescent.
441         (mfont_put_prop): Allow negative size.
442         (mfont_find): Handle the case of spec->size < 0.  Fix previous
443         change.
444         (mfont_list): Handle the case of spec->size < 0.
445         (mfont_check): Likewise.
446
447         * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
448         (fc_get_pattern): Handle the case of font->size < 0.
449         (ft_open): Set ascent, descent, and max_advance members of rfont.
450         (ft_find_metric): Improve rounding.
451         (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
452         FC_SIZE.
453
454         * face.c (mface__realize): Handle the case of font->size < 0.
455
456 2005-08-22  Kenichi Handa  <handa@m17n.org>
457
458         * coding.c (MConverterStatus): Change the member buf to union.
459         (mconv_buffer_converter): Add const to the arg buf.
460         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
461         (mconv_decode): Adjusted for the change of MConverterStatus.
462         (mconv_encode_range): Likewise.
463
464         * m17n.h (mconv_buffer_converter): Prototype adjusted.
465         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
466
467 2005-08-20  Kenichi Handa  <handa@m17n.org>
468
469         * m17n-gui.h (mfont_from_name): Prototype adjusted.
470         (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
471
472         * m17n-X.c (xfont_open): Set members ascent, descent, and
473         max_advance of rfont.
474         (xft_open): Likewise.
475
476         * font-ft.c (ft_open): Set members ascent, descent, and max_advance
477         of rfont.
478         (mfont__ft_parse_name): Add const to the arg name.
479
480         * font.c (xlfd_parse_name): Add const to the arg name.  Call
481         mfont__set_property instead of mfont_set_spec.  Set font->spacing.
482         (xlfd_unparse_name): Handle spacing.
483         (mfont__init): Initialize new variables.
484         (mfont__id): Handle spacing.
485         (mfont__merge): Likewise.
486         (mfont__set_spec): This function deleted.
487         (mfont__parse_name_into_font): Add const to the arg name.  Fix the
488         condition of calling mfont__ft_parse_name.
489         (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
490         (mfont_get_prop): Handle properties spacing, ascent, descent,
491         and max-advance.
492         (mfont_find): Return a realized font.
493         (mfont_from_name): Add const to the arg name.
494
495         * font.h (enum MFontProperty): New member MFONT_SPACING.
496         (enum MFontSpacing): New enum.
497         (MFont): New members spacing and max_advance.
498         (mfont__ft_parse_name): Prototype adjusted.
499         (mfont__set_spec): Extern deleted.
500         (mfont__parse_name_into_font): Prototype adjusted.
501
502 2005-08-19  Kenichi Handa  <handa@m17n.org>
503
504         * m17n-gui.h (mfont_parse_name): Prototype adjusted.
505
506         * font.c (mfont_list): If FONT is null, use a temporary font.
507         (mfont_parse_name): Add const to the arg name.
508
509 2005-08-18  Kenichi Handa  <handa@m17n.org>
510
511         * word-thai.c: Surround code by #ifdef and #endif to escape from
512         doxygen.
513
514         * font-ft.c: Mostly re-written.
515
516         * font-flt.c (FontLayoutCmdOTF): This type deleted.
517         (FontLayoutCmd): Type of the member otf changed..
518         (load_otf_command): Adjusted for the format change of otf command.
519         (load_command): Likewise.
520         (free_flt_command): Unref cmd->body.otf.
521         (run_otf): Ajusted for the type change of otf_cmd.
522         (run_command): Ajusted for the type change of otf_cmd.  On
523         debugging, print ctx->combining_code.
524         (mfont__flt_run): Initialize ctx's members code_offset,
525         combining_code, and left_padding to 0.
526
527         * face.h (struct MRealizedFace): New member font.
528         (mface__realize): Prototype adjusted.
529
530         * face.c (find_realized_face): New arg font.
531         (find_realized_face): Adjusted for the change of MFont.
532         (mface__init): Call M17N_OBJECT_ADD_ARRAY.
533         (mface__fini): Don't call mdebug__report_object.
534         (mface__realize): New arg font.
535         (mface__for_chars): Adjusted for the change of mfont__encode_char.
536         Optimize the latin case.
537         (mface__free_realized): Free rface->font.
538         (mface__update_frame_face): Adjusted for the change of mface__realize.
539         (mface_equal): New function.
540
541         * draw.c (Mcommon): New variable.
542         (visual_order): Args to mfont__encode_char changed.
543         (compose_glyph_string): Handle Mfont text property.
544         (layout_glyphs): Adjusted for the change of MFont.
545         (mdraw__init): Initialize Mcommon.
546         (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
547
548         * font.h (enum MFontType): Members completely changed.
549         (enum MFontProperty): Move MFONT_SIZE to the tail.
550         (enum MFontSource): New enum.
551         (struct MFont): New members type, source, sizes, file, capability,
552         and encoding.
553         (struct MRealizedFont): Type of member font changed. Members
554         score, status, and encoding deleted.
555         (MFontScore): New type.
556         (MFontList): Member changed.
557         (struct MFontDriver): New member has_char.  Types of members
558         changed.
559         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
560         (Mapple_roman): Extern them.
561         (OTF_Tag): Typedefed if not HAVE_OTF.
562         (enum MFontOpenTypeTable): New enum.
563         (MFontCapability): New type.
564         (mfont__ft_drive_otf): Prototype adjusted.
565         (mfont__score): Extern deleted.
566         (mfont__merge): Extern it.
567         (mfont__has_char): Extern it.
568         (mfont__encode_char): Prototype adjusted.
569         (mfont__open): Extern it.
570         (mfont__set_spec): Prototype adjusted.
571         (mfont__get_capability): Extern it.
572
573         * font.c: Include "fontset.h".
574         (M_font_capability, M_font_list, M_font_list_len): New variables.
575         (font_score_priority): Change order of initial elements.
576         (font_score_shift_bits): Fix array size.
577         (common_weight): Add "thin", "semibold", and "heavy".
578         (common_stretch): Add "ultracondensed", "extracondensed",
579         "extraexpanded", and "utltraexpand".
580         (font_weight_regular, font_weight_normal, font_weight_medium): New
581         variables.
582         (gen_font_name): This function deleted.
583         (find_encoding): Set font->encoding.
584         (OTF_tag): New function.
585         (otf_script_list): New variable.
586         (load_otf_script_list): New function.
587         (find_script_from_otf_tag): New function.
588         (xlfd_parse_name): Set font->type and font->source.
589         (mfont__free_realized): Free chains rfonts.
590         (font_score): Renamed from mfont__score.
591         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
592         (Mapple_roman): New variables.
593         (mfont__init): Initilize new variables.  Initalize
594         default_encoding.encoding_name and
595         default_encoding.encoding_charset to Municode_full and
596         mcharset__unicode.  Use SAFE* macros for allocating filepath
597         buffer.
598         (mfont__fini): Free otf_script_list.
599         (mfont__id): New function.
600         (mfont__match_p): Check also capability member of MFont.
601         (mfont__merge): New funciton.
602         (mfont__set_spec_from_face): Set type and source members.
603         (mfont__set_spec_from_plist): Set capability and type members.
604         (mfont__select): Argument changed.
605         (mfont__available): New function.
606         (compare_font_score): New function.
607         (mfont__list): New function.
608         (mfont__open): Return a realized font.
609         (mfont__resize): Adjusted for the change of MFont.
610         (mfont__has_char): New function.
611         (mfont__encode_char): Argument changed.
612         (mfont__set_spec): Argument changed.
613         (free_font_capability): New function.
614         (mfont__get_capability): New function.
615         (MFontfile): New variable.
616         (mfont_get_prop): Adjusted for the change of MFont.
617         (mfont_put_prop): Likewise.
618         (mfont_set_selection_priority): Fix the way of setting
619         font_score_priority[].
620         (mfont_find): Use mfont__list instead of mfont__select.
621         (mfont_resize_ratio): Adjusted for the change of MFont.
622         (mfont_list): Use mfont__list.
623         (mfont_check): New function.
624         (font_score): Make it static.
625
626         * fontset.h (mfont__realize_fontset): Prototype adjusted.
627         (mfont__lookup_fontset): Likewise.
628
629         * fontset.c (struct MFontset): Delete member font_spec_list.
630         (struct MRealizedFontset): Type of member spec changed.  New
631         member request.
632         (load_font_group): Arg spec_list deleted.
633         (load_fontset_contents): Adjusted for the change of fontset_def.
634         (free_fontset): Fix the way of freeing fontset elements.
635         (realize_fontset_elements): Argument changed.
636         (get_per_script): New function.
637         (free_realized_fontset_elements): Fix the way of feeing rfontset
638         elements.
639         (update_fontset_elements): Fix args to realize_fontset_elements.
640         (mfont__realize_fontset): New arg spec.
641         (try_font_list): New function.
642         (try_font_group): New arg request.  Use try_font_list.
643         (mfont__lookup_fontset): New arg ignore_fallback.  Fix arg to
644         try_font_group.
645         (mfontset): Adjusted for the change of MFontset.
646         (mfontset_copy): Likewise.  Don't share plists.
647         (mfontset_modify_entry): Adjusted for the change of MFontset.
648         (mfontset_lookup): Call get_per_script.
649         (mdebug_dump_fontset): Print also the address of fonts.
650
651         * input.c (shift_state): Don't reset ic_info->vars.
652         (take_action_list): Call MDEBUG_PRINT fore calling
653         take_action_list.
654
655         * internal-gui.h (MFontDriver): Don't typedef it here.
656
657         * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
658         (MXFont): This type deleted.
659         (MFontX): New type.
660         (struct _MFontX): New struct.
661         (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
662         (MDisplayInfo): Member base_font_list deleted.
663         (DEFAULT_FONT): Definition changed.
664         (FALLBACK_FONT): This maclr deleted.
665         (free_display_info): Adjusted for the change of MDisplayInfo.
666         (free_device): Argument to mfont__free_realized changed.
667         (xfont_driver): Adjusted for the change of MFontDriver.
668         (xfont_registry_list): Use MFontX instead of MXFont.
669         (MRealizedFontX): Renamed from MXFontInfo.
670         (xfont_select): Return the font found first.
671         (close_xfont): Change MXFontInfo to MRealizedFontX.
672         (xfont_open): Return the realized font.
673         (xfont_find_metric): Get xfont from rfont->fontp.
674         (xfont_has_char): New function.
675         (xfont_encode_char): Adjusted for the argument change.
676         (xfont_render): Get xfont from rfont->fontp.
677         (xfont_list): Adjusted for the argument change.
678         (MRealizedFontXft): Renamed from MXftFontInfo.
679         (xft_driver): Ajusted for the change of MFontDriver.
680         (close_xft): Change MXtfFontInfo to MRealizedFontXft
681         (xft_open_font): Argument changed.
682         (xft_open): Argument changed.  Return the realized font.
683         (xft_find_metric): Get xft_font from rfont->fontp.
684         (xft_has_char, xft_encode_char): New functions.
685         (xft_render): Change MXftFontInfo to MRealizedFontXft.  Open a
686         font if not yet opened.
687         (device_open): Don't set frame->font.
688
689         * m17n-gd.c (gd_font_driver): Adjusted for the change of
690         MFontDriver.
691         (gd_font_open): New function.
692         (gd_render): Don't use the local variable ft_info.
693         (device_init): Adjusted for the change of gd_font_driver.
694
695         * textprop.c (mtext__prop_init): Initialize text_property_table.
696         Call M17N_OBJECT_ADD_ARRAY.
697         (mtext__prop_fini): Don't call mdebug__report_object.
698
699         * plist.c (mplist__init): Initialize plist_table.
700         (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
701         (mplist__fini): Don't call mdebug__report_object.
702
703         * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
704         (mtext__fini): Don't call mdebug__report_object.
705         (MTEXT_FORMAT_UTF_16): Correct type.
706         (mtext_data): New function.
707         (mtext_text): Fix calculation of limit and args to
708         find_char_backward.
709
710         * language.c: Include "plist.h".
711         (M_script_lang_list): New variable.
712         (mlang__init): Read languages and their information from m17n
713         database.
714         (mlanguage__list): New function.
715         (Miso639_1, Miso639_2): New variables.
716
717         * language.h (mlanguage__list): Extern it.
718
719         * database.c (get_database_stream): Use SAFE_* macros for
720         allocating and freeing path.
721         (mdatabase__init): Likewise.
722
723         * symbol.c (msymbol__fini): Don't free symbols here.
724         (msymbol__free_table): New function.
725         (msymbol_is_managing_key): New function.
726
727         * symbol.h (msymbol__free_table): Extern it.
728         (msymbol__list): Extern it.
729
730         * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
731         New macros.
732         (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
733         (struct _M17NObjectArray): New member name and next.
734         (mdebug__add_object_array): Extern it.
735         (M17N_OBJECT_ADD_ARRAY): New macro.
736         (mdebug__report_object): Don't extern it.
737
738         * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
739
740         * m17n-gui.c (free_frame): Don't free frame->font.
741         (null_device_fini): Fix code for freeing
742         null_device.realized_font_list.
743         (m17n_fini_win): Free interface.
744         (mframe): Cast the return value of dlsym.  Set frame->font here.
745         (mframe_get_prop): Check frame->rface->rfont before accessing the
746         member font.
747
748         * m17n-gui.h (Mfontfile): Extern it.
749         (mfont_check): Extern it.
750         (mface_equal): Extern it.
751
752         * m17n-core.c: Include "symbol.h".
753         (report_header_printed): This variable deleted.
754         (object_array_root): New variable.
755         (report_object_array): New function.
756         (mdebug__report_object): This function deleted.
757         (mdebug__add_object_array): New function.
758         (m17n_init_core): Call mchartable_init () before mtext_init ().
759         (m17n_fini_core): Call report_object_array (if necessary) and
760         msymbol__free_atable at the end.
761
762         * m17n-core.h (msymbol_is_managing_key): Extern it.
763         (mtext_data): Extern it.
764         (MTEXT_FORMAT_UTF_16): Correct type.
765         (M17NLIB_MINOR_VERSION): Changed to 3.
766         (M17NLIB_VERSION_NAME): Changed to "1.3.0".
767         
768         * chartab.c (mchartable__init): Initalize chartable_table.count.
769         (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
770         mdebug__report_object.
771
772 2005-05-26  Kenichi Handa  <handa@m17n.org>
773
774         * m17n.h (Miso639_1, Miso639_2): Extern them.
775
776         * symbol.h (msymbol__list): Extern it.
777
778         * symbol.c (msymbol__list): New function.
779
780 2005-05-19  Kenichi Handa  <handa@m17n.org>
781
782         * input-gui.c (minput__win_init): Don't change the value of
783         minput_driver.
784
785 2005-05-16  Kenichi Handa  <handa@m17n.org>
786
787         * m17n-core.c (m17n_object): Be sure to initialize all members.
788
789         * font-ft.c (fc_decode_prop): Fix args to msymbol.
790
791 2005-05-09  Kenichi Handa  <handa@m17n.org>
792
793         * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
794
795 2005-04-27  Kenichi Handa  <handa@m17n.org>
796
797         * language.c (mlang__init): Add "an" (Aragonese).
798
799         * word-thai.c: Add support for libthai.
800         (mtext__word_thai_init): Initialize wordseg library conditionaly.
801         (mtext__word_thai_fini): Finalize wordseg library conditionaly.
802
803         * mtext.c: Include "word-thai.h" conditionaly.
804         (mtext__init): Call mtext__word_thai_init conditionaly.
805         (mtext__fini): Call mtext__word_thai_fini conditionaly.
806
807         * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
808         not WORDCUT_LD_FLAGS.
809
810 2005-04-19  Kenichi Handa  <handa@m17n.org>
811
812         * word-thai.c (wordseg_propertize): Always unref the attached
813         property.
814         (thai_wordseg): Don't unref the property.
815
816 2005-04-18  Kenichi Handa  <handa@m17n.org>
817
818         * word-thai.c: Include stdlib.h.
819         (wordseg_propertize): Add dummy function for the case that wordcut
820         library doesn't exist.
821         (wordseg_propertize): Fix for old wordcut library.
822
823 2005-04-16  Kenichi Handa  <handa@m17n.org>
824
825         * word-thai.c: Include <stdio.h>.
826
827 2005-04-15  Kenichi Handa  <handa@m17n.org>
828
829         * draw.c: Include mtext.h.
830         (linebreak_table, M_break_at_space, M_break_at_word)
831         (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
832         (compose_glyph_string): Check POS before getting Mface text
833         property.
834         (truncate_gstring): Give correct TO arg to line_break function.
835         (GET_LB_TYPE): New macro.
836         (find_break_backward, find_break_forward): New functions.
837         (mdraw__init): Initialize the above new variables.
838         (mdraw__fini): Free linebreak_table.
839         (mdraw_default_line_break): Use find_break_backward and
840         find_break_forward.
841
842         * word-thai.c: New file.
843
844         * word-thai.h: New file.
845
846         * mtext.c: Include word-thai.h.
847         (wordseg_func_table): New variable.
848         (mtext__init): Initialize wordseg_func_table and call
849         mtext__word_thai_init.
850         (mtext__fini): Call mtext__word_thai_fini, free
851         wordseg_func_table.
852         (MTextWordsegFunc): New type.
853         (mtext__word_segment): New function.
854
855         * mtext.h (wordseg_func_table): Extern it.
856         (mtext__word_segment): Extern it.
857
858         * m17n.c (m17n_init): Fix typo (== -> =).
859
860         * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
861         (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
862
863         * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
864         (MTEXTPROP_VAL): New macros.
865
866         * input.c (DLOPEN_SHLIB_EXT): Don't define it.
867
868 2005-04-07  Kenichi Handa  <handa@m17n.org>
869
870         * database.c (load_chartable): Fix pursing of symbol name.
871
872 2005-03-24  Kenichi Handa  <handa@m17n.org>
873
874         * m17n.c (m17n_init): Fix typo (== -> =).
875
876 2005-03-11  Kenichi Handa  <handa@m17n.org>
877
878         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
879
880         * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
881
882         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
883         first.
884
885 2005-03-09  handa  <handa@m17n.org>
886
887         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
888         calling m17n_init ().
889
890         * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
891         calling m17n_init_core ().
892
893 2005-02-28  Kenichi Handa  <handa@m17n.org>
894
895         * font-flt.c (mfont__flt_run): Add resulting code sequence in
896         debug info.
897
898 2005-02-17  Kenichi Handa  <handa@m17n.org>
899
900         * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
901         (M_description, M_command, M_variable): New variables.
902         (load_im_info_keys): New variables.
903         (load_im_info, check_command_keyseq, get_description_advance)
904         (parse_command_list, get_command_list, parse_variable_list)
905         (get_variable_list, input_method_hook): New functions.
906         (command_list, variable_list): New variables.
907         (minput__init): Put input_method_hook to Minput_method.
908         Initialize M_description, M_command, M_variable, Mdetail_text,
909         load_im_info_keys, command_list, variable_list.
910         (minput__fini): Unref command_list, variable_list, load_im_info_keys.
911         (Mdetail_text): New variable.
912         (minput_get_description, minput_get_commands)
913         (minput_assign_command_keys, minput_get_variables)
914         (minput_set_variable): New functions.
915
916         * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
917         (minput_assign_command_keys, minput_get_variables)
918         (minput_set_variable): Extern them.
919
920         * plist.c (UNGETC): Just decrement st->p.
921         (read_mtext_element): New arg skip.
922         (read_integer_element): Likewise.
923         (read_symbol_element): Likewise.
924         (read_element): New arg KEYS.
925         (mplist__from_plist): Don't increment ref-count of NULL object.
926         (mplist__from_file): New arg KEYS.
927         (mplist_put): Don't increment ref-count of NULL object.
928         (mplist_add): Likewise.
929         (mplist_push): Likewise.
930         (mplist_set): Likewise.  Call M17N_OBJECT_UNREF unconditionally.
931
932         * plist.h (mplist__from_file): Prototype adjusted.
933
934         * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
935         (get_database_stream): New function.
936         (load_database): Use get_database_stream.
937         (M_database_hook): New variable
938         (mdatabase__init): Initialize M_database_hook.
939         (mdatabase__load_for_keys): New function.
940         (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
941         function.
942         (mdatabase_define): Free mdb->extra_info if necessary.
943
944         * database.h (mdatabase__dir_list, M_database_hook)
945         (mdatabase__load_for_keys): Extern them.
946         (MDatabaseHookFunc): New type.
947
948         * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
949
950 2004-12-27  Kenichi Handa  <handa@m17n.org>
951
952         * Version 1.2.0 released.
953
954 2004-12-27  Kenichi Handa  <handa@m17n.org>
955
956         * input.c (minput_filter): Don't reset ic->xxx_changed.
957
958         * mtext.c (mtext_from_data): Fix documentation.
959
960 2004-12-25  Kenichi Handa  <handa@m17n.org>
961
962         * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
963         (M17NLIB_VERSION_NAME): Update to "1.2.".
964
965 2004-12-24  Kenichi Handa  <handa@m17n.org>
966
967         * input.c (reset_ic): Set key_unhandled to 0.
968
969 2004-12-21  Kenichi Handa  <handa@m17n.org>
970
971         * m17n-gui.h (mfont_from_spec): Delete extern.
972
973         * input-gui.c (win_callback): Handle Minput_reset.
974         (minput__win_init): Register reset_ic as a callback for
975         Minput_reset.
976
977         * input.c (reset_ic): New arg IGNORE which is ignored.  Caller
978         changed.  At first, shift to the initial state.
979         (minput__init): Initialize Minput_reset.  Register reset_ic as a
980         callback for Minput_reset.
981         (Minput_reset): New variable.
982         (minput_filter): Always set ic->xxx_changed to 0.
983         (minput_reset_ic): New function.
984         (integer_value): Fix typo ('>' -> '<') and calculation of length
985         of preedit text.
986
987         * m17n-core.c (merror_code): Change type to `int'.
988
989         * m17n-misc.h (merror_code): Adjust type.
990
991         * m17n.h (Minput_reset, minput_reset_ic): Extern them.
992
993         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
994         (mtext_change_prop): Delete extern.
995
996         * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
997         to `int'.  Move the documents to m17n-core.h.
998
999 2004-12-13  Kenichi Handa  <handa@m17n.org>
1000
1001         * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
1002         (MTextProperty): Document it.
1003
1004 2004-12-09  Kenichi Handa  <handa@m17n.org>
1005
1006         * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
1007
1008 2004-12-03  Kenichi Handa  <handa@m17n.org>
1009
1010         * internal.h (m17n__core_initialized, m17n__shell_initialized,
1011         m17n__gui_initialized): New externs.
1012
1013         * m17n-core.h (enum M17NStatus): New enum.
1014         (m17n_status): Extern it.
1015
1016         * m17n-core.c (core_initialized): Delete this variable.
1017         (m17n__core_initialized, m17n__shell_initialized,
1018         m17n__gui_initialized): New variables.
1019         (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
1020         instead of core_initialized.
1021         (m17n_status): New function.
1022
1023         * m17n.c (shell_initialized): Delete this variable.
1024         (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
1025         shell_initialized.
1026
1027         * m17n-gui.h (m17n_init_win): Adjust the prototype.
1028
1029         * m17n-gui.c (win_initialized): Delete this variable.
1030         (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
1031         instead of gui_initialized.
1032
1033 2004-11-19  Kenichi Handa  <handa@m17n.org>
1034
1035         * input.c (reset_ic): Check if ic_info->state is NULL.
1036         (filter): If ic_info->state is NULL, return 0.
1037         (load_input_method): Don't unref `maps' it it's not created.
1038
1039 2004-11-15  Kenichi Handa  <handa@m17n.org>
1040
1041         * input.c (find_candidates_group): If INDEX is -1, find the last
1042         candidate group.
1043         (take_action_list): If the previous of the first candidate is
1044         requested, select the last candidate.
1045
1046 2004-11-08  Kenichi Handa  <handa@m17n.org>
1047
1048         * m17n-X.c (device_open): Try at most 32 fonts to find a
1049         non-autoscaled font.
1050
1051         * font.c (xlfd_parse_name): Fix previous change.
1052
1053 2004-11-05  Kenichi Handa  <handa@m17n.org>
1054
1055         * font.c: (commont_style): Include dummy elements "slanted" and
1056         "rslanted" to prefer "o" to "r" if "i" is requested.
1057
1058         * font-ft.c (ft_to_prop): Fix "oblique" entry.
1059
1060 2004-10-29  Kenichi Handa  <handa@m17n.org>
1061
1062         * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
1063
1064         * m17n-X.c (MXFont): Change type of the member `sizes' to int.
1065         New members smallest and larger.
1066         (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
1067         (xfont_registry_list): Likewise.
1068         (xfont_select): Likewise.
1069         
1070
1071 2004-10-28  Kenichi Handa  <handa@m17n.org>
1072
1073         * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
1074         font name comparison.
1075         (xfont_select): Fix logic for selecting a larger size font.
1076
1077 2004-10-25  Kenichi Handa  <handa@m17n.org>
1078
1079         * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
1080         ">" actions.
1081
1082 2004-10-22  Kenichi Handa  <handa@m17n.org>
1083
1084         * input.c (update_candidate): Renamed from udpate_candidate.
1085         (take_action_list): Show more debugging info on arithmetic commands.
1086
1087         * m17n-X.c (device_open): Fix previous change.
1088
1089         * draw.c (compose_glyph_string): Don't get face property at the
1090         end of M-text.
1091
1092 2004-10-21  Kenichi Handa  <handa@m17n.org>
1093
1094         * draw.c (compose_glyph_string): Fix for the case of category
1095         being Mnil.
1096
1097 2004-10-19  Kenichi Handa  <handa@m17n.org>
1098
1099         * input.c (mdebug_mask): New variable.
1100         (shift_state): Print debug information.
1101         (take_action_list): Likewise.
1102         (handle_key): Likewise.
1103
1104 2004-10-14  Kenichi Handa  <handa@m17n.org>
1105
1106         * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
1107
1108 2004-10-13  Kenichi Handa  <handa@m17n.org>
1109
1110         * m17n-X.c (device_open): Be sure to register at least one font
1111         driver.
1112
1113         * font-ft.c: Include <freetype/ftbdf.h> conditionally.  Check
1114         HAVE_FTBDF_H before calling FT_Get_BDF_Property.
1115
1116 2004-10-12  Kenichi Handa  <handa@m17n.org>
1117
1118         * draw.c (alloc_gstring): Fix previous change.
1119
1120         * font-ft.c (ft_list_generic): Fix for the case of not
1121         HAVE_FONTCONFIG.
1122
1123         * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
1124
1125         * font.c (mfont_list): If no font is found, return NULL.
1126         (load_font_encoding_table): Put entries of nil registry first.
1127         (find_encoding): Adjust for the above change.
1128
1129 2004-10-11  Kenichi Handa  <handa@m17n.org>
1130
1131         * m17n-gui.h (mfont_list): Adjust prototype.
1132
1133         * m17n-X.c (xfont_list): New arg maxnum.
1134
1135         * font.h (struct MFontDriver): Change prototype of <list>.
1136
1137         * font-ft.c (fc_generic_family_list): Delete it.
1138         (Mserif, Msans_serif, Mmonospace): Delete them.
1139         (M_generic_family_info): New variable.
1140         (enum GenericFamilyType): New enum.
1141         (struct GenericFamilyInfo): New struct.
1142         (generic_family_table): New variable.
1143         (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
1144         iso8859-1.
1145         (add_font_info): Get style here.
1146         (ft_list_family): Don't initialize fc_config here.  Don't list
1147         generic families.
1148         (ft_list_generic): New function.
1149         (ft_select): Pay attention to generic familes here.
1150         (ft_open): Fix calculation of ascent and descent.
1151         (ft_list): Pay attention to generic families.
1152         (mfont__ft_init): Initialize M_generic_family_info,
1153         generic_family_table, and fc_config..
1154         (mfont__ft_fini): Finalize generic_family_table.
1155
1156         * draw.c (compose_glyph_string): Use more constant font for
1157         glyphs.  Adjust for the member change in MGlyph.
1158         (layout_glyph_string): Adjust for the member change in MGlyph.
1159         (alloc_gstring): Intilize scracth_glyph to avoid
1160         compose_glyph_string on it.
1161         (get_gstring): Don't call compose_glyph_string on scracth_glyph.
1162         (mdraw_coordinates_position): Fix previous change.
1163
1164         * internal-gui.h (glyph_category): New enum.
1165         (MGlyph): Change type of <category> to enum glyph_category.
1166
1167         * face.c (mface__realize): Delete args langauge and charset.
1168         (mface__for_chars): Fix for the case that glyphs have different
1169         rfaces.
1170         (mface__update_frame_face): Adjust for mface__realize change.
1171
1172         * face.h (mface__realize): Adjust prototype.
1173
1174 2004-10-05  Kenichi Handa  <handa@m17n.org>
1175
1176         * language.c (mlang__init): Add Akan.
1177
1178 2004-10-04  Kenichi Handa  <handa@m17n.org>
1179
1180         * font-ft.c (add_font_info): Add instead of push the element.
1181         (ft_list_family): For generic fonts, try all
1182         substituted. families.
1183
1184         * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
1185         (run_rule): Don't update cluster range here.
1186         (run_command): Update cluster range on appending a glyph.
1187         (run_otf): Update cluster range for glyphs generated by OTF.
1188
1189 2004-10-02  Kenichi Handa  <handa@m17n.org>
1190
1191         * m17n-X.c (device_open): Handle Mfont key in PLIST.
1192
1193 2004-09-30  Kenichi Handa  <handa@m17n.org>
1194
1195         * font-ft.c (ft_select): Ignore family on calling mfont__score.
1196
1197 2004-09-30  Kenichi Handa  <handa@m17n.org>
1198
1199         * font.h: Include <fontconfig/fontconfig.h>.
1200         (MFTInfo): New member langset.
1201         (mfont__encoding_list): Extern it.
1202
1203         * font.c (mfont__encoding_list): New function.
1204         (mdebug_dump_font_list): New function.
1205
1206         * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
1207         (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
1208         variables.
1209         (ft_family_list): New variable.
1210         (set_font_info): New arg basep.  Callers changed.
1211         (fc_list): Check the return value of FcPatternGetString.
1212         (add_font_info): New arg plist.  Callers changed. Update
1213         ft_family_list.
1214         (ft_list_family): New function (merged fc_list and ft_list_all).
1215         (ft_select): Use ft_list_family.
1216         (ft_list): Likewise.  If FONT is not NULL, check all fonts.  Fix
1217         typo (== -> !=).
1218         (mfont__ft_init): Initialize above new variables.
1219         (mfont__ft_fini): Free ft_family_list.
1220         (STRDUP_LOWER): New macro.
1221         (set_font_info): Use STRDUP_LOWER.
1222         (ft_list_family): Avoid duplicate addition of font path.  Use
1223         STRDUP_LOWER.
1224         (fc_decode_prop): Fix typo.
1225
1226         * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
1227         (xfont_registry_list): Change argument disp_info to frame.
1228         Callers changed.
1229         (xfont_list_all): New function.
1230         (xfont_list): If FONT is not NULL, check all fonts.
1231
1232 2004-09-28  Kenichi Handa  <handa@m17n.org>
1233
1234         * m17n-X.c (MXFont, MXFontList): New types.
1235         (MDisplayInfo): Delete members font_registry_list,
1236         iso8859_1_family_list, iso10646_1_family_list, new members
1237         font_list, base_font_list.
1238         (free_display_info): Adusted for the change of MDisplayInfo.
1239         (xfont_driver): Initialize with xfont_list.
1240         (font_compare): New function.
1241         (build_font_list): Deleted.
1242         (xfont_registry_list): New function.
1243         (xfont_select): Use xfont_registry_list.
1244         (xfont_list): New function.
1245         (device_open): Adusted for the change of MDisplayInfo.
1246
1247         * font-ft.c (add_font_info): New arg languages.  Callers changed.
1248         (fc_list): Get languages from fonts..
1249         (ft_list_all): Renamed from ft_list.  Callers changed.
1250         (ft_list): New function.
1251         (mfont__ft_driver): Initalize with ft_list.
1252
1253         * font.c (mfont_list): New function.
1254
1255         * font.h (struct MFontDriver): New member `list'.
1256         (MFTInfo): New member languages.
1257
1258         * m17n-gui.h (mfont_list): Extern it.
1259
1260 2004-09-27  Kenichi Handa  <handa@m17n.org>
1261
1262         * internal-gui.h (struct MGlyphString): Delete members mt,
1263         sub_width, sub_lbrearing, sub_rbearing, and region.
1264
1265         * draw.c (MSubTextExtents): New type.
1266         (layout_glyphs): New arg extents.  Set its members.
1267         (layout_glyph_string): Adjusted for the above change.
1268         (alloc_gstring): Don't set gstring->mt.
1269         (truncate_gstring): Call line_break function with mt instead of
1270         gstring->mt.
1271
1272 2004-09-22  Kenichi Handa  <handa@m17n.org>
1273
1274         * mtext.c (count_utf_16_chars): Count each code of invalid
1275         surrogates as one.
1276
1277 2004-09-19  Kenichi Handa  <handa@m17n.org>
1278
1279         * mtext.c (default_utf_16, default_utf_32): Rename them to
1280         MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively.  Caller
1281         changed.
1282
1283         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
1284         them.
1285
1286 2004-09-13  Kenichi Handa  <handa@m17n.org>
1287
1288         * draw.c (Mlatin): Don't declare it here.
1289         (visual_order): Fix reordering of combining characters.
1290         (compose_glyph_string): Fix detection of script.
1291         (layout_glyphs): Don't fix reordering of combining characters
1292         here.
1293         (layout_glyph_string): Pay attention to
1294         control->disable_overlapping_adjustment.
1295         (truncate_gstring): Include at least on character in a line.
1296         (get_gstring): Always scan one full line.
1297         (mdraw__init): Don't initialize Mlatin here.
1298         (mdraw_text_per_char_extents): Fix iteration.  If a glyph doesn't
1299         have a font, use ascent/descent of an ASCII font.  Allow
1300         ink_array_return and logical_array_return to be NULL.
1301         (mdraw_coordinates_position): Fix iteration.
1302
1303         * font-ft.c (MFTtoProp): Member completely changed.
1304         (ft_to_prop): Adjusted for the above change.
1305         (ft_to_prop_size): Likewise.
1306         (set_font_info): Adjusted for the change of MFTtoProp.
1307         (fc_generic_family_list): New variable.
1308         (fc_list): Add special handling of generic font names.
1309         (mfont__ft_init): Adjusted for the change of MFTtoProp.
1310         Initialize fc_generic_family_list.
1311         (mfont__ft_fini): Don't free ft_to_prop.  Free
1312         fc_generic_family_list.
1313         (FC_vs_M17N_font_prop): New type.
1314         (fc_weight_table, fc_slant_table, fc_width_table): New variables.
1315         (fc_decode_prop, fc_encode_prop): New functions.
1316         (mfont__ft_parse_name): Use fc_decode_prop.
1317         (mfont__ft_unparse_name): Use fc_encode_prop.
1318
1319         * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
1320         (MWDevice): Add member realized_font_list.
1321         (free_display_info): Don't free disp_info->realized_font_list.
1322         (free_device): Free device->realized_fontset_list.
1323         (xft_find_metric): Use gstring->frame instead of rfont->frame.
1324         (device_open): Don't initialize disp_info->realized_font_list.
1325         (device_open): Initialize device->realized_font_list and set it to
1326         frame->realized_font_list.
1327
1328         * fontset.c (try_font_group): New function.
1329         (mfont__lookup_fontset): Use try_font_group.
1330
1331         * font.c (common_weight): Change the order of "regular".
1332
1333         * face.c (Mlatin): Don't make it static.
1334         (mface__realize): Be sure to set work_gstring.frame.
1335         (mface__for_chars): Likewise.
1336
1337         * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
1338         MTEXT_FORMAT_UTF_8.
1339
1340         * internal-gui.h (Mlatin): Extern it.
1341
1342         * m17n-gui.h (MDrawControl): New member
1343         disable_overlapping_adjustment.
1344
1345 2004-09-06  Kenichi Handa  <handa@m17n.org>
1346
1347         * font-flt.c (run_otf): Fix typo ('}'->']').
1348
1349         * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
1350         (COMBINING_PRECOMPUTED_P): New macros.
1351
1352         * draw.c (layout_glyphs): Handle precomputed combining code.
1353
1354         * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
1355         precomupted combining code.
1356
1357 2004-09-03  Kenichi Handa  <handa@m17n.org>
1358
1359         * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
1360         otf_gstring.glyphs.
1361
1362 2004-08-27  Kenichi Handa  <handa@m17n.org>
1363
1364         * face.c (mface_put_prop): If the new value is the same as the
1365         current one, don't increment frame->tick.
1366
1367 2004-08-25  Kenichi Handa  <handa@m17n.org>
1368
1369         * fontset.c (mfontset): Initialize font_spec_list member.
1370         (mfontset_copy): Load fontset if necessary.
1371
1372         * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
1373         'metrics' to for C++.
1374
1375         * draw.c (mdraw_glyph_info): Adjusted for the member name change
1376         (this -> metics).
1377
1378 2004-08-16  Kenichi Handa  <handa@m17n.org>
1379
1380         * Version 1.1.0 released.
1381
1382 2004-08-13  Kenichi Handa  <handa@m17n.org>
1383
1384         * language.c (mlang__init): Add Dhivehi.
1385
1386         * m17n-gui.c (Mx, Mfreetype): Delete it.
1387         (m17n_init_win): Don't initialize Mx and Mfreetype here.
1388
1389         * m17n-gui.h (Mfreetype, Mxft): Extern them.
1390         (mfont_resize_ratio): Extern it.
1391         (MDrawGlyphInfo): New member logical_width;
1392         (MDrawGlyph): New type.
1393         (mdraw_glyph_list): Prototype adjusted.
1394
1395         * m17n-X.c (xfont_open): Set type and fontp members.
1396         (xft_open): Likewise.
1397
1398         * internal-gui.h (Mx, Mfreetype): Delete extern.
1399
1400         * font.h (struct MRealizedFont): New member type and fontp.
1401
1402         * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
1403         (Mx, Mfreetype): Declare here.
1404         (Mxft): New variable.
1405         (mfont_resize_ratio): New function.
1406
1407         * font-ft.c (ft_open): Set type and fontp members.
1408
1409         * draw.c (mdraw_glyph_list): Argument type changed.  Don't set
1410         glyph_code member.
1411
1412 2004-08-11  Kenichi Handa  <handa@m17n.org>
1413
1414         * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
1415         FT_LOAD_DEFAULT.
1416
1417 2004-08-06  Kenichi Handa  <handa@m17n.org>
1418
1419         * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
1420         feature to apply.
1421
1422         * font-flt.c (run_otf): Print debugging information if necessary.
1423
1424 2004-08-05  Kenichi Handa  <handa@m17n.org>
1425
1426         * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff.  Support
1427         positioning_type 5 and 6.  Switch simplified.
1428
1429 2004-08-04  Kenichi Handa  <handa@m17n.org>
1430
1431         * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
1432
1433 2004-08-02  Kenichi Handa  <handa@m17n.org>
1434
1435         * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
1436         set val to 1 even if it is greater than 1.
1437
1438         * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
1439
1440 2004-07-29  Kenichi Handa  <handa@m17n.org>
1441
1442         * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
1443         debugging information.
1444
1445         * internal.h (MDEBUG_PRINT5): New macro.
1446
1447         * draw.c (layout_glyphs): Don't combine a zero width glyph with
1448         the previous one if the zero width glyph has left or right
1449         padding.
1450
1451 2004-07-26  Kenichi Handa  <handa@m17n.org>
1452
1453         * m17n-X.c (xft_render): Pay attention to members left_padding and
1454         right_padding of MGlyph.
1455
1456         * draw.c (visual_order): Allocate one more elements for arrays as
1457         a workaround of fribidi bug.
1458         (layout_glyphs): Fix previous change. Check MGlyph->combining_code
1459         instead of MGlyph->bidi_sensitive.
1460         (layout_glyph_string): Pay attentinon to
1461         control->orientation_reversed when padding at the head or tail.
1462         Fix adjustment of space glyph width.
1463         (get_gstring): If cursor_width or cursor_bidi is changed, don't
1464         use a cache.
1465
1466         * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
1467         instead of MGlyph->bidi_sensitive.
1468
1469         * internal-gui.h (MGlyph): Delete member bidi_sensitive.
1470
1471 2004-07-26  Kenichi Handa  <handa@m17n.org>
1472
1473         * draw.c (visual_order): Don't treat combined glyphs specially.
1474         (layout_glyphs): Don't get metrics glyphs that are already ready.
1475         Pay attention to MGlyph->bidi_sensitive.  Combine a glyph of zero
1476         width with the previous one. 
1477         (draw_background): Fix bar cursor position on a r2l glyph.
1478
1479         * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
1480         (run_rule): Fix place of updating cluster_begin_pos and
1481         cluster_end_pos here.
1482         (run_otf): Don't set left_padding.
1483
1484         * font-ft.c (adjust_anchor): Type of argument `code' changed.
1485         Caller changed.
1486         (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
1487         Fix handling of GPOS.
1488         (mfont__ft_drive_gpos): Delete this function.
1489
1490         * font.h (mfont__ft_drive_otf): Renamed back from
1491         mfont__ft_drive_gsub.
1492         (mfont__ft_drive_gpos): Delete extern.
1493
1494         * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
1495         (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
1496
1497 2004-07-23  Kenichi Handa  <handa@m17n.org>
1498
1499         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
1500         the same bidi level.
1501
1502         * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
1503
1504 2004-07-22  Kenichi Handa  <handa@m17n.org>
1505
1506         * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
1507
1508 2004-07-20  Kenichi Handa  <handa@m17n.org>
1509
1510         * draw.c (render_glyphs): Fix checking of g->code validity.
1511
1512         * face.c (mface__realize): Set g.type.
1513
1514 2004-07-18  Kenichi Handa  <handa@m17n.org>
1515
1516         * Makefile.am: Prepend ${top_srcdir} to all *.la in
1517         *_LIBADD/*_LDADD.
1518
1519         * m17n-gui.c (mframe): Print error message give by dlopen to
1520         stderr.
1521
1522 2004-07-16  Kenichi Handa  <handa@m17n.org>
1523
1524         * draw.c (compose_glyph_string): Improve the way of deciding a
1525         script.  For a character that doesn't have script property, use
1526         the last non-latin script.
1527
1528         * font-ft.c (fc_list): Cancel previous change.
1529         (mfont__ft_init): Add more entries in ft_to_prop_name.
1530
1531 2004-07-15  Kenichi Handa  <handa@m17n.org>
1532
1533         * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
1534         previous or next character glyphs.
1535
1536 2004-07-14  Kenichi Handa  <handa@m17n.org>
1537
1538         * draw.c (compose_glyph_string): Be sure to set codes for glyphs
1539         of type GLYPH_SPACE.
1540
1541         * fontset.c (mfont__lookup_fontset): If glyph type is
1542         GLYPH_SPACE, get codes for SPACE.
1543
1544         * internal-gui.h (Mfont): Delete extern.
1545
1546         * m17n-gui.h (Mfont): Delete duplicated extern.
1547
1548 2004-07-13  Kenichi Handa  <handa@m17n.org>
1549
1550         * font-ft.c (DEVICE_DELTA): New macro.
1551         (adjust_anchor): New function.
1552         (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf.  Drive
1553         only GSUB.
1554         (mfont__ft_drive_gpos): New function.
1555
1556         * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
1557         (FontLayoutContext): Delete member `rfont'.
1558         (run_otf): Set g->otf_cmd.  Call 
1559         (mfont__flt_run): Don't set ctx.rfont.  Call mfont__ft_decode_otf
1560         only whne HAVE_OTF is defined.
1561
1562         * fontset.c: Include "config.h".
1563
1564         * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
1565         (MGlyph): New member otf_cmd.
1566
1567         * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
1568         (mfont__ft_drive_gpos): Extern it.
1569
1570         * face.c: Include "config.h".
1571
1572         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
1573
1574         * input-gui.c: Include "config.h".
1575
1576         * plist.c: Include "config.h".
1577
1578 2004-07-06  Kenichi Handa  <handa@m17n.org>
1579
1580         * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
1581         internal-gui.h: Cancel previous changes.
1582
1583         * m17n-gd.h: Delete it.
1584
1585         * Makefile.am (libm17n_core_la_LIBADD): New variable.
1586         (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
1587         @XML2_LD_FLAGS@ to above.
1588         (libm17n_la_LIBADD): Add -ldl.
1589         (libm17n_la_LDFLAGS): Add -export-dynamic.
1590         (X_LD_FLAGS): Fix the order of linking.
1591         (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
1592         (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
1593         (libm17n_X_la_LDFLAGS): Add -module.
1594         (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
1595         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1596         (libm17n_gd_la_LDFLAGS): Add -module.
1597         (include_HEADERS): Delete m17n-gd.h.
1598
1599 2004-06-30  Kenichi Handa  <handa@m17n.org>
1600
1601         * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
1602         (MDeviceLibraryInterface): Delete it.
1603         (register_device_library): Delete it.
1604         (m17n__device_library_list): Renamed from device_library_list.
1605
1606         * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
1607         (m17n_init_win): Adjust prototype.
1608
1609         * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
1610         (m17n_init_gd): New function. 
1611
1612         * m17n-gd.h: New file.
1613
1614         * m17n-X.h: Include <m17n-gui.h>.
1615         (m17n_init_X): Extern it.
1616         (M17N_INIT): Redefine it.
1617
1618         * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
1619         (m17n_init_X): New function.
1620
1621         * internal-gui.h (m17n__device_library_list): Extern it.
1622         (struct MDeviceDriver): New members initialized, init, and fini.
1623
1624         * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
1625         @XFT2_LD_FLAGS@.
1626         (libm17n_X_la_LIBADD): Delete aboves.
1627         (libm17n_gd_la_SOURCES): Add m17n-gd.h.
1628         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1629         (libm17n_gd_la_LDFLAGS): Delete it.
1630         (include_HEADERS): Add m17n-gd.h.
1631
1632 2004-06-25  Kenichi Handa  <handa@m17n.org>
1633
1634         * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
1635         (libm17n_gd_la_LDFLAGS): Cancel previous change.
1636
1637         * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
1638
1639         * font-ft.c (fc_list): If FcFontList finds no font, try
1640         FcFontMatch.
1641
1642         * draw.c (compose_glyph_string): Terminate the last loop after
1643         doing default combining if necessary.
1644
1645 2004-06-24  Kenichi Handa  <handa@m17n.org>
1646
1647         * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
1648
1649         * character.c (mchar_define_property): Add const to an arg.
1650
1651         * charset.c (mchar_define_charset): Add const to an arg.
1652
1653         * coding.c (MCodingSystem): Add const to an arg or decoder.
1654         (finish_decoding): Add const to an arg.
1655         (decode_coding_charset, decode_coding_utf_8)
1656         (decode_coding_utf_16, decode_coding_utf_32)
1657         (decode_coding_iso_2022, decode_coding_sjis)
1658         (mconv_define_coding): Likewise.
1659
1660         * m17n-X.c (xft_find_metric): Delete unused variable.
1661
1662         * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
1663         prototypes.
1664
1665         * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
1666         prototypes.
1667
1668         * mtext.c (count_utf_8_chars, count_utf_16_chars)
1669         (mtext__from_data, mtext_from_data): Add `const' to an arg.
1670
1671         * mtext.h (mtext__from_data): Ajust prototype.
1672
1673 2004-06-23  Kenichi Handa  <handa@m17n.org>
1674
1675         * draw.c (compose_glyph_string): Always get glyph codes by
1676         mface__for_char.
1677         (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
1678         (mdraw_glyph_list): New function.
1679
1680         * font-flt.c (mfont__flt_run): Be sure to call
1681         rfont->driver->encode_char.
1682
1683         * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
1684         (ft_encode_char): Delete arg C.
1685         (ft_render): Don't call FT_Get_Char_Index.
1686
1687         * font.c (mfont__encodable_p): Delete it.
1688         (mfont__encode_char): Be sure to call rfont->driver->encode_char.
1689
1690         * font.h (struct MFontDriver): Delete arg C of encode_char.
1691         (mfont__encodable_p): Delete extern.
1692
1693         * m17n-X.c (xfont_encode_char): Delete arg C.
1694         (xft_find_metric): Don't cal FT_Get_Char_Index.
1695         (xft_render): Likewise.
1696
1697         * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
1698         logical_width.
1699         (mdraw_glyph_list): Extern it.
1700
1701         * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
1702
1703 2004-06-22  Kenichi Handa  <handa@m17n.org>
1704
1705         * m17n-gui.h (mfontset_lookup): Extern it.
1706
1707         * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
1708
1709         * fontset.c (realize_fontset_elements)
1710         (free_realized_fontset_elements, update_fontset_elements): New
1711         functions.
1712         (mfont__realize_fontset): Call realize_fontset_elements.
1713         (mfont__free_realized_fontset): Call free_realized_fontset_elements.
1714         (mfont__lookup_fontset): If a fontset was modified, update
1715         the realized fontset.
1716         (mfontset_modify_entry): Increment fontset->tick.
1717         (mfontset_lookup): New function.
1718
1719 2004-06-21  Kenichi Handa  <handa@m17n.org>
1720
1721         * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
1722
1723         * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
1724         (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
1725         length of source text 0.
1726
1727 2004-06-21  Kenichi Handa  <handa@m17n.org>
1728
1729         * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
1730         (compare): Pay attention to format other than utf-8.
1731         (copy): Delete this function.
1732         (count_by_utf_8, count_by_utf_16, insert): New functions.
1733         (count_utf_16_chars): Fix handling of a surrogate pair.
1734         (find_char_forward, find_char_backward): Likewise.
1735         (mtext__from_data): Delete unnecessary check.  Fix number of
1736         allocated bytes.
1737         (mtext_from_data): Don't count items.
1738         (mtext_ref_char): Optimize the code.
1739         (mtext_set_char): Pay attention to format other than utf-8.
1740         (mtext_cat_char): Likewise.
1741         (mtext_dup): Don't call copy, instead do allocation here.
1742         (mtext_cat): Call insert instead of copy.
1743         (mtext_ncat): Likewise.
1744         (mtext_cpy): Delete character at first and call insert instead of
1745         copy.
1746         (mtext_ncpy): Likewise.
1747         (mtext_copy): Likewise.
1748         (mtext_duplicate): Call insert instead of copy.
1749         (mtext_del): Pay attention to format other than utf-8.
1750         (mtext_ins): Simply call insert.
1751         (mtext_ins_char): Pay attention to format other than utf-8.
1752         (mtext_tok): Call insert instead of copy.
1753         (mtext_text): Call UNIT_BYTES.
1754
1755         * textprop.c (mtext__adjust_plist_for_change): New function.
1756
1757         * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
1758         (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
1759         (CHAR_UNITS_AT): Fix typo.
1760         (CHAR_UNITS_BY_HEAD): Fix typo.
1761         (STRING_CHAR_AND_UNITS): Fix typo.
1762
1763         * internal.h (MTEXT_READ_ONLY_P): New macro. 
1764
1765         * mtext.h (mtext__replace): Delete the extern.
1766         (mtext__adjust_foramt): Adjust prototype.
1767
1768         * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
1769         if possible.  Otherwise make a copy of mmt.
1770
1771         * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
1772         utf-8.
1773
1774 2004-06-18  Kenichi Handa  <handa@m17n.org>
1775
1776         * character.h (CHAR_STRING_UTF16): Fix syntax.
1777
1778 2004-06-16  Kenichi Handa  <handa@m17n.org>
1779
1780         * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
1781         (libm17n_X_la_LIBADD): Delete it.
1782         (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
1783
1784         * m17n-X.c (device_open): Add parens in `if' condition.
1785
1786         * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
1787         (DEC_POSITION): Likewise.
1788         (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
1789
1790 2004-06-15  Kenichi Handa  <handa@m17n.org>
1791
1792         * fontset.c (mfont__lookup_fontset): Fix selection of font groups
1793         by language.
1794
1795         * draw.c (compose_glyph_string): If langauge is specified, call
1796         mface__for_chars even if a text is all latin.  Fix condition for
1797         setting non_ascii_found.
1798
1799         * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
1800
1801         * m17n.h (minput_char_to_key): Delete extern.
1802
1803         * m17n-gui.h (minput_event_to_key): Cancel previous change.
1804
1805         * m17n-gui.c (null_device_open): Set several members of frame.
1806
1807 2004-06-14  Kenichi Handa  <handa@m17n.org>
1808
1809         * m17n-gui.h (minput_event_to_key): Delete extern.
1810
1811         * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
1812
1813         * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
1814
1815         * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
1816
1817 2004-06-08  Kenichi Handa  <handa@m17n.org>
1818
1819         * character.c (mchar_put_prop): Don't increment the ref-count of
1820         record->table.
1821
1822 2004-06-04  Kenichi Handa  <handa@m17n.org>
1823
1824         * m17n-core.c (mdebug__register_object): New function.
1825         (mdebug__unregister_object): Likewise.
1826
1827         * internal.h (mdebug__register_object, mdebug__unregister_object):
1828         Extern them.
1829         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
1830         respectively.
1831
1832         * charset.c (mcharset__load_from_database): Don't call
1833         mconv__register_charset_coding here.
1834
1835         * coding.c (find_coding): Get a real name from an element of
1836         coding_definition_list.
1837         (mconv__register_charset_coding): Set the real name at the top of
1838         param.
1839         (mcoding__load_from_database): Likewise.
1840         (mconv_list_codings): Adjusted for the above change.
1841
1842 2004-06-03  Kenichi Handa  <handa@m17n.org>
1843
1844         * coding.c (find_coding): Find by canonicalized name.  Don't have
1845         to modify the element of coding_definition_list by
1846         mplist__from_plist.
1847         (mconv__define_coding_from_charset): Delete it.
1848         (mconv__register_charset_coding): Canonicalize sym.
1849         (mcoding__load_from_database): Register plist modified by
1850         mplist__from_plist.
1851
1852         * coding.h (mconv__define_coding_from_charset): Don't extern it.
1853
1854         * font-ft.c (ft_open): Fix setting of rfont->descent.
1855
1856 2004-06-02  Kenichi Handa  <handa@m17n.org>
1857
1858         * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
1859         (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
1860         (xlfd_unparse_name): Renamed from xfont_build_name.
1861         (mfont__init): Initialized Mfontconfig.
1862         (mfont__free_realized): Unconditionally unref rfont->info.
1863         (mfont__select): Free `this' if it's not best.
1864         (mfont__open): Don't check frame->realized_font_list.
1865         (mfont__parse_name_into_font): New function.
1866         (Mfontconfig): New variable.
1867         (mfont_from_name): Call mfont_parse_name.
1868         (mfont_name): Call mfont_unparse_name.
1869         (mdebug_dump_font): Likewise.
1870
1871         * font.h (struct MFontDriver): Delete members parse_name and
1872         build_name.
1873         (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
1874         (mfont__parse_name_into_font): Extern it.
1875
1876         * font-ft.c: Include "symbol.h".
1877         (close_ft): Unconditionally free filename and charmap_list of
1878         ft_into.
1879         (ft_open): Duplicate base->filename.  Increment ref-count of
1880         ft_info->charmap_list.  Free ft_info->charmap_list and
1881         ft_info->filename on error.
1882         (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
1883
1884         * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
1885         xfont_build_name.
1886         (enum xlfd_field_idx): Moved to font.c.
1887         (split_font_name, build_font_name): Likewise.
1888         (build_font_list): Call mfont__parse_name_info_font.
1889         (xfont_open): Call mfont__unparse_name.  Free name.
1890         (xfont_parse_name, xfont_build_name): Moved to font.c
1891         (xft_select): Prototype deleted.
1892         (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
1893         Call mfont_pase_name.
1894
1895         * m17n-gui.c (free_frame): Unref frame->font_driver_list.
1896         (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
1897         (mframe): Likewise.
1898
1899         * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
1900         Extern them.
1901
1902         * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
1903
1904 2004-06-01  Kenichi Handa  <handa@m17n.org>
1905
1906         * fontset.c (mfontset_modify_entry): Pay attention to the case
1907         that fontset->font_spec_list is NULL.
1908
1909 2004-05-31  Kenichi Handa  <handa@m17n.org>
1910
1911         * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
1912
1913         * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
1914
1915         * font.c (mfont__select): Print score the a font for debugging.
1916
1917         * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
1918
1919         * coding.c (reset_coding_sjis): Check kanji and kana instead of
1920         kanji_sym and kana_sym.
1921
1922 2004-05-28  Kenichi Handa  <handa@m17n.org>
1923
1924         * Makefile.am (VINFO): New variable.
1925         (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
1926         (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
1927
1928 2004-05-27  Kenichi Handa  <handa@m17n.org>
1929
1930         The following chanages are to make device dependent functions
1931         accessible only from MDeviceDriver structure, and to add GD and
1932         null device drivers.  Font drivers get also device dependent.
1933
1934         * m17n.c (m17n_init): Increament shell_initialized.
1935         (m17n_fini): Decremented shell_initialized.
1936
1937         * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
1938
1939         * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
1940         (Mwidget, Mcolormap, Mx): Extern them.
1941
1942         * m17n-gui.c: Include <dlfcn.h> and "config.h".
1943         (free_frame): Call frame->driver->close instead of
1944         mwin__close_device.
1945         (DLOPEN_SHLIB_EXT): New macro.
1946         (MDeviceLibraryInterface): New type.
1947         (device_library_list): New variable.
1948         (register_device_library): New function.
1949         (null_device): New variable.
1950         (null_device_close, null_device_get_prop)
1951         (null_device_realize_face, null_device_free_realized_face): New
1952         function.
1953         (null_driver): New variable.
1954         (null_device_init, null_device_fini, null_device_open): New
1955         functions.
1956         (null_interface): New variable.
1957         (Mfreetype, Mdevice): Declare them.
1958         (m17n_init_win): Increment win_initialized.  Initialize Mx, Mgd,
1959         Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
1960         Mwin__Close_Device.  Register drivers for Mx and Mgd.
1961         (m17n_fini_win): Decremented win_initialized.  Call "fini"
1962         function of all opened devices.  Don't call mwin__fini.
1963         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
1964         Declare them here.
1965         (mframe): Handle Mdevice key of PLIST.
1966         (mframe_get_prop): Call frame->device->get_prop instead of
1967         mwin__device_get_prop.
1968
1969         * m17n-gd.c: New file.
1970
1971         * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
1972         (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
1973
1974         * m17n-core.c (m17n_init_core): Increate core_initialized.
1975         (m17n_fini_core): Decremented core_initialized.
1976
1977         * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
1978         (Mcolormap): Don't extern them here.
1979
1980         * m17n-X.c (FRAME_DEVICE): New macro.
1981         (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
1982         (free_display_info): Use MPLIST_DO.
1983         (free_device): Free rface->info.
1984         (xft_close): Delete it.
1985         (device_init): Renamed from mwin__init.
1986         (device_fini): Renamed from mwin__fini.
1987         (device_open): Renamed from mwin__open_device.
1988         (x_driver): New variable.
1989         (MXFontInfo): Delete member frame, add member display.
1990         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
1991         Don't declare them here.
1992
1993         * internal-gui.h (MDeviceType): New enum.
1994         (MWDefice): Delete it.
1995         (struct MFrame): Change type of device to void *.  New members
1996         device_type, driver, font_driver_list.
1997         (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
1998         (MDeviceDriver): New type.
1999         (Mx, Mgd, Mfreetype): Extern them.
2000         (mwin__XXX): Delete all of them.
2001
2002         * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
2003         mwin__XXX.
2004         (win_destroy_ic): Likewise.
2005         (adjust_window_and_draw): Likewise.
2006         (win_callback): Likewise.
2007         (Mxim): Declare it here.
2008         (minput_event_to_key): Call M_CHECK_READABLE.
2009
2010         * fontset.c (mfont__lookup_fontset): Delete local variable
2011         font_group.
2012
2013         * font.h (struct MFontDriver): Delete member close, add members
2014         parse_name and build_name.
2015         (mfont__driver_list): Delete extern.
2016         (mfont__close): Delete extern.
2017
2018         * font.c (mfont__init): Don't set mfont__driver_list.
2019         (mfont__fini): Don't unref mfont__driver_list.
2020         (mfont__select): Try font drivers in frame->font_driver_list.  Set
2021         driver member of a realized font.
2022         (mfont__close): Delete it.
2023         (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
2024         functions of the default frame.
2025
2026         * font-ft.c (close_ft): Check ft_info->ft_face and work
2027         differently.
2028         (add_font_info): Allocate ft_info by M17N_OBJECT.
2029         (ft_close): Delete it.
2030         (mfont__ft_driver): Don't set ft_close.
2031         (ft_select): Increment ref-count of best_font.
2032         (ft_open): Decremented ref-count of base.  On error, call
2033         FT_Done_Face and free ft_info.
2034         (ft_find_metric): Always use XXX_MONO in load_flags.
2035         (ft_render): Fix setting of width.  Call
2036         frame->driver->draw_points instead of mwin__draw_points.
2037         (ft_to_prop): Don't set mfont__driver_list.
2038         (mfont__ft_fini): Just unref ft_info.
2039
2040         * face.c (mface__init): Exchange foreground and background of
2041         mface__default.  Call mface_put_prop to set hline of
2042         mface_underline,
2043         (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
2044         (mface__free_realized): Don't call mwin__free_realized_face.
2045
2046         * draw.c (Mdepth): Don't declare it here.
2047         (draw_background): Call frame->driver->XXX instead of mwin__XXX.
2048         (render_glyphs, render_glyph_string): Likewise.
2049         (mdraw__init): Don't set Mdepth.
2050         (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
2051         M_CHECK_WRITABLE.
2052         (mdraw_text_per_char_extents): Return 0 on success and -1 on
2053         error.
2054         (mdraw_text_items): Check FRAME is writable.
2055         (mdraw_per_char_extents): Implement body.
2056
2057         * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
2058         libm17n-gd.la.
2059         (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
2060         (GUI_SOURCES): Delete it.
2061         (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
2062         (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
2063         (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
2064         (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
2065         (linkgui_LDADD): Set to libm17n-gui.la
2066         (linkgui_LDFLAGS): New target.
2067         (SRC): Include ${libm17n_gui_la_SOURCES} and
2068         ${libm17n_gd_la_SOURCES}.
2069
2070 2004-05-24  Kenichi Handa  <handa@m17n.org>
2071
2072         * draw.c (draw_background): Don't draw background even if
2073         rface->face.property[MFACE_BACKGROUND] is not Mnil.
2074
2075 2004-05-22  Kenichi Handa  <handa@m17n.org>
2076
2077         * m17n-X.c (xft_open_font): Fix anti_alias setting.
2078
2079 2004-05-20  Kenichi Handa  <handa@m17n.org>
2080
2081         * m17n-gui.h (MFaceHookFunc): Change this function type to void.
2082
2083         * m17n-gui.c: Include "plist.h".
2084         (mframe): If PLIST is NULL, initialize it to emply plist.
2085
2086         * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
2087         (xft_driver): New variable.
2088         (xft_select, close_xft, xft_open_font, xft_open, xft_close)
2089         (xft_find_metric, xft_render): New function.
2090         (mwin__init): Adjusted for the new mfont__driver_list.
2091         (mwin__open_device): Assume arg PARAM is not NULL.  Push a newly
2092         generated face to PARAM.
2093         (mwin__realize_face): Fix setting of box colors.  Don't call hook
2094         function here.
2095         (mwin__draw_hline): New function.
2096         (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
2097         (mwin__xft_render): Delete these function.
2098
2099         * internal-gui.h (struct MFrame): New member tick.
2100         (struct MGlyphString): New member tick.
2101         (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
2102         (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
2103         (mwin__xft_render): Delete extern.
2104
2105         * fontset.c (mfont__lookup_fontset): Make the code simpler.
2106         (mfontset): Always increment the reference count of returned
2107         object.
2108
2109         * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
2110         (MFTInfo): Moved to font.h.
2111         (ft_iso8859_1_font_list): Delete this variable.
2112         (set_font_info): Don't set font->property[MFONT_TYPE].
2113         (set_font_info): Don't udpate ft_iso8859_1_font_list.
2114         (add_font_info): Change type to void.
2115         (fc_list): Change anme from xft_list.  Caller changed.  Include
2116         FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
2117         (mfont__ft_driver): Change name from ft_driver.  Caller changed.
2118         (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
2119         (close_ft): Don't call mwin__xft_close.  Unref
2120         ft_info->extra_info.
2121         (ft_open): Don't setup ft_info->fontname.  Don't call
2122         mwin__xft_open.
2123         (ft_find_metric): Don't call mwin__xft_get_metric.
2124         (ft_encode_char): Call rfont->driver->open instead of ft_open.
2125         (ft_render): Don't check HAVE_XFT2.  Don't call mwin__xft_render.
2126         (mfont__ft_init): Adjusted for new mfont__driver_list.
2127         (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
2128
2129         * font.c (mfont__driver_list): Make it MPlist.
2130         (mfont__init): Adjust initialization of mfont__driver_list.
2131         (mfont__fini): Free mfont__driver_list.
2132         (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
2133         (mfont__select): Adjusted for the new mfont__driver_list.
2134
2135         * font.h (enum MFontProperty): Delete MFONT_TYPE.
2136         (mfont__drirver_list): Adjust prototype.
2137         (MFTInfo): Move to here from fron.c.  Deleve member fontname.
2138
2139         * face.h (struct MFace): Delete member realized_face_list, add
2140         member frame_list.
2141         (struct MRealizedFace): Delete member need_update
2142         andnofont_rface, add member non_ascii_list.
2143         (mface__update_frame_face): Extern it.
2144
2145         * face.c (hline_prop_list, box_prop_list, noop_hook): New
2146         variables.
2147         (get_hline_create, get_box_create): New functions.
2148         (find_realized_face): Cancel previous change.  Arg RFONT deleted.
2149         Use memcmp.
2150         (free_face): Cancep previous change.  Free face->frame_list.
2151         (serialize_hline): Do nothing if hline->width is zero.
2152         (serialize_box): Do nothing if box->width is zero.
2153         (mface__init): Setup all properties of mface__default.
2154         (mface__fini): Free hline_prop_list and box_prop_list.
2155         (mface__realize): Cancel previous change.  Update
2156         face->frame_list.  Setup rface->non_ascii_list.
2157         (mface__for_chars): Update rface->non_ascii_list.
2158         (mface__free_realized): Free rface->non_ascii_list.
2159         (mface__update_frame_face): New function.
2160         (mface): Initialize face->frame_list.
2161         (mface_copy): Likewise.  Just copy MFACE_HLINE and MFACE_BOX
2162         properties.
2163         (mface_merge): Likewise.
2164         (mface_put_prop): If key is Mhline or Mbox, get value by
2165         get_hline_create or get_box_create respectively.
2166         (mface_put_prop): Update frame->tick and call
2167         mface__update_frame_face if necessary.
2168         (mface_update): Do nothing if func is noop_hook.
2169
2170         * draw.c (render_glyphs): If a font is not found, use
2171         mwin__draw_empty_boxes.
2172         (alloc_gstring): Initialize gstring->tick.
2173         (get_gstring): Check gstring->tick.
2174
2175 2004-05-17  Kenichi Handa  <handa@m17n.org>
2176
2177         * face.c (find_realized_face): Return value changed.  If RFONT is
2178         NULL, avoid unnecessary checking.
2179         (free_face): Free face->realized_face_list.
2180         (mface__realize): Adjusted for the change of find_realized_face.
2181         If it returns a realized face that needs update, free it and
2182         realize a new one.  Push a new realized face to
2183         frame->realized_face_list instead of appending.
2184         (mface__for_chars): Adjusted for the change of find_realized_face.
2185         Short cut if the required font is in rface->ascii_rface.
2186         (mface_put_prop): Free old value if necessary.  Set need_update
2187         member of realized faces to 1.
2188
2189         * face.h (struct MFace): Delete member tick, add member
2190         realized_face_list.
2191         (struct MRealizedFace): Delete member tick, add member
2192         need_update.
2193
2194 2004-05-13  Kenichi Handa  <handa@m17n.org>
2195
2196         * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
2197
2198 2004-05-12  Kenichi Handa  <handa@m17n.org>
2199
2200         * internal-gui.h (mwin__xft_open): Arguemnt name changed.
2201
2202         * m17n-X.c (mwin__xft_open): Argument changed to fontname and
2203         parse it XftNameParse.
2204
2205         * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
2206         (all_fonts_scaned): New variable.
2207         (set_font_info): FAMILY may be Mnil.
2208         (add_font_info): Argument changed.
2209         (xft_list): Call add_font_info in it.
2210         (ft_list): Likewise.
2211         (ft_select): Make it work in the case family is Mnil.
2212         (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
2213         (mfont__ft_fini): Set all_fonts_scaned to 0.
2214
2215         * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
2216         that is failed to open.
2217
2218 2004-05-10  Kenichi Handa  <handa@m17n.org>
2219
2220         * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
2221         device's depth is 1 (i.e. monochrome).
2222
2223         * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
2224         to work around the problem of libtool.
2225
2226         * font-ft.c: Include <freetype/ftbdf.h>.
2227         (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
2228         variables.
2229         (mfont__ft_init): Initialize them.
2230         (ft_iso8859_1_font_list): New variable.
2231         (set_font_info): Detect a font containing iso8859-1 glyphs and
2232         register it in ft_iso8859_1_font_list.  If the font is not
2233         scalable, assume it as BDF or PCF font and setup SIZE and RESY
2234         properties of the font from its properties.
2235         (add_font_list): If the font is not scalable, check if it is BDF
2236         or PCF font.  If not, ignore it.
2237         (ft_select): If FAMILY is Mnil, return NULL only if the requested
2238         registry is not iso8859-1.
2239         (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
2240         ft_iso8859_1_font_list.
2241         (ft_find_metric): If the font is not scalable, assume it as BDF
2242         or PCF, and get a metric from its properties.
2243         (mfont__ft_fini): Free ft_iso8859_1_font_list.
2244
2245 2004-05-07  Kenichi Handa  <handa@redhat.m17n.org>
2246
2247         * Makefile.am (libm17n_la_LIBADD): Include -ldl.
2248         (libm17n_la_LDFLAGS): Delete it.
2249         (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
2250         (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
2251
2252 2004-05-06  Kenichi Handa  <handa@m17n.org>
2253
2254         * draw.c (compose_glyph_string): Fix previous change.
2255
2256 2004-04-30  Kenichi Handa  <handa@m17n.org>
2257
2258         * font-ft.c (ft_list): Delete unused variable `result'.
2259         (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
2260
2261 2004-04-27  Kenichi Handa  <handa@m17n.org>
2262
2263         * m17n-X.c: Include config.h
2264         [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
2265         (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
2266         (MWDevice) [HAVE_XFT2]: New member xft_draw.
2267         (FRAME_CMAP, FRAME_VISUAL): New macros.
2268         (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
2269         (xfont_driver): Make it static.
2270         (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
2271         (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
2272         info->xft_color_back.
2273         (MXftFontInfo) [HAVE_XFT2]: New type.
2274         (mwin__xft_close) [HAVE_XFT2]: New function.
2275         (mwin__xft_open) [HAVE_XFT2]: New function.
2276         (mwin__xft_get_metric) [HAVE_XFT2]: New function.
2277         (mwin__xft_render) [HAVE_XFT2]: New function.
2278
2279         * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2280         (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
2281         (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
2282         externs.
2283
2284         * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
2285
2286         * font-ft.c: Don't include FT_FREETYPE_H here.
2287         [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
2288         (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
2289         (MFTInfo): New member charmap_index.
2290         (MFTInfo) [HAVE_XFT2]: New member xft_info.
2291         (check_otf_filename): Renamed from check_filename.  Return value
2292         changed.
2293         (ft_set_property): This function deleted.
2294         (set_font_info): New function.
2295         (add_font_list): Argument changed.  Add multiple fonts.
2296         (xft_list) [HAVE_XFT2]: New function.
2297         (ft_list) [not HAVE_XFT2]: New function.
2298         (ft_select): Add code for Xft.
2299         (close_ft): Likewise.
2300         (ft_open): Likewise.
2301         (ft_find_metric): Likewise.
2302         (ft_encode_char): Likewise.
2303         (ft_render): Likewise.
2304
2305         * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
2306
2307 2004-04-26  Kenichi Handa  <handa@m17n.org>
2308
2309         * textprop.c (mtext_attach_property): Declare the return type as
2310         `int'.
2311
2312 2004-04-21  Kenichi Handa  <handa@m17n.org>
2313
2314         * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
2315
2316 2004-04-09  Kenichi Handa  <handa@m17n.org>
2317
2318         * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
2319         seq_to.
2320         (load_command): Setup above members.
2321
2322 2004-04-05  Kenichi Handa  <handa@m17n.org>
2323
2324         * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
2325
2326 2004-03-30  Kenichi Handa  <handa@m17n.org>
2327
2328         * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
2329         >= 0x10000.
2330
2331         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
2332         (M17NLIB_VERSION_NAME): Changed to 1.0.2.
2333
2334 2004-03-29  Kenichi Handa  <handa@m17n.org>
2335
2336         * Version 1.0 Patch Level 2 released.
2337
2338 2004-03-29  Kenichi Handa  <handa@m17n.org>
2339
2340         * charset.c (make_charset): Set charset->fully_loaded and
2341         charset->simple correctly.  Don't try to get charset->min_char and
2342         charset->max_char for a charset of method subset and superset.
2343         Don't load a mapping file here.
2344         (mcharset__init): Set unified_max.
2345         (mcharset__load_from_database): Free a working plist.
2346
2347         * coding.c (mcoding__fini): Free all malloced data.
2348
2349         * input-gui.c (win_create_ic): Set control.as_image for preediting
2350         to 0.
2351
2352         * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
2353         `count') to initialize the array.
2354
2355         * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
2356         M17N_OBJECT_UNREF.
2357
2358         * m17n-X.c (xfont_render): If rface->rfont is null, draw a
2359         rectangle.
2360         (mwin__create_window): Fix bug of setting a background pixel of a
2361         new window.
2362         (mwin__adjust_window): Clear the window before drawing.
2363
2364         * m17n-core.c (mdebug__report_object): Free array->objectes if
2365         necessary.
2366         (m17n_init_core): Don't set report_header_printed to 0 here.
2367         Fix debugging information.
2368         (m17n_fini_core): Set report_header_printed to 0 here.
2369
2370         * m17n-core.h (mplist_deserialize): Extern it.
2371
2372         * m17n-gui.c (m17n_fini_win): Fix debugging information.
2373
2374         * m17n.c (m17n_fini): Fix debugging information.
2375
2376         * mtext.c (mtext__adjust_foramt): New function.
2377
2378         * mtext.h (mtext__adjust_foramt): Extern it.
2379
2380         * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
2381
2382         * plist.h (mplist__deserialize): Don't extern it.
2383
2384         * symbol.c (msymbol__fini): Set freed_symbols to 0.  Set all
2385         elements of symbol_table to NULL.  Report about created and freed
2386         symbols if MDEBUG_FINI is set.
2387
2388 2004-03-22  Kenichi Handa  <handa@m17n.org>
2389
2390         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
2391
2392         * m17n.c (m17n_init): Fix the way of checking merror_code.
2393
2394         * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
2395
2396 2004-03-22  Kenichi Handa  <handa@m17n.org>
2397
2398         * fontset.c (realize_font_group): Adjust the font size by
2399         mfont__resize before selecting a font.
2400
2401         * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
2402
2403 2004-03-19  Kenichi Handa  <handa@m17n.org>
2404
2405         * Version 1.0 Patch Level 1 released.
2406
2407 2004-03-19  Kenichi Handa  <handa@m17n.org>
2408
2409         * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
2410
2411         * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
2412
2413 2004-03-19  Kenichi Handa  <handa@m17n.org>
2414
2415         Re-apply the changes forgotten in the released version.
2416
2417         * charset.c (mcharset__load_from_database): Call
2418         mchar_define_charset.
2419
2420         * coding.c (encode_unsupporeted_char): Put Mcoding text property.
2421         (mconv_encode_range): Put Mcoding text property.
2422
2423 2004-03-18  Kenichi Handa  <handa@m17n.org>
2424
2425         * draw.c (Mdepth): New variable.
2426         (visual_order): Delete unused local var `pos'.
2427         (compose_glyph_string): Fix for the case that gstring->glyphs is
2428         realloced.  Stop generating glyphs at TO.  Fix handling of
2429         control charaters.
2430         (layout_glyphs): Get metrics of all glyphs in advance.  Set
2431         lbearing and rbearing of base of composition glyph correctly.
2432         Handle left-overhang glyphs correctly.
2433         (alloc_gstring): New arg frame.  Set gstring->anti_alias.  Caller
2434         changed.
2435         (dump_combining_code): Change the defualt off_x character to ".".
2436         (mdraw__init): Initialize Mdepth.
2437
2438         * face.c (work_gstring): New variable
2439         (mface__init): Initialize work_gstring.
2440         (mface__fini): Free work_gstring.glyphs.
2441         (mface__realize): Don't handle videomode property here.  Adjusted
2442         for the change of mfont__get_metric.
2443         (mface__for_chars): Adjusted for the change of mfont__get_metric.
2444
2445         * face.h (enum face_gc): Moved to m17n-X.c.
2446
2447         * font.h (struct MFontDriver): Arguments of find_metric changed.
2448         (mfont__select): Prototype adjusted.
2449         (mfont__get_metric): Likewise.
2450         (mfont__ft_drive_otf): Likewise.
2451         (mfont__flt_run): Likewise.
2452         
2453         * font.c (mfont__select): New argument layouter.  If layouter is
2454         different in the registered font, make a new copy of realized
2455         font.
2456         (mfont__get_metric): Argument changed.  Get metrics of multiple
2457         glyphs.
2458         (mfont_find): Call mfont__select with layouter as Mnil.
2459
2460         * font-flt.c (FontLayoutContext): New member rfont.
2461         (run_otf): Adjusted for the change of mfont__ft_drive_otf.
2462         (mfont__flt_run): Argument changed.  Initialize ctx.rfont.
2463
2464         * font-ft.c (ft_find_metric): Arguments changed.  Get metrics of
2465         multiple glyphs.
2466         (NUM_POINTS): New macro.
2467         (MPointTable): New type.
2468         (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
2469         (mfont__ft_drive_otf): New argument rfont.
2470
2471         * fontset.c (realize_font_group): Adjusted for the changed of
2472         mfont__select.
2473         (check_fontset_element): This function deleted.
2474
2475         * input-gui.c (adjust_window_and_draw): Locate a preedit window
2476         off the parent window if the preedit text is zero length.
2477
2478         * internal-gui.h (struct MFrame): New members foreground,
2479         background, videomode, font.
2480         (struct MGlyphString): New member anti_alias.
2481         (MDrawPoint): New type.
2482         (mwin__draw_bitmap): Prototype deleted.
2483         (mwin__draw_points): Prototype added.
2484
2485         * m17n-gui.h (MDrawControl): New member anti_alias.
2486
2487         * m17n-gui.c (free_frame): Free frame->font.
2488         (mframe): Set the fontset of frame->face to the default fontset.
2489
2490         * m17n-X.c (RGB_GC): New type.
2491         (enum gc_index): Renamed from enum face_gc.  Member names changed.
2492         (GCInfo): New typel
2493         (struct MWDevice): Members foreground and background deleted.  New
2494         member scratch_gc, gc_list.
2495         (DEFAULT_FONT, FALLBACK_FONT): New macros.
2496         (free_device): Free GCs in device->gc_list.
2497         (get_rgb_gc): New function.
2498         (get_gc): Renamed and argument changed from get_color.
2499         (get_gc_for_anti_alias): New function.
2500         (xfont_find_metric): Arguments changed.  Get metrics of multiple
2501         glyphs.
2502         (set_region): Argument changed.  Caller changed.
2503         (xfont_render): Allways set a font in gc.
2504         (x_error_handler, x_io_error_handler): Define only if
2505         X_SET_ERROR_HANDLER is defined.
2506         (mwin__open_device): Create device->scratch_gc.  Set members
2507         foreground, background, and videomode of frame.  Call
2508         XSetErrorHandler and XSetIOErrorHandler only if
2509         X_SET_ERROR_HANDLER is defined.
2510         (struct gc_list): Deleted.
2511         (REGISTER_GC, UNREGISTER_GC): These macros deleted.
2512         (mwin__realize_face): Adjusted for the change of the format of
2513         rface->info and the charge of set_region.
2514         (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
2515         (mwin__draw_box): Likewise.
2516         (mwin__draw_bitmap): This function deleted.
2517         (mwin__draw_points): New function.
2518         (mwin__verify_region): Adjusted for the change of the format of
2519         rface->info and the charge of set_region.
2520         (mwin__create_window): Inherit backgound pixel from parent.
2521         (mwin__dump_gc): Adjusted for the change of the format of
2522         rface->info.
2523
2524 2004-03-16  Kenichi Handa  <handa@m17n.org>
2525
2526         * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
2527
2528         * input.c (M_key_alias): New variable.
2529         (handle_key): Try M_key_alias property of a key too.
2530         (minput__init): Initialize M_key_alias.  Give that property to
2531         symbols in one_char_symbol.  Fix bug of initializing
2532         one_char_symbol.
2533
2534         * draw.c (compose_glyph_string): Don't handle
2535         ignore_formatting_char here.  Include formatting characters in the
2536         range processed by a FTL.
2537         (layout_glyph_string): Handle ignore_formatting_char here.
2538
2539 2004-03-12  Kenichi Handa  <handa@m17n.org>
2540
2541         * input-gui.c (win_create_ic): Enable bidi in status control.
2542
2543         * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
2544
2545 2004-03-09  Kenichi Handa  <handa@m17n.org>
2546
2547         * input.c (load_input_method): If title is not specified, use the
2548         input method name as title.
2549
2550         * m17n-X.c (get_color): Make it static.
2551         (xim_create_ic, xim_destroy_ic, x_error_handler)
2552         (x_io_error_handler): Likewise.
2553
2554 2004-03-01  Kenichi Handa  <handa@m17n.org>
2555
2556         * Version 1.0 released.
2557
2558 \f
2559 Copyright (C) 2003, 2004
2560   National Institute of Advanced Industrial Science and Technology (AIST)
2561   Registration Number H15PRO112
2562
2563 This file is part of the m17n library.
2564
2565 The m17n library is free software; you can redistribute it and/or
2566 modify it under the terms of the GNU Lesser General Public License
2567 as published by the Free Software Foundation; either version 2.1 of
2568 the License, or (at your option) any later version.
2569
2570 The m17n library is distributed in the hope that it will be useful,
2571 but WITHOUT ANY WARRANTY; without even the implied warranty of
2572 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2573 Lesser General Public License for more details.
2574
2575 You should have received a copy of the GNU Lesser General Public
2576 License along with the m17n library; if not, write to the Free
2577 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2578 02111-1307, USA.