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