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