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