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