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