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