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