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