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