Copyright years udpated.
[m17n/m17n-lib.git] / src / ChangeLog
1 2010-03-01  Kenichi Handa  <handa@m17n.org>
2
3         * m17n-flt.c (run_rule): Fix checking of glyph availability.
4
5 2010-02-18  Kenichi Handa  <handa@m17n.org>
6
7         * m17n-gui.c (register_device_library): Preprend M17N_MODULE_DIR
8         to the module file name.
9
10         * input.c (load_external_module): Preprend M17N_MODULE_DIR to the
11         module file name.
12
13         * charset.c (load_charset): Check the return value of fgets.
14
15         * Makefile.am: Build modules dynamically loaded with
16         -avoid-version and no -version-info.
17
18 2010-01-15  Kenichi Handa  <handa@m17n.org>
19
20         * draw.c (run_flt): Set mflt_try_otf to rfont->driver->try_otf.
21         (mdraw__init): Set mflt_enable_new_feature to 1.
22
23         * font-ft.c (ft_try_otf): New function.
24         (mfont__ft_driver): Set ft_try_otf.
25
26         * font.h (struct MFontDriver): New member try_otf.
27
28         * m17n-X.c (xft_driver): Set xft_try_otf.
29         (xft_try_otf): New function.
30
31         * m17n-flt.h: (mflt_enable_new_feature): Extern it.
32         (mflt_try_otf): Extern it.
33
34         * m17n-flt.c (load_category_table): If mflt_enable_new_feature is
35         zero, return NULL for such categories that require the new
36         feature.
37         (parse_otf_command): If mflt_enable_new_feature is zero, return
38         -1.
39         (load_otf_command): Fix previous change.
40         (load_flt): Check the return value of load_category_table.
41         (try_otf): Renamed from run_otf_category.  Call mflt_try_otf
42         instead of font->drive_otf.
43         (run_command): Call try_otf instead of run_otf_category.
44         (m17n_init_flt): Initialize mflt_enable_new_feature to 0,
45         mflt_try_otf to NULL.
46         (mflt_enable_new_feature): New variable.
47         (mflt_try_otf): New variable.
48
49 2009-12-10  Kenichi Handa  <handa@m17n.org>
50
51         * m17n-flt.c (parse_otf_command): Handle ":otf?".
52         (run_otf_category): If not features are specified, reset category
53         codes.
54         (run_command): On copy, don't re-calculate a category code.
55
56 2009-12-03  Kenichi Handa  <handa@m17n.org>
57
58         * m17n-flt.c (run_stages): Reset category code if category-table
59         is changed.
60         (mflt_run): Don't set category code here.
61         (decode_packed_otf_tag): If no feature is applied, re-calculate
62         category code.
63
64 2009-12-02  Kenichi Handa  <handa@m17n.org>
65
66         * m17n-flt.c (mflt_find): If FONT is specified but no flt is
67         found, return NULL.
68         (run_command): Don't set ENCODED and MEASURED of separator.
69
70 2009-11-30  Kenichi Handa  <handa@m17n.org>
71
72         * m17n-flt.c (load_otf_command): Check 4th char against '?'.
73         (load_command): Likewise.
74         (decode_packed_otf_tag): New arg CTX.  If CTX->in == gstring,
75         update CTX->encoded.  Caller changed.
76
77 2009-11-30  Kenichi Handa  <handa@m17n.org>
78
79         * font-ft.c (ft_drive_otf): Check if OUT is null or not.
80         (ft_drive_otf): Call OTF_drive_gsub_with_log and
81         OTF_drive_gpos_with_log.  Record the applied feature in
82         g->g.internal.
83
84         * font.c (mfont__get_glyph_id): Encode g->c instead of g->code.
85
86         * internal-flt.h (MAKE_COMBINING_CODE_BY_CLASS)
87         (COMBINING_BY_CLASS_P, COMBINING_CODE_CLASS)
88         (MAKE_PRECOMPUTED_COMBINDING_CODE, COMBINING_PRECOMPUTED_P):
89         Delete externs..
90         (PACK_OTF_TAG): Extern it.
91
92         * draw.c (reorder_combining_chars): Delete it.
93
94         * m17n-flt.h (mflt_font_id): Use type MFLFont.
95         (mflt_iterate_otf_feature): Likewise.
96
97         * m17n-flt.c (enum GlyphInfoMask): New member CategoryCodeMask and
98         CombinedMask.
99         (GET_CATEGORY_CODE, SET_CATEGORY_CODE, GET_COMBINED): New macros.
100         (SET_COMBINING_CODE): Set also CombinedMask.
101         (FontLayoutFeatureTable): Delete it.
102         (FeatureCodeTable): New type.
103         (FontLayoutCategory): Type of feature_table changed.
104         (load_category_table): Adjusted for the change of
105         FontLayoutCategory.
106         (unref_category_table): Likewise.
107         (gen_otf_tag): New member shift.  Caller changed.
108         (FontLayoutContext): New member category.
109         (run_rule): Compare g->c instead of g->code.
110         (decode_packed_otf_tag): New function.
111         (run_otf): Call decode_packed_otf_tag.  Don't reset combining-code
112         here.
113         (run_otf_category): New function.
114         (run_command): Set category-code if necessary.  Call
115         run_otf_category for FontLayoutCmdTypeOTFCategory.
116         (run_stages): Set ctx->category.  Get category from glyph if
117         possible.
118         (mflt_dump_gstring): New function.
119
120 2009-11-26  Kenichi Handa  <handa@m17n.org>
121
122         * m17n-flt.c (enum FontLayoutCmdType): New member
123         FontLayoutCmdTypeOTFCategory.
124         (FontLayoutFeatureTable): New type.
125         (FontLayoutCategory): New members feature_table_size and
126         feature_table.
127         (load_category_table): Handle feature_table.
128         (unref_category_table): Likewise.
129         (load_otf_command): Handle FontLayoutCmdTypeOTFCategory.
130         (load_command): Likewise.
131         (free_flt_command): Likewise.
132
133 2009-11-10  Kenichi Handa  <handa@m17n.org>
134
135         * draw.c (run_flt): Update category code of each glyph.
136
137 2009-11-07  Kenichi Handa  <handa@m17n.org>
138
139         * font-ft.c (ft_drive_otf): Don't accumulate anchor adjustments.
140
141 2009-11-05  Kenichi Handa  <handa@m17n.org>
142
143         * m17n-flt.c (run_otf): Fix updating of g->lbearing, etc.
144
145         * font-ft.c (ft_drive_otf): Use OTF_drive_gpos2 if possible.
146
147 2009-10-28  Kenichi Handa  <handa@m17n.org>
148
149         * fontset.c (mdebug_flag): New variable.
150         (mfont__lookup_fontset): Print debug info.
151
152         * m17n-core.c (m17n_init_core): Call SET_DEBUG_FLAG for
153         MDEBUG_FONTSET.
154
155         * internal.h (enum MDebugFlag): Add MDEBUG_FONTSET.
156
157         * language.c (mscript__from_otf_tag): Adjusted for the new format
158         of the database <standard script unicode>.
159
160 2009-10-22  Kenichi Handa  <handa@m17n.org>
161
162         * database.c (check_version): Fix the check.
163
164         * input.c (surrounding_pos): New arg *pos.
165         (integer_value): Fix handling of "@+0".
166         (take_action_list): Adjusted for the change of surrounding_pos.
167
168 2009-10-05  Kenichi Handa  <handa@m17n.org>
169
170         * m17n-flt.h: (mflt_iterate_otf_feature, mflt_font_id): Extern
171         them.
172
173         * m17n-flt.c (FontLayoutCategory): New typedef.
174         (FontLayoutStage): Type of the member `category' changed.
175         (struct _MFLT): Type of the member `coverage' changed.  New member
176         need_config and font_id.
177         (apply_otf_feature): New function.
178         (load_category_table): New arg FONT.  If FONT is non-NULL, call
179         apply_otf_feature.  Setup category->definition.
180         (ref_category_table): New macro.
181         (unref_category_table): New function.
182         (load_flt): Adjusted for the type change of category.
183         (free_flt_stage): New arg FLT.
184         (list_flt): Adjusted for the type change of category.
185         (run_stages): Adjusted for the type change of category.
186         (configure_category, configure_flt): New function.
187         (m17n_init_flt): Initialize mflt_iterate_otf_feature and
188         mflt_font_id to NULL.
189         (mflt_get): Skip the heading configured FLTs.
190         (mflt_find): Likewise.  If necessary, configure the found flt.
191         (mflt_run): Handle mflt_iterate_otf_feature and mflt_font_id.
192         Adjusted for the type change of category.
193         (mflt_iterate_otf_feature, mflt_font_id): New variable.
194
195         * m17n-X.c (xfont_open): Set rfont->id.
196         (xft_driver): Set xft_iterate_otf_feature.
197         (xft_open): Set rfont->id.
198         (xft_iterate_otf_feature): New function.
199
200         * font.h (struct MRealizedFont): New member id.
201         (struct MFontDriver): New member iterate_otf_feature.
202
203         * font.c (mfont__get_glyph_id): Pay attention to. mfont->source.
204
205         * font-ft.c (ft_open, ft_encapsulate): Set rfont->id.
206         (get_otf): New funcition.
207         (ft_check_otf, ft_drive_otf): Use get_otf.
208         (iterate_callback, ft_iterate_otf_feature): New functions.
209         (mfont__ft_driver): Set ft_iterate_otf_feature.
210
211         * draw.c: Docstring updated.
212         (font_id): New function.
213         (run_flt): Set mflt_font_id and mflt_iterate_otf_feature before
214         calling mflt_run.
215
216 2009-10-02  Kenichi Handa  <handa@m17n.org>
217
218         * m17n-flt.c (load_flt): Check the return value of
219         load_category_table.
220
221 2009-09-03  Kenichi Handa  <handa@m17n.org>
222
223         * m17n-flt.c (run_otf): Clear combining code for glyphs whose
224         positions are adjusted by GPOS table.
225
226 2009-08-13  Kenichi Handa  <handa@m17n.org>
227
228         * Version 1.5.5 released.
229
230 2009-08-13  Kenichi Handa  <handa@m17n.org>
231
232         * m17n-core.h (M17NLIB_PATCH_LEVEL):  Changed to 5.
233         (M17NLIB_VERSION_NAME): Changed to "1.5.5".
234
235 2009-03-03  Kenichi Handa  <handa@m17n.org>
236
237         * draw.c (compose_glyph_string): Check if category not Mnil.
238
239 2009-03-02  Kenichi Handa  <handa@m17n.org>
240
241         * Version 1.5.4 released.
242
243 2009-02-25  Kenichi Handa  <handa@m17n.org>
244
245         * m17n-core.c (report_object_array): For M-text and Plist, print
246         more information.
247
248         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 4.
249         (M17NLIB_VERSION_NAME): Changed to "1.5.4".
250
251         * input.c (get_candidate_list): Free unnecessary objects.
252         (take_action_list): Free plist.
253
254 2009-02-04  Kenichi Handa  <handa@m17n.org>
255
256         * coding.c (mcoding__init): Add "Shift_JIS" as an alias of "sjis".
257
258 2009-01-16  Kenichi Handa  <handa@m17n.org>
259
260         * m17n-core.h (Mcased, Msoft_dotted, Mcase_mapping, Mblock):
261         Extern them.
262
263         * character.c (Mcased, Msoft_dotted, Mcase_mapping, Mblock): New
264         variables.
265
266 2009-01-14  Kenichi Handa  <handa@m17n.org>
267
268         * coding.c (decode_coding_iso_2022): Check invocation status
269         before updating charset0 and charset1.
270
271         * symbol.c (msymbol__canonicalize): Handle "windows-XXXX".
272
273 2008-12-31  Kenichi Handa  <handa@m17n.org>
274
275         * m17n-flt.c (mflt_run): If g->encoded is set, don't clear
276         g->code.
277
278 2008-10-30  Andreas Schwab <schwab@suse.de>  (tiny change)
279
280         * face.c (mface_get_prop): Fix strict aliasing bug.
281         (mface_put_prop): Likewise.
282
283         * m17n-gui.c (mframe): Fix strict aliasing bug.
284
285 2008-10-20  Kenichi Handa  <handa@m17n.org>
286
287         * Version 1.5.3 released.
288
289 2008-10-06  Kenichi Handa  <handa@m17n.org>
290
291         * draw.c (mdraw__init): Use TRUE only when
292         FRIBIDI_INTERFACE_VERSION is less than 3.
293
294 2008-10-03  Kenichi Handa  <handa@m17n.org>
295
296         * database.c (mdatabase__find_file): Return a copy of filename if
297         it is absolute pathname.
298
299 2008-09-25  Kenichi Handa  <handa@m17n.org>
300
301         * input.c (load_macros): Don't parse the action list here.
302         (load_im_info): Parse action lists of all macros.
303
304 2008-09-24  Kenichi Handa  <handa@m17n.org>
305
306         * m17n-flt.c (mflt_find): Setup coverage of "combining" flt.
307
308 2008-09-19  Kenichi Handa  <handa@m17n.org>
309
310         * input.c (fully_initialize): Rename "@reload" to "-reload".
311
312 2008-09-17  Kenichi Handa  <handa@m17n.org>
313
314         * m17n-flt.c (run_stages): Fix combining with a variable width
315         font.
316
317 2008-08-04  Kenichi Handa  <handa@m17n.org>
318
319         * input.c (fully_initialize): Add more aliaese (e.g. C-M-1
320         vs. C-A-1).
321
322 2008-07-22  Kenichi Handa  <handa@m17n.org>
323
324         * input.c (fully_initialize): Fix previous change.
325
326 2008-07-19  Kenichi Handa  <handa@m17n.org>
327
328         * input.c (fully_initialize): Fix previous change.
329
330 2008-07-14  Kenichi Handa  <handa@m17n.org>
331
332         * font-ft.c (ft_list_family): New arg CHECK_ALIAS.  Callers changed.
333
334 2008-07-14  Kenichi Handa  <handa@m17n.org>
335
336         * input.c (fully_initialize): Handle C-M-1, etc.
337
338 2008-07-11  Kenichi Handa  <handa@m17n.org>
339
340         * input.c (minput_open_im): Check if the arg NAME is not Mnil.
341
342 2008-06-23  Kenichi Handa  <handa@m17n.org>
343
344         * Version 1.5.2 released.
345
346 2008-06-23  Kenichi Handa  <handa@m17n.org>
347
348         * m17n-core.h (M17NLIB_MINOR_VERSION): Changed to 5.
349         (M17NLIB_PATCH_LEVEL): Changed to 2.
350         (M17NLIB_VERSION_NAME): Changed "1.5.2".
351
352 2008-06-13  Kenichi Handa  <handa@m17n.org>
353
354         * input.c (minput_config_file): Comment fixed for man-page.
355
356 2008-06-13  Harshula  <harshula@gmail.com>  (tiny change)
357
358         * Makefile.am (libm17n_gd_la_LIBADD): Add @FREETYPE_LD_FLAGS@.
359
360 2008-05-24  Kenichi Handa  <handa@m17n.org>
361
362         * m17n-flt.c (mdebug_dump_flt): Change return value to (MFLT *).
363
364 2008-05-23  Kenichi Handa  <handa@m17n.org>
365
366         * Makefile.am (libm17n_gui_la_LIBADD): Include libm17n-core.la.
367         (libm17n_X_la_LIBADD): Include libm17n-core.la, libm17n.la, and
368         libm17n-flt.la.
369         (libm17n_gd_la_LIBADD): Likewise.
370
371         * input.c (take_action_list): Fix debug info.
372
373 2008-05-14  Kenichi Handa  <handa@m17n.org>
374
375         * m17n-flt.c (run_rule): Check SRC_REGEX at first.
376         (run_stages): Fix index of g_indices.
377
378 2008-04-03  Kenichi Handa  <handa@m17n.org>
379
380         * draw.c (compose_glyph_string): Don't run flt striding over the
381         cursor position.
382         (get_gstring): Don't use the cached gstring if cursor position is
383         changed.
384
385 2008-04-02  Kenichi Handa  <handa@m17n.org>
386
387         * input.c (integer_value): Delete the 3rd arg VALUE.
388         (resolve_expression): Adjust the call of integer_value.
389         (take_action_list): Likewise.
390
391 2008-03-06  Kenichi Handa  <handa@m17n.org>
392
393         * font-ft.c (ft_drive_otf): Don't ignore the otf-spec to apply all
394         features.
395
396 2008-01-31  Kenichi Handa  <handa@ni.aist.go.jp>
397
398         * Version 1.5.1 released.
399
400 2008-01-31  Kenichi Handa  <handa@ni.aist.go.jp>
401
402         * draw.c (mdraw_glyph_list): Refer to mfont__ft_driver only when
403         HAVE_FREETYPE is defined.
404
405         * font.h (OTF_Tag): Be sure that it is defined in any cases.
406
407 2008-01-30  Kenichi Handa  <handa@ni.aist.go.jp>
408
409         * font.h (enum MFontOpenTypeTable, MFontCapability): Define them
410         unconditionally.
411
412 2008-01-25  Kenichi Handa  <handa@ni.aist.go.jp>
413
414         * input.c (parse_action_list): Handle the case "(insert INTEGER)".
415
416 2008-01-25  Kenichi Handa  <handa@ni.aist.go.jp>
417
418         * input.c (parse_action_list): Check M_candidates.
419         (get_im_info): If key is Mnil, be sure to set im_info->states to a
420         plist.
421
422 2008-01-23  Kenichi Handa  <handa@ni.aist.go.jp>
423
424         * input.c (integer_value): Fix interpretation of "@-N".
425
426 2008-01-17  Kenichi Handa  <handa@ni.aist.go.jp>
427
428         * input.c (get_following_char): Fix interpretation of POS.
429         (get_following_char): Fix interpretation of "@+N".
430
431 2008-01-15  Kenichi Handa  <handa@ni.aist.go.jp>
432
433         * font-ft.c (ft_drive_otf): Don't refer to otf_gstring if HAVE_OTF
434         is not defined.
435
436         * Makefile.am (FLT_SOURCES): Include internal-flt.h.
437
438 2008-01-07  Kenichi Handa  <handa@ni.aist.go.jp>
439
440         * m17n-flt.c (UPDATE_CLUSTER_RANGE): Don't check if clustering
441         now.
442         (run_rule): Call UPDATE_CLUSTER_RANGE when necessary.
443         (run_command): Check if clustering now before calling
444         UPDATE_CLUSTER_RANGE.
445
446 2008-01-06  Kenichi Handa  <handa@m17n.org>
447
448         * font.c (mfont__get_glyph_id): Return -1 if some code is invalid.
449
450         * font-ft.c (ft_drive_otf): Fix checking of negative feature.
451
452         * m17n-X.c (xft_find_metric): Set g->g.measured.
453
454         * m17n-flt.c (Mequal): New variable.
455         (m17n_init_flt): Initialize it.
456         (FontLayoutCmdRule): Merge members supported_glyph and otf_spec
457         into a new member facility.
458         (load_command): Modify parsing of Mfont_facility.
459         (run_rule): Adjuted for the change of FontLayoutCmdRule.
460         (run_otf): Adjusted metrics if a->back is nonzero.
461
462 2007-12-28  Kenichi Handa  <handa@ni.aist.go.jp>
463
464         * Version 1.5.0 released.
465
466 2007-12-13  Kenichi Handa  <handa@ni.aist.go.jp>
467
468         * m17n-core.c (m17n_init_core): Handle the lang. env. MDEBUG_FLT.
469
470         * m17n-flt.c (mdebug_flag): Set to MDEBUG_FLT.
471         (run_rule): Check if a font has the specific glyph correctly.
472
473         * internal.h (enum MDebugFlag): Delete MDEBUG_FONT_OTF, change
474         MDEBUG_FONT_FLT to MDEBUG_FLT.
475
476         * font.c (mfont__get_glyph_id): Encode g->g.code (not g->g.c).
477
478         * font-flt.c: Delete it.
479
480 2007-12-08  Kenichi Handa  <handa@ni.aist.go.jp>
481
482         * m17n-flt.c (run_rule): Fix printing of debug info.  Don't update
483         TO for the rule of SRC_HAS_GLYPH.
484
485         * draw.c (run_flt): Argument changed.
486         (compose_glyph_string): Adjusted for the above change.
487
488 2007-12-07  Kenichi Handa  <handa@ni.aist.go.jp>
489
490         * plist.c (read_mtext_element): Don't free the malloced buffer.
491
492 2007-12-04  Kenichi Handa  <handa@ni.aist.go.jp>
493
494         * m17n-core.h (merror_code): Extern it.
495
496         * m17n-misc.h (merror_code): Don't extern it.
497
498         * m17n.h: Handle the case of _M17N_FLT_H_ being defined.
499
500         * m17n-flt.h: Handle the case of _M17N_H_ being defined.
501
502 2007-11-22  Kenichi Handa  <handa@ni.aist.go.jp>
503
504         * draw.c (compose_glyph_string): Check g->rface->layouter, not
505         g->rface->rfont->layouter.
506
507         * font-ft.c (ft_drive_otf): Fix setting of g->g.from and g->g.to.
508
509         * m17n-flt.c (FontLayoutContext): New member encoded_offset.
510         (run_rule): Use ctx->encoded_offset.
511         (run_command): Likewise.
512         (run_stages): Set ctx->encoded_offset.
513
514 2007-11-21  Kenichi Handa  <handa@ni.aist.go.jp>
515
516         * m17n-flt.c (enum GlyphInfoMask): Adjusted for the change of
517         bit-size of MFLTGlyph->internal.
518
519 2007-11-20  Kenichi Handa  <handa@ni.aist.go.jp>
520
521         * draw.c (visual_order): Exclude the last anchor glyph from the
522         iteration.
523
524         * m17n-flt.h (MFLTGlyph): New member <adjusted>.
525
526         * m17n-flt.c (run_otf): Set adjusted flag of glyphs if necessary.
527         (run_stages): Likewise.
528         (load_flt): Unref top after checking plist.
529
530         * m17n-X.c (xft_render): Check adjusted flag of glyphs.
531
532 2007-11-12  Kenichi Handa  <handa@ni.aist.go.jp>
533
534         * font-ft.c (ft_check_otf): Fix arg to OTF_check_features.
535
536         * m17n-flt.c (Mcombining): New variable.
537         (Mfont_facility): Renamed from Mfont_has.  Referrer changed.
538         (enum FontLayoutCmdRuleSrcType): Delete SRC_EXIST, add
539         SRC_HAS_GLYPH and SRC_OTF_SPEC.
540         (FontLayoutCmdRule): Delete src.exist, add src.supported_glyph and
541         src.otf_spec.
542         (load_command): Adjusted for the above changes.
543         (run_rule): Likewise.
544         (combining_code_from_class): Delete it.
545         (mflt_get): Check flt->name against Mcombining, not Mt.
546
547         * internal-flt.h (Mcombining): Extern it.
548
549         * draw.c (compose_glyph_string): Call run_flt with Mcombining for
550         combining characters.
551
552 2007-11-09  Kenichi Handa  <handa@ni.aist.go.jp>
553
554         * face.c (mface__realize): Reset measured flag before calling
555         mfont__get_metric.
556
557         * m17n-flt.c (run_stages): Fix handing of off_x and off_y.
558         (setup_combining_coverage): New function.
559         (setup_combining_flt): New function.
560         (mflt_get): If flt is not found, return NULL.  If name if Mt,
561         call setup_combining_flt.
562         (mflt_run): For debugging, print font family name.
563
564         * font-ft.c (ft_render): Fix handling of baseline_offset.
565         (ft_encapsulate): Set metrics in 26.6 fixed pixel.
566         (ft_render): Check pixel_mode to determine anti_alias.
567
568         * m17n-X.c (xfont_find_metric): Delete invalid "continue" line.
569         (xfont_find_metric): Set metrics in 26.6 fixed pixel.
570         (xfont_render): Set baseline_offset in pixel.
571         (xft_render): Fix handling of baseline_offset.
572
573         * draw.c (run_flt): Set font.font.family.
574         (compose_glyph_string): Fix handling of combining characters.
575
576         * fontset.c (try_font_list): Check if the named flt is surely
577         available.
578
579 2007-11-07  Kenichi Handa  <handa@ni.aist.go.jp>
580
581         * draw.c (analyse_bidi_level): New function.
582         (visual_order): Do reordering using the already decided
583         bidi-level.
584         (compose_glyph_string): Decide bidi-level before calling flt.
585
586         * m17n-flt.c (mflt_run): Fix typo.
587
588         * font-ft.c (ft_drive_otf): Fix indexing gstring->glyphs.
589
590 2007-11-06  Kenichi Handa  <handa@ni.aist.go.jp>
591
592         * draw.c (visual_order): Don't rely on the width of glyphs.
593         (run_flt): Fix culculation of g->g.to.
594
595         * m17n-flt.c (run_rule): Don't set error code here.
596         (run_cond): Likewise.
597         (run_otf): Fix culculation of xoff and yoff.
598         (run_command): Don't set error code here.
599         (PREV): New macro.
600         (NEXT): New macro.
601
602         * m17n-X.c (xfont_open): Keep rfont's metrics in 26.6 fixed pixels.
603         (xfont_find_metric): Set glyph's yadv to 0.
604         (xft_find_metric): Likewise.
605
606         * font-ft.c (ft_open): Keep rfont's metrics in 26.6 fixed pixels.
607         (ft_find_metric): Adjust glyph's metrics.
608         (ft_encapsulate): Keep rfont's metrics in 26.6 fixed pixels.
609         (ft_drive_otf): Set mark glyph's xadv to 0.
610
611         * face.c (mface__for_chars): Adjusts the unit of face's ascent and
612         descent.
613
614 2007-10-29  Kenichi Handa  <handa@m17n.org>
615
616         * m17n-flt.h (struct _MFLTOtfSpec): Adjusted for the new FLT handling.
617         (mflt_get): Adjusted for the argument change.
618         (mflt_name): Adjusted for the return value change.
619
620         * m17n-flt.c (Mgenerator, Mend): New variables.
621         (flt_min_coverage, flt_max_coverage): New variables.
622         (GCPY): New macro.
623         (GDUP): Use it.
624         (Mfont_has): Renamed from Mexist.  Referrers chagned.
625         (gen_otf_tag): Handle the trailing whitespaces.
626         (otf_count_features, otf_store_features): Fix for negative features.
627         (parse_otf_command): Adjusted for the change of MFLTOtfSpec.
628         (load_otf_command): Likewise.
629         (free_flt_command): Adjusted for the change of MFLTOtfSpec.
630         (load_flt): Argument changed.  Caller changed.
631         (free_flt_list): New function.
632         (run_rule): Adjusted for the change of FontLayoutContext.
633         (mflt_run): Adjusted for the change of FontLayoutContext.
634
635         * m17n-gui.c (m17n_init_win): Call m17n_init_flt.
636         (m17n_fini_win): Call m17n_fini_flt.
637
638         * m17n-gui.h: Include m17n-flt.h.
639
640         * m17n-gd.c: Adusted for the change of MGlyph.
641
642         * m17n-X.c: Adusted for the change of MGlyph.
643         (xft_check_otf, xft_drive_otf): New functions.
644
645         * internal-gui.h (MGlyph): Modified for new FLT handling.
646
647         * fontset.c (try_font_list): Adusted for the change of MGlyph.
648
649         * font-ft.c: Adjusted for the change of MGlyph.
650         (ft_check_cap_otf): Renamed from ft_check_otf.  Callers changed.
651         (get_glyph_metric): Deleted.
652         (ft_check_otf): New function.
653         (ft_drive_otf): New fucntion.
654
655         * font.c: Adjusted for the change of MGlyph.
656         (mfont__init): Don't call mfont__flt_init.
657         (mfont__fini): Don't call mfont__flt_fini.
658         (mfont__get_glyph_id, mfont__get_metrics): New functions.
659
660         * font.h (struct MRealizedFont): New members x_ppem and y_ppem.
661         (MFLTFontForRealized): New struct.
662         (struct MFontDriver): New members check_otf and drive_otf.
663         (mfont__get_glyph_id, mfont__get_metrics): Extern them.
664
665         * face.c: Adjusted for the change of MGlyph.
666
667         * draw.c: Adjusted for the change of MGlyph.
668
669         * m17n.c (m17n_init): Don't call mchar_init.
670
671         * m17n-core.c (m17n_init_core): Call mchar_init.
672
673         * m17n-core.h (mchartable_min_char, mchartable_max_char): Extern them.
674
675         * input.c: Include "m17n.h" instead of "m17n-gui.h".
676
677         * chartab.c (mchartable): Initialize table->min_char to -1.
678         (mchartable_min_char): New function.
679         (mchartable_max_char): New function.
680
681         * Makefile.am (GUI_SOURCES): Delete font-flt.c.
682         (libm17n_gui_la_LIBADD): Add ${top_builddir}/src/libm17n-flt.la.
683
684 2007-10-12  Kenichi Handa  <handa@m17n.org>
685
686         * m17n-core.h (Mcharset): Extern it.
687         Move detabase related declarations from m17n.h.
688
689         * m17n-flt.h: Include m17n-core.h instead of m17n.h.
690         (struct _MFLTOtfFeatures): New struct.
691         (struct _MFLTOtfSpec): Delete gsub, gpos, etc, add gsub_gpos.
692         (struct _MFLTFont): Delete otf, add check_otf.
693         (MCHAR_INVALID_CODE): Define it.
694
695         * plist.c (read_mtext_element): Simplify the code.
696
697         * m17n.h: Move database related declarations to m17n-core.h
698         (Mharset): Don't extern it.
699
700         * m17n.c (m17n_init): Don't call mdatabase__init.
701
702         * m17n-gd.c (read_rgb_txt): Check also /etc/X11/rgb.txt.  Downcase
703         color names.
704
705         * m17n-flt.c: Include m17n-core.h instead of m17n.h.
706         (Mexist): New variable.
707         (enum FontLayoutCmdRuleSrcType): New enum SRC_EXIST.
708         (FontLayoutCmdRule): New member src.exist.
709         (parse_otf_command): Handle gsub_count and gpos_count separately.
710         (load_otf_command): Adjusted for the change of MFLTOtfSpec.
711         (load_command): Handle the command "exist".
712         (free_flt_command): Adjusted for the change of MFLTOtfSpec.
713         (run_rule): Handle the case SRC_EXIST.
714         (run_otf): Adjusted for the change of MFLTOtfSpec.
715         (run_command): Check the range of FROM.
716         (check_otf_spec): Delete it.
717         (m17n_init_flt): Call m17n_init_core instead of m17n_init.
718         Initialize Mexist.
719         (m17n_fini_flt): Call m17n_fini_core instead of m17n_fiini.
720         (mflt_find): Call font->check_otf instead of check_otf_spec.
721         (mflt_run): Keep the metrics in 26.6 fixed point.
722
723         * m17n-core.c (mdatabase__finder, mdatabase__loader): Delete them.
724         (m17n_init_core): Call mdatabase__init.
725
726         * m17n-X.c (device_open): Use mplist_add, not mplist_push.
727
728         * internal.h (mdatabase__finder, mdatabase__loader): Delete externs
729         of them.
730
731         * font-flt.c (Mexist): New variable.
732         (enum FontLayoutCmdRuleSrcType): New enum SRC_EXIST.
733         (FontLayoutCmdRule): New member src.exist.
734         (load_category_table): Use isalnum, not isalpha.
735         (load_command): Check the command "exist".
736         (run_rule): Hande the case SRC_EXIST.
737         (run_command): Check the range of FROM.
738         (mfont__flt_init): Initialize Mexist.
739
740         * draw.c (layout_glyphs): Fix calculation of off_x and off_y.
741
742         * database.h (mdatabase__load_charset_func): Extern it.
743
744         * database.c: Include m17n-core.h instead of m17n.h.
745         (load_chartable): Use mtext__from_data.
746         (load_charset): Moved to charset.c
747         (load_database): Call mdatabase__load_charset_func instead of
748         load_charset.
749         (mdatabase__load_charset_func): New variable.
750         (mdatabase__init): Initialize mdatabase__load_charset_func and
751         Mcharset.  Don't set mdatabase__finder and mdatabase__loader.
752         (mdatabase__save): Use fwrite, not mconv_encode_stream.
753         (Mcharset): Declare it here.
754
755         * charset.c: Include "database.h.".
756         (load_charset): Moved from database.c.
757         (mcharset__init): Initialize mdatabase__load_charset_func, don't
758         initialize Mcharset.
759
760         * character.c (mchar_define_property): Call mdatabase_find directly.
761         (mchar_get_prop): Call mdatabase_add directly.
762         (mchar_put_prop): Call mdatabase_load directly.
763         (mchar_get_prop_table): Likewise.
764
765         * Makefile.am (libm17n_core_la_SOURCES): Add database.[ch].
766         (libm17n_la_SOURCES): Remove database.[ch].
767         (libm17n_flt_la_LIBADD): Delete libm17n.la, add libm17n-core.la.
768
769 2007-09-18  Kenichi Handa  <handa@m17n.org>
770
771         * face.c (mface__realize): Try Freetype based font at first.
772
773         * font.c: Include <ctype.h>
774
775 2007-09-16  Kenichi Handa  <handa@m17n.org>
776
777         * m17n-flt.c (load_flt): New arg full.  If full is zero, load only
778         coverage.
779         (run_otf): Call font->get_metrics, not font->get_metric.
780         (run_stages): Likewise.
781         (CHECK_FLT_COVERAGE): New macro.
782         (CHECK_FLT_STAGES): Call load_flt with the second arg 1.
783         (check_otf_spec): New function.
784         (m17n_fini_flt): Unref flt->coverage.
785         (mflt_find): Argument changed.
786         (mflt_name): New function.
787         (mflt_coverage): Use CHECK_FLT_COVERAGE.
788
789         * m17n-flt.h (MFLTFont): Member get_metrics renamed from get_metric.
790         (mflt_find): Prototype adjusted.
791         (mflt_name): Extern it.
792
793 2007-09-14  Kenichi Handa  <handa@m17n.org>
794
795         * m17n-flt.h (struct _MFLTGlyph): Change signedness of members.
796
797         * font-flt.c (run_otf): Make debug info printing comaptible with
798         that of m17n-flt.c.
799         (run_command): Likewise.
800         (mfont__flt_run): Likewise.
801
802         * m17n-flt.c (UPDATE_CLUSTER_RANGE): ctx->cluster_begin_idx is
803         invalid only when it's negative.
804         (run_otf): Likewise.
805         (run_command): Likewise.
806         (mflt_run): Initialize ctx.cluster_begin_idx to -1.
807
808 2007-09-10  Kenichi Handa  <handa@m17n.org>
809
810         * m17n-flt.h (struct _MFLTGlyph): New member encoded and measured.
811         (struct _MFLTFont): Prototype of get_glyph_id changed.
812
813         * m17n-flt.c (enum GlyphInfoMask): Delete EncodedMask and
814         PositionedMask.
815         (GAPPEND): Delete this macro.
816         (GET_ENCODED, SET_ENCODED, GET_MEASURED, SET_MEASURED): Adjusted
817         for the change of MFLTGlyph.  Caller changed.
818         (run_otf): Simply calls font->get_glyph_id.
819         (run_command): Reset g->encoded and g->measured for direct code.
820         (positioning): Delete this function.
821         (run_stages): Simply calls font->get_glyph_id and font->get_metric.
822
823 2007-09-07  Kenichi Handa  <handa@m17n.org>
824
825         * draw.c (compose_glyph_string): Improve script detection.
826
827 2007-09-06  Kenichi Handa  <handa@m17n.org>
828
829         * m17n-flt.h (mflt_get): Extern it.
830
831         * m17n-flt.c (run_stages): Call positioning only if
832         font->get_metric is non-NULL.
833         (CHECK_FLT_STAGES): Fix typo.
834         (mflt_get): New function.
835
836         * font-flt.c (mfont__flt_run): Improve debug info printing.
837
838 2007-09-04  Kenichi Handa  <handa@m17n.org>
839
840         * m17n-flt.c (MFontLayoutTable): Delete this type.
841         (struct _MFLT): New member mdb and coverage.
842         (list_flt): Set flt->mdb.
843         (load_generator): Argument and return value changed.  Caller
844         changed.
845         (get_font_layout_table): Delete this function.
846         (run_stages): Argument changed.  Caller changed.
847         (CHECK_FLT_STAGES): New macro.
848         (mfont__flt_encode_char): Argument changed.
849         (mflt_find): Likewise.
850         (mflt_coverage): New function.
851         (mflt_run): Argument changed.
852         (mdebug_dump_flt): Likewise.
853
854         * m17n-flt.h (mflt_coverage): Extern it.
855         (mflt_find): Prototype adjusted.
856
857 2007-09-03  Kenichi Handa  <handa@m17n.org>
858
859         * internal.h (MTABLE_CALLOC_SAFE, MSTRUCT_CALLOC_SAFE): New macros.
860
861         * database.c (mdatabase__props): New function.
862
863         * database.h (mdatabase__props): Extern it.
864
865         * m17n-flt.h (struct _MFLTGlyphString): Delete user_data, add
866         script and langsys.
867         (struct _MFLTFont): Add suitable_p.
868         (mflt_find): Extern it.
869
870         * m17n-flt.c: Include "database.h".
871         (struct _MFLT): New struct.
872         (list_flt): New function.
873         (load_flt): Don't update flt_list.
874         (get_font_layout_table): Use flt_list.
875         (m17n_init_flt): Don't initialize flt_list.
876         (m17n_fini_flt): Adjusted for the change of flt_list.
877         (mflt_find): New function.
878         (mflt_run): Fix debug printing.
879
880 2007-08-23  Kenichi Handa  <handa@m17n.org>
881
882         * m17n-flt.c (run_otf): Remove #ifdef HAVE_OTF and #endi.
883         (run_stages): Print separator in encoded string as "|".
884
885 2007-08-23  Kenichi Handa  <handa@m17n.org>
886
887         * font-flt.c (mfont__flt_run): Don't calculate a glyph metric if
888         the glyph is already handled by OTF.
889
890 2007-08-21  Kenichi Handa  <handa@m17n.org>
891
892         * font-ft.c (ft_check_capability): Check cap->script_tag at first.
893
894 2007-08-20  Kenichi Handa  <handa@m17n.org>
895
896         * font-flt.c (mfont__flt_run): Get glyph metrics before printing
897         debug information.
898
899 2007-08-17  Kenichi Handa  <handa@m17n.org>
900
901         * m17n-flt.h (struct _MFLTGlyphString): Member pointer renamed to
902         user_data.
903         (MFLTOtfSpec): Renamed from MFLT_OTF_Spec.
904         (MFLTFont): Prototype of the member drive_otf adjusted.
905
906         * m17n-flt.c (run_stages): Fix handling of padding.
907
908         * font-ft.c (get_glyph_metric): New function.
909         (DEVICE_DELTA): Return 26.6 fixed point value.
910         (adjust_anchor): Likewise.
911         (mfont__ft_drive_otf): Use get_glyph_metric.
912
913         * font-flt.c (mfont__flt_run): Pay attention to padding on
914         printing debug info.
915
916 2007-08-16  Kenichi Handa  <handa@m17n.org>
917
918         * m17n-flt.c (run_stages): Fix typo.
919
920         * font-ft.c (adjust_anchor): Argument changed.  Calculte based on
921         26.6 fixed point.
922         (mfont__ft_drive_otf): Don't call OTF_check_features for GPOS.
923         Adjusted for the argument change of adjust_anchor.  Calculte based
924         on 26.6 fixed point.
925
926 2007-08-15  Kenichi Handa  <handa@m17n.org>
927
928         * charset.c (mcharset__load_from_database): Set mdebug_flag
929         instead of mdebug_mask.
930
931         * coding.c (mcoding__load_from_database): Set mdebug_flag instead
932         of mdebug_mask.
933
934         * database.c (load_database): Set mdebug_flag instead of
935         mdebug_mask.
936         (mdatabase__load_for_keys): Likewise.
937
938         * draw.c: Include "internal-flt.h".
939         (dump_combining_code): Don't subtract 128 from combining code
940         off_x/y.
941
942         * font-flt.c: Include "internal-flt.h".  Set mdebug_flag instead
943         of mdebug_mask.
944         (run_rule): Print debug info only when MDEBUG_FLAG is greater than
945         2.
946         (run_cond): Likewise.
947         (run_otf): Likewise.
948         (run_command): Likewise.
949         (mfont__flt_run): Change format of debug info.
950
951         * font-ft.c: Include "internal-flt.h".
952         Set mdebug_flag instead of mdebug_mask.
953         (mfont__ft_drive_otf): Fix arg to OTF_check_features.
954
955         * input.c: Set mdebug_flag instead of mdebug_mask.
956         (shift_state): New MDEBUG_FLAG macro.
957         (preedit_commit): Likewise.
958         (filter): Likewise.
959
960         * internal-flt.h: New file.
961
962         * internal-gui.h (MAKE_COMBINING_CODE, COMBINING_CODE_OFF_Y)
963         (COMBINING_CODE_OFF_X, COMBINING_CODE_BASE_X)
964         (COMBINING_CODE_BASE_Y, COMBINING_CODE_ADD_X)
965         (COMBINING_CODE_ADD_Y, MAKE_COMBINING_CODE_BY_CLASS)
966         (COMBINING_BY_CLASS_P, COMBINING_CODE_CLASS)
967         (MAKE_PRECOMPUTED_COMBINDING_CODE, COMBINING_PRECOMPUTED_P): Move
968         these macros to internal-flt.h.
969
970         * internal.h (M17N_OBJECT_ADD_ARRAY): Adjusted for the change of
971         mdebug__flags.
972         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Likewise.
973         (enum MDebugMaskBit): Delete this enum.
974         (enum MDebugFlag): New enum.
975         (mdebug__flag): Don't extern it.
976         (mdebug__flags): Extern it.
977         (MDEBUG_FLAG): New macro.
978         (MDEBUG_PRINT0): Use the macro MDEBUG_FLAG.
979         (MDEBUG_DUMP, MDEBUG_PUSH_TIME, MDEBUG_POP_TIME)
980         (MDEBUG_PRINT_TIME): Likewise.
981
982         * m17n-X.c (xfont_open): Set mdebug_flag instead of mdebug_mask.
983         (xfont_list): Likewise.
984
985         * m17n-core.c (mdebug__flag): Delete this variable.
986         (mdebug__flags): New variable.
987         (SET_DEBUG_FLAG): Make it a function.
988         (m17n_init_core): Set mdebug_flag instead of mdebug_mask.
989         (m17n_fini_core): Likewise.
990
991         * m17n-gui.c (m17n_init_win): Set mdebug_flag instead of mdebug_mask.
992         (m17n_fini_win): Likewise.
993
994         * m17n-misc.h (enum MErrorCode): Add MERROR_FLT.
995
996         * m17n.c (m17n_init): Set mdebug_flag instead of mdebug_mask.
997         (m17n_fini): Likewise.
998
999         * symbol.c (msymbol__free_table): Adjusted for the change of
1000         mdebug__flags.
1001
1002         * Makefile.am (BASICBUILDS): Add libm17n-flt.la.
1003         (BASICHEADERS): Add m17n-flt.h.
1004         (FLT_SOURCES): New variable.
1005         (libm17n_flt_la_SOURCES, libm17n_flt_la_LIBADD)
1006         (libm17n_flt_la_LDFLAGS): Likewise.
1007
1008         * m17n-flt.h: New file.
1009
1010         * m17n-flt.c: New file created by modifying font-flt.c.
1011
1012 2007-07-13  Kenichi Handa  <handa@m17n.org>
1013
1014         * Version 1.4.0 released.
1015
1016 2007-07-12  Kenichi Handa  <handa@m17n.org>
1017
1018         * input.c: Fix doxygen @ref commands.
1019
1020 2007-07-10  Kenichi Handa  <handa@m17n.org>
1021
1022         * m17n-core.h (M17NFunc): Fix typo of Doxygen directive.
1023
1024 2007-07-09  Kenichi Handa  <handa@m17n.org>
1025
1026         * m17n-core.h (M17N_BEGIN_HEADER, M17N_END_HEADER): New macros.
1027
1028         * m17n.h: Include m17n-core.h if not yet done.  Use macros
1029         M17N_BEGIN_HEADER and M17N_END_HEADER.
1030
1031         * m17n-gui.h: Likewise.
1032
1033         * m17n-misc.h: Likewise.
1034
1035 2007-06-13  Kenichi Handa  <handa@m17n.org>
1036
1037         * font-flt.c (load_command): Prepend "^" in the regular expression.
1038
1039 2007-06-11  Kenichi Handa  <handa@m17n.org>
1040
1041         * language.c (mlanguage_name_list): Fix previous change.
1042
1043         * coding.c (mcoding__load_from_database): Add aliases in
1044         coding_definition_list.
1045
1046 2007-06-10  Kenichi Handa  <handa@m17n.org>
1047
1048         * language.c (mlanguage_name_list): Fix previous change.
1049
1050 2007-06-08  Kenichi Handa  <handa@m17n.org>
1051
1052         * input.c (update_candidate): Copy candidate_list earlier.
1053         (re_init_ic): Provide pseudo initialize state if none.
1054
1055 2007-06-05  Kenichi Handa  <handa@m17n.org>
1056
1057         * input.c (preedit_insert): Print debug information.
1058
1059         * database.c (expand_wildcard_database): New function.
1060         (mdatabase_list): Fix handling of wildcard database.
1061
1062         * language.c (load_lang_name): New function.
1063         (mlang__fini): Cancel the last two changes.
1064         (mlanguage_name_list): New arg script and territories.  Use
1065         load_lang_name.
1066
1067         * m17n.h (mlangauge_name_list): Adjusted.
1068
1069 2007-06-04  Kenichi Handa  <handa@m17n.org>
1070
1071         * input.c (open_im): Check if the input method has at least one
1072         state.
1073
1074 2007-06-01  Kenichi Handa  <handa@m17n.org>
1075
1076         * input.c (shift_state): Change the format of debug print.
1077         (preedit_commit): New arg need_prefix.  Caller changed.
1078         (update_candidate): Copy candidate_list.
1079         (take_action_list): Likewise.
1080         (handle_key): Change the format of debug print.
1081
1082         * font-flt.c (load_flt): Ignore unknown directives.
1083
1084 2007-05-25  Kenichi Handa  <handa@m17n.org>
1085
1086         * m17n-core.c (mdebug__unregister_object): Small optimization.
1087
1088         * database.c (find_file): Merged into get_database_file.
1089         (get_database_file): New arg result.  Caller changed.
1090         (mdatabase__check): Fix the logic.
1091
1092 2007-05-24  Kenichi Handa  <handa@m17n.org>
1093
1094         * database.c (find_database): If unprocessed wildcard database is
1095         found, register database filed and recursively call find_database.
1096         (free_db_info): Unref db_info->properties.
1097         (register_database): New arg properties.  Delete code for
1098         initializing mdatabase__list.
1099         (register_databases_in_files): Argument changed.  Caller changed.
1100         (mdatabase__update): Don't list files by glob here.
1101         (mdatabase_list): If unprocessed wildcard database is found,
1102         register database filed and recursively call mdatabase_list.
1103
1104         * database.h (enum MDatabaseStatus): New enum
1105         MDB_STATUS_AUTO_WILDCARD.
1106
1107         * input.c (load_branch): Fix previous change.
1108         (update_global_info): If the global database is not found, return -1.
1109
1110 2007-05-23  Kenichi Handa  <handa@m17n.org>
1111
1112         * database.c (Mversion): New variable.
1113         (mdatabase__init): Initialize it.
1114         (register_database): New arg properties.  Caller changed.
1115         (register_databases_in_files): Don't check version here.
1116         (mdatabase__update): Likewise.
1117
1118         * database.h (MDatabaseInfo): New member properties.
1119
1120 2007-05-21  Kenichi Handa  <handa@m17n.org>
1121
1122         * language.c: Include <ctype.h>
1123         (mlanguage__info): Use strncasecmp (not memcmp).
1124         (mlanguage_name): Downcase language name for backward
1125         compatibility.
1126
1127         * input.c (filter): Don't check Mlanguage property of
1128         ic->im->langauge.
1129
1130 2007-05-18  Kenichi Handa  <handa@m17n.org>
1131
1132         * language.c (mlanguage_name): Fix it to handle M-text English
1133         name.
1134
1135         * input.c (config_command): Set NAME before using it.
1136         (load_branch): Try to resolve a map name by variables.
1137
1138 2007-05-17  Kenichi Handa  <handa@m17n.org>
1139
1140         * language.c (mlang__fini): Fix previous change.
1141
1142 2007-05-16  Kenichi Handa  <handa@m17n.org>
1143
1144         * plist.c (free_plist): Cancel the last change.
1145         (write_element): Check if PLIST is nested.
1146         (mplist__from_plist): Label a plist as nested if appropriate.
1147         (mplist__from_alist): Label a plist as nested.
1148         (mplist__conc): Check the value of PL before referring it.  Label
1149         a plist as nested if appropriate.
1150         (mplist_copy): Label a plist as nested if appropriate.
1151         (mplist_put_func): Return Mnil if KEY is a managing key.
1152         (mplist_push): Label a plist as nested if appropriate.
1153
1154         * plist.h (MPLIST_SET_NESTED_P): Return 1 iff plist->control.flag
1155         is set as nested.
1156
1157         * language.c (mlang__fini): Unref each element of langname_list.
1158
1159 2007-05-14  Kenichi Handa  <handa@m17n.org>
1160
1161         * language.c: Include <string.h> and <locale.h>.
1162         (langname_list): New variable.
1163         (load_lang_script_list): Exclude invalid list elements.
1164         (mlang__init): Initialize langname_list.
1165         (mlang__fini): Unref langname_list.
1166         (mlanguage__info): Adjusted for the change of English
1167         name (symbol->M-text).
1168         (mlanguage_name): Label it as obsolete.
1169         (mlanguage_name_list): New function.
1170
1171         * m17n.h (mlanguage_name_list): Extern it.
1172
1173         * locale.c (make_locale): Fix setting of members of locale.
1174
1175         * plist.c (free_plist): Unref also nested plist.
1176
1177 2007-05-11  Kenichi Handa  <handa@m17n.org>
1178
1179         * coding.c (mconv_reset_converter): Set internal->used to 0.
1180
1181 2007-05-08  Kenichi Handa  <handa@m17n.org>
1182
1183         * input.c (check_description): Force copying the translated text.
1184
1185 2007-05-02  Kenichi Handa  <handa@m17n.org>
1186
1187         * input.c (minput_save_config): Unref unnecessary plist.  Use
1188         free_im_list to free im_config_list.
1189
1190 2007-04-20  Kenichi Handa  <handa@m17n.org>
1191
1192         * input.c (config_command): Fix previous change again.
1193         (config_variable): Likewise.
1194         (minput_config_command): Fix for the case of setting back to
1195         default.
1196         (minput_config_variable): Likewise.
1197         (minput_save_config): Include nil as documentation of customized
1198         command/variable.
1199
1200 2007-04-05  Kenichi Handa  <handa@m17n.org>
1201
1202         * input.c (config_command): Fix previous change.
1203         (config_variable): Likewise.
1204
1205         * plist.c (mplist_get_func): Fix for backward compatiblity.
1206
1207 2007-04-04  Kenichi Handa  <handa@m17n.org>
1208
1209         * input.c (minput_get_command, minput_config_command): Fix example
1210         codes.
1211
1212 2007-03-29  Kenichi Handa  <handa@m17n.org>
1213
1214         These changes are to avoid unsafe casting of a function pointer.
1215
1216         * face.h (enum MFaceProperty): Delete MFACE_HOOK_FUNC.
1217         (struct MFace): New member hook.
1218
1219         * face.c (serialize_face): Adjusted for the change of MFace.
1220         (deserialize_face): Likewise.
1221         (mface__init): Likewise.  Use msymbol_put_func.
1222         (mface__realize): Adjusted for the change of MFace.  Avoid
1223         compiler warning.
1224         (mface_get_prop): Adjusted for the change of MFace.
1225         (mface_put_prop): Likewise.
1226         (mface_get_hook): New function.
1227         (mface_put_hook): New function.
1228         (mface_update): Adjusted for the change of MFace.
1229
1230         * input-gui.c (win_callback): Use mplsit_get_func.
1231         (minput__win_init): Use mplsit_put_func.
1232
1233         * input.c (take_action_list): Use mplist_get_func.
1234         (init_ic_info): Likewise.
1235         (fini_ic_info): Likewise.
1236         (minput_callback): Likewise.
1237         (minput__init): Use mplist_put_func.
1238
1239         * language.c (mlang__init): Use msymbol_put_func.
1240
1241         * m17n-core.h (M17NFunc): New function type.
1242         (M17N_FUNC): New macro.
1243         (msymbol_put_func, msymbol_get_func): Extern them.
1244         (mplist_put_func, mplist_get_func): Extern them.
1245
1246         * m17n-gui.h (mface_get_hook, mface_put_hook): Extern them.
1247
1248         * m17n-gui.c (mframe): Add a proper casting.
1249
1250         * plist.h (struct MPlist): Make the member val a union.
1251         (MPLIST_VAL): Adjusted for the above change.
1252         (MPLIST_FUNC): New macro.
1253         (MPLIST_VAL_FUNC_P, MPLIST_SET_VAL_FUNC_P): New macros.
1254
1255         * plist.c (mplist_put_func, mplist_get_func): New functions.
1256
1257         * symbol.c (msymbol__fini): Use MPLIST_VAL.
1258         (msymbol_put_func, msymbol_get_func): New functions.
1259
1260         * textprop.c (mtext_serialize): Use msymbol_get_func.
1261         (mtext_deserialize): Likewise.
1262
1263 2007-03-28  Kenichi Handa  <handa@m17n.org>
1264
1265         * input.c (get_candidate_list): Avoid unnecessary unref.
1266
1267 2007-03-23  Kenichi Handa  <handa@m17n.org>
1268
1269         * database.c (mdatabase__update): Unref plist at the tail.
1270
1271 2007-03-21  Kenichi Handa  <handa@m17n.org>
1272
1273         * input.c (update_custom_info): Fix for the case "name == Mnil &&
1274         extra != Mnil".
1275         (config_command): Fix for the case that configuration is
1276         cancelled.
1277         (config_variable): Likewise.
1278         (minput_config_command): If keyseqlist is an empty list, cancel
1279         the customization.
1280         (minput_config_variable) If value is an empty list, cancel the
1281         customization.
1282         (minput_save_config): Handle cancellation of config and customize
1283         correctly.
1284
1285 2007-03-15  Kenichi Handa  <handa@m17n.org>
1286
1287         * input.c (minput_config_variable): Check custom->vars (not
1288         custom->cmds).
1289
1290 2007-03-01  Kenichi Handa  <handa@m17n.org>
1291
1292         * input.c (reload_im_info): Setup cmds, vars, and title of
1293         im_info.
1294         (check_variable_value): Fix the return value.
1295
1296         * database.c (mdatabase__check): If necessary, update database and
1297         find a new file.
1298
1299 2007-02-28  Kenichi Handa  <handa@m17n.org>
1300
1301         * database.c (get_dir_info): Set dir_info->status to
1302         MDB_STATUS_OUTDATED.
1303         (check_version): New function.
1304         (register_database): Don't call find_database.
1305         (register_databases_in_files): Don't register a database of
1306         invalid version.
1307         (mdatabase__update): Likewise.  Avoid unnecessary scanning.
1308
1309         * database.h (enum MDatabaseStatus): New membes MDB_STATUS_UPDATED
1310         and MDB_STATUS_OUTDATED.
1311
1312         * font.h (struct MFont): Types of members type, source, and
1313         spacing changed to unsigned.
1314
1315         * internal-gui.h (struct): Types of members category and type
1316         changed to unsigned.
1317
1318         * internal.h (struct MText): Types of members format and coverage
1319         changed to unsigned.
1320
1321         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 5.
1322         (M17NLIB_VERSION_NAME): Changed to "1.3.5".
1323
1324 2007-02-23  Kenichi Handa  <handa@m17n.org>
1325
1326         * input.c (Mpop): New variable.
1327         (fully_initialize): Initialize Mpop.
1328         (parse_action_list): Handle Mpop.
1329         (take_action_list): Likewise.
1330         (handle_key): When a key is unhandled, shift to the initial state
1331         only if the current state has no branch action.
1332
1333 2007-02-12  Kenichi Handa  <handa@m17n.org>
1334
1335         * input.c (get_preceding_char): Unref mt if necessary.
1336         (get_following_char): Likewise.
1337         (parse_action_list): Fix handling of `insert' action as
1338         candidates.
1339         (get_candidate_list): Fix for handling (("CANDIDATE1" ...)).
1340         (take_action_list): Check invalid candidate list.
1341
1342 2007-02-06  Kenichi Handa  <handa@m17n.org>
1343
1344         * input.c (integer_value): Check also ic->produced for @-N.
1345
1346 2007-01-26  Kenichi Handa  <handa@m17n.org>
1347
1348         * database.c (mdatabase__update): Check mdatabase__dir_list from
1349         the tail.
1350
1351         * font-ft.c (STRDUP_LOWER): Don't ignore the tailing spaces.
1352
1353 2007-01-12  Kenichi Handa  <handa@m17n.org>
1354
1355         * input.c (handle_key): Handle a branch action of the initial
1356         state correctly.
1357
1358 2007-01-10  Kenichi Handa  <handa@m17n.org>
1359
1360         * m17n-gd.c (gd_render): Delete superfluous line.
1361
1362 2006-12-26  Kenichi Handa  <handa@m17n.org>
1363
1364         * m17n.h (minput_callback): Extern it.
1365
1366         * input.h (minput__callback): Delte extern.
1367
1368         * input.c (get_surrounding_text): Adjusted for the change of
1369         minput__callback to minput_callback.
1370         (delete_surrounding_text): Likewise.
1371         (minput_create_ic): Likewise.
1372         (minput_destroy_ic): Likewise.
1373         (minput_filter): Likewise.
1374         (minput_set_spot): Likewise.
1375         (minput_toggle): Likewise.
1376         (minput_reset_ic): Likewise.
1377
1378         (preedit_commit): Reset ic->candidate_index, ic->candidate_from,
1379         and ic->candidate_to to 0.
1380         (minput_callback): Renamed from minput__callback.
1381
1382         * input-gui.c (win_callback): Adjusted for the change of
1383         minput__callback to minput_callback.
1384
1385 2006-12-15  Kenichi Handa  <handa@m17n.org>
1386
1387         * font-ft.c (ft_add_font): Fix typo.
1388
1389 2006-12-06  Kenichi Handa  <handa@m17n.org>
1390
1391         * Version 1.3.4 released.
1392
1393 2006-11-16  Kenichi Handa  <handa@m17n.org>
1394
1395         * input.c (parse_action_list): Allow (undo 0).
1396         (adjust_markers): New function.
1397         (preedit_insert, preedit_delete): Call adjust_markers.
1398         (preedit_replace): New function.
1399         (update_candidate): Call preedit_replace instead of preedit_insert
1400         and preedit_delete.
1401         (filter): When ic_info->commit_key_head is nonzero, shift input
1402         event keys even if there's no committed text.
1403
1404 2006-11-10  Kenichi Handa  <handa@m17n.org>
1405
1406         * input.h (MInputContextInfo): New member commit_key_head.
1407
1408         * input.c (preedit_commit): Update ic_info->commit_key_head.
1409         (take_action_list): Reset ic_info->commit_key_head on Mundo.
1410         (filter): When committed, shift keys by ic_info->commit_key_head.
1411
1412 2006-10-30  Kenichi Handa  <handa@m17n.org>
1413
1414         * input.c (preedit_delete): Fix typo.
1415         (take_action_list): Print more debugging information.  Allow
1416         variable in arg of 'select' and `pushback'.
1417
1418         * database.c (gen_database_name): Don't put extra space.
1419         (load_database): Print debugging information.
1420         (register_databases_in_files): New arg headlen.  Callers changed.
1421         (mdatabase__load_for_keys): Shorten debugging information.
1422         (mdatabase_load): Don't print debugging information here.
1423
1424 2006-10-27  Kenichi Handa  <handa@m17n.org>
1425
1426         * input.c (marker_code): New arg surrounding.  Callers changed.
1427         (surrounding_pos): Check if name[0] == '@'.
1428         (integer_value): Fix for the change semantics of `@-N' and `@+N'.
1429         (take_action_list): Likewise.
1430         (get_preceding_char): If POS is zero, always call
1431         get_surrounding_text.
1432
1433 2006-10-19  Kenichi Handa  <handa@m17n.org>
1434
1435         * input.c (load_variables): Fix setting of `global'.
1436
1437 2006-10-16  Kenichi Handa  <handa@m17n.org>
1438
1439         * draw.c (draw_background): Be sure to set *to_x.
1440         (render_glyph_string): If from == to, just return.
1441
1442 2006-10-18  Kenichi Handa  <handa@m17n.org>
1443
1444         * database.c (get_dir_info): Return NULL if the directory name is
1445         too long.
1446         (register_databases_in_files): Call register_database with
1447         MDB_STATUS_AUTO.
1448         (mdatabase__update): Fix logic.  Call register_database with
1449         MDB_STATUS_AUTO.
1450         (mdatabase_define): Call register_database with
1451         MDB_STATUS_EXPLICIT.
1452
1453         * input.c (delete_surrounding_text): Be sure to set members
1454         preceding_text and following_text to NULL.
1455         (shift_state): Save variable values in ic_info->vars_saved.
1456         (preedit_commit): Don't print debug information here.  Don't
1457         change ic_info->keys here.
1458         (get_candidate_list): Don't ref plist.
1459         (take_action_list): Don't unref return value of
1460         get_candidate_list.  For undo, reset ic->produced and recover
1461         ic_info->vars.  Be sure to set ic->candidate_list to NULL after
1462         unref it.
1463         (init_ic_info): Set ic_info->vars_saved.
1464         (fini_ic_info): Unref ic_info->vars_saved.
1465         (re_init_ic): Be sure to set ic->candidate_list to NULL after
1466         unref it.
1467         (filter): Be sure to set members preceding_text and following_text
1468         to NULL.  Print debug information about produced text.  Delete
1469         processed keys from ic_info->keys.
1470
1471         * input.h (MInputContextInfo): New member vars_saved.
1472
1473 2006-10-16  Kenichi Handa  <handa@m17n.org>
1474
1475         * database.c (mdatabase__update): Fix the way to get db_info.
1476
1477 2006-10-02  Kenichi Handa  <handa@m17n.org>
1478
1479         * font.h (struct MFont): New member `multiple_sizes'.  Bit-size of
1480         `size' changed to 24.
1481
1482         * font.c (xlfd_unparse_name): Adjusted for the change of
1483         MFont->size.
1484         (font_score): Likewise.
1485         (mfont__set_spec_from_face): Set spec->multiple_sizes to 0.
1486
1487         * m17n-X.c (MFontX, _MFontX): Deleted.
1488         (SET_SIZE, HAVE_SIZE): Deleted.
1489         (free_display_info): Adjusted for the change of
1490         disp_info->font_list format.
1491         (xfont_registry_list): Likewise.
1492         (xfont_open): Likewise.
1493         (xfont_list): Likewise.
1494         (xfont_encode_char): Ignore size to find a realized font.
1495         (MRealizedFontXft): Change the order of members to make it
1496         compatible with MRealizedFontFT.
1497
1498 2006-09-27  Kenichi Handa  <handa@m17n.org>
1499
1500         * font.c (mfont_match_p, mfont_open, mfont_encapsulate)
1501         (mfont_close): Add comments.
1502
1503         * mtext-lbrk.c (mtext_line_break): Add comment.
1504
1505 2006-09-26  Kenichi Handa  <handa@m17n.org>
1506
1507         * input.c (minput_get_description): Handle description about
1508         inclusion-only input methods.
1509
1510 2006-09-21  Kenichi Handa  <handa@m17n.org>
1511
1512         * input.c (M_gettext): New variable.
1513         (fully_initialize): Initialize M_gettext.
1514         (check_description): New function.
1515         (load_commands): Call check_description.
1516         (config_all_commands): Be sure to unref pl.
1517         (load_variables): Call check_description.
1518         (config_all_variables): Be sure to unref pl.
1519         (load_im_info): Call check_description.
1520
1521         * internal.h [ENABLE_NLS]: Include <libintl.h> and define _.
1522
1523         * m17n-core.c (m17n_init_core) [ENABLE_NLS]: Call bindtextdoman
1524         and bind_textdomain_codeset.
1525
1526         * Makefile.am (AM_CPPFLAGS): Add -DGETTEXTDIR=...
1527
1528 2006-09-15  Kenichi Handa  <handa@m17n.org>
1529
1530         * input.c (reload_im_info): Update custom and global info.
1531         (init_ic_info): Fix previous change.
1532
1533 2006-09-14  Kenichi Handa  <handa@m17n.org>
1534
1535         * database.c: Include <libgen.h>.
1536         (mdatabase__lock): Make a directory if necessary.
1537
1538         * input.c (resolve_command): Adjusted for the format change of
1539         configured_cmds member.
1540         (load_commands, load_variables): Fix for errornous data handling.
1541         (config_command, config_variable): New function.
1542         (config_all_commands, config_all_variables): Renamed from
1543         config_commands and config_variables.  Utilize the above function.
1544         (check_variable_value): Argument changed.  Callers changed.
1545         (load_im_info): Call config_all_commands and config_all_variables.
1546         (init_ic_info): Adjusted for the format change of configured_vars
1547         member.
1548         (minput__init): Initialize Mcustomized, Mconfigured, and
1549         Minherited.
1550         (Mcustomized, Mconfigured, Minherited): New variables.
1551         (minput_get_command): Be sure to return NULL if an input method
1552         use no local command.
1553         (minput_get_variable): Be sure to return NULL if an input method
1554         use no local variable.
1555         (minput_config_command, minput_config_variable)
1556         (minput_save_config): Adjusted for the format change of
1557         configured_cmds and configured_vars members.
1558         
1559         * plist.c (write_element): Delete superfluous ':'.
1560
1561 2006-09-13  Kenichi Handa  <handa@m17n.org>
1562
1563         * m17n.h (Minherited, Mcustomized, Mconfigured): Extern them.
1564         (minput_config_file): Extern it.
1565
1566         * draw.c (Minherited): Declaration moved to input.c.
1567         (mdraw__init): Don't initialize Minherited here.
1568
1569         * database.c (mdatabase__unlock): Be sure to unlink uniq file.
1570
1571 2006-09-07  Kenichi Handa  <handa@m17n.org>
1572
1573         * textprop.c (mtext_serialize): Call mplist__serialize with the
1574         arg pretty 0.
1575
1576         * plist.h (mplist__serialize): Prototype adjusted.
1577         (mplist__assq): Extern it.
1578
1579         * plist.c: Include <ctype.h>
1580         (PUTC, PUTS): New macros.
1581         (write_symbol): New function.
1582         (write_element): New arg indent.
1583         (dump_string, dump_plist_element): Delete them.
1584         (mplist__from_string): New arg pretty.
1585         (mplist__assq): New function.
1586         (mdebug_dump_plist): Use write_element.
1587
1588         * mtext.c (mtext_cat_char): Allocate more memory.
1589         (mdebug_dump_mtext): Don't escal a newline character.
1590
1591         * m17n.h (minput_get_command, minput_get_variable)
1592         (minput_config_command, minput_config_variable)
1593         (minput_save_config): Extern them.
1594
1595         * m17n-core.c: Include <string.h>.
1596         (m17n_init_core): If the env. var. MDEBUG_OUTPUT_FILE is "stdout",
1597         use the stream stdout instead of a file of that name.
1598
1599         * m17n-X.c (mwin__parse_event): Fix handling of Shift and Control
1600         modifiers.
1601
1602         * internal.h (MFAILP, MDEBUG_PRINT0): New macros.
1603         (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
1604         (MDEBUG_PRINT4, MDEBUG_PRINT5): Use MDEBUG_PRINT0.
1605         (MDEBUG_DUMP): Flush the stream.
1606
1607         * input.h (struct _MInputMethodInfo): Delete member im.  New
1608         members mdb, language, name, extra, cmds, configured_cmds,
1609         bc_cmds, vars, configured_vars, bc_vars, description, and tick.
1610         (MInputContextInfo): New member tick.
1611
1612         * input.c: Big change to improve user-side input method
1613         customization.  Here, list just public API changes.
1614         (minput_get_commands, minput_get_variables)
1615         (minput_assign_command_keys, minput_set_variable): Label them
1616         obsolete.
1617         (minput_get_command, minput_get_variable)
1618         (minput_config_command, minput_config_variable)
1619         (minput_save_config): New functions.
1620         
1621         * database.h (PATH_MAX): Define it if not yet defined.
1622         (PATH_SEPARATOR): Likewise.
1623         (enum MDatabaseStatus): New enum.
1624         (struct MDatabaseInfo): Moved from database.c.  New members status,
1625         time, lock_file, and uniq_file.
1626         (mdatabase__update, mdatabase__file, mdatabase__lock, mdatabase__save)
1627         (mdatabase__unlock): Extern them.
1628
1629         * database.c: Include <time.h>.
1630         (MDB_DIR_LEN): Don't include the terminating '\0' in the length.
1631         (GEN_PATH): Args changed.  Callers changed.
1632         (struct MDatabaseInfo): Moved to database.h.
1633         (struct MDatabase, mdb_list): Deleted.
1634         (mdatabase__list): New var.
1635         (get_database_filename): Deleted.  Callers changed to use
1636         get_database_file.
1637         (find_file, get_database_file): New files.
1638         (get_dir_info): Initialize new members of MDatabaseInfo.
1639         (find_database): Arg chagnded.  Callers changed.
1640         (free_db_info, register_database, register_databases_in_files):
1641         New functions.
1642         (update_database_list): Deleted.
1643         (mdatabase__init): Initialize mdatabase__list instead of mdb_list.
1644         (mdatabase__fini): Finalize mdatabase__list instead of mdb_list.
1645         (mdatabase__update): New function.
1646         (mdatabase__check): Return value changed.
1647         (mdatabase__file, mdatabase__lock, mdatabase__save)
1648         (mdatabase__unlock): New functions.
1649
1650 2006-08-30  TAKAHASHI Naoto  <ntakahas@m17n.org>
1651
1652         * input.c (get_surrounding_text): Return -2 when surrounding text
1653         is unavailable.
1654         (get_following_char): Likewise.
1655         (get_preceding_char): Likewise.
1656         (minput__callback): Return 0 if there is a callback function,
1657         otherwise -1.
1658
1659 2006-08-17  Kenichi Handa  <handa@m17n.org>
1660
1661         * input.c (reset_ic): Use shift_state to setup the current state.
1662
1663 2006-08-02  Theppitak Karoonboonyanan  <thep@linux.thai.net>  (tiny change)
1664
1665         * Makefile.am (libm17n_la_LIBADD, libm17n_gui_la_LIBADD)
1666         (libm17n_X_la_LIBADD, libm17n_gd_la_LIBADD, linkcore_LDADD)
1667         (linkshell_LDADD, linkgui_LDADD): Use ${top_builddir}.
1668
1669 2006-08-02  Kenichi Handa  <handa@m17n.org>
1670
1671         * plist.c (mdebug_dump_plist): Fix the 2nd arg to dump_plist_element.
1672
1673         * mtext.c (mdebug_dump_mtext): If not fullp, dump just text. 
1674
1675         * font-ft.c (ft_encapsulate): Add code for debugging.
1676         (mfont__ft_drive_otf): Be sure to encode character before getting
1677         metrics.
1678
1679 2006-07-21  Kenichi Handa  <handa@m17n.org>
1680
1681         * draw.c (mdraw_text_extents): Fix previous typo.
1682
1683 2006-07-19  Kenichi Handa  <handa@m17n.org>
1684
1685         * draw.c (gstring_width): New arg lbearing.
1686         (render_glyph_string): Adjusted for the change of gstring_width.
1687         (mdraw_text_extents): Fix lbearing of ink and line metrics.
1688
1689         * m17n-core.h (Mlanguage): Extern it.
1690
1691         * m17n.h (Mlanguage): Extern deleted. 
1692
1693         * mtext.c (mtext__init): Initialize Mlanguage.
1694         (Mlanguage): Declaration moved from locale.c
1695
1696         * locale.c (mlocale__init): Don't initialize Mlanguage here.
1697         (Mlanguage): Declaration moved to mtext.c.
1698
1699         * language.c (mlang__init): Don't initialize Mlanguage here.
1700
1701         * font.c (OTF_tag_name) [! HAVE_OTF]: New function.
1702
1703 2006-07-14  Kenichi Handa  <handa@m17n.org>
1704
1705         * font-ft.c: Use FT_BDF_H macro.  Include fontconfig/fcfreetype.h.
1706         (MRealizedFontFT): New member face_encapsulated.
1707         (free_ft_rfont): Pay attention to ft_rfont->face_encapsulated.
1708         (ft_gen_font): New function.
1709         (ft_add_font): Use ft_gen_font.
1710         (ft_list_script): Store lists in ft_script_list.
1711         (ft_check_otf): New arg ft_face.  Caller changed.
1712         (ft_check_language): Likewise.
1713         (ft_check_script): Likewise.
1714         (ft_encapsulate, ft_close): New functions.
1715         (mfont__ft_driver): Initialize members encapsulate and close.
1716         (mfont__ft_drive_otf): Use OTF_open_ft_face if it is available.
1717
1718         * font.h (struct MRealizedFont): New member encapsulating.
1719         (struct MFontDriver): New members encapsulate and close.
1720
1721         * font.c (mfont__match_p): If FONT is realized, check capability
1722         by font drivers's check_capability method.
1723         (mfont_match_p, mfont_open, mfont_encapsulate, mfont_close): New
1724         functions.
1725
1726         * m17n-X.c (xfont_list_family_names): Delete unused var.  Fix
1727         declarations of foundry and fam local vars.
1728         (xft_driver): Make it static.
1729
1730         * m17n-gui.h (mfont_match_p, mfont_open, mfont_encapsulate)
1731         (mfont_close): Extern them.
1732
1733         * m17n-gd.c (device_open): Don't specify foundry and family of the
1734         default face.
1735
1736 2006-07-11  Kenichi Handa  <handa@m17n.org>
1737
1738         * m17n-gui.c (m17n_fini_win): Set null_interface.handle to NULL;
1739
1740 2006-07-13  Kenichi Handa  <handa@m17n.org>
1741
1742         * font-ft.c (fc_build_charset): Return NULL if FcCharSet can't be
1743         created.
1744         (ft_check_script): Delete unused var.
1745         (ft_list_capability): Likewise.
1746
1747         * font.c (mfont__get_capability): Setup cap->otf.
1748         (Motf): Make it global.
1749         (mfont_get_prop): Accept Mlanguage, Mscript, and Motf as key arg.
1750
1751         * font.h (MFontCapability): New member otf.
1752
1753         * language.c (mlang__fini): Delete unused vars.
1754
1755         * m17n-gui.h (Motf): Extern it.
1756
1757         * database.c (update_database_list): Delete unused vars.
1758
1759 2006-07-07  Kenichi Handa  <handa@m17n.org>
1760
1761         * font-ft.c (DEVICE_DELTA): Fix typo.
1762
1763 2006-07-06  Kenichi Handa  <handa@m17n.org>
1764
1765         * fontset.c (mfont__lookup_fontset): Don't ignore family and
1766         foundry of face.
1767
1768 2006-07-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
1769
1770         * database.c: Update comments.
1771
1772 2006-07-05  Kenichi Handa  <handa@m17n.org>
1773
1774         * database.c (PATH_MAX): Define it if not yet defined.
1775         (PATH_SEPARATOR, USE_GEN_PATH, GEN_PATH, GEN_PATH_FROM_MT): New
1776         macros.
1777         (get_database_filename): Use GEN_PATH.
1778         (get_dir_info): Don't include the last '/' in directory name.
1779         (register_database): New function.
1780         (update_database_list): Use register_database.  Search all
1781         directories in mdatabase__dir_list for wildcard databases.
1782         (mdatabase__init): Check "~/.m17n.d".
1783
1784 2006-07-03  Kenichi Handa  <handa@m17n.org>
1785
1786         * input-gui.c (win_callback): If is ic->candidate_show zero, don't
1787         push reverse property.
1788
1789         * plist.c (dump_plist_element): Fix previous change.
1790
1791 2006-06-28  Kenichi Handa  <handa@m17n.org>
1792
1793         * font.c (xlfd_unparse_name): Suppress the heading '-' if not
1794         necessary.
1795
1796         * draw.c (MbidiNSM): New variable.
1797         (visual_order) [! HAVE_FRIBIDI]: Clear levels at first.  Pay
1798         attention to bidi type NSM.
1799         (mdraw__init): Initialize MbibiNSM.
1800
1801         * language.c (mscript__char_list): Fix finding a char-list element.
1802
1803         * plist.c (dump_string): Return number of printed characters.
1804         (dump_plist_element): Print elements more compactly.
1805
1806 2006-06-23  Kenichi Handa  <handa@m17n.org>
1807
1808         * Makefile.am (BUILD_LIBS): Don't increment it conditionally.
1809         (include_HEADERS): Likewise.
1810
1811 2006-06-23  TAKAHASHI Naoto  <ntakahas@m17n.org>
1812
1813         * language.c: Update documentation.
1814
1815 2006-06-23  Kenichi Handa  <handa@m17n.org>
1816
1817         * font-ft.c (struct MFontFT): Delete member lang.
1818         (free_ft_info): Don't unref member lang.  Destroy members langset
1819         and charset.
1820         (fc_parse_pattern): Last argument changed to MFontFT *.  Callers
1821         changed.  Set members langset and charset.
1822         (fc_init_font_list, fc_list_pattern, fc_build_charset): New
1823         functions.
1824         (ft_init_font_list, ft_has_char_list_p, ft_list_char_list): New
1825         functions.
1826         (ft_list_family) [HAVE_FONTCONFIG]: Include FC_CHARSET on objset.
1827         (ft_list_family) [! HAVE_FONTCONFIG]: Call ft_init_font_list.
1828         (ft_list_language) [HAVE_FONTCONFIG]: Check representative
1829         characters at first.  If it fails, try listing by language names.
1830         (ft_list_language) [! HAVE_FONTCONFIG]: Call ft_list_char_list.
1831         (ft_check_language): Renamed from ft_check_lang.  Adjusted for the
1832         change of MFontCapability.
1833         (ft_list_capability): Likewise.  Try listing by languages, then by
1834         scripts.  Check OTF at last.
1835         (ft_check_script): New function.
1836         (ft_select): Adjusted for the check of MFontCapability.
1837         (ft_list_family_names): New function.
1838         (ft_check_capability): If cap->script is not Mnil, call
1839         ft_check_script.
1840         (mfont__ft_driver): Initialize with ft_list_family_names.
1841
1842         * font.h (struct MFontDriver): New member list_fmaily_names.
1843         (struct): Change member "MSymbol *lang" to "MSymbol language".
1844
1845         * font.c: Include "language.h".
1846         (Motf): New variable.
1847         (otf_script_list, load_otf_script_list): Delete it.
1848         (find_script_from_otf_tag): Delete it.
1849         (merge_capability): New function.
1850         (mfont__init): Init Motf.
1851         (mfont__fini): Don't unref otf_script_list.
1852         (free_font_capability): Check cap->script_tag to determine if
1853         OTF-related capability is set.
1854         (mfont__get_capability): Call mscript__from_otf_tag.  Adjusted for
1855         the change of type MFontCapability.
1856         (mfont_put_prop): Call merge_capability for Mlanguage, Mscript,
1857         and Motf properties.
1858         (mfont_list): Call merge_capability for LANGUAGE arg.
1859         (mfont_list_family_names): New function.
1860
1861         * input-gui.c: Typo in comments fixed.
1862
1863         * input.c: Typo in comments fixed.
1864
1865         * language.h (mlanguage__list): Delete it.
1866         (mscript__char_list, mscript__otf_tag, mscript__from_otf_tag): New
1867         functions.
1868
1869         * language.c: Include "mtext.h".
1870         (M_script_lang_list): Delete it.
1871         (language_list, script_list): New variables.
1872         (load_lang_script_list, init_language_list, init_script_list): New
1873         functions.
1874         (mlang__init): Don't load language database here.
1875         (mlang__fini): Unref language_list and script_list if not NULL.
1876         (mlanguage__list): Delete it.
1877         (mlanguage__info, mscript__info, mscript__char_list)
1878         (mscript__otf_tag, mscript__from_otf_tag): New functions.
1879         (mlanguage_list, mlanguage_code, mlanguage_name, mlanguage_text)
1880         (mscript_list, mscript_language_list): New functions.
1881
1882         * m17n-gui.h (mfont_list_family_names): Extern it.
1883
1884         * m17n.h (mlanguage_list, mlanguage_code, mlanguage_name)
1885         (mlanguage_text, mscript_list, mscript_language_list): Extern
1886         them.
1887
1888 2006-06-21  Kenichi Handa  <handa@m17n.org>
1889
1890         * m17n-X.c (xfont_driver): Initialize with
1891         xfont_list_family_names.
1892         (xfont_list_family_names): New function.
1893         (xft_driver): Initialize with NULL for list_family_names member.
1894         (device_init): Set list_family_names member of xft_driver to that
1895         of mfont__ft_driver.
1896
1897 2006-06-06  Kenichi Handa  <handa@m17n.org>
1898
1899         * fontset.c (mfont__lookup_fontset): Don't set *num to 1 if it is 0.
1900
1901 2006-03-24  Kenichi Handa  <handa@m17n.org>
1902
1903         * font-ft.c (ft_open): Improve debug message.
1904
1905         * fontset.c (mfontset__get_font): Fix for the case that no font in
1906         per_script list is available.
1907
1908 2006-02-06  Kenichi Handa  <handa@m17n.org>
1909
1910         * Version 1.3.3 released.
1911
1912 2006-02-22  Kenichi Handa  <handa@m17n.org>
1913
1914         * textprop.c: Fix some typos in documentation.
1915
1916         * plist.c: Fix some typos in documentation.
1917
1918         * m17n-core.h: Fix some typos in documentation.
1919         (M17NLIB_PATCH_LEVEL): Updated to 3.
1920         (M17NLIB_VERSION_NAME): Updated to "1.3.3".
1921
1922         * symbol.c: Fix some typos in documentation.
1923
1924         * mtext.c: Fix some typos in documentation.
1925
1926         * input.c: Fix several typos in documentation.
1927
1928 2006-02-06  Kenichi Handa  <handa@m17n.org>
1929
1930         * Version 1.3.2 released.
1931
1932 2006-02-03  Kenichi Handa  <handa@m17n.org>
1933
1934         * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 2.
1935         (M17NLIB_VERSION_NAME): Updated to "1.3.2".
1936
1937         * font.c (xlfd_parse_name): Fix handling of the name "nil".
1938
1939         * draw.c (layout_glyphs): Fix handling left_padding of
1940         composition's base.
1941
1942         * m17n-gd.c (read_rgb_txt): Support HTML 4.0 color names.
1943
1944 2006-02-02  Kenichi Handa  <handa@m17n.org>
1945
1946         * Makefile.am (include_HEADERS): Add m17n-gui.h and m17n-X.h only
1947         if WITH_GUI is true.
1948
1949 2006-01-25  Kenichi Handa  <handa@m17n.org>
1950
1951         * input.c (resolve_expression): If the value of PLIST is a plist,
1952         but the first element is not symbol, return 0.
1953
1954 2006-01-17  Kenichi Handa  <handa@m17n.org>
1955
1956         * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha only if
1957         HAVE_GD is 2 or the greater.
1958
1959 2006-01-16  Kenichi Handa  <handa@m17n.org>
1960
1961         * Version 1.3.1 released.
1962
1963 2006-01-16  Kenichi Handa  <handa@m17n.org>
1964
1965         * m17n-gd.c (gd_render): Use gdImageColorResolveAlpha instead of
1966         simulating anti-aliasing.
1967
1968         * m17n-core.h (M17NLIB_PATCH_LEVEL): Updated to 1.
1969         (M17NLIB_VERSION_NAME): Updated to "1.3.1".
1970
1971 2006-01-12  Kenichi Handa  <handa@m17n.org>
1972
1973         * input.c (get_surrounding_text): Always pop ic->plist.
1974         (reset_ic): Don't reset ic->plist.
1975
1976 2006-01-10  Kenichi Handa  <handa@m17n.org>
1977
1978         * input.c (preedit_commit): For debugging, print only commiting
1979         charactes.  Don't set ic->candidate_show to 0.
1980         (handle_key): Don't run branch-actions just by shifting to the
1981         current state.
1982         (reset_ic): Reset state_key_head and key_head of ic_info to 0.
1983         Reset vars and plist.
1984
1985 2006-01-07  Kenichi Handa  <handa@m17n.org>
1986
1987         * input.c (load_branch): Confirm that maps is not NULL.
1988
1989 2006-01-05  Kenichi Handa  <handa@m17n.org>
1990
1991         * input-gui.c (win_filter): Try to convert arg to key only when
1992         arg is not NULL.
1993
1994         * plist.c (read_integer_element): If '#' and '-' are followed by
1995         non-integer-constituent, read them as a part of a symbol.
1996         (read_symbol_element): New arg C.
1997         (read_element): Adjust args to read_symbol_element.
1998
1999         * input.c (load_macros): On overwriting a macro, free the old
2000         definition.
2001         (minput__init): Store Mmap in load_im_info_keys.
2002         (minput_get_title_icon): If the input method has no title, be sure
2003         to return NULL.
2004         (minput_get_description): If the input method has no description,
2005         be sure to return NULL.
2006         (minput_get_variables): Fix documentation.
2007         (handle_key): Pay attention to the case that key is Mnil.
2008         (filter): Likewise.  Fix handling of such symbol as S-A.
2009
2010 2005-12-22  Kenichi Handa  <handa@m17n.org>
2011
2012         * Version 1.3.0 released.
2013
2014 2005-12-22  Kenichi Handa  <handa@m17n.org>
2015
2016         * font-ft.c (ft_list): If the specified font has no property,
2017         return all fonts.
2018
2019 2005-12-20  Kenichi Handa  <handa@m17n.org>
2020
2021         * character.c (mchar_get_prop): Check char_prop_list.
2022         (mchar_put_prop, mchar_get_prop_table): Likewise.
2023
2024 2005-12-18  Kenichi Handa  <handa@m17n.org>
2025
2026         * input.c (minput_get_title_icon): If LANGUAGE is Mt, try also a
2027         file name sans language.
2028
2029 2005-12-16  TAKAHASHI Naoto  <ntakahas@m17n.org>
2030
2031         * input.c: Fix typo in comments.
2032
2033 2005-12-14  Kenichi Handa  <handa@m17n.org>
2034
2035         * input.c (minput_get_title_icon): Check the default icon for the
2036         input method.
2037
2038 2005-12-13  Kenichi Handa  <handa@m17n.org>
2039
2040         * input.c (Mless_equal, Mgreater_equal): New variables.
2041         (parse_expression, resolve_expression, parse_action_list)
2042         (take_action_list): Handle the aboves.
2043         (filter): Treat key S-X as X.
2044         (minput__init): Initialize Mless_equal and Mgreater_equal.
2045         (minput_get_title_icon): New function.
2046
2047         * m17n.h (minput_get_title_icon): Extern it.
2048
2049         * database.c (get_database_filename): Return a filename instead of
2050         file pointer.
2051         (load_database): Adjusted for the above change.
2052         (mdatabase__load_for_keys): Likewise.
2053         (mdatabase__find_file): New function.
2054
2055         * database.h (mdatabase__find_file): Extern it.
2056
2057         * font.h (mfont__resize): Delete extern.
2058
2059         * font.c (mfont__list): Check resize ratio.
2060         (mfont__resize): Delete it.
2061         (mfont_resize_ratio): Include the code of mfont__resize.
2062
2063         * font-ft.c (ft_open): Check resize ratio.
2064
2065         * m17n-X.c (xfont_open): Check resize ratio.
2066         (xft_open): Likewise.
2067
2068 2005-12-07  Kenichi Handa  <handa@m17n.org>
2069
2070         * input.c (take_action_list): If take_action_list return -1,
2071         return -1.
2072         (handle_key): Likewise.
2073
2074         * face.c (mface__for_chars): When font is specified and layouter
2075         is found for it, if the layouter doesn't support one of a
2076         character, use a face sans layouter for it.
2077
2078 2005-12-06  Kenichi Handa  <handa@m17n.org>
2079
2080         * fontset.c (mfont__lookup_fontset): If only a fallback font is
2081         found, don't use it for more than one character.
2082
2083 2005-12-05  Kenichi Handa  <handa@m17n.org>
2084
2085         * face.c (mface__realize): Set rfont->layouter to Mnil.
2086         (mface__for_chars): Fix handling of layouter.
2087
2088         * character.h (mchar__define_prop): Extern it.
2089
2090         * database.c (update_database_list): Call mchar__define_prop if
2091         necessary.
2092
2093         * character.c (mchar__init): Don't call mchar_define_property.
2094         Instead just initialize property keys.
2095         (mchar__fini): Free char_prop_list only if it's not NULL.
2096         (mchar__define_prop): New function.
2097         (mchar_define_property): Call mchar__define_prop.
2098
2099         * m17n-core.c (m17n_fini_core): Call mtext__prop_fini at after
2100         mplist__fini.
2101
2102 2005-12-02  Kenichi Handa  <handa@m17n.org>
2103
2104         * language.c (mlang__init): Handle extra chars.
2105
2106         * m17n-gui.h (mfont_check): Adjust prototype.
2107
2108         * m17n-X.c (xfont_driver): Specify xfont_check_capability.
2109         (xfont_check_capability): New function.
2110         (xft_driver): Specify xft_check_capability.
2111         (xft_check_capability): New function.
2112
2113         * font-ft.c (M0_3): Delete it.
2114         (M0): New variable.
2115         (ft_get_charmaps): Refer to M0.
2116         (fc_parse_pattern): Fix previous change.
2117         (ft_list_language): Check also extra chars.
2118         (ft_check_otf): Define it even if HAVE_OTF is undef.
2119         (ft_check_lang): Check the result of FcLangSetHasLang against
2120         FcLangDifferentLang.  Check also extra chars.
2121         (ft_list_capability): Delete ifdef HAVE_OTF.
2122         (ft_select): Likewise.
2123         (ft_open): Improve debug information.
2124         (ft_check_capability): New function.
2125         (mfont__ft_driver): Specify ft_check_capability.
2126         (mfont__ft_init): Initialize M0.
2127
2128         * fontset.c (get_font_from_group): New function.
2129         (mfontset__get_font): New function.
2130
2131         * fontset.h (mfontset__get_font): Extern it.
2132
2133         * font.c (OTF_tag): Define it if HAVE_OTF is undef.
2134         (mfont__fini): Delete ifdef HAVE_OTF.
2135         (free_font_capability): Likewise.
2136         (mfont__get_capability): Likewise.
2137         (mfont__check_capability): New function.
2138         (mfont_check): Change the order of arguments.  Use
2139         mfontset__get_font.
2140
2141         * font.h (struct MFontDriver): New member check_capability.
2142         (MFontCapability): Delete ifdef HAVE_OTF.
2143         (mfont__check_capability): Extern it.
2144
2145         * face.c (mface__realize): Fix handling of FONT arg.
2146         (mface__for_chars): Fix handling of explicitly specified font.
2147
2148 2005-11-25  Kenichi Handa  <handa@m17n.org>
2149
2150         * font-flt.c (run_command): Print debug info for
2151         left/rigth_padding
2152
2153         * draw.c (layout_glyphs): Fix handling of left/right_padding.
2154
2155         * face.c (mface__for_chars): Check rfont before accessing the
2156         members.
2157
2158 2005-11-21  Kenichi Handa  <handa@m17n.org>
2159
2160         * Makefile.am (lib_LTLIBRARIES): Define it conditionaly on
2161         WITH_GUI.
2162
2163         * fontset.c (fontset_table): New variable.
2164         (free_fontset): Call M17N_OBJECT_UNREGISTER.
2165         (mfont__fontset_init): Add fontset_table as an object array.
2166         (mfont__realize_fontset): Ref FONTSET.
2167         (mfont__free_realized_fontset): Unref REALIZED->fontset.
2168         (mfontset): Call M17N_OBJECT_REGISTER.
2169         (mfontset_copy): Likewise.
2170
2171         * input.c (handle_key): For debugging, print information about
2172         alias key.
2173         (filter): Add an alias for Meta and Alt modifiers.
2174         (Mcond, Mplus, Mminus, Mstar, Mslush, Mand, Mor, Mnot): New
2175         variables.
2176         (minput__init): Initialize them.
2177         (parse_expression): New function.
2178         (resolve_expression): New function.
2179         (parse_action_list): Handle expressions by parse_expression.
2180         (take_action_list): Handle expressions by resolve_expression.
2181         (parse_nested_list_value): Fix previous change.
2182         (resolve_command): Fix handling of the return value of
2183         get_nested_list.
2184
2185 2005-11-18  Kenichi Handa  <handa@m17n.org>
2186
2187         * font-ft.c (ft_check_otf, otf_script_list): Define only when
2188         HAVE_OTF is defined.
2189         (ft_list_capability): Call ft_check_otf only when HAVE_OTF is
2190         defined.
2191         (ft_select): Likewise.
2192
2193         * font.c (mfont_list): Fix for the case that FONT is NULL.
2194         (OTF_tag): Delete it.
2195         (load_otf_script_list): Define only when HAVE_OTF is defined.
2196         (mfont__fini): Unref otf_script_list only when HAVE_OTF is
2197         defined.
2198
2199         * draw.c (truncate_gstring): Be sure to truncate at
2200         glapheme-cluster boundary.
2201
2202 2005-11-11  Kenichi Handa  <handa@m17n.org>
2203
2204         * input.c (delete_surrounding_text): Clear cache if necessary.
2205
2206 2005-11-09  Kenichi Handa  <handa@m17n.org>
2207
2208         * draw.c (compose_glyph_string): Update prev->rface->rfont if the
2209         glyph prev is also supported by the current flt.
2210
2211 2005-11-08  Kenichi Handa  <handa@m17n.org>
2212
2213         * m17n-X.c (xft_render): Cancel previous change.
2214
2215 2005-11-07  Kenichi Handa  <handa@m17n.org>
2216
2217         * input.c: Include <stdlib.h>.
2218         (get_surrounding_text, delete_surrounding_text)
2219         (get_preceding_char, get_following_char): New functions.
2220         (integer_value): New arg surrounding.  If it is nonzero, try to
2221         get a surrounding character.  Callers changed.
2222         (take_action_list): Check `value' before setting an element.
2223         (destroy_ic): Unref ic_info->preceding_text and
2224         ic_info->following_text.
2225         (minput__init): Initialize Minput_get_surrounding_text and
2226         Minput_delete_surrounding_text.
2227         (Minput_get_surrounding_text, Minput_delete_surrounding_text): New
2228         variables.
2229         (filter): Unref ic_info->preceding_text and
2230         ic_info->following_text.
2231
2232         * m17n.h (Minput_get_surrounding_text, Minput_delete_surrounding_text):
2233         Extern them.
2234
2235         * input.h (MInputContextInfo): New members preceding_text and
2236         following_text.
2237
2238 2005-11-04  Kenichi Handa  <handa@m17n.org>
2239
2240         * input.c (parse_nested_list_value): Fix handling of the global
2241         definition.
2242         (get_nested_list): Get global definitions by load_partial_im_info.
2243         (preedit_commit): Set ic->candidates_changed to bitwise or of enum
2244         MInputCandidatesChanged.
2245         (take_action_list): Likewise.
2246         (reset_ic): Likewise.
2247         (create_ic): Don't pay special attention to
2248         Mcandidates_group_size.
2249         (load_partial_im_info): Call mdatabase_find with correct 4th arg.
2250         (minput_set_variable): Get a definition of varible by
2251         mplist_find_by_value, not mplist_get.
2252
2253         * m17n.h (enum MInputCandidatesChanged): New enum.
2254
2255 2005-11-01  Kenichi Handa  <handa@m17n.org>
2256
2257         * m17n-X.c (xft_render): Check xft_draw's drawable before changing
2258         it.
2259         (mwin__destroy_window): If xft_draw's drawable is win, change it
2260         to device->drawable before destroying win.
2261
2262 2005-10-31  Kenichi Handa  <handa@m17n.org>
2263
2264         * input.c (load_im_info): Fix adding of state.
2265
2266         * m17n-core.c (m17n_fini_core): Fix reporting of module
2267         finalization.
2268
2269         * m17n.c (m17n_fini): Fix reporting of module finalization.
2270
2271         * m17n-gui.c (m17n_init_win): Fix reporting of module
2272         finalization.
2273
2274 2005-10-29  Kenichi Handa  <handa@m17n.org>
2275
2276         * input.c (get_candidate_list): Fix the timing of referring plist.
2277
2278 2005-10-28  Kenichi Handa  <handa@m17n.org>
2279
2280         * input.c (load_branch): Ignore an undefined map name.
2281         (load_im_info): Set im_info->title from `name' only if it's not
2282         Mnil.
2283         (shift_state): Always update ic->status.
2284         (adjust_candidates): Renamed from adjust_candidate_command.
2285         Argument changed.  Caller changed.
2286         (get_candidate_list, regularize_action): New functions.
2287         (take_action_list): Use them.  On handling Munhandle, don't set
2288         ic_info->used to 0.
2289         (handle_key): If KEY is not handled by MAP, and MAP has
2290         branch_actions, perform them.
2291
2292         * database.c (mdatabase__fini): Free dir_info->filename;
2293
2294 2005-10-20  Kenichi Handa  <handa@m17n.org>
2295
2296         * input.c (marker_code): Accept '@@'.
2297         (integer_value): Handle '@@'.
2298         (parse_action_list): Accept a symbol argument.
2299         (take_action_list): Resolve the symbol argument.  Handle the
2300         integer argument.
2301
2302 2005-10-18  Kenichi Handa  <handa@m17n.org>
2303
2304         * input.c: Include "charset.h".
2305         (M_candidates, Mcandidates_group_size, Mcandidates_charset): New
2306         variables.
2307         (MIMState): New member (M17NObject control).
2308         (lookup_nested_list, set_nested_list, parse_nested_list_value)
2309         (get_nested_list, resolve_variable): New functions.
2310         (integer_value): New arg (MPlist **value).  Set it to the plist
2311         element containing the value.
2312         (resolve_command): New function.
2313         (load_translation): New arg (MPlist *map_actions).
2314         (load_branch): New args language and name.  If `keylist' is a
2315         symbol, resolved that as a command name.
2316         (free_map): New arg top.  Free map->map_actions only if top is
2317         nonzero.
2318         (free_state): New function.
2319         (load_state): New arg name.
2320         (im_info_list): New variable.
2321         (free_im_info, get_im_info_by_tags): New functions.
2322         (load_im_info): Arg key changed to plist.  Handle `include'.
2323         Return (MInputMethodInfo *).
2324         (preedit_commit): Ref ic->candidate_list.
2325         (get_select_charset, adjust_candidate_command): New functions.
2326         (take_action_list): Handle `include'.  Adjust candidate action
2327         properly.  Handle control variables `candidates-charset' and
2328         `candidates-group-size'.
2329         (open_im): Use get_im_info.
2330         (create_ic): Get global variables.
2331         (load_partial_im_info): New function.
2332         (get_im_info): New function.
2333         (check_command_keyseq, check_command_list, check_variable_list):
2334         New functions.
2335         (minput__init): Don't handle M_database_hook and Mdetail_text.
2336         Initialize M_candidates, Mcandidates_group_size,
2337         Mcandidates_charset.
2338         (parse_variable_list, get_variable_list, parse_command_list)
2339         (get_command_list): Delete them.
2340         (MDatabaseStatList, imdir_stat_list, input_method_hook): Delete them.
2341         (minput__fini): Simply unref command_list and variable_list.
2342         (minput_get_description): Adjusted for the new form of description.
2343         (minput_get_commands): Use get_nested_list.
2344         (minput_assign_command_keys): Likewise.
2345         (minput_get_variables, minput_set_variable): Likewise.
2346
2347         * input.h (MInputMethodInfo): New members im and maps.
2348
2349         * database.h (M_database_hook): Delete extern.
2350         (MDatabaseHookFunc): Delete extern.
2351         (mdatabase__check): Extern it.
2352
2353         * database.c: Include <glob.h>.
2354         (MAX_TIME): New macro.
2355         (Masterisk): New variable.
2356         (get_database_stream): Argument changed to (MDatabaseInfo *).
2357         Callers changed.
2358         (get_dir_info): Renamed from duplicate_dirname.  Callers changed.
2359         (find_database): New function.
2360         (update_database_list): New function.
2361         (mdatabase__init): Initialize Masterisk.  Setup mdb_list by
2362         calling update_database_list.
2363         (mdatabase__check): New function.
2364         (mdatabase_find): Use update_database and find_database.  Don't
2365         handle MDatabaseHookFunc.
2366         (mdatabase_list): Call update_database at first.
2367         (mdatabase_define): Adjusted for the change of mdb->extra_info.
2368         (MDatabaseList): New type.
2369
2370         * plist.h (mplist_conv, mplist__pop_unref): Extern them.
2371
2372         * m17n.h (Mdetail_text): Delete extern.
2373
2374         * m17n-core.h (mplist_conc): Delete extern.
2375
2376         * plist.c (mplist__conc): Renamed from mplist_conc.  Don't ref
2377         tail.
2378         (mplist_conc): Renamed to mplist__conc.
2379         (mplist__pop_unref): New function.
2380
2381 2005-10-14  Kenichi Handa  <handa@m17n.org>
2382
2383         * plist.c (read_mtext_element): Ignore the sequence of '\\' and
2384         newline.
2385         (read_element): If keys is an empty plist, return any element
2386         found first.
2387         (dump_plist_element): Check if plist is nested.
2388         (mplist_conc): Always ref tail.
2389         (mplist_set): If key is a managing key, ref val in advance.
2390
2391         * plist.h (MPLIST_VAL_MANAGED_P): Delete this macro.
2392         (MPLIST_NESTED_P, MPLIST_SET_NESTED_P): New macros.
2393         (MPLIST_ADD_PLIST, MPLIST_PUSH_PLIST, MPLIST_PUT_PLIST): New
2394         macros.
2395
2396         * fontset.c (free_fontset): Unref fontset_list if necessary.
2397         (mfont__fontset_fini): Don't free fontset_list.  Unref
2398         default_fontset.
2399         (mfont__realize_fontset): Initialize request.
2400         (mfontset): Ref default_fontset or fontset only if necessary.
2401         (mfontset_copy): Don't ref copy.
2402
2403         * draw.c (render_glyphs): Check gend->type before checking
2404         gend->to.
2405
2406         * font-ft.c (mfont__ft_fini): Unref ft_default_list.  Set all
2407         unrefed plists to NULL.
2408
2409 2005-10-04  Kenichi Handa  <handa@m17n.org>
2410
2411         * textprop.c (mtext_serialize): Be sure to make mt
2412         MTEXT_FORMAT_UTF_8 and NULL terminated.
2413
2414         * m17n-gui.c (m17n_init_win): Initialize Mcolormap.
2415
2416         * draw.c (mdraw_glyph_list): Fix settting of glyphs->font->source.
2417
2418 2005-10-03  Kenichi Handa  <handa@m17n.org>
2419
2420         * draw.c (mdraw_glyph_info): Pay attention to the case that FROM
2421         is not at the beginning of line.
2422
2423 2005-09-22  Kenichi Handa  <handa@m17n.org>
2424
2425         * input.c: Include <sys/stat.h> and <unistd.h>.
2426         (Minclude, Mcommit, Munhandle): New variables.
2427         (minput__init): Initialize them.  Push only Mstate to
2428         load_im_info_keys.   Add aliases C-lowercase for C-uppercase.
2429         (parse_action_list): Allow integer arg for undo.  Handle Mcommit
2430         and Munhandle.
2431         (load_input_method): Handle "include" directive.  If no states are
2432         loaded, return -1.
2433         (shift_state): If state_name is Mt, shift back to the previous
2434         state.  Call preedit_commit to commit preedit text.
2435         (preedit_commit): New function.
2436         (take_action_list): Improve debug printing.  Handle commit and
2437         unhandle commands.
2438         (handle_key): Check the return value of take_action_list.  Don't
2439         take branch_actions just after changing to the root map.
2440         (reset_ic): Reset all ic_info members.
2441         (filter): When a key is not handled, just move ic_info->keys
2442         instead fo calling reset_ic.
2443         (load_im_info): If key is not Mstate, push Mmap to
2444         load_im_info_keys.
2445         (MDatabaseStatList): New type.
2446         (imdir_stat_list): New variable.
2447         (input_method_hook): Don't cancel the hook.  Check the
2448         modification time of directories.
2449         (minput__fini): Free imdir_stat_list;
2450
2451         * input.h (MInputContextInfo): New member prev_state.
2452
2453         * m17n-core.h (mplist_conc): Extern it.
2454
2455         * plist.c (mplist_conc): New function.
2456
2457         * mtext.c (mdebug_dump_mtext): Escape '"' and '\\' by '\\'.
2458
2459         * font.h (MRealizedFont): New member average_width.
2460
2461         * font-ft.c (ft_open): Set rface->average_width.
2462
2463         * font.c (xlfd_unparse_name): Print '*' before registry name.
2464
2465         * m17n-X.c (MDisplayInfo): New member AVERAGE_WIDTH.
2466         (xfont_open): Set rfont->average_width.
2467         (xft_open): Likewise.
2468         (device_open): Initialize disp_info->AVERAGE_WIDTH.
2469
2470         * internal-gui.h (struct MFrame): New member average_width.
2471
2472         * m17n-gui.c (mframe): Fix setting of frame->rfont.
2473         (mframe_get_prop): Return the average_width of a font.
2474
2475         * face.c (mface__realize): Set rface->average_width.
2476         (mface__update_frame_face): Set frame->average_width.
2477
2478         * face.h (MRealizedFace): New member average_width.
2479
2480 2005-09-19  Kenichi Handa  <handa@m17n.org>
2481
2482         * font.c (xlfd_unparse_name): New arg full_xlfd.
2483         (mfont__encode_char): Use shortcut only for X core fonts.
2484         (mfont_unparse_name): Call xlfd_unparse_name with full_xlfd arg 1.
2485         (mfont_put_prop): Handle `language' property.
2486         (mdebug_dump_font): Call xlfd_unparse_name with full_xlfd arg 0.
2487         Print file can capability info too.
2488
2489         * m17n-core.c (mdebug__output): New variable.
2490         (SET_DEBUG_FLAG): Unset mask if env_value is '0'.
2491         (m17n_init_core): Handle MDEBUG_ALL and MDEBUG_OUTPUT_FILE.
2492         (m17n_fini_core): Close mdebug__output if it's not stderr.
2493
2494         * m17n-X.c (MDisplayInfo): New member MULE_BASELINE_OFFSET.
2495         (xfont_open): Handle baseline_offset.
2496         (xfont_find_metric): Likewise.
2497         (xfont_render): Likewise.
2498         (xft_open): Likewise.
2499         (xft_render): Likewise.
2500
2501         * internal.h (MDebugMaskBit): Add MDEBUG_ALL.
2502         (mdebug__output): Extern it.
2503         (MDEBUG_PRINT, MDEBUG_PRINT1, MDEBUG_PRINT2, MDEBUG_PRINT3)
2504         (MDEBUG_PRINT4, MDEBUG_PRINT5): Print to medebug__output.
2505         (MDEBUG_DUMP): New macro.
2506         (MDEBUG_PRINT_TIME): Print to medebug__output.
2507
2508         * font.h (MRealizedFont): New member baseline_offset.
2509
2510         * font-ft.c (ft_get_charmaps): Check if the font support iso8859-1
2511         characters.
2512         (fc_weight_table): Add FC_WEIGHT_REGULAR.
2513         (ft_list_family): Check alias.
2514         (ft_list_language): If language is "en", don't try to the second
2515         step.
2516         (ft_default_list): New variable.
2517         (ft_list_default): New function.
2518         (ft_select): If family is not specified, try only the default
2519         fonts.  Treat the weights normal and medium same.
2520         (ft_open): Fix debug message.  If registry is not specified, try
2521         unicode-bmp.  Handle _MULE_BASELINE_OFFSET property of BDF fonts.
2522         (ft_find_metric): Likewise.
2523         (ft_render): Likewise.
2524         (ft_list): Fix debug message.  Accept the registring iso8859-1.
2525         If family is not specified, try only the default fonts.
2526
2527         * face.c (mface__realize): Fix logic of opening a font.
2528
2529 2005-09-16  Kenichi Handa  <handa@m17n.org>
2530
2531         * face.c (mface__realize): 
2532
2533         * m17n.h (Minput_focus_move, Minput_focus_in, Minput_focus_out):
2534         Extern them.
2535
2536         * input.c (shift_state): Fix the condition of taking init actions.
2537         (take_action_list): Fix handling of pushback action.
2538         (handle_key): Don't change key while checking its alias.
2539         (minput__init): Initialize new variables.
2540         (Minput_focus_move, Minput_focus_in, Minput_focus_out): New
2541         variables.
2542
2543 2005-09-12  Kenichi Handa  <handa@m17n.org>
2544
2545         * mtext.c (mtext__uppercase): Add proper open/close parens.
2546         (mtext_titlecase): Add proper casting.
2547
2548         * input.c (parse_action_list): Handle the case that the arg is a
2549         key sequence (MText or MPlist).
2550         (take_action_list): Likewise.
2551         (shift_state): Shorter debug message.
2552         (handle_key): Terminate a debug message by "\n".
2553         (reset_ic): Don't take initial actions here.
2554         (minput_open_im): Print a debug message.
2555         (minput_close_im): Likewise.
2556         (minput_create_ic): Likewise.
2557         (minput_destroy_ic): Likewise.
2558
2559 2005-09-09  TAKAHASHI Naoto  <ntakahas@m17n.org>
2560
2561         * mtext.c (mtext_lowercase, mtext_titlecase, mtext_uppercase):
2562         Change API.
2563
2564 2005-09-07  TAKAHASHI Naoto  <ntakahas@m17n.org>
2565         * character.c: Add "cased", "soft-dotted", and "case-mapping" in
2566         mchar__init ().
2567
2568         * character.c: Add Japanese documentation for
2569         mchar_get_prop_table ().
2570
2571 2005-09-06  TAKAHASHI Naoto  <ntakahas@m17n.org>
2572
2573         * mtext.c (tricky_chars, *cased, *soft_dotted, *case_mapping)
2574         (MCharTable *combining_class, Mlt, Mtr, Maz, gr03A3, lt0049,
2575         (lt004A, lt012E, lt00CC, lt00CD, lt0128, tr0130, tr0049, tr0069):
2576         New variables.
2577         (init_case_conversion): New function.
2578         (CASE_CONV_INIT, REPLACE, DELETE, LOOKUP): New macros.
2579         (uppercase_precheck, lowercase_precheck, final_sigma)
2580         (after_soft_dotted, more_above, before_dot, after_i)
2581         (mtext_uppercase, mtext_titlecase, mtext_lowercase): New functions.
2582
2583 2005-09-05  TAKAHASHI Naoto  <ntakahas@m17n.org>
2584
2585         * plist.c (read_mtext_element): Fix previous change.
2586
2587 2005-09-05  Kenichi Handa  <handa@m17n.org>
2588
2589         * plist.c (read_mtext_element): Handle \uXXXX notation.
2590
2591         * internal.h (MTABLE_MALLOC): Don't use a local variable.
2592         (MTABLE_ALLOCA): Change the name of local variable.
2593
2594         * m17n-gd.c (device_open): Define it even if HAVE_GD nor
2595         HAVE_FREETYPE are defined.
2596
2597         * m17n-X.c: Check HAVE_X11.
2598
2599         * Makefile.am (X_LD_FLAGS): Use @X11_LD_FLAGS@ instead of
2600         directory listing libraries.
2601         (noinst_PROGRAMS): Define it only in maintainer mode.
2602
2603 2005-09-02  Kenichi Handa  <handa@m17n.org>
2604
2605         * m17n-gui.h (mdraw_line_break_option): Extern it.
2606
2607         * draw.c (truncate_gstring): Use find_glyph_in_gstring to find the
2608         end of the first glyph.
2609         (GET_LB_TYPE, find_break_backward, find_break_forward): Delete
2610         them.
2611         (mdraw_line_break_option): New variable.
2612         (mdraw_default_line_break): Use mtext_line_break.
2613
2614         * mtext.h (wordseg_func_table): Don't extern it.
2615         (mtext__wseg_fini): Extern it.
2616
2617         * mtext.c: Don't include word-thai.h.
2618         (wordseg_func_table): Delete this variable.
2619         (mtext__init): Don't initialize above.  Don't call
2620         mtext__word_thai_init.
2621         (mtext__fini): Don't free wordseg_func_table.  Call
2622         mtext__wseg_fini instead fo mtext__word_thai_fini.
2623         (MTextWordsegFunc): Don't typedef it.
2624         (mtext__word_segment): Moved to mtext-wseg.c.
2625
2626         * m17n-core.h (enum MTextLineBreakOption): New enum.
2627         (mtext_line_break): Extern it.
2628
2629         * mtext-wseg.c: New file.
2630
2631         * mtext-lbrk.c: New file.
2632
2633         * Makefile.am (libm17n_core_la_SOURCES): Delete word-thai.[ch],
2634         add mtext-lbrk.c and mtext-wseg.c.
2635
2636         * textprop.c (mtext__adjust_plist_for_change): Pay attention for
2637         the case that head is NULL.
2638
2639 2005-09-01  Kenichi Handa  <handa@m17n.org>
2640
2641         * word-thai.c (wordseg_propertize): If the property value is nil,
2642         don't make the property no-merge.
2643         (thai_wordseg): Don't require *from and *to are set a priori.  Pay
2644         attention to the case that they are NULL.
2645         (mtext__word_thai_init): Make the name of Mthai_wordseg starts
2646         with two spaces.
2647
2648         * character.c (mchar_get_prop_table): New function.
2649
2650         * textprop.h (mtext__adjust_plist_for_change): Prototype adjusted.
2651
2652         * m17n-core.h (mtext_insert, mtext_replace): Extern them.
2653         (mchar_get_prop_table): Extern it.
2654
2655         * textprop.c (prepare_to_modify): New arg deleting.  Callers changed.
2656         (mtext__adjust_plist_for_change): Argument changed.  Callers changed.
2657
2658         * internal.h (enum MTextCoverage): New enum.
2659         (MText): New member coverage.
2660
2661         * mtext.c (FORMAT_COVERAGE): New macro.
2662         (insert): Copy mt2->coverage.
2663         (mtext__from_data): Initialize mt->coverage.
2664         (mtext__adjust_format): Update mt->coverage.
2665         (mtext): Initialize mt->coverage.
2666         (mtext_set_char): Adjust args to mtext__adjust_plist_for_change.
2667         Update mt->coverage if necessary.
2668         (mtext_duplicate): Copy mt->coverage.
2669         (mtext_insert, mtext_replace): New functions.
2670         (mtext_dup): Use mtext_duplicate.
2671         (mtext__word_segment): Don't set *from and *to if a word
2672         segmentation funcion is not found.
2673         (mtext_ins_char): Fix typo.
2674
2675 2005-08-25  Kenichi Handa  <handa@m17n.org>
2676
2677         * font.h (MFont): New member for_full_width.
2678
2679         * font.c (compare_font_score): Prefer a font of not
2680         for_full_width.
2681
2682         * m17n-X.c (xfont_registry_list): Set font.for_full_width if the
2683         registry charset of a font is one of CJK charsets.
2684
2685         * font-ft.c (fc_parse_pattern): Set font->for_full_width if a font
2686         supports some of CJK.
2687
2688 2005-08-24  Kenichi Handa  <handa@m17n.org>
2689
2690         * m17n-gui.h (Mascent, Mdescent): Don't extern them.
2691
2692         * m17n-gui.c (null_device_open): Check Mresolution param and set
2693         frame->dpi.
2694
2695         * m17n-gd.c (device_open): Check Mresolution param and set
2696         frame->dpi.
2697
2698         * m17n-X.c (MWDevice): New member resy.
2699         (xfont_open): Set ascent, descent, and max_advance members of
2700         rfont.
2701         (xft_open): Likewise.
2702         (device_open): Compare also screen_num to find a device.  Set
2703         device->resy and frame->dpi.
2704
2705         * internal-gui.h (MFrame): New member dpi.
2706
2707         * font.h (MRealizedFont): New member max_advance.
2708
2709         * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
2710         (mfont__init): Don't initialize Mascent, Mdescent.
2711         (Mascent, Mdescent): Delete these variables.
2712         (mfont_get_prop): Fix previous change.  Check Mfont_ascent and
2713         Mfont_descent instead of Mascent and Mdescent.
2714         (mfont_put_prop): Allow negative size.
2715         (mfont_find): Handle the case of spec->size < 0.  Fix previous
2716         change.
2717         (mfont_list): Handle the case of spec->size < 0.
2718         (mfont_check): Likewise.
2719
2720         * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
2721         (fc_get_pattern): Handle the case of font->size < 0.
2722         (ft_open): Set ascent, descent, and max_advance members of rfont.
2723         (ft_find_metric): Improve rounding.
2724         (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
2725         FC_SIZE.
2726
2727         * face.c (mface__realize): Handle the case of font->size < 0.
2728
2729 2005-08-22  Kenichi Handa  <handa@m17n.org>
2730
2731         * coding.c (MConverterStatus): Change the member buf to union.
2732         (mconv_buffer_converter): Add const to the arg buf.
2733         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
2734         (mconv_decode): Adjusted for the change of MConverterStatus.
2735         (mconv_encode_range): Likewise.
2736
2737         * m17n.h (mconv_buffer_converter): Prototype adjusted.
2738         (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
2739
2740 2005-08-20  Kenichi Handa  <handa@m17n.org>
2741
2742         * m17n-gui.h (mfont_from_name): Prototype adjusted.
2743         (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
2744
2745         * m17n-X.c (xfont_open): Set members ascent, descent, and
2746         max_advance of rfont.
2747         (xft_open): Likewise.
2748
2749         * font-ft.c (ft_open): Set members ascent, descent, and max_advance
2750         of rfont.
2751         (mfont__ft_parse_name): Add const to the arg name.
2752
2753         * font.c (xlfd_parse_name): Add const to the arg name.  Call
2754         mfont__set_property instead of mfont_set_spec.  Set font->spacing.
2755         (xlfd_unparse_name): Handle spacing.
2756         (mfont__init): Initialize new variables.
2757         (mfont__id): Handle spacing.
2758         (mfont__merge): Likewise.
2759         (mfont__set_spec): This function deleted.
2760         (mfont__parse_name_into_font): Add const to the arg name.  Fix the
2761         condition of calling mfont__ft_parse_name.
2762         (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
2763         (mfont_get_prop): Handle properties spacing, ascent, descent,
2764         and max-advance.
2765         (mfont_find): Return a realized font.
2766         (mfont_from_name): Add const to the arg name.
2767
2768         * font.h (enum MFontProperty): New member MFONT_SPACING.
2769         (enum MFontSpacing): New enum.
2770         (MFont): New members spacing and max_advance.
2771         (mfont__ft_parse_name): Prototype adjusted.
2772         (mfont__set_spec): Extern deleted.
2773         (mfont__parse_name_into_font): Prototype adjusted.
2774
2775 2005-08-19  Kenichi Handa  <handa@m17n.org>
2776
2777         * m17n-gui.h (mfont_parse_name): Prototype adjusted.
2778
2779         * font.c (mfont_list): If FONT is null, use a temporary font.
2780         (mfont_parse_name): Add const to the arg name.
2781
2782 2005-08-18  Kenichi Handa  <handa@m17n.org>
2783
2784         * word-thai.c: Surround code by #ifdef and #endif to escape from
2785         doxygen.
2786
2787         * font-ft.c: Mostly re-written.
2788
2789         * font-flt.c (FontLayoutCmdOTF): This type deleted.
2790         (FontLayoutCmd): Type of the member otf changed..
2791         (load_otf_command): Adjusted for the format change of otf command.
2792         (load_command): Likewise.
2793         (free_flt_command): Unref cmd->body.otf.
2794         (run_otf): Ajusted for the type change of otf_cmd.
2795         (run_command): Ajusted for the type change of otf_cmd.  On
2796         debugging, print ctx->combining_code.
2797         (mfont__flt_run): Initialize ctx's members code_offset,
2798         combining_code, and left_padding to 0.
2799
2800         * face.h (struct MRealizedFace): New member font.
2801         (mface__realize): Prototype adjusted.
2802
2803         * face.c (find_realized_face): New arg font.
2804         (find_realized_face): Adjusted for the change of MFont.
2805         (mface__init): Call M17N_OBJECT_ADD_ARRAY.
2806         (mface__fini): Don't call mdebug__report_object.
2807         (mface__realize): New arg font.
2808         (mface__for_chars): Adjusted for the change of mfont__encode_char.
2809         Optimize the latin case.
2810         (mface__free_realized): Free rface->font.
2811         (mface__update_frame_face): Adjusted for the change of mface__realize.
2812         (mface_equal): New function.
2813
2814         * draw.c (Mcommon): New variable.
2815         (visual_order): Args to mfont__encode_char changed.
2816         (compose_glyph_string): Handle Mfont text property.
2817         (layout_glyphs): Adjusted for the change of MFont.
2818         (mdraw__init): Initialize Mcommon.
2819         (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
2820
2821         * font.h (enum MFontType): Members completely changed.
2822         (enum MFontProperty): Move MFONT_SIZE to the tail.
2823         (enum MFontSource): New enum.
2824         (struct MFont): New members type, source, sizes, file, capability,
2825         and encoding.
2826         (struct MRealizedFont): Type of member font changed. Members
2827         score, status, and encoding deleted.
2828         (MFontScore): New type.
2829         (MFontList): Member changed.
2830         (struct MFontDriver): New member has_char.  Types of members
2831         changed.
2832         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
2833         (Mapple_roman): Extern them.
2834         (OTF_Tag): Typedefed if not HAVE_OTF.
2835         (enum MFontOpenTypeTable): New enum.
2836         (MFontCapability): New type.
2837         (mfont__ft_drive_otf): Prototype adjusted.
2838         (mfont__score): Extern deleted.
2839         (mfont__merge): Extern it.
2840         (mfont__has_char): Extern it.
2841         (mfont__encode_char): Prototype adjusted.
2842         (mfont__open): Extern it.
2843         (mfont__set_spec): Prototype adjusted.
2844         (mfont__get_capability): Extern it.
2845
2846         * font.c: Include "fontset.h".
2847         (M_font_capability, M_font_list, M_font_list_len): New variables.
2848         (font_score_priority): Change order of initial elements.
2849         (font_score_shift_bits): Fix array size.
2850         (common_weight): Add "thin", "semibold", and "heavy".
2851         (common_stretch): Add "ultracondensed", "extracondensed",
2852         "extraexpanded", and "utltraexpand".
2853         (font_weight_regular, font_weight_normal, font_weight_medium): New
2854         variables.
2855         (gen_font_name): This function deleted.
2856         (find_encoding): Set font->encoding.
2857         (OTF_tag): New function.
2858         (otf_script_list): New variable.
2859         (load_otf_script_list): New function.
2860         (find_script_from_otf_tag): New function.
2861         (xlfd_parse_name): Set font->type and font->source.
2862         (mfont__free_realized): Free chains rfonts.
2863         (font_score): Renamed from mfont__score.
2864         (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
2865         (Mapple_roman): New variables.
2866         (mfont__init): Initilize new variables.  Initalize
2867         default_encoding.encoding_name and
2868         default_encoding.encoding_charset to Municode_full and
2869         mcharset__unicode.  Use SAFE* macros for allocating filepath
2870         buffer.
2871         (mfont__fini): Free otf_script_list.
2872         (mfont__id): New function.
2873         (mfont__match_p): Check also capability member of MFont.
2874         (mfont__merge): New funciton.
2875         (mfont__set_spec_from_face): Set type and source members.
2876         (mfont__set_spec_from_plist): Set capability and type members.
2877         (mfont__select): Argument changed.
2878         (mfont__available): New function.
2879         (compare_font_score): New function.
2880         (mfont__list): New function.
2881         (mfont__open): Return a realized font.
2882         (mfont__resize): Adjusted for the change of MFont.
2883         (mfont__has_char): New function.
2884         (mfont__encode_char): Argument changed.
2885         (mfont__set_spec): Argument changed.
2886         (free_font_capability): New function.
2887         (mfont__get_capability): New function.
2888         (MFontfile): New variable.
2889         (mfont_get_prop): Adjusted for the change of MFont.
2890         (mfont_put_prop): Likewise.
2891         (mfont_set_selection_priority): Fix the way of setting
2892         font_score_priority[].
2893         (mfont_find): Use mfont__list instead of mfont__select.
2894         (mfont_resize_ratio): Adjusted for the change of MFont.
2895         (mfont_list): Use mfont__list.
2896         (mfont_check): New function.
2897         (font_score): Make it static.
2898
2899         * fontset.h (mfont__realize_fontset): Prototype adjusted.
2900         (mfont__lookup_fontset): Likewise.
2901
2902         * fontset.c (struct MFontset): Delete member font_spec_list.
2903         (struct MRealizedFontset): Type of member spec changed.  New
2904         member request.
2905         (load_font_group): Arg spec_list deleted.
2906         (load_fontset_contents): Adjusted for the change of fontset_def.
2907         (free_fontset): Fix the way of freeing fontset elements.
2908         (realize_fontset_elements): Argument changed.
2909         (get_per_script): New function.
2910         (free_realized_fontset_elements): Fix the way of feeing rfontset
2911         elements.
2912         (update_fontset_elements): Fix args to realize_fontset_elements.
2913         (mfont__realize_fontset): New arg spec.
2914         (try_font_list): New function.
2915         (try_font_group): New arg request.  Use try_font_list.
2916         (mfont__lookup_fontset): New arg ignore_fallback.  Fix arg to
2917         try_font_group.
2918         (mfontset): Adjusted for the change of MFontset.
2919         (mfontset_copy): Likewise.  Don't share plists.
2920         (mfontset_modify_entry): Adjusted for the change of MFontset.
2921         (mfontset_lookup): Call get_per_script.
2922         (mdebug_dump_fontset): Print also the address of fonts.
2923
2924         * input.c (shift_state): Don't reset ic_info->vars.
2925         (take_action_list): Call MDEBUG_PRINT fore calling
2926         take_action_list.
2927
2928         * internal-gui.h (MFontDriver): Don't typedef it here.
2929
2930         * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
2931         (MXFont): This type deleted.
2932         (MFontX): New type.
2933         (struct _MFontX): New struct.
2934         (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
2935         (MDisplayInfo): Member base_font_list deleted.
2936         (DEFAULT_FONT): Definition changed.
2937         (FALLBACK_FONT): This maclr deleted.
2938         (free_display_info): Adjusted for the change of MDisplayInfo.
2939         (free_device): Argument to mfont__free_realized changed.
2940         (xfont_driver): Adjusted for the change of MFontDriver.
2941         (xfont_registry_list): Use MFontX instead of MXFont.
2942         (MRealizedFontX): Renamed from MXFontInfo.
2943         (xfont_select): Return the font found first.
2944         (close_xfont): Change MXFontInfo to MRealizedFontX.
2945         (xfont_open): Return the realized font.
2946         (xfont_find_metric): Get xfont from rfont->fontp.
2947         (xfont_has_char): New function.
2948         (xfont_encode_char): Adjusted for the argument change.
2949         (xfont_render): Get xfont from rfont->fontp.
2950         (xfont_list): Adjusted for the argument change.
2951         (MRealizedFontXft): Renamed from MXftFontInfo.
2952         (xft_driver): Ajusted for the change of MFontDriver.
2953         (close_xft): Change MXtfFontInfo to MRealizedFontXft
2954         (xft_open_font): Argument changed.
2955         (xft_open): Argument changed.  Return the realized font.
2956         (xft_find_metric): Get xft_font from rfont->fontp.
2957         (xft_has_char, xft_encode_char): New functions.
2958         (xft_render): Change MXftFontInfo to MRealizedFontXft.  Open a
2959         font if not yet opened.
2960         (device_open): Don't set frame->font.
2961
2962         * m17n-gd.c (gd_font_driver): Adjusted for the change of
2963         MFontDriver.
2964         (gd_font_open): New function.
2965         (gd_render): Don't use the local variable ft_info.
2966         (device_init): Adjusted for the change of gd_font_driver.
2967
2968         * textprop.c (mtext__prop_init): Initialize text_property_table.
2969         Call M17N_OBJECT_ADD_ARRAY.
2970         (mtext__prop_fini): Don't call mdebug__report_object.
2971
2972         * plist.c (mplist__init): Initialize plist_table.
2973         (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
2974         (mplist__fini): Don't call mdebug__report_object.
2975
2976         * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
2977         (mtext__fini): Don't call mdebug__report_object.
2978         (MTEXT_FORMAT_UTF_16): Correct type.
2979         (mtext_data): New function.
2980         (mtext_text): Fix calculation of limit and args to
2981         find_char_backward.
2982
2983         * language.c: Include "plist.h".
2984         (M_script_lang_list): New variable.
2985         (mlang__init): Read languages and their information from m17n
2986         database.
2987         (mlanguage__list): New function.
2988         (Miso639_1, Miso639_2): New variables.
2989
2990         * language.h (mlanguage__list): Extern it.
2991
2992         * database.c (get_database_stream): Use SAFE_* macros for
2993         allocating and freeing path.
2994         (mdatabase__init): Likewise.
2995
2996         * symbol.c (msymbol__fini): Don't free symbols here.
2997         (msymbol__free_table): New function.
2998         (msymbol_is_managing_key): New function.
2999
3000         * symbol.h (msymbol__free_table): Extern it.
3001         (msymbol__list): Extern it.
3002
3003         * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
3004         New macros.
3005         (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
3006         (struct _M17NObjectArray): New member name and next.
3007         (mdebug__add_object_array): Extern it.
3008         (M17N_OBJECT_ADD_ARRAY): New macro.
3009         (mdebug__report_object): Don't extern it.
3010
3011         * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
3012
3013         * m17n-gui.c (free_frame): Don't free frame->font.
3014         (null_device_fini): Fix code for freeing
3015         null_device.realized_font_list.
3016         (m17n_fini_win): Free interface.
3017         (mframe): Cast the return value of dlsym.  Set frame->font here.
3018         (mframe_get_prop): Check frame->rface->rfont before accessing the
3019         member font.
3020
3021         * m17n-gui.h (Mfontfile): Extern it.
3022         (mfont_check): Extern it.
3023         (mface_equal): Extern it.
3024
3025         * m17n-core.c: Include "symbol.h".
3026         (report_header_printed): This variable deleted.
3027         (object_array_root): New variable.
3028         (report_object_array): New function.
3029         (mdebug__report_object): This function deleted.
3030         (mdebug__add_object_array): New function.
3031         (m17n_init_core): Call mchartable_init () before mtext_init ().
3032         (m17n_fini_core): Call report_object_array (if necessary) and
3033         msymbol__free_atable at the end.
3034
3035         * m17n-core.h (msymbol_is_managing_key): Extern it.
3036         (mtext_data): Extern it.
3037         (MTEXT_FORMAT_UTF_16): Correct type.
3038         (M17NLIB_MINOR_VERSION): Changed to 3.
3039         (M17NLIB_VERSION_NAME): Changed to "1.3.0".
3040
3041         * chartab.c (mchartable__init): Initalize chartable_table.count.
3042         (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
3043         mdebug__report_object.
3044
3045 2005-05-26  Kenichi Handa  <handa@m17n.org>
3046
3047         * m17n.h (Miso639_1, Miso639_2): Extern them.
3048
3049         * symbol.h (msymbol__list): Extern it.
3050
3051         * symbol.c (msymbol__list): New function.
3052
3053 2005-05-19  Kenichi Handa  <handa@m17n.org>
3054
3055         * input-gui.c (minput__win_init): Don't change the value of
3056         minput_driver.
3057
3058 2005-05-16  Kenichi Handa  <handa@m17n.org>
3059
3060         * m17n-core.c (m17n_object): Be sure to initialize all members.
3061
3062         * font-ft.c (fc_decode_prop): Fix args to msymbol.
3063
3064 2005-05-09  Kenichi Handa  <handa@m17n.org>
3065
3066         * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
3067
3068 2005-04-27  Kenichi Handa  <handa@m17n.org>
3069
3070         * language.c (mlang__init): Add "an" (Aragonese).
3071
3072         * word-thai.c: Add support for libthai.
3073         (mtext__word_thai_init): Initialize wordseg library conditionaly.
3074         (mtext__word_thai_fini): Finalize wordseg library conditionaly.
3075
3076         * mtext.c: Include "word-thai.h" conditionaly.
3077         (mtext__init): Call mtext__word_thai_init conditionaly.
3078         (mtext__fini): Call mtext__word_thai_fini conditionaly.
3079
3080         * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
3081         not WORDCUT_LD_FLAGS.
3082
3083 2005-04-19  Kenichi Handa  <handa@m17n.org>
3084
3085         * word-thai.c (wordseg_propertize): Always unref the attached
3086         property.
3087         (thai_wordseg): Don't unref the property.
3088
3089 2005-04-18  Kenichi Handa  <handa@m17n.org>
3090
3091         * word-thai.c: Include stdlib.h.
3092         (wordseg_propertize): Add dummy function for the case that wordcut
3093         library doesn't exist.
3094         (wordseg_propertize): Fix for old wordcut library.
3095
3096 2005-04-16  Kenichi Handa  <handa@m17n.org>
3097
3098         * word-thai.c: Include <stdio.h>.
3099
3100 2005-04-15  Kenichi Handa  <handa@m17n.org>
3101
3102         * draw.c: Include mtext.h.
3103         (linebreak_table, M_break_at_space, M_break_at_word)
3104         (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
3105         (compose_glyph_string): Check POS before getting Mface text
3106         property.
3107         (truncate_gstring): Give correct TO arg to line_break function.
3108         (GET_LB_TYPE): New macro.
3109         (find_break_backward, find_break_forward): New functions.
3110         (mdraw__init): Initialize the above new variables.
3111         (mdraw__fini): Free linebreak_table.
3112         (mdraw_default_line_break): Use find_break_backward and
3113         find_break_forward.
3114
3115         * word-thai.c: New file.
3116
3117         * word-thai.h: New file.
3118
3119         * mtext.c: Include word-thai.h.
3120         (wordseg_func_table): New variable.
3121         (mtext__init): Initialize wordseg_func_table and call
3122         mtext__word_thai_init.
3123         (mtext__fini): Call mtext__word_thai_fini, free
3124         wordseg_func_table.
3125         (MTextWordsegFunc): New type.
3126         (mtext__word_segment): New function.
3127
3128         * mtext.h (wordseg_func_table): Extern it.
3129         (mtext__word_segment): Extern it.
3130
3131         * m17n.c (m17n_init): Fix typo (== -> =).
3132
3133         * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
3134         (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
3135
3136         * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
3137         (MTEXTPROP_VAL): New macros.
3138
3139         * input.c (DLOPEN_SHLIB_EXT): Don't define it.
3140
3141 2005-04-07  Kenichi Handa  <handa@m17n.org>
3142
3143         * database.c (load_chartable): Fix pursing of symbol name.
3144
3145 2005-03-24  Kenichi Handa  <handa@m17n.org>
3146
3147         * m17n.c (m17n_init): Fix typo (== -> =).
3148
3149 2005-03-11  Kenichi Handa  <handa@m17n.org>
3150
3151         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
3152
3153         * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
3154
3155         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
3156         first.
3157
3158 2005-03-09  handa  <handa@m17n.org>
3159
3160         * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
3161         calling m17n_init ().
3162
3163         * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
3164         calling m17n_init_core ().
3165
3166 2005-02-28  Kenichi Handa  <handa@m17n.org>
3167
3168         * font-flt.c (mfont__flt_run): Add resulting code sequence in
3169         debug info.
3170
3171 2005-02-17  Kenichi Handa  <handa@m17n.org>
3172
3173         * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
3174         (M_description, M_command, M_variable): New variables.
3175         (load_im_info_keys): New variables.
3176         (load_im_info, check_command_keyseq, get_description_advance)
3177         (parse_command_list, get_command_list, parse_variable_list)
3178         (get_variable_list, input_method_hook): New functions.
3179         (command_list, variable_list): New variables.
3180         (minput__init): Put input_method_hook to Minput_method.
3181         Initialize M_description, M_command, M_variable, Mdetail_text,
3182         load_im_info_keys, command_list, variable_list.
3183         (minput__fini): Unref command_list, variable_list, load_im_info_keys.
3184         (Mdetail_text): New variable.
3185         (minput_get_description, minput_get_commands)
3186         (minput_assign_command_keys, minput_get_variables)
3187         (minput_set_variable): New functions.
3188
3189         * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
3190         (minput_assign_command_keys, minput_get_variables)
3191         (minput_set_variable): Extern them.
3192
3193         * plist.c (UNGETC): Just decrement st->p.
3194         (read_mtext_element): New arg skip.
3195         (read_integer_element): Likewise.
3196         (read_symbol_element): Likewise.
3197         (read_element): New arg KEYS.
3198         (mplist__from_plist): Don't increment ref-count of NULL object.
3199         (mplist__from_file): New arg KEYS.
3200         (mplist_put): Don't increment ref-count of NULL object.
3201         (mplist_add): Likewise.
3202         (mplist_push): Likewise.
3203         (mplist_set): Likewise.  Call M17N_OBJECT_UNREF unconditionally.
3204
3205         * plist.h (mplist__from_file): Prototype adjusted.
3206
3207         * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
3208         (get_database_stream): New function.
3209         (load_database): Use get_database_stream.
3210         (M_database_hook): New variable
3211         (mdatabase__init): Initialize M_database_hook.
3212         (mdatabase__load_for_keys): New function.
3213         (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
3214         function.
3215         (mdatabase_define): Free mdb->extra_info if necessary.
3216
3217         * database.h (mdatabase__dir_list, M_database_hook)
3218         (mdatabase__load_for_keys): Extern them.
3219         (MDatabaseHookFunc): New type.
3220
3221         * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
3222
3223 2004-12-27  Kenichi Handa  <handa@m17n.org>
3224
3225         * Version 1.2.0 released.
3226
3227 2004-12-27  Kenichi Handa  <handa@m17n.org>
3228
3229         * input.c (minput_filter): Don't reset ic->xxx_changed.
3230
3231         * mtext.c (mtext_from_data): Fix documentation.
3232
3233 2004-12-25  Kenichi Handa  <handa@m17n.org>
3234
3235         * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
3236         (M17NLIB_VERSION_NAME): Update to "1.2.".
3237
3238 2004-12-24  Kenichi Handa  <handa@m17n.org>
3239
3240         * input.c (reset_ic): Set key_unhandled to 0.
3241
3242 2004-12-21  Kenichi Handa  <handa@m17n.org>
3243
3244         * m17n-gui.h (mfont_from_spec): Delete extern.
3245
3246         * input-gui.c (win_callback): Handle Minput_reset.
3247         (minput__win_init): Register reset_ic as a callback for
3248         Minput_reset.
3249
3250         * input.c (reset_ic): New arg IGNORE which is ignored.  Caller
3251         changed.  At first, shift to the initial state.
3252         (minput__init): Initialize Minput_reset.  Register reset_ic as a
3253         callback for Minput_reset.
3254         (Minput_reset): New variable.
3255         (minput_filter): Always set ic->xxx_changed to 0.
3256         (minput_reset_ic): New function.
3257         (integer_value): Fix typo ('>' -> '<') and calculation of length
3258         of preedit text.
3259
3260         * m17n-core.c (merror_code): Change type to `int'.
3261
3262         * m17n-misc.h (merror_code): Adjust type.
3263
3264         * m17n.h (Minput_reset, minput_reset_ic): Extern them.
3265
3266         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
3267         (mtext_change_prop): Delete extern.
3268
3269         * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
3270         to `int'.  Move the documents to m17n-core.h.
3271
3272 2004-12-13  Kenichi Handa  <handa@m17n.org>
3273
3274         * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
3275         (MTextProperty): Document it.
3276
3277 2004-12-09  Kenichi Handa  <handa@m17n.org>
3278
3279         * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
3280
3281 2004-12-03  Kenichi Handa  <handa@m17n.org>
3282
3283         * internal.h (m17n__core_initialized, m17n__shell_initialized,
3284         m17n__gui_initialized): New externs.
3285
3286         * m17n-core.h (enum M17NStatus): New enum.
3287         (m17n_status): Extern it.
3288
3289         * m17n-core.c (core_initialized): Delete this variable.
3290         (m17n__core_initialized, m17n__shell_initialized,
3291         m17n__gui_initialized): New variables.
3292         (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
3293         instead of core_initialized.
3294         (m17n_status): New function.
3295
3296         * m17n.c (shell_initialized): Delete this variable.
3297         (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
3298         shell_initialized.
3299
3300         * m17n-gui.h (m17n_init_win): Adjust the prototype.
3301
3302         * m17n-gui.c (win_initialized): Delete this variable.
3303         (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
3304         instead of gui_initialized.
3305
3306 2004-11-19  Kenichi Handa  <handa@m17n.org>
3307
3308         * input.c (reset_ic): Check if ic_info->state is NULL.
3309         (filter): If ic_info->state is NULL, return 0.
3310         (load_input_method): Don't unref `maps' it it's not created.
3311
3312 2004-11-15  Kenichi Handa  <handa@m17n.org>
3313
3314         * input.c (find_candidates_group): If INDEX is -1, find the last
3315         candidate group.
3316         (take_action_list): If the previous of the first candidate is
3317         requested, select the last candidate.
3318
3319 2004-11-08  Kenichi Handa  <handa@m17n.org>
3320
3321         * m17n-X.c (device_open): Try at most 32 fonts to find a
3322         non-autoscaled font.
3323
3324         * font.c (xlfd_parse_name): Fix previous change.
3325
3326 2004-11-05  Kenichi Handa  <handa@m17n.org>
3327
3328         * font.c: (commont_style): Include dummy elements "slanted" and
3329         "rslanted" to prefer "o" to "r" if "i" is requested.
3330
3331         * font-ft.c (ft_to_prop): Fix "oblique" entry.
3332
3333 2004-10-29  Kenichi Handa  <handa@m17n.org>
3334
3335         * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
3336
3337         * m17n-X.c (MXFont): Change type of the member `sizes' to int.
3338         New members smallest and larger.
3339         (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
3340         (xfont_registry_list): Likewise.
3341         (xfont_select): Likewise.
3342         
3343
3344 2004-10-28  Kenichi Handa  <handa@m17n.org>
3345
3346         * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
3347         font name comparison.
3348         (xfont_select): Fix logic for selecting a larger size font.
3349
3350 2004-10-25  Kenichi Handa  <handa@m17n.org>
3351
3352         * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
3353         ">" actions.
3354
3355 2004-10-22  Kenichi Handa  <handa@m17n.org>
3356
3357         * input.c (update_candidate): Renamed from udpate_candidate.
3358         (take_action_list): Show more debugging info on arithmetic commands.
3359
3360         * m17n-X.c (device_open): Fix previous change.
3361
3362         * draw.c (compose_glyph_string): Don't get face property at the
3363         end of M-text.
3364
3365 2004-10-21  Kenichi Handa  <handa@m17n.org>
3366
3367         * draw.c (compose_glyph_string): Fix for the case of category
3368         being Mnil.
3369
3370 2004-10-19  Kenichi Handa  <handa@m17n.org>
3371
3372         * input.c (mdebug_mask): New variable.
3373         (shift_state): Print debug information.
3374         (take_action_list): Likewise.
3375         (handle_key): Likewise.
3376
3377 2004-10-14  Kenichi Handa  <handa@m17n.org>
3378
3379         * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
3380
3381 2004-10-13  Kenichi Handa  <handa@m17n.org>
3382
3383         * m17n-X.c (device_open): Be sure to register at least one font
3384         driver.
3385
3386         * font-ft.c: Include <freetype/ftbdf.h> conditionally.  Check
3387         HAVE_FTBDF_H before calling FT_Get_BDF_Property.
3388
3389 2004-10-12  Kenichi Handa  <handa@m17n.org>
3390
3391         * draw.c (alloc_gstring): Fix previous change.
3392
3393         * font-ft.c (ft_list_generic): Fix for the case of not
3394         HAVE_FONTCONFIG.
3395
3396         * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
3397
3398         * font.c (mfont_list): If no font is found, return NULL.
3399         (load_font_encoding_table): Put entries of nil registry first.
3400         (find_encoding): Adjust for the above change.
3401
3402 2004-10-11  Kenichi Handa  <handa@m17n.org>
3403
3404         * m17n-gui.h (mfont_list): Adjust prototype.
3405
3406         * m17n-X.c (xfont_list): New arg maxnum.
3407
3408         * font.h (struct MFontDriver): Change prototype of <list>.
3409
3410         * font-ft.c (fc_generic_family_list): Delete it.
3411         (Mserif, Msans_serif, Mmonospace): Delete them.
3412         (M_generic_family_info): New variable.
3413         (enum GenericFamilyType): New enum.
3414         (struct GenericFamilyInfo): New struct.
3415         (generic_family_table): New variable.
3416         (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
3417         iso8859-1.
3418         (add_font_info): Get style here.
3419         (ft_list_family): Don't initialize fc_config here.  Don't list
3420         generic families.
3421         (ft_list_generic): New function.
3422         (ft_select): Pay attention to generic familes here.
3423         (ft_open): Fix calculation of ascent and descent.
3424         (ft_list): Pay attention to generic families.
3425         (mfont__ft_init): Initialize M_generic_family_info,
3426         generic_family_table, and fc_config..
3427         (mfont__ft_fini): Finalize generic_family_table.
3428
3429         * draw.c (compose_glyph_string): Use more constant font for
3430         glyphs.  Adjust for the member change in MGlyph.
3431         (layout_glyph_string): Adjust for the member change in MGlyph.
3432         (alloc_gstring): Intilize scracth_glyph to avoid
3433         compose_glyph_string on it.
3434         (get_gstring): Don't call compose_glyph_string on scracth_glyph.
3435         (mdraw_coordinates_position): Fix previous change.
3436
3437         * internal-gui.h (glyph_category): New enum.
3438         (MGlyph): Change type of <category> to enum glyph_category.
3439
3440         * face.c (mface__realize): Delete args langauge and charset.
3441         (mface__for_chars): Fix for the case that glyphs have different
3442         rfaces.
3443         (mface__update_frame_face): Adjust for mface__realize change.
3444
3445         * face.h (mface__realize): Adjust prototype.
3446
3447 2004-10-05  Kenichi Handa  <handa@m17n.org>
3448
3449         * language.c (mlang__init): Add Akan.
3450
3451 2004-10-04  Kenichi Handa  <handa@m17n.org>
3452
3453         * font-ft.c (add_font_info): Add instead of push the element.
3454         (ft_list_family): For generic fonts, try all
3455         substituted. families.
3456
3457         * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
3458         (run_rule): Don't update cluster range here.
3459         (run_command): Update cluster range on appending a glyph.
3460         (run_otf): Update cluster range for glyphs generated by OTF.
3461
3462 2004-10-02  Kenichi Handa  <handa@m17n.org>
3463
3464         * m17n-X.c (device_open): Handle Mfont key in PLIST.
3465
3466 2004-09-30  Kenichi Handa  <handa@m17n.org>
3467
3468         * font-ft.c (ft_select): Ignore family on calling mfont__score.
3469
3470 2004-09-30  Kenichi Handa  <handa@m17n.org>
3471
3472         * font.h: Include <fontconfig/fontconfig.h>.
3473         (MFTInfo): New member langset.
3474         (mfont__encoding_list): Extern it.
3475
3476         * font.c (mfont__encoding_list): New function.
3477         (mdebug_dump_font_list): New function.
3478
3479         * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
3480         (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
3481         variables.
3482         (ft_family_list): New variable.
3483         (set_font_info): New arg basep.  Callers changed.
3484         (fc_list): Check the return value of FcPatternGetString.
3485         (add_font_info): New arg plist.  Callers changed. Update
3486         ft_family_list.
3487         (ft_list_family): New function (merged fc_list and ft_list_all).
3488         (ft_select): Use ft_list_family.
3489         (ft_list): Likewise.  If FONT is not NULL, check all fonts.  Fix
3490         typo (== -> !=).
3491         (mfont__ft_init): Initialize above new variables.
3492         (mfont__ft_fini): Free ft_family_list.
3493         (STRDUP_LOWER): New macro.
3494         (set_font_info): Use STRDUP_LOWER.
3495         (ft_list_family): Avoid duplicate addition of font path.  Use
3496         STRDUP_LOWER.
3497         (fc_decode_prop): Fix typo.
3498
3499         * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
3500         (xfont_registry_list): Change argument disp_info to frame.
3501         Callers changed.
3502         (xfont_list_all): New function.
3503         (xfont_list): If FONT is not NULL, check all fonts.
3504
3505 2004-09-28  Kenichi Handa  <handa@m17n.org>
3506
3507         * m17n-X.c (MXFont, MXFontList): New types.
3508         (MDisplayInfo): Delete members font_registry_list,
3509         iso8859_1_family_list, iso10646_1_family_list, new members
3510         font_list, base_font_list.
3511         (free_display_info): Adusted for the change of MDisplayInfo.
3512         (xfont_driver): Initialize with xfont_list.
3513         (font_compare): New function.
3514         (build_font_list): Deleted.
3515         (xfont_registry_list): New function.
3516         (xfont_select): Use xfont_registry_list.
3517         (xfont_list): New function.
3518         (device_open): Adusted for the change of MDisplayInfo.
3519
3520         * font-ft.c (add_font_info): New arg languages.  Callers changed.
3521         (fc_list): Get languages from fonts..
3522         (ft_list_all): Renamed from ft_list.  Callers changed.
3523         (ft_list): New function.
3524         (mfont__ft_driver): Initalize with ft_list.
3525
3526         * font.c (mfont_list): New function.
3527
3528         * font.h (struct MFontDriver): New member `list'.
3529         (MFTInfo): New member languages.
3530
3531         * m17n-gui.h (mfont_list): Extern it.
3532
3533 2004-09-27  Kenichi Handa  <handa@m17n.org>
3534
3535         * internal-gui.h (struct MGlyphString): Delete members mt,
3536         sub_width, sub_lbrearing, sub_rbearing, and region.
3537
3538         * draw.c (MSubTextExtents): New type.
3539         (layout_glyphs): New arg extents.  Set its members.
3540         (layout_glyph_string): Adjusted for the above change.
3541         (alloc_gstring): Don't set gstring->mt.
3542         (truncate_gstring): Call line_break function with mt instead of
3543         gstring->mt.
3544
3545 2004-09-22  Kenichi Handa  <handa@m17n.org>
3546
3547         * mtext.c (count_utf_16_chars): Count each code of invalid
3548         surrogates as one.
3549
3550 2004-09-19  Kenichi Handa  <handa@m17n.org>
3551
3552         * mtext.c (default_utf_16, default_utf_32): Rename them to
3553         MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively.  Caller
3554         changed.
3555
3556         * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
3557         them.
3558
3559 2004-09-13  Kenichi Handa  <handa@m17n.org>
3560
3561         * draw.c (Mlatin): Don't declare it here.
3562         (visual_order): Fix reordering of combining characters.
3563         (compose_glyph_string): Fix detection of script.
3564         (layout_glyphs): Don't fix reordering of combining characters
3565         here.
3566         (layout_glyph_string): Pay attention to
3567         control->disable_overlapping_adjustment.
3568         (truncate_gstring): Include at least on character in a line.
3569         (get_gstring): Always scan one full line.
3570         (mdraw__init): Don't initialize Mlatin here.
3571         (mdraw_text_per_char_extents): Fix iteration.  If a glyph doesn't
3572         have a font, use ascent/descent of an ASCII font.  Allow
3573         ink_array_return and logical_array_return to be NULL.
3574         (mdraw_coordinates_position): Fix iteration.
3575
3576         * font-ft.c (MFTtoProp): Member completely changed.
3577         (ft_to_prop): Adjusted for the above change.
3578         (ft_to_prop_size): Likewise.
3579         (set_font_info): Adjusted for the change of MFTtoProp.
3580         (fc_generic_family_list): New variable.
3581         (fc_list): Add special handling of generic font names.
3582         (mfont__ft_init): Adjusted for the change of MFTtoProp.
3583         Initialize fc_generic_family_list.
3584         (mfont__ft_fini): Don't free ft_to_prop.  Free
3585         fc_generic_family_list.
3586         (FC_vs_M17N_font_prop): New type.
3587         (fc_weight_table, fc_slant_table, fc_width_table): New variables.
3588         (fc_decode_prop, fc_encode_prop): New functions.
3589         (mfont__ft_parse_name): Use fc_decode_prop.
3590         (mfont__ft_unparse_name): Use fc_encode_prop.
3591
3592         * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
3593         (MWDevice): Add member realized_font_list.
3594         (free_display_info): Don't free disp_info->realized_font_list.
3595         (free_device): Free device->realized_fontset_list.
3596         (xft_find_metric): Use gstring->frame instead of rfont->frame.
3597         (device_open): Don't initialize disp_info->realized_font_list.
3598         (device_open): Initialize device->realized_font_list and set it to
3599         frame->realized_font_list.
3600
3601         * fontset.c (try_font_group): New function.
3602         (mfont__lookup_fontset): Use try_font_group.
3603
3604         * font.c (common_weight): Change the order of "regular".
3605
3606         * face.c (Mlatin): Don't make it static.
3607         (mface__realize): Be sure to set work_gstring.frame.
3608         (mface__for_chars): Likewise.
3609
3610         * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
3611         MTEXT_FORMAT_UTF_8.
3612
3613         * internal-gui.h (Mlatin): Extern it.
3614
3615         * m17n-gui.h (MDrawControl): New member
3616         disable_overlapping_adjustment.
3617
3618 2004-09-06  Kenichi Handa  <handa@m17n.org>
3619
3620         * font-flt.c (run_otf): Fix typo ('}'->']').
3621
3622         * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
3623         (COMBINING_PRECOMPUTED_P): New macros.
3624
3625         * draw.c (layout_glyphs): Handle precomputed combining code.
3626
3627         * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
3628         precomupted combining code.
3629
3630 2004-09-03  Kenichi Handa  <handa@m17n.org>
3631
3632         * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
3633         otf_gstring.glyphs.
3634
3635 2004-08-27  Kenichi Handa  <handa@m17n.org>
3636
3637         * face.c (mface_put_prop): If the new value is the same as the
3638         current one, don't increment frame->tick.
3639
3640 2004-08-25  Kenichi Handa  <handa@m17n.org>
3641
3642         * fontset.c (mfontset): Initialize font_spec_list member.
3643         (mfontset_copy): Load fontset if necessary.
3644
3645         * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
3646         'metrics' to for C++.
3647
3648         * draw.c (mdraw_glyph_info): Adjusted for the member name change
3649         (this -> metics).
3650
3651 2004-08-16  Kenichi Handa  <handa@m17n.org>
3652
3653         * Version 1.1.0 released.
3654
3655 2004-08-13  Kenichi Handa  <handa@m17n.org>
3656
3657         * language.c (mlang__init): Add Dhivehi.
3658
3659         * m17n-gui.c (Mx, Mfreetype): Delete it.
3660         (m17n_init_win): Don't initialize Mx and Mfreetype here.
3661
3662         * m17n-gui.h (Mfreetype, Mxft): Extern them.
3663         (mfont_resize_ratio): Extern it.
3664         (MDrawGlyphInfo): New member logical_width;
3665         (MDrawGlyph): New type.
3666         (mdraw_glyph_list): Prototype adjusted.
3667
3668         * m17n-X.c (xfont_open): Set type and fontp members.
3669         (xft_open): Likewise.
3670
3671         * internal-gui.h (Mx, Mfreetype): Delete extern.
3672
3673         * font.h (struct MRealizedFont): New member type and fontp.
3674
3675         * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
3676         (Mx, Mfreetype): Declare here.
3677         (Mxft): New variable.
3678         (mfont_resize_ratio): New function.
3679
3680         * font-ft.c (ft_open): Set type and fontp members.
3681
3682         * draw.c (mdraw_glyph_list): Argument type changed.  Don't set
3683         glyph_code member.
3684
3685 2004-08-11  Kenichi Handa  <handa@m17n.org>
3686
3687         * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
3688         FT_LOAD_DEFAULT.
3689
3690 2004-08-06  Kenichi Handa  <handa@m17n.org>
3691
3692         * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
3693         feature to apply.
3694
3695         * font-flt.c (run_otf): Print debugging information if necessary.
3696
3697 2004-08-05  Kenichi Handa  <handa@m17n.org>
3698
3699         * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff.  Support
3700         positioning_type 5 and 6.  Switch simplified.
3701
3702 2004-08-04  Kenichi Handa  <handa@m17n.org>
3703
3704         * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
3705
3706 2004-08-02  Kenichi Handa  <handa@m17n.org>
3707
3708         * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
3709         set val to 1 even if it is greater than 1.
3710
3711         * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
3712
3713 2004-07-29  Kenichi Handa  <handa@m17n.org>
3714
3715         * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
3716         debugging information.
3717
3718         * internal.h (MDEBUG_PRINT5): New macro.
3719
3720         * draw.c (layout_glyphs): Don't combine a zero width glyph with
3721         the previous one if the zero width glyph has left or right
3722         padding.
3723
3724 2004-07-26  Kenichi Handa  <handa@m17n.org>
3725
3726         * m17n-X.c (xft_render): Pay attention to members left_padding and
3727         right_padding of MGlyph.
3728
3729         * draw.c (visual_order): Allocate one more elements for arrays as
3730         a workaround of fribidi bug.
3731         (layout_glyphs): Fix previous change. Check MGlyph->combining_code
3732         instead of MGlyph->bidi_sensitive.
3733         (layout_glyph_string): Pay attentinon to
3734         control->orientation_reversed when padding at the head or tail.
3735         Fix adjustment of space glyph width.
3736         (get_gstring): If cursor_width or cursor_bidi is changed, don't
3737         use a cache.
3738
3739         * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
3740         instead of MGlyph->bidi_sensitive.
3741
3742         * internal-gui.h (MGlyph): Delete member bidi_sensitive.
3743
3744 2004-07-26  Kenichi Handa  <handa@m17n.org>
3745
3746         * draw.c (visual_order): Don't treat combined glyphs specially.
3747         (layout_glyphs): Don't get metrics glyphs that are already ready.
3748         Pay attention to MGlyph->bidi_sensitive.  Combine a glyph of zero
3749         width with the previous one. 
3750         (draw_background): Fix bar cursor position on a r2l glyph.
3751
3752         * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
3753         (run_rule): Fix place of updating cluster_begin_pos and
3754         cluster_end_pos here.
3755         (run_otf): Don't set left_padding.
3756
3757         * font-ft.c (adjust_anchor): Type of argument `code' changed.
3758         Caller changed.
3759         (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
3760         Fix handling of GPOS.
3761         (mfont__ft_drive_gpos): Delete this function.
3762
3763         * font.h (mfont__ft_drive_otf): Renamed back from
3764         mfont__ft_drive_gsub.
3765         (mfont__ft_drive_gpos): Delete extern.
3766
3767         * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
3768         (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
3769
3770 2004-07-23  Kenichi Handa  <handa@m17n.org>
3771
3772         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
3773         the same bidi level.
3774
3775         * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
3776
3777 2004-07-22  Kenichi Handa  <handa@m17n.org>
3778
3779         * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
3780
3781 2004-07-20  Kenichi Handa  <handa@m17n.org>
3782
3783         * draw.c (render_glyphs): Fix checking of g->code validity.
3784
3785         * face.c (mface__realize): Set g.type.
3786
3787 2004-07-18  Kenichi Handa  <handa@m17n.org>
3788
3789         * Makefile.am: Prepend ${top_srcdir} to all *.la in
3790         *_LIBADD/*_LDADD.
3791
3792         * m17n-gui.c (mframe): Print error message give by dlopen to
3793         stderr.
3794
3795 2004-07-16  Kenichi Handa  <handa@m17n.org>
3796
3797         * draw.c (compose_glyph_string): Improve the way of deciding a
3798         script.  For a character that doesn't have script property, use
3799         the last non-latin script.
3800
3801         * font-ft.c (fc_list): Cancel previous change.
3802         (mfont__ft_init): Add more entries in ft_to_prop_name.
3803
3804 2004-07-15  Kenichi Handa  <handa@m17n.org>
3805
3806         * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
3807         previous or next character glyphs.
3808
3809 2004-07-14  Kenichi Handa  <handa@m17n.org>
3810
3811         * draw.c (compose_glyph_string): Be sure to set codes for glyphs
3812         of type GLYPH_SPACE.
3813
3814         * fontset.c (mfont__lookup_fontset): If glyph type is
3815         GLYPH_SPACE, get codes for SPACE.
3816
3817         * internal-gui.h (Mfont): Delete extern.
3818
3819         * m17n-gui.h (Mfont): Delete duplicated extern.
3820
3821 2004-07-13  Kenichi Handa  <handa@m17n.org>
3822
3823         * font-ft.c (DEVICE_DELTA): New macro.
3824         (adjust_anchor): New function.
3825         (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf.  Drive
3826         only GSUB.
3827         (mfont__ft_drive_gpos): New function.
3828
3829         * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
3830         (FontLayoutContext): Delete member `rfont'.
3831         (run_otf): Set g->otf_cmd.  Call 
3832         (mfont__flt_run): Don't set ctx.rfont.  Call mfont__ft_decode_otf
3833         only whne HAVE_OTF is defined.
3834
3835         * fontset.c: Include "config.h".
3836
3837         * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
3838         (MGlyph): New member otf_cmd.
3839
3840         * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
3841         (mfont__ft_drive_gpos): Extern it.
3842
3843         * face.c: Include "config.h".
3844
3845         * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
3846
3847         * input-gui.c: Include "config.h".
3848
3849         * plist.c: Include "config.h".
3850
3851 2004-07-06  Kenichi Handa  <handa@m17n.org>
3852
3853         * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
3854         internal-gui.h: Cancel previous changes.
3855
3856         * m17n-gd.h: Delete it.
3857
3858         * Makefile.am (libm17n_core_la_LIBADD): New variable.
3859         (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
3860         @XML2_LD_FLAGS@ to above.
3861         (libm17n_la_LIBADD): Add -ldl.
3862         (libm17n_la_LDFLAGS): Add -export-dynamic.
3863         (X_LD_FLAGS): Fix the order of linking.
3864         (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
3865         (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
3866         (libm17n_X_la_LDFLAGS): Add -module.
3867         (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
3868         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
3869         (libm17n_gd_la_LDFLAGS): Add -module.
3870         (include_HEADERS): Delete m17n-gd.h.
3871
3872 2004-06-30  Kenichi Handa  <handa@m17n.org>
3873
3874         * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
3875         (MDeviceLibraryInterface): Delete it.
3876         (register_device_library): Delete it.
3877         (m17n__device_library_list): Renamed from device_library_list.
3878
3879         * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
3880         (m17n_init_win): Adjust prototype.
3881
3882         * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
3883         (m17n_init_gd): New function. 
3884
3885         * m17n-gd.h: New file.
3886
3887         * m17n-X.h: Include <m17n-gui.h>.
3888         (m17n_init_X): Extern it.
3889         (M17N_INIT): Redefine it.
3890
3891         * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
3892         (m17n_init_X): New function.
3893
3894         * internal-gui.h (m17n__device_library_list): Extern it.
3895         (struct MDeviceDriver): New members initialized, init, and fini.
3896
3897         * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
3898         @XFT2_LD_FLAGS@.
3899         (libm17n_X_la_LIBADD): Delete aboves.
3900         (libm17n_gd_la_SOURCES): Add m17n-gd.h.
3901         (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
3902         (libm17n_gd_la_LDFLAGS): Delete it.
3903         (include_HEADERS): Add m17n-gd.h.
3904
3905 2004-06-25  Kenichi Handa  <handa@m17n.org>
3906
3907         * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
3908         (libm17n_gd_la_LDFLAGS): Cancel previous change.
3909
3910         * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
3911
3912         * font-ft.c (fc_list): If FcFontList finds no font, try
3913         FcFontMatch.
3914
3915         * draw.c (compose_glyph_string): Terminate the last loop after
3916         doing default combining if necessary.
3917
3918 2004-06-24  Kenichi Handa  <handa@m17n.org>
3919
3920         * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
3921
3922         * character.c (mchar_define_property): Add const to an arg.
3923
3924         * charset.c (mchar_define_charset): Add const to an arg.
3925
3926         * coding.c (MCodingSystem): Add const to an arg or decoder.
3927         (finish_decoding): Add const to an arg.
3928         (decode_coding_charset, decode_coding_utf_8)
3929         (decode_coding_utf_16, decode_coding_utf_32)
3930         (decode_coding_iso_2022, decode_coding_sjis)
3931         (mconv_define_coding): Likewise.
3932
3933         * m17n-X.c (xft_find_metric): Delete unused variable.
3934
3935         * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
3936         prototypes.
3937
3938         * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
3939         prototypes.
3940
3941         * mtext.c (count_utf_8_chars, count_utf_16_chars)
3942         (mtext__from_data, mtext_from_data): Add `const' to an arg.
3943
3944         * mtext.h (mtext__from_data): Ajust prototype.
3945
3946 2004-06-23  Kenichi Handa  <handa@m17n.org>
3947
3948         * draw.c (compose_glyph_string): Always get glyph codes by
3949         mface__for_char.
3950         (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
3951         (mdraw_glyph_list): New function.
3952
3953         * font-flt.c (mfont__flt_run): Be sure to call
3954         rfont->driver->encode_char.
3955
3956         * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
3957         (ft_encode_char): Delete arg C.
3958         (ft_render): Don't call FT_Get_Char_Index.
3959
3960         * font.c (mfont__encodable_p): Delete it.
3961         (mfont__encode_char): Be sure to call rfont->driver->encode_char.
3962
3963         * font.h (struct MFontDriver): Delete arg C of encode_char.
3964         (mfont__encodable_p): Delete extern.
3965
3966         * m17n-X.c (xfont_encode_char): Delete arg C.
3967         (xft_find_metric): Don't cal FT_Get_Char_Index.
3968         (xft_render): Likewise.
3969
3970         * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
3971         logical_width.
3972         (mdraw_glyph_list): Extern it.
3973
3974         * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
3975
3976 2004-06-22  Kenichi Handa  <handa@m17n.org>
3977
3978         * m17n-gui.h (mfontset_lookup): Extern it.
3979
3980         * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
3981
3982         * fontset.c (realize_fontset_elements)
3983         (free_realized_fontset_elements, update_fontset_elements): New
3984         functions.
3985         (mfont__realize_fontset): Call realize_fontset_elements.
3986         (mfont__free_realized_fontset): Call free_realized_fontset_elements.
3987         (mfont__lookup_fontset): If a fontset was modified, update
3988         the realized fontset.
3989         (mfontset_modify_entry): Increment fontset->tick.
3990         (mfontset_lookup): New function.
3991
3992 2004-06-21  Kenichi Handa  <handa@m17n.org>
3993
3994         * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
3995
3996         * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
3997         (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
3998         length of source text 0.
3999
4000 2004-06-21  Kenichi Handa  <handa@m17n.org>
4001
4002         * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
4003         (compare): Pay attention to format other than utf-8.
4004         (copy): Delete this function.
4005         (count_by_utf_8, count_by_utf_16, insert): New functions.
4006         (count_utf_16_chars): Fix handling of a surrogate pair.
4007         (find_char_forward, find_char_backward): Likewise.
4008         (mtext__from_data): Delete unnecessary check.  Fix number of
4009         allocated bytes.
4010         (mtext_from_data): Don't count items.
4011         (mtext_ref_char): Optimize the code.
4012         (mtext_set_char): Pay attention to format other than utf-8.
4013         (mtext_cat_char): Likewise.
4014         (mtext_dup): Don't call copy, instead do allocation here.
4015         (mtext_cat): Call insert instead of copy.
4016         (mtext_ncat): Likewise.
4017         (mtext_cpy): Delete character at first and call insert instead of
4018         copy.
4019         (mtext_ncpy): Likewise.
4020         (mtext_copy): Likewise.
4021         (mtext_duplicate): Call insert instead of copy.
4022         (mtext_del): Pay attention to format other than utf-8.
4023         (mtext_ins): Simply call insert.
4024         (mtext_ins_char): Pay attention to format other than utf-8.
4025         (mtext_tok): Call insert instead of copy.
4026         (mtext_text): Call UNIT_BYTES.
4027
4028         * textprop.c (mtext__adjust_plist_for_change): New function.
4029
4030         * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
4031         (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
4032         (CHAR_UNITS_AT): Fix typo.
4033         (CHAR_UNITS_BY_HEAD): Fix typo.
4034         (STRING_CHAR_AND_UNITS): Fix typo.
4035
4036         * internal.h (MTEXT_READ_ONLY_P): New macro. 
4037
4038         * mtext.h (mtext__replace): Delete the extern.
4039         (mtext__adjust_foramt): Adjust prototype.
4040
4041         * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
4042         if possible.  Otherwise make a copy of mmt.
4043
4044         * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
4045         utf-8.
4046
4047 2004-06-18  Kenichi Handa  <handa@m17n.org>
4048
4049         * character.h (CHAR_STRING_UTF16): Fix syntax.
4050
4051 2004-06-16  Kenichi Handa  <handa@m17n.org>
4052
4053         * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
4054         (libm17n_X_la_LIBADD): Delete it.
4055         (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
4056
4057         * m17n-X.c (device_open): Add parens in `if' condition.
4058
4059         * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
4060         (DEC_POSITION): Likewise.
4061         (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
4062
4063 2004-06-15  Kenichi Handa  <handa@m17n.org>
4064
4065         * fontset.c (mfont__lookup_fontset): Fix selection of font groups
4066         by language.
4067
4068         * draw.c (compose_glyph_string): If langauge is specified, call
4069         mface__for_chars even if a text is all latin.  Fix condition for
4070         setting non_ascii_found.
4071
4072         * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
4073
4074         * m17n.h (minput_char_to_key): Delete extern.
4075
4076         * m17n-gui.h (minput_event_to_key): Cancel previous change.
4077
4078         * m17n-gui.c (null_device_open): Set several members of frame.
4079
4080 2004-06-14  Kenichi Handa  <handa@m17n.org>
4081
4082         * m17n-gui.h (minput_event_to_key): Delete extern.
4083
4084         * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
4085
4086         * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
4087
4088         * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
4089
4090 2004-06-08  Kenichi Handa  <handa@m17n.org>
4091
4092         * character.c (mchar_put_prop): Don't increment the ref-count of
4093         record->table.
4094
4095 2004-06-04  Kenichi Handa  <handa@m17n.org>
4096
4097         * m17n-core.c (mdebug__register_object): New function.
4098         (mdebug__unregister_object): Likewise.
4099
4100         * internal.h (mdebug__register_object, mdebug__unregister_object):
4101         Extern them.
4102         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
4103         respectively.
4104
4105         * charset.c (mcharset__load_from_database): Don't call
4106         mconv__register_charset_coding here.
4107
4108         * coding.c (find_coding): Get a real name from an element of
4109         coding_definition_list.
4110         (mconv__register_charset_coding): Set the real name at the top of
4111         param.
4112         (mcoding__load_from_database): Likewise.
4113         (mconv_list_codings): Adjusted for the above change.
4114
4115 2004-06-03  Kenichi Handa  <handa@m17n.org>
4116
4117         * coding.c (find_coding): Find by canonicalized name.  Don't have
4118         to modify the element of coding_definition_list by
4119         mplist__from_plist.
4120         (mconv__define_coding_from_charset): Delete it.
4121         (mconv__register_charset_coding): Canonicalize sym.
4122         (mcoding__load_from_database): Register plist modified by
4123         mplist__from_plist.
4124
4125         * coding.h (mconv__define_coding_from_charset): Don't extern it.
4126
4127         * font-ft.c (ft_open): Fix setting of rfont->descent.
4128
4129 2004-06-02  Kenichi Handa  <handa@m17n.org>
4130
4131         * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
4132         (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
4133         (xlfd_unparse_name): Renamed from xfont_build_name.
4134         (mfont__init): Initialized Mfontconfig.
4135         (mfont__free_realized): Unconditionally unref rfont->info.
4136         (mfont__select): Free `this' if it's not best.
4137         (mfont__open): Don't check frame->realized_font_list.
4138         (mfont__parse_name_into_font): New function.
4139         (Mfontconfig): New variable.
4140         (mfont_from_name): Call mfont_parse_name.
4141         (mfont_name): Call mfont_unparse_name.
4142         (mdebug_dump_font): Likewise.
4143
4144         * font.h (struct MFontDriver): Delete members parse_name and
4145         build_name.
4146         (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
4147         (mfont__parse_name_into_font): Extern it.
4148
4149         * font-ft.c: Include "symbol.h".
4150         (close_ft): Unconditionally free filename and charmap_list of
4151         ft_into.
4152         (ft_open): Duplicate base->filename.  Increment ref-count of
4153         ft_info->charmap_list.  Free ft_info->charmap_list and
4154         ft_info->filename on error.
4155         (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
4156
4157         * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
4158         xfont_build_name.
4159         (enum xlfd_field_idx): Moved to font.c.
4160         (split_font_name, build_font_name): Likewise.
4161         (build_font_list): Call mfont__parse_name_info_font.
4162         (xfont_open): Call mfont__unparse_name.  Free name.
4163         (xfont_parse_name, xfont_build_name): Moved to font.c
4164         (xft_select): Prototype deleted.
4165         (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
4166         Call mfont_pase_name.
4167
4168         * m17n-gui.c (free_frame): Unref frame->font_driver_list.
4169         (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
4170         (mframe): Likewise.
4171
4172         * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
4173         Extern them.
4174
4175         * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
4176
4177 2004-06-01  Kenichi Handa  <handa@m17n.org>
4178
4179         * fontset.c (mfontset_modify_entry): Pay attention to the case
4180         that fontset->font_spec_list is NULL.
4181
4182 2004-05-31  Kenichi Handa  <handa@m17n.org>
4183
4184         * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
4185
4186         * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
4187
4188         * font.c (mfont__select): Print score the a font for debugging.
4189
4190         * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
4191
4192         * coding.c (reset_coding_sjis): Check kanji and kana instead of
4193         kanji_sym and kana_sym.
4194
4195 2004-05-28  Kenichi Handa  <handa@m17n.org>
4196
4197         * Makefile.am (VINFO): New variable.
4198         (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
4199         (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
4200
4201 2004-05-27  Kenichi Handa  <handa@m17n.org>
4202
4203         The following chanages are to make device dependent functions
4204         accessible only from MDeviceDriver structure, and to add GD and
4205         null device drivers.  Font drivers get also device dependent.
4206
4207         * m17n.c (m17n_init): Increament shell_initialized.
4208         (m17n_fini): Decremented shell_initialized.
4209
4210         * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
4211
4212         * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
4213         (Mwidget, Mcolormap, Mx): Extern them.
4214
4215         * m17n-gui.c: Include <dlfcn.h> and "config.h".
4216         (free_frame): Call frame->driver->close instead of
4217         mwin__close_device.
4218         (DLOPEN_SHLIB_EXT): New macro.
4219         (MDeviceLibraryInterface): New type.
4220         (device_library_list): New variable.
4221         (register_device_library): New function.
4222         (null_device): New variable.
4223         (null_device_close, null_device_get_prop)
4224         (null_device_realize_face, null_device_free_realized_face): New
4225         function.
4226         (null_driver): New variable.
4227         (null_device_init, null_device_fini, null_device_open): New
4228         functions.
4229         (null_interface): New variable.
4230         (Mfreetype, Mdevice): Declare them.
4231         (m17n_init_win): Increment win_initialized.  Initialize Mx, Mgd,
4232         Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
4233         Mwin__Close_Device.  Register drivers for Mx and Mgd.
4234         (m17n_fini_win): Decremented win_initialized.  Call "fini"
4235         function of all opened devices.  Don't call mwin__fini.
4236         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
4237         Declare them here.
4238         (mframe): Handle Mdevice key of PLIST.
4239         (mframe_get_prop): Call frame->device->get_prop instead of
4240         mwin__device_get_prop.
4241
4242         * m17n-gd.c: New file.
4243
4244         * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
4245         (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
4246
4247         * m17n-core.c (m17n_init_core): Increate core_initialized.
4248         (m17n_fini_core): Decremented core_initialized.
4249
4250         * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
4251         (Mcolormap): Don't extern them here.
4252
4253         * m17n-X.c (FRAME_DEVICE): New macro.
4254         (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
4255         (free_display_info): Use MPLIST_DO.
4256         (free_device): Free rface->info.
4257         (xft_close): Delete it.
4258         (device_init): Renamed from mwin__init.
4259         (device_fini): Renamed from mwin__fini.
4260         (device_open): Renamed from mwin__open_device.
4261         (x_driver): New variable.
4262         (MXFontInfo): Delete member frame, add member display.
4263         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
4264         Don't declare them here.
4265
4266         * internal-gui.h (MDeviceType): New enum.
4267         (MWDefice): Delete it.
4268         (struct MFrame): Change type of device to void *.  New members
4269         device_type, driver, font_driver_list.
4270         (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
4271         (MDeviceDriver): New type.
4272         (Mx, Mgd, Mfreetype): Extern them.
4273         (mwin__XXX): Delete all of them.
4274
4275         * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
4276         mwin__XXX.
4277         (win_destroy_ic): Likewise.
4278         (adjust_window_and_draw): Likewise.
4279         (win_callback): Likewise.
4280         (Mxim): Declare it here.
4281         (minput_event_to_key): Call M_CHECK_READABLE.
4282
4283         * fontset.c (mfont__lookup_fontset): Delete local variable
4284         font_group.
4285
4286         * font.h (struct MFontDriver): Delete member close, add members
4287         parse_name and build_name.
4288         (mfont__driver_list): Delete extern.
4289         (mfont__close): Delete extern.
4290
4291         * font.c (mfont__init): Don't set mfont__driver_list.
4292         (mfont__fini): Don't unref mfont__driver_list.
4293         (mfont__select): Try font drivers in frame->font_driver_list.  Set
4294         driver member of a realized font.
4295         (mfont__close): Delete it.
4296         (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
4297         functions of the default frame.
4298
4299         * font-ft.c (close_ft): Check ft_info->ft_face and work
4300         differently.
4301         (add_font_info): Allocate ft_info by M17N_OBJECT.
4302         (ft_close): Delete it.
4303         (mfont__ft_driver): Don't set ft_close.
4304         (ft_select): Increment ref-count of best_font.
4305         (ft_open): Decremented ref-count of base.  On error, call
4306         FT_Done_Face and free ft_info.
4307         (ft_find_metric): Always use XXX_MONO in load_flags.
4308         (ft_render): Fix setting of width.  Call
4309         frame->driver->draw_points instead of mwin__draw_points.
4310         (ft_to_prop): Don't set mfont__driver_list.
4311         (mfont__ft_fini): Just unref ft_info.
4312
4313         * face.c (mface__init): Exchange foreground and background of
4314         mface__default.  Call mface_put_prop to set hline of
4315         mface_underline,
4316         (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
4317         (mface__free_realized): Don't call mwin__free_realized_face.
4318
4319         * draw.c (Mdepth): Don't declare it here.
4320         (draw_background): Call frame->driver->XXX instead of mwin__XXX.
4321         (render_glyphs, render_glyph_string): Likewise.
4322         (mdraw__init): Don't set Mdepth.
4323         (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
4324         M_CHECK_WRITABLE.
4325         (mdraw_text_per_char_extents): Return 0 on success and -1 on
4326         error.
4327         (mdraw_text_items): Check FRAME is writable.
4328         (mdraw_per_char_extents): Implement body.
4329
4330         * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
4331         libm17n-gd.la.
4332         (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
4333         (GUI_SOURCES): Delete it.
4334         (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
4335         (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
4336         (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
4337         (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
4338         (linkgui_LDADD): Set to libm17n-gui.la
4339         (linkgui_LDFLAGS): New target.
4340         (SRC): Include ${libm17n_gui_la_SOURCES} and
4341         ${libm17n_gd_la_SOURCES}.
4342
4343 2004-05-24  Kenichi Handa  <handa@m17n.org>
4344
4345         * draw.c (draw_background): Don't draw background even if
4346         rface->face.property[MFACE_BACKGROUND] is not Mnil.
4347
4348 2004-05-22  Kenichi Handa  <handa@m17n.org>
4349
4350         * m17n-X.c (xft_open_font): Fix anti_alias setting.
4351
4352 2004-05-20  Kenichi Handa  <handa@m17n.org>
4353
4354         * m17n-gui.h (MFaceHookFunc): Change this function type to void.
4355
4356         * m17n-gui.c: Include "plist.h".
4357         (mframe): If PLIST is NULL, initialize it to emply plist.
4358
4359         * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
4360         (xft_driver): New variable.
4361         (xft_select, close_xft, xft_open_font, xft_open, xft_close)
4362         (xft_find_metric, xft_render): New function.
4363         (mwin__init): Adjusted for the new mfont__driver_list.
4364         (mwin__open_device): Assume arg PARAM is not NULL.  Push a newly
4365         generated face to PARAM.
4366         (mwin__realize_face): Fix setting of box colors.  Don't call hook
4367         function here.
4368         (mwin__draw_hline): New function.
4369         (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
4370         (mwin__xft_render): Delete these function.
4371
4372         * internal-gui.h (struct MFrame): New member tick.
4373         (struct MGlyphString): New member tick.
4374         (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
4375         (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
4376         (mwin__xft_render): Delete extern.
4377
4378         * fontset.c (mfont__lookup_fontset): Make the code simpler.
4379         (mfontset): Always increment the reference count of returned
4380         object.
4381
4382         * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
4383         (MFTInfo): Moved to font.h.
4384         (ft_iso8859_1_font_list): Delete this variable.
4385         (set_font_info): Don't set font->property[MFONT_TYPE].
4386         (set_font_info): Don't udpate ft_iso8859_1_font_list.
4387         (add_font_info): Change type to void.
4388         (fc_list): Change anme from xft_list.  Caller changed.  Include
4389         FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
4390         (mfont__ft_driver): Change name from ft_driver.  Caller changed.
4391         (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
4392         (close_ft): Don't call mwin__xft_close.  Unref
4393         ft_info->extra_info.
4394         (ft_open): Don't setup ft_info->fontname.  Don't call
4395         mwin__xft_open.
4396         (ft_find_metric): Don't call mwin__xft_get_metric.
4397         (ft_encode_char): Call rfont->driver->open instead of ft_open.
4398         (ft_render): Don't check HAVE_XFT2.  Don't call mwin__xft_render.
4399         (mfont__ft_init): Adjusted for new mfont__driver_list.
4400         (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
4401
4402         * font.c (mfont__driver_list): Make it MPlist.
4403         (mfont__init): Adjust initialization of mfont__driver_list.
4404         (mfont__fini): Free mfont__driver_list.
4405         (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
4406         (mfont__select): Adjusted for the new mfont__driver_list.
4407
4408         * font.h (enum MFontProperty): Delete MFONT_TYPE.
4409         (mfont__drirver_list): Adjust prototype.
4410         (MFTInfo): Move to here from fron.c.  Deleve member fontname.
4411
4412         * face.h (struct MFace): Delete member realized_face_list, add
4413         member frame_list.
4414         (struct MRealizedFace): Delete member need_update
4415         andnofont_rface, add member non_ascii_list.
4416         (mface__update_frame_face): Extern it.
4417
4418         * face.c (hline_prop_list, box_prop_list, noop_hook): New
4419         variables.
4420         (get_hline_create, get_box_create): New functions.
4421         (find_realized_face): Cancel previous change.  Arg RFONT deleted.
4422         Use memcmp.
4423         (free_face): Cancep previous change.  Free face->frame_list.
4424         (serialize_hline): Do nothing if hline->width is zero.
4425         (serialize_box): Do nothing if box->width is zero.
4426         (mface__init): Setup all properties of mface__default.
4427         (mface__fini): Free hline_prop_list and box_prop_list.
4428         (mface__realize): Cancel previous change.  Update
4429         face->frame_list.  Setup rface->non_ascii_list.
4430         (mface__for_chars): Update rface->non_ascii_list.
4431         (mface__free_realized): Free rface->non_ascii_list.
4432         (mface__update_frame_face): New function.
4433         (mface): Initialize face->frame_list.
4434         (mface_copy): Likewise.  Just copy MFACE_HLINE and MFACE_BOX
4435         properties.
4436         (mface_merge): Likewise.
4437         (mface_put_prop): If key is Mhline or Mbox, get value by
4438         get_hline_create or get_box_create respectively.
4439         (mface_put_prop): Update frame->tick and call
4440         mface__update_frame_face if necessary.
4441         (mface_update): Do nothing if func is noop_hook.
4442
4443         * draw.c (render_glyphs): If a font is not found, use
4444         mwin__draw_empty_boxes.
4445         (alloc_gstring): Initialize gstring->tick.
4446         (get_gstring): Check gstring->tick.
4447
4448 2004-05-17  Kenichi Handa  <handa@m17n.org>
4449
4450         * face.c (find_realized_face): Return value changed.  If RFONT is
4451         NULL, avoid unnecessary checking.
4452         (free_face): Free face->realized_face_list.
4453         (mface__realize): Adjusted for the change of find_realized_face.
4454         If it returns a realized face that needs update, free it and
4455         realize a new one.  Push a new realized face to
4456         frame->realized_face_list instead of appending.
4457         (mface__for_chars): Adjusted for the change of find_realized_face.
4458         Short cut if the required font is in rface->ascii_rface.
4459         (mface_put_prop): Free old value if necessary.  Set need_update
4460         member of realized faces to 1.
4461
4462         * face.h (struct MFace): Delete member tick, add member
4463         realized_face_list.
4464         (struct MRealizedFace): Delete member tick, add member
4465         need_update.
4466
4467 2004-05-13  Kenichi Handa  <handa@m17n.org>
4468
4469         * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
4470
4471 2004-05-12  Kenichi Handa  <handa@m17n.org>
4472
4473         * internal-gui.h (mwin__xft_open): Arguemnt name changed.
4474
4475         * m17n-X.c (mwin__xft_open): Argument changed to fontname and
4476         parse it XftNameParse.
4477
4478         * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
4479         (all_fonts_scaned): New variable.
4480         (set_font_info): FAMILY may be Mnil.
4481         (add_font_info): Argument changed.
4482         (xft_list): Call add_font_info in it.
4483         (ft_list): Likewise.
4484         (ft_select): Make it work in the case family is Mnil.
4485         (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
4486         (mfont__ft_fini): Set all_fonts_scaned to 0.
4487
4488         * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
4489         that is failed to open.
4490
4491 2004-05-10  Kenichi Handa  <handa@m17n.org>
4492
4493         * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
4494         device's depth is 1 (i.e. monochrome).
4495
4496         * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
4497         to work around the problem of libtool.
4498
4499         * font-ft.c: Include <freetype/ftbdf.h>.
4500         (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
4501         variables.
4502         (mfont__ft_init): Initialize them.
4503         (ft_iso8859_1_font_list): New variable.
4504         (set_font_info): Detect a font containing iso8859-1 glyphs and
4505         register it in ft_iso8859_1_font_list.  If the font is not
4506         scalable, assume it as BDF or PCF font and setup SIZE and RESY
4507         properties of the font from its properties.
4508         (add_font_list): If the font is not scalable, check if it is BDF
4509         or PCF font.  If not, ignore it.
4510         (ft_select): If FAMILY is Mnil, return NULL only if the requested
4511         registry is not iso8859-1.
4512         (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
4513         ft_iso8859_1_font_list.
4514         (ft_find_metric): If the font is not scalable, assume it as BDF
4515         or PCF, and get a metric from its properties.
4516         (mfont__ft_fini): Free ft_iso8859_1_font_list.
4517
4518 2004-05-07  Kenichi Handa  <handa@redhat.m17n.org>
4519
4520         * Makefile.am (libm17n_la_LIBADD): Include -ldl.
4521         (libm17n_la_LDFLAGS): Delete it.
4522         (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
4523         (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
4524
4525 2004-05-06  Kenichi Handa  <handa@m17n.org>
4526
4527         * draw.c (compose_glyph_string): Fix previous change.
4528
4529 2004-04-30  Kenichi Handa  <handa@m17n.org>
4530
4531         * font-ft.c (ft_list): Delete unused variable `result'.
4532         (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
4533
4534 2004-04-27  Kenichi Handa  <handa@m17n.org>
4535
4536         * m17n-X.c: Include config.h
4537         [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
4538         (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
4539         (MWDevice) [HAVE_XFT2]: New member xft_draw.
4540         (FRAME_CMAP, FRAME_VISUAL): New macros.
4541         (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
4542         (xfont_driver): Make it static.
4543         (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
4544         (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
4545         info->xft_color_back.
4546         (MXftFontInfo) [HAVE_XFT2]: New type.
4547         (mwin__xft_close) [HAVE_XFT2]: New function.
4548         (mwin__xft_open) [HAVE_XFT2]: New function.
4549         (mwin__xft_get_metric) [HAVE_XFT2]: New function.
4550         (mwin__xft_render) [HAVE_XFT2]: New function.
4551
4552         * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
4553         (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
4554         (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
4555         externs.
4556
4557         * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
4558
4559         * font-ft.c: Don't include FT_FREETYPE_H here.
4560         [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
4561         (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
4562         (MFTInfo): New member charmap_index.
4563         (MFTInfo) [HAVE_XFT2]: New member xft_info.
4564         (check_otf_filename): Renamed from check_filename.  Return value
4565         changed.
4566         (ft_set_property): This function deleted.
4567         (set_font_info): New function.
4568         (add_font_list): Argument changed.  Add multiple fonts.
4569         (xft_list) [HAVE_XFT2]: New function.
4570         (ft_list) [not HAVE_XFT2]: New function.
4571         (ft_select): Add code for Xft.
4572         (close_ft): Likewise.
4573         (ft_open): Likewise.
4574         (ft_find_metric): Likewise.
4575         (ft_encode_char): Likewise.
4576         (ft_render): Likewise.
4577
4578         * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
4579
4580 2004-04-26  Kenichi Handa  <handa@m17n.org>
4581
4582         * textprop.c (mtext_attach_property): Declare the return type as
4583         `int'.
4584
4585 2004-04-21  Kenichi Handa  <handa@m17n.org>
4586
4587         * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
4588
4589 2004-04-09  Kenichi Handa  <handa@m17n.org>
4590
4591         * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
4592         seq_to.
4593         (load_command): Setup above members.
4594
4595 2004-04-05  Kenichi Handa  <handa@m17n.org>
4596
4597         * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
4598
4599 2004-03-30  Kenichi Handa  <handa@m17n.org>
4600
4601         * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
4602         >= 0x10000.
4603
4604         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
4605         (M17NLIB_VERSION_NAME): Changed to 1.0.2.
4606
4607 2004-03-29  Kenichi Handa  <handa@m17n.org>
4608
4609         * Version 1.0 Patch Level 2 released.
4610
4611 2004-03-29  Kenichi Handa  <handa@m17n.org>
4612
4613         * charset.c (make_charset): Set charset->fully_loaded and
4614         charset->simple correctly.  Don't try to get charset->min_char and
4615         charset->max_char for a charset of method subset and superset.
4616         Don't load a mapping file here.
4617         (mcharset__init): Set unified_max.
4618         (mcharset__load_from_database): Free a working plist.
4619
4620         * coding.c (mcoding__fini): Free all malloced data.
4621
4622         * input-gui.c (win_create_ic): Set control.as_image for preediting
4623         to 0.
4624
4625         * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
4626         `count') to initialize the array.
4627
4628         * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
4629         M17N_OBJECT_UNREF.
4630
4631         * m17n-X.c (xfont_render): If rface->rfont is null, draw a
4632         rectangle.
4633         (mwin__create_window): Fix bug of setting a background pixel of a
4634         new window.
4635         (mwin__adjust_window): Clear the window before drawing.
4636
4637         * m17n-core.c (mdebug__report_object): Free array->objectes if
4638         necessary.
4639         (m17n_init_core): Don't set report_header_printed to 0 here.
4640         Fix debugging information.
4641         (m17n_fini_core): Set report_header_printed to 0 here.
4642
4643         * m17n-core.h (mplist_deserialize): Extern it.
4644
4645         * m17n-gui.c (m17n_fini_win): Fix debugging information.
4646
4647         * m17n.c (m17n_fini): Fix debugging information.
4648
4649         * mtext.c (mtext__adjust_foramt): New function.
4650
4651         * mtext.h (mtext__adjust_foramt): Extern it.
4652
4653         * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
4654
4655         * plist.h (mplist__deserialize): Don't extern it.
4656
4657         * symbol.c (msymbol__fini): Set freed_symbols to 0.  Set all
4658         elements of symbol_table to NULL.  Report about created and freed
4659         symbols if MDEBUG_FINI is set.
4660
4661 2004-03-22  Kenichi Handa  <handa@m17n.org>
4662
4663         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
4664
4665         * m17n.c (m17n_init): Fix the way of checking merror_code.
4666
4667         * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
4668
4669 2004-03-22  Kenichi Handa  <handa@m17n.org>
4670
4671         * fontset.c (realize_font_group): Adjust the font size by
4672         mfont__resize before selecting a font.
4673
4674         * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
4675
4676 2004-03-19  Kenichi Handa  <handa@m17n.org>
4677
4678         * Version 1.0 Patch Level 1 released.
4679
4680 2004-03-19  Kenichi Handa  <handa@m17n.org>
4681
4682         * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
4683
4684         * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
4685
4686 2004-03-19  Kenichi Handa  <handa@m17n.org>
4687
4688         Re-apply the changes forgotten in the released version.
4689
4690         * charset.c (mcharset__load_from_database): Call
4691         mchar_define_charset.
4692
4693         * coding.c (encode_unsupporeted_char): Put Mcoding text property.
4694         (mconv_encode_range): Put Mcoding text property.
4695
4696 2004-03-18  Kenichi Handa  <handa@m17n.org>
4697
4698         * draw.c (Mdepth): New variable.
4699         (visual_order): Delete unused local var `pos'.
4700         (compose_glyph_string): Fix for the case that gstring->glyphs is
4701         realloced.  Stop generating glyphs at TO.  Fix handling of
4702         control charaters.
4703         (layout_glyphs): Get metrics of all glyphs in advance.  Set
4704         lbearing and rbearing of base of composition glyph correctly.
4705         Handle left-overhang glyphs correctly.
4706         (alloc_gstring): New arg frame.  Set gstring->anti_alias.  Caller
4707         changed.
4708         (dump_combining_code): Change the defualt off_x character to ".".
4709         (mdraw__init): Initialize Mdepth.
4710
4711         * face.c (work_gstring): New variable
4712         (mface__init): Initialize work_gstring.
4713         (mface__fini): Free work_gstring.glyphs.
4714         (mface__realize): Don't handle videomode property here.  Adjusted
4715         for the change of mfont__get_metric.
4716         (mface__for_chars): Adjusted for the change of mfont__get_metric.
4717
4718         * face.h (enum face_gc): Moved to m17n-X.c.
4719
4720         * font.h (struct MFontDriver): Arguments of find_metric changed.
4721         (mfont__select): Prototype adjusted.
4722         (mfont__get_metric): Likewise.
4723         (mfont__ft_drive_otf): Likewise.
4724         (mfont__flt_run): Likewise.
4725         
4726         * font.c (mfont__select): New argument layouter.  If layouter is
4727         different in the registered font, make a new copy of realized
4728         font.
4729         (mfont__get_metric): Argument changed.  Get metrics of multiple
4730         glyphs.
4731         (mfont_find): Call mfont__select with layouter as Mnil.
4732
4733         * font-flt.c (FontLayoutContext): New member rfont.
4734         (run_otf): Adjusted for the change of mfont__ft_drive_otf.
4735         (mfont__flt_run): Argument changed.  Initialize ctx.rfont.
4736
4737         * font-ft.c (ft_find_metric): Arguments changed.  Get metrics of
4738         multiple glyphs.
4739         (NUM_POINTS): New macro.
4740         (MPointTable): New type.
4741         (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
4742         (mfont__ft_drive_otf): New argument rfont.
4743
4744         * fontset.c (realize_font_group): Adjusted for the changed of
4745         mfont__select.
4746         (check_fontset_element): This function deleted.
4747
4748         * input-gui.c (adjust_window_and_draw): Locate a preedit window
4749         off the parent window if the preedit text is zero length.
4750
4751         * internal-gui.h (struct MFrame): New members foreground,
4752         background, videomode, font.
4753         (struct MGlyphString): New member anti_alias.
4754         (MDrawPoint): New type.
4755         (mwin__draw_bitmap): Prototype deleted.
4756         (mwin__draw_points): Prototype added.
4757
4758         * m17n-gui.h (MDrawControl): New member anti_alias.
4759
4760         * m17n-gui.c (free_frame): Free frame->font.
4761         (mframe): Set the fontset of frame->face to the default fontset.
4762
4763         * m17n-X.c (RGB_GC): New type.
4764         (enum gc_index): Renamed from enum face_gc.  Member names changed.
4765         (GCInfo): New typel
4766         (struct MWDevice): Members foreground and background deleted.  New
4767         member scratch_gc, gc_list.
4768         (DEFAULT_FONT, FALLBACK_FONT): New macros.
4769         (free_device): Free GCs in device->gc_list.
4770         (get_rgb_gc): New function.
4771         (get_gc): Renamed and argument changed from get_color.
4772         (get_gc_for_anti_alias): New function.
4773         (xfont_find_metric): Arguments changed.  Get metrics of multiple
4774         glyphs.
4775         (set_region): Argument changed.  Caller changed.
4776         (xfont_render): Allways set a font in gc.
4777         (x_error_handler, x_io_error_handler): Define only if
4778         X_SET_ERROR_HANDLER is defined.
4779         (mwin__open_device): Create device->scratch_gc.  Set members
4780         foreground, background, and videomode of frame.  Call
4781         XSetErrorHandler and XSetIOErrorHandler only if
4782         X_SET_ERROR_HANDLER is defined.
4783         (struct gc_list): Deleted.
4784         (REGISTER_GC, UNREGISTER_GC): These macros deleted.
4785         (mwin__realize_face): Adjusted for the change of the format of
4786         rface->info and the charge of set_region.
4787         (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
4788         (mwin__draw_box): Likewise.
4789         (mwin__draw_bitmap): This function deleted.
4790         (mwin__draw_points): New function.
4791         (mwin__verify_region): Adjusted for the change of the format of
4792         rface->info and the charge of set_region.
4793         (mwin__create_window): Inherit backgound pixel from parent.
4794         (mwin__dump_gc): Adjusted for the change of the format of
4795         rface->info.
4796
4797 2004-03-16  Kenichi Handa  <handa@m17n.org>
4798
4799         * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
4800
4801         * input.c (M_key_alias): New variable.
4802         (handle_key): Try M_key_alias property of a key too.
4803         (minput__init): Initialize M_key_alias.  Give that property to
4804         symbols in one_char_symbol.  Fix bug of initializing
4805         one_char_symbol.
4806
4807         * draw.c (compose_glyph_string): Don't handle
4808         ignore_formatting_char here.  Include formatting characters in the
4809         range processed by a FTL.
4810         (layout_glyph_string): Handle ignore_formatting_char here.
4811
4812 2004-03-12  Kenichi Handa  <handa@m17n.org>
4813
4814         * input-gui.c (win_create_ic): Enable bidi in status control.
4815
4816         * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
4817
4818 2004-03-09  Kenichi Handa  <handa@m17n.org>
4819
4820         * input.c (load_input_method): If title is not specified, use the
4821         input method name as title.
4822
4823         * m17n-X.c (get_color): Make it static.
4824         (xim_create_ic, xim_destroy_ic, x_error_handler)
4825         (x_io_error_handler): Likewise.
4826
4827 2004-03-01  Kenichi Handa  <handa@m17n.org>
4828
4829         * Version 1.0 released.
4830
4831 \f
4832 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4833   National Institute of Advanced Industrial Science and Technology (AIST)
4834   Registration Number H15PRO112
4835
4836 This file is part of the m17n library.
4837
4838 The m17n library is free software; you can redistribute it and/or
4839 modify it under the terms of the GNU Lesser General Public License
4840 as published by the Free Software Foundation; either version 2.1 of
4841 the License, or (at your option) any later version.
4842
4843 The m17n library is distributed in the hope that it will be useful,
4844 but WITHOUT ANY WARRANTY; without even the implied warranty of
4845 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4846 Lesser General Public License for more details.
4847
4848 You should have received a copy of the GNU Lesser General Public
4849 License along with the m17n library; if not, write to the Free
4850 Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
4851 Boston, MA 02110-1301, USA.