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