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