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