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