dabf35cf0c89ecb05ca6e976f878dc5bfa857ffb
[m17n/m17n-lib.git] / src / ChangeLog
1 2004-06-24  Kenichi Handa  <handa@m17n.org>
2
3         * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
4
5         * character.c (mchar_define_property): Add const to an arg.
6
7         * charset.c (mchar_define_charset): Add const to an arg.
8
9         * coding.c (MCodingSystem): Add const to an arg or decoder.
10         (finish_decoding): Add const to an arg.
11         (decode_coding_charset, decode_coding_utf_8)
12         (decode_coding_utf_16, decode_coding_utf_32)
13         (decode_coding_iso_2022, decode_coding_sjis)
14         (mconv_define_coding): Likewise.
15
16         * m17n-X.c (xft_find_metric): Delete unused variable.
17
18         * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
19         prototypes.
20
21         * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
22         prototypes.
23
24         * mtext.c (count_utf_8_chars, count_utf_16_chars)
25         (mtext__from_data, mtext_from_data): Add `const' to an arg.
26
27         * mtext.h (mtext__from_data): Ajust prototype.
28
29 2004-06-23  Kenichi Handa  <handa@m17n.org>
30
31         * draw.c (compose_glyph_string): Always get glyph codes by
32         mface__for_char.
33         (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
34         (mdraw_glyph_list): New function.
35
36         * font-flt.c (mfont__flt_run): Be sure to call
37         rfont->driver->encode_char.
38
39         * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
40         (ft_encode_char): Delete arg C.
41         (ft_render): Don't call FT_Get_Char_Index.
42
43         * font.c (mfont__encodable_p): Delete it.
44         (mfont__encode_char): Be sure to call rfont->driver->encode_char.
45
46         * font.h (struct MFontDriver): Delete arg C of encode_char.
47         (mfont__encodable_p): Delete extern.
48
49         * m17n-X.c (xfont_encode_char): Delete arg C.
50         (xft_find_metric): Don't cal FT_Get_Char_Index.
51         (xft_render): Likewise.
52
53         * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
54         logical_width.
55         (mdraw_glyph_list): Extern it.
56
57         * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
58
59 2004-06-22  Kenichi Handa  <handa@m17n.org>
60
61         * m17n-gui.h (mfontset_lookup): Extern it.
62
63         * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
64
65         * fontset.c (realize_fontset_elements)
66         (free_realized_fontset_elements, update_fontset_elements): New
67         functions.
68         (mfont__realize_fontset): Call realize_fontset_elements.
69         (mfont__free_realized_fontset): Call free_realized_fontset_elements.
70         (mfont__lookup_fontset): If a fontset was modified, update
71         the realized fontset.
72         (mfontset_modify_entry): Increment fontset->tick.
73         (mfontset_lookup): New function.
74
75 2004-06-21  Kenichi Handa  <handa@m17n.org>
76
77         * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
78
79         * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
80         (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
81         length of source text 0.
82
83 2004-06-21  Kenichi Handa  <handa@m17n.org>
84
85         * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
86         (compare): Pay attention to format other than utf-8.
87         (copy): Delete this function.
88         (count_by_utf_8, count_by_utf_16, insert): New functions.
89         (count_utf_16_chars): Fix handling of a surrogate pair.
90         (find_char_forward, find_char_backward): Likewise.
91         (mtext__from_data): Delete unnecessary check.  Fix number of
92         allocated bytes.
93         (mtext_from_data): Don't count items.
94         (mtext_ref_char): Optimize the code.
95         (mtext_set_char): Pay attention to format other than utf-8.
96         (mtext_cat_char): Likewise.
97         (mtext_dup): Don't call copy, instead do allocation here.
98         (mtext_cat): Call insert instead of copy.
99         (mtext_ncat): Likewise.
100         (mtext_cpy): Delete character at first and call insert instead of
101         copy.
102         (mtext_ncpy): Likewise.
103         (mtext_copy): Likewise.
104         (mtext_duplicate): Call insert instead of copy.
105         (mtext_del): Pay attention to format other than utf-8.
106         (mtext_ins): Simply call insert.
107         (mtext_ins_char): Pay attention to format other than utf-8.
108         (mtext_tok): Call insert instead of copy.
109         (mtext_text): Call UNIT_BYTES.
110
111         * textprop.c (mtext__adjust_plist_for_change): New function.
112
113         * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
114         (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
115         (CHAR_UNITS_AT): Fix typo.
116         (CHAR_UNITS_BY_HEAD): Fix typo.
117         (STRING_CHAR_AND_UNITS): Fix typo.
118
119         * internal.h (MTEXT_READ_ONLY_P): New macro. 
120
121         * mtext.h (mtext__replace): Delete the extern.
122         (mtext__adjust_foramt): Adjust prototype.
123
124         * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
125         if possible.  Otherwise make a copy of mmt.
126
127         * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
128         utf-8.
129
130 2004-06-18  Kenichi Handa  <handa@m17n.org>
131
132         * character.h (CHAR_STRING_UTF16): Fix syntax.
133
134 2004-06-16  Kenichi Handa  <handa@m17n.org>
135
136         * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
137         (libm17n_X_la_LIBADD): Delete it.
138         (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
139
140         * m17n-X.c (device_open): Add parens in `if' condition.
141
142         * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
143         (DEC_POSITION): Likewise.
144         (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
145
146 2004-06-15  Kenichi Handa  <handa@m17n.org>
147
148         * fontset.c (mfont__lookup_fontset): Fix selection of font groups
149         by language.
150
151         * draw.c (compose_glyph_string): If langauge is specified, call
152         mface__for_chars even if a text is all latin.  Fix condition for
153         setting non_ascii_found.
154
155         * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
156
157         * m17n.h (minput_char_to_key): Delete extern.
158
159         * m17n-gui.h (minput_event_to_key): Cancel previous change.
160
161         * m17n-gui.c (null_device_open): Set several members of frame.
162
163 2004-06-14  Kenichi Handa  <handa@m17n.org>
164
165         * m17n-gui.h (minput_event_to_key): Delete extern.
166
167         * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
168
169         * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
170
171         * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
172
173 2004-06-08  Kenichi Handa  <handa@m17n.org>
174
175         * character.c (mchar_put_prop): Don't increment the ref-count of
176         record->table.
177
178 2004-06-04  Kenichi Handa  <handa@m17n.org>
179
180         * m17n-core.c (mdebug__register_object): New function.
181         (mdebug__unregister_object): Likewise.
182
183         * internal.h (mdebug__register_object, mdebug__unregister_object):
184         Extern them.
185         (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
186         respectively.
187
188         * charset.c (mcharset__load_from_database): Don't call
189         mconv__register_charset_coding here.
190
191         * coding.c (find_coding): Get a real name from an element of
192         coding_definition_list.
193         (mconv__register_charset_coding): Set the real name at the top of
194         param.
195         (mcoding__load_from_database): Likewise.
196         (mconv_list_codings): Adjusted for the above change.
197
198 2004-06-03  Kenichi Handa  <handa@m17n.org>
199
200         * coding.c (find_coding): Find by canonicalized name.  Don't have
201         to modify the element of coding_definition_list by
202         mplist__from_plist.
203         (mconv__define_coding_from_charset): Delete it.
204         (mconv__register_charset_coding): Canonicalize sym.
205         (mcoding__load_from_database): Register plist modified by
206         mplist__from_plist.
207
208         * coding.h (mconv__define_coding_from_charset): Don't extern it.
209
210         * font-ft.c (ft_open): Fix setting of rfont->descent.
211
212 2004-06-02  Kenichi Handa  <handa@m17n.org>
213
214         * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
215         (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
216         (xlfd_unparse_name): Renamed from xfont_build_name.
217         (mfont__init): Initialized Mfontconfig.
218         (mfont__free_realized): Unconditionally unref rfont->info.
219         (mfont__select): Free `this' if it's not best.
220         (mfont__open): Don't check frame->realized_font_list.
221         (mfont__parse_name_into_font): New function.
222         (Mfontconfig): New variable.
223         (mfont_from_name): Call mfont_parse_name.
224         (mfont_name): Call mfont_unparse_name.
225         (mdebug_dump_font): Likewise.
226
227         * font.h (struct MFontDriver): Delete members parse_name and
228         build_name.
229         (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
230         (mfont__parse_name_into_font): Extern it.
231
232         * font-ft.c: Include "symbol.h".
233         (close_ft): Unconditionally free filename and charmap_list of
234         ft_into.
235         (ft_open): Duplicate base->filename.  Increment ref-count of
236         ft_info->charmap_list.  Free ft_info->charmap_list and
237         ft_info->filename on error.
238         (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
239
240         * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
241         xfont_build_name.
242         (enum xlfd_field_idx): Moved to font.c.
243         (split_font_name, build_font_name): Likewise.
244         (build_font_list): Call mfont__parse_name_info_font.
245         (xfont_open): Call mfont__unparse_name.  Free name.
246         (xfont_parse_name, xfont_build_name): Moved to font.c
247         (xft_select): Prototype deleted.
248         (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
249         Call mfont_pase_name.
250
251         * m17n-gui.c (free_frame): Unref frame->font_driver_list.
252         (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
253         (mframe): Likewise.
254
255         * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
256         Extern them.
257
258         * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
259
260 2004-06-01  Kenichi Handa  <handa@m17n.org>
261
262         * fontset.c (mfontset_modify_entry): Pay attention to the case
263         that fontset->font_spec_list is NULL.
264
265 2004-05-31  Kenichi Handa  <handa@m17n.org>
266
267         * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
268
269         * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
270
271         * font.c (mfont__select): Print score the a font for debugging.
272
273         * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
274
275         * coding.c (reset_coding_sjis): Check kanji and kana instead of
276         kanji_sym and kana_sym.
277
278 2004-05-28  Kenichi Handa  <handa@m17n.org>
279
280         * Makefile.am (VINFO): New variable.
281         (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
282         (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
283
284 2004-05-27  Kenichi Handa  <handa@m17n.org>
285
286         The following chanages are to make device dependent functions
287         accessible only from MDeviceDriver structure, and to add GD and
288         null device drivers.  Font drivers get also device dependent.
289
290         * m17n.c (m17n_init): Increament shell_initialized.
291         (m17n_fini): Decremented shell_initialized.
292
293         * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
294
295         * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
296         (Mwidget, Mcolormap, Mx): Extern them.
297
298         * m17n-gui.c: Include <dlfcn.h> and "config.h".
299         (free_frame): Call frame->driver->close instead of
300         mwin__close_device.
301         (DLOPEN_SHLIB_EXT): New macro.
302         (MDeviceLibraryInterface): New type.
303         (device_library_list): New variable.
304         (register_device_library): New function.
305         (null_device): New variable.
306         (null_device_close, null_device_get_prop)
307         (null_device_realize_face, null_device_free_realized_face): New
308         function.
309         (null_driver): New variable.
310         (null_device_init, null_device_fini, null_device_open): New
311         functions.
312         (null_interface): New variable.
313         (Mfreetype, Mdevice): Declare them.
314         (m17n_init_win): Increment win_initialized.  Initialize Mx, Mgd,
315         Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
316         Mwin__Close_Device.  Register drivers for Mx and Mgd.
317         (m17n_fini_win): Decremented win_initialized.  Call "fini"
318         function of all opened devices.  Don't call mwin__fini.
319         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
320         Declare them here.
321         (mframe): Handle Mdevice key of PLIST.
322         (mframe_get_prop): Call frame->device->get_prop instead of
323         mwin__device_get_prop.
324
325         * m17n-gd.c: New file.
326
327         * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
328         (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
329
330         * m17n-core.c (m17n_init_core): Increate core_initialized.
331         (m17n_fini_core): Decremented core_initialized.
332
333         * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
334         (Mcolormap): Don't extern them here.
335
336         * m17n-X.c (FRAME_DEVICE): New macro.
337         (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
338         (free_display_info): Use MPLIST_DO.
339         (free_device): Free rface->info.
340         (xft_close): Delete it.
341         (device_init): Renamed from mwin__init.
342         (device_fini): Renamed from mwin__fini.
343         (device_open): Renamed from mwin__open_device.
344         (x_driver): New variable.
345         (MXFontInfo): Delete member frame, add member display.
346         (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
347         Don't declare them here.
348
349         * internal-gui.h (MDeviceType): New enum.
350         (MWDefice): Delete it.
351         (struct MFrame): Change type of device to void *.  New members
352         device_type, driver, font_driver_list.
353         (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
354         (MDeviceDriver): New type.
355         (Mx, Mgd, Mfreetype): Extern them.
356         (mwin__XXX): Delete all of them.
357
358         * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
359         mwin__XXX.
360         (win_destroy_ic): Likewise.
361         (adjust_window_and_draw): Likewise.
362         (win_callback): Likewise.
363         (Mxim): Declare it here.
364         (minput_event_to_key): Call M_CHECK_READABLE.
365
366         * fontset.c (mfont__lookup_fontset): Delete local variable
367         font_group.
368
369         * font.h (struct MFontDriver): Delete member close, add members
370         parse_name and build_name.
371         (mfont__driver_list): Delete extern.
372         (mfont__close): Delete extern.
373
374         * font.c (mfont__init): Don't set mfont__driver_list.
375         (mfont__fini): Don't unref mfont__driver_list.
376         (mfont__select): Try font drivers in frame->font_driver_list.  Set
377         driver member of a realized font.
378         (mfont__close): Delete it.
379         (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
380         functions of the default frame.
381
382         * font-ft.c (close_ft): Check ft_info->ft_face and work
383         differently.
384         (add_font_info): Allocate ft_info by M17N_OBJECT.
385         (ft_close): Delete it.
386         (mfont__ft_driver): Don't set ft_close.
387         (ft_select): Increment ref-count of best_font.
388         (ft_open): Decremented ref-count of base.  On error, call
389         FT_Done_Face and free ft_info.
390         (ft_find_metric): Always use XXX_MONO in load_flags.
391         (ft_render): Fix setting of width.  Call
392         frame->driver->draw_points instead of mwin__draw_points.
393         (ft_to_prop): Don't set mfont__driver_list.
394         (mfont__ft_fini): Just unref ft_info.
395
396         * face.c (mface__init): Exchange foreground and background of
397         mface__default.  Call mface_put_prop to set hline of
398         mface_underline,
399         (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
400         (mface__free_realized): Don't call mwin__free_realized_face.
401
402         * draw.c (Mdepth): Don't declare it here.
403         (draw_background): Call frame->driver->XXX instead of mwin__XXX.
404         (render_glyphs, render_glyph_string): Likewise.
405         (mdraw__init): Don't set Mdepth.
406         (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
407         M_CHECK_WRITABLE.
408         (mdraw_text_per_char_extents): Return 0 on success and -1 on
409         error.
410         (mdraw_text_items): Check FRAME is writable.
411         (mdraw_per_char_extents): Implement body.
412
413         * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
414         libm17n-gd.la.
415         (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
416         (GUI_SOURCES): Delete it.
417         (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
418         (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
419         (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
420         (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
421         (linkgui_LDADD): Set to libm17n-gui.la
422         (linkgui_LDFLAGS): New target.
423         (SRC): Include ${libm17n_gui_la_SOURCES} and
424         ${libm17n_gd_la_SOURCES}.
425
426 2004-05-24  Kenichi Handa  <handa@m17n.org>
427
428         * draw.c (draw_background): Don't draw background even if
429         rface->face.property[MFACE_BACKGROUND] is not Mnil.
430
431 2004-05-22  Kenichi Handa  <handa@m17n.org>
432
433         * m17n-X.c (xft_open_font): Fix anti_alias setting.
434
435 2004-05-20  Kenichi Handa  <handa@m17n.org>
436
437         * m17n-gui.h (MFaceHookFunc): Change this function type to void.
438
439         * m17n-gui.c: Include "plist.h".
440         (mframe): If PLIST is NULL, initialize it to emply plist.
441
442         * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
443         (xft_driver): New variable.
444         (xft_select, close_xft, xft_open_font, xft_open, xft_close)
445         (xft_find_metric, xft_render): New function.
446         (mwin__init): Adjusted for the new mfont__driver_list.
447         (mwin__open_device): Assume arg PARAM is not NULL.  Push a newly
448         generated face to PARAM.
449         (mwin__realize_face): Fix setting of box colors.  Don't call hook
450         function here.
451         (mwin__draw_hline): New function.
452         (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
453         (mwin__xft_render): Delete these function.
454
455         * internal-gui.h (struct MFrame): New member tick.
456         (struct MGlyphString): New member tick.
457         (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
458         (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
459         (mwin__xft_render): Delete extern.
460
461         * fontset.c (mfont__lookup_fontset): Make the code simpler.
462         (mfontset): Always increment the reference count of returned
463         object.
464
465         * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
466         (MFTInfo): Moved to font.h.
467         (ft_iso8859_1_font_list): Delete this variable.
468         (set_font_info): Don't set font->property[MFONT_TYPE].
469         (set_font_info): Don't udpate ft_iso8859_1_font_list.
470         (add_font_info): Change type to void.
471         (fc_list): Change anme from xft_list.  Caller changed.  Include
472         FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
473         (mfont__ft_driver): Change name from ft_driver.  Caller changed.
474         (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
475         (close_ft): Don't call mwin__xft_close.  Unref
476         ft_info->extra_info.
477         (ft_open): Don't setup ft_info->fontname.  Don't call
478         mwin__xft_open.
479         (ft_find_metric): Don't call mwin__xft_get_metric.
480         (ft_encode_char): Call rfont->driver->open instead of ft_open.
481         (ft_render): Don't check HAVE_XFT2.  Don't call mwin__xft_render.
482         (mfont__ft_init): Adjusted for new mfont__driver_list.
483         (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
484
485         * font.c (mfont__driver_list): Make it MPlist.
486         (mfont__init): Adjust initialization of mfont__driver_list.
487         (mfont__fini): Free mfont__driver_list.
488         (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
489         (mfont__select): Adjusted for the new mfont__driver_list.
490
491         * font.h (enum MFontProperty): Delete MFONT_TYPE.
492         (mfont__drirver_list): Adjust prototype.
493         (MFTInfo): Move to here from fron.c.  Deleve member fontname.
494
495         * face.h (struct MFace): Delete member realized_face_list, add
496         member frame_list.
497         (struct MRealizedFace): Delete member need_update
498         andnofont_rface, add member non_ascii_list.
499         (mface__update_frame_face): Extern it.
500
501         * face.c (hline_prop_list, box_prop_list, noop_hook): New
502         variables.
503         (get_hline_create, get_box_create): New functions.
504         (find_realized_face): Cancel previous change.  Arg RFONT deleted.
505         Use memcmp.
506         (free_face): Cancep previous change.  Free face->frame_list.
507         (serialize_hline): Do nothing if hline->width is zero.
508         (serialize_box): Do nothing if box->width is zero.
509         (mface__init): Setup all properties of mface__default.
510         (mface__fini): Free hline_prop_list and box_prop_list.
511         (mface__realize): Cancel previous change.  Update
512         face->frame_list.  Setup rface->non_ascii_list.
513         (mface__for_chars): Update rface->non_ascii_list.
514         (mface__free_realized): Free rface->non_ascii_list.
515         (mface__update_frame_face): New function.
516         (mface): Initialize face->frame_list.
517         (mface_copy): Likewise.  Just copy MFACE_HLINE and MFACE_BOX
518         properties.
519         (mface_merge): Likewise.
520         (mface_put_prop): If key is Mhline or Mbox, get value by
521         get_hline_create or get_box_create respectively.
522         (mface_put_prop): Update frame->tick and call
523         mface__update_frame_face if necessary.
524         (mface_update): Do nothing if func is noop_hook.
525
526         * draw.c (render_glyphs): If a font is not found, use
527         mwin__draw_empty_boxes.
528         (alloc_gstring): Initialize gstring->tick.
529         (get_gstring): Check gstring->tick.
530
531 2004-05-17  Kenichi Handa  <handa@m17n.org>
532
533         * face.c (find_realized_face): Return value changed.  If RFONT is
534         NULL, avoid unnecessary checking.
535         (free_face): Free face->realized_face_list.
536         (mface__realize): Adjusted for the change of find_realized_face.
537         If it returns a realized face that needs update, free it and
538         realize a new one.  Push a new realized face to
539         frame->realized_face_list instead of appending.
540         (mface__for_chars): Adjusted for the change of find_realized_face.
541         Short cut if the required font is in rface->ascii_rface.
542         (mface_put_prop): Free old value if necessary.  Set need_update
543         member of realized faces to 1.
544
545         * face.h (struct MFace): Delete member tick, add member
546         realized_face_list.
547         (struct MRealizedFace): Delete member tick, add member
548         need_update.
549
550 2004-05-13  Kenichi Handa  <handa@m17n.org>
551
552         * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
553
554 2004-05-12  Kenichi Handa  <handa@m17n.org>
555
556         * internal-gui.h (mwin__xft_open): Arguemnt name changed.
557
558         * m17n-X.c (mwin__xft_open): Argument changed to fontname and
559         parse it XftNameParse.
560
561         * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
562         (all_fonts_scaned): New variable.
563         (set_font_info): FAMILY may be Mnil.
564         (add_font_info): Argument changed.
565         (xft_list): Call add_font_info in it.
566         (ft_list): Likewise.
567         (ft_select): Make it work in the case family is Mnil.
568         (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
569         (mfont__ft_fini): Set all_fonts_scaned to 0.
570
571         * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
572         that is failed to open.
573
574 2004-05-10  Kenichi Handa  <handa@m17n.org>
575
576         * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
577         device's depth is 1 (i.e. monochrome).
578
579         * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
580         to work around the problem of libtool.
581
582         * font-ft.c: Include <freetype/ftbdf.h>.
583         (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
584         variables.
585         (mfont__ft_init): Initialize them.
586         (ft_iso8859_1_font_list): New variable.
587         (set_font_info): Detect a font containing iso8859-1 glyphs and
588         register it in ft_iso8859_1_font_list.  If the font is not
589         scalable, assume it as BDF or PCF font and setup SIZE and RESY
590         properties of the font from its properties.
591         (add_font_list): If the font is not scalable, check if it is BDF
592         or PCF font.  If not, ignore it.
593         (ft_select): If FAMILY is Mnil, return NULL only if the requested
594         registry is not iso8859-1.
595         (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
596         ft_iso8859_1_font_list.
597         (ft_find_metric): If the font is not scalable, assume it as BDF
598         or PCF, and get a metric from its properties.
599         (mfont__ft_fini): Free ft_iso8859_1_font_list.
600
601 2004-05-07  Kenichi Handa  <handa@redhat.m17n.org>
602
603         * Makefile.am (libm17n_la_LIBADD): Include -ldl.
604         (libm17n_la_LDFLAGS): Delete it.
605         (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
606         (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
607
608 2004-05-06  Kenichi Handa  <handa@m17n.org>
609
610         * draw.c (compose_glyph_string): Fix previous change.
611
612 2004-04-30  Kenichi Handa  <handa@m17n.org>
613
614         * font-ft.c (ft_list): Delete unused variable `result'.
615         (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
616
617 2004-04-27  Kenichi Handa  <handa@m17n.org>
618
619         * m17n-X.c: Include config.h
620         [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
621         (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
622         (MWDevice) [HAVE_XFT2]: New member xft_draw.
623         (FRAME_CMAP, FRAME_VISUAL): New macros.
624         (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
625         (xfont_driver): Make it static.
626         (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
627         (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
628         info->xft_color_back.
629         (MXftFontInfo) [HAVE_XFT2]: New type.
630         (mwin__xft_close) [HAVE_XFT2]: New function.
631         (mwin__xft_open) [HAVE_XFT2]: New function.
632         (mwin__xft_get_metric) [HAVE_XFT2]: New function.
633         (mwin__xft_render) [HAVE_XFT2]: New function.
634
635         * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
636         (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
637         (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
638         externs.
639
640         * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
641
642         * font-ft.c: Don't include FT_FREETYPE_H here.
643         [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
644         (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
645         (MFTInfo): New member charmap_index.
646         (MFTInfo) [HAVE_XFT2]: New member xft_info.
647         (check_otf_filename): Renamed from check_filename.  Return value
648         changed.
649         (ft_set_property): This function deleted.
650         (set_font_info): New function.
651         (add_font_list): Argument changed.  Add multiple fonts.
652         (xft_list) [HAVE_XFT2]: New function.
653         (ft_list) [not HAVE_XFT2]: New function.
654         (ft_select): Add code for Xft.
655         (close_ft): Likewise.
656         (ft_open): Likewise.
657         (ft_find_metric): Likewise.
658         (ft_encode_char): Likewise.
659         (ft_render): Likewise.
660
661         * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
662
663 2004-04-26  Kenichi Handa  <handa@m17n.org>
664
665         * textprop.c (mtext_attach_property): Declare the return type as
666         `int'.
667
668 2004-04-21  Kenichi Handa  <handa@m17n.org>
669
670         * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
671
672 2004-04-09  Kenichi Handa  <handa@m17n.org>
673
674         * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
675         seq_to.
676         (load_command): Setup above members.
677
678 2004-04-05  Kenichi Handa  <handa@m17n.org>
679
680         * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
681
682 2004-03-30  Kenichi Handa  <handa@m17n.org>
683
684         * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
685         >= 0x10000.
686
687         * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
688         (M17NLIB_VERSION_NAME): Changed to 1.0.2.
689
690 2004-03-29  Kenichi Handa  <handa@m17n.org>
691
692         * Version 1.0 Patch Level 2 released.
693
694 2004-03-29  Kenichi Handa  <handa@m17n.org>
695
696         * charset.c (make_charset): Set charset->fully_loaded and
697         charset->simple correctly.  Don't try to get charset->min_char and
698         charset->max_char for a charset of method subset and superset.
699         Don't load a mapping file here.
700         (mcharset__init): Set unified_max.
701         (mcharset__load_from_database): Free a working plist.
702
703         * coding.c (mcoding__fini): Free all malloced data.
704
705         * input-gui.c (win_create_ic): Set control.as_image for preediting
706         to 0.
707
708         * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
709         `count') to initialize the array.
710
711         * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
712         M17N_OBJECT_UNREF.
713
714         * m17n-X.c (xfont_render): If rface->rfont is null, draw a
715         rectangle.
716         (mwin__create_window): Fix bug of setting a background pixel of a
717         new window.
718         (mwin__adjust_window): Clear the window before drawing.
719
720         * m17n-core.c (mdebug__report_object): Free array->objectes if
721         necessary.
722         (m17n_init_core): Don't set report_header_printed to 0 here.
723         Fix debugging information.
724         (m17n_fini_core): Set report_header_printed to 0 here.
725
726         * m17n-core.h (mplist_deserialize): Extern it.
727
728         * m17n-gui.c (m17n_fini_win): Fix debugging information.
729
730         * m17n.c (m17n_fini): Fix debugging information.
731
732         * mtext.c (mtext__adjust_foramt): New function.
733
734         * mtext.h (mtext__adjust_foramt): Extern it.
735
736         * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
737
738         * plist.h (mplist__deserialize): Don't extern it.
739
740         * symbol.c (msymbol__fini): Set freed_symbols to 0.  Set all
741         elements of symbol_table to NULL.  Report about created and freed
742         symbols if MDEBUG_FINI is set.
743
744 2004-03-22  Kenichi Handa  <handa@m17n.org>
745
746         * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
747
748         * m17n.c (m17n_init): Fix the way of checking merror_code.
749
750         * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
751
752 2004-03-22  Kenichi Handa  <handa@m17n.org>
753
754         * fontset.c (realize_font_group): Adjust the font size by
755         mfont__resize before selecting a font.
756
757         * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
758
759 2004-03-19  Kenichi Handa  <handa@m17n.org>
760
761         * Version 1.0 Patch Level 1 released.
762
763 2004-03-19  Kenichi Handa  <handa@m17n.org>
764
765         * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
766
767         * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
768
769 2004-03-19  Kenichi Handa  <handa@m17n.org>
770
771         Re-apply the changes forgotten in the released version.
772
773         * charset.c (mcharset__load_from_database): Call
774         mchar_define_charset.
775
776         * coding.c (encode_unsupporeted_char): Put Mcoding text property.
777         (mconv_encode_range): Put Mcoding text property.
778
779 2004-03-18  Kenichi Handa  <handa@m17n.org>
780
781         * draw.c (Mdepth): New variable.
782         (visual_order): Delete unused local var `pos'.
783         (compose_glyph_string): Fix for the case that gstring->glyphs is
784         realloced.  Stop generating glyphs at TO.  Fix handling of
785         control charaters.
786         (layout_glyphs): Get metrics of all glyphs in advance.  Set
787         lbearing and rbearing of base of composition glyph correctly.
788         Handle left-overhang glyphs correctly.
789         (alloc_gstring): New arg frame.  Set gstring->anti_alias.  Caller
790         changed.
791         (dump_combining_code): Change the defualt off_x character to ".".
792         (mdraw__init): Initialize Mdepth.
793
794         * face.c (work_gstring): New variable
795         (mface__init): Initialize work_gstring.
796         (mface__fini): Free work_gstring.glyphs.
797         (mface__realize): Don't handle videomode property here.  Adjusted
798         for the change of mfont__get_metric.
799         (mface__for_chars): Adjusted for the change of mfont__get_metric.
800
801         * face.h (enum face_gc): Moved to m17n-X.c.
802
803         * font.h (struct MFontDriver): Arguments of find_metric changed.
804         (mfont__select): Prototype adjusted.
805         (mfont__get_metric): Likewise.
806         (mfont__ft_drive_otf): Likewise.
807         (mfont__flt_run): Likewise.
808         
809         * font.c (mfont__select): New argument layouter.  If layouter is
810         different in the registered font, make a new copy of realized
811         font.
812         (mfont__get_metric): Argument changed.  Get metrics of multiple
813         glyphs.
814         (mfont_find): Call mfont__select with layouter as Mnil.
815
816         * font-flt.c (FontLayoutContext): New member rfont.
817         (run_otf): Adjusted for the change of mfont__ft_drive_otf.
818         (mfont__flt_run): Argument changed.  Initialize ctx.rfont.
819
820         * font-ft.c (ft_find_metric): Arguments changed.  Get metrics of
821         multiple glyphs.
822         (NUM_POINTS): New macro.
823         (MPointTable): New type.
824         (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
825         (mfont__ft_drive_otf): New argument rfont.
826
827         * fontset.c (realize_font_group): Adjusted for the changed of
828         mfont__select.
829         (check_fontset_element): This function deleted.
830
831         * input-gui.c (adjust_window_and_draw): Locate a preedit window
832         off the parent window if the preedit text is zero length.
833
834         * internal-gui.h (struct MFrame): New members foreground,
835         background, videomode, font.
836         (struct MGlyphString): New member anti_alias.
837         (MDrawPoint): New type.
838         (mwin__draw_bitmap): Prototype deleted.
839         (mwin__draw_points): Prototype added.
840
841         * m17n-gui.h (MDrawControl): New member anti_alias.
842
843         * m17n-gui.c (free_frame): Free frame->font.
844         (mframe): Set the fontset of frame->face to the default fontset.
845
846         * m17n-X.c (RGB_GC): New type.
847         (enum gc_index): Renamed from enum face_gc.  Member names changed.
848         (GCInfo): New typel
849         (struct MWDevice): Members foreground and background deleted.  New
850         member scratch_gc, gc_list.
851         (DEFAULT_FONT, FALLBACK_FONT): New macros.
852         (free_device): Free GCs in device->gc_list.
853         (get_rgb_gc): New function.
854         (get_gc): Renamed and argument changed from get_color.
855         (get_gc_for_anti_alias): New function.
856         (xfont_find_metric): Arguments changed.  Get metrics of multiple
857         glyphs.
858         (set_region): Argument changed.  Caller changed.
859         (xfont_render): Allways set a font in gc.
860         (x_error_handler, x_io_error_handler): Define only if
861         X_SET_ERROR_HANDLER is defined.
862         (mwin__open_device): Create device->scratch_gc.  Set members
863         foreground, background, and videomode of frame.  Call
864         XSetErrorHandler and XSetIOErrorHandler only if
865         X_SET_ERROR_HANDLER is defined.
866         (struct gc_list): Deleted.
867         (REGISTER_GC, UNREGISTER_GC): These macros deleted.
868         (mwin__realize_face): Adjusted for the change of the format of
869         rface->info and the charge of set_region.
870         (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
871         (mwin__draw_box): Likewise.
872         (mwin__draw_bitmap): This function deleted.
873         (mwin__draw_points): New function.
874         (mwin__verify_region): Adjusted for the change of the format of
875         rface->info and the charge of set_region.
876         (mwin__create_window): Inherit backgound pixel from parent.
877         (mwin__dump_gc): Adjusted for the change of the format of
878         rface->info.
879
880 2004-03-16  Kenichi Handa  <handa@m17n.org>
881
882         * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
883
884         * input.c (M_key_alias): New variable.
885         (handle_key): Try M_key_alias property of a key too.
886         (minput__init): Initialize M_key_alias.  Give that property to
887         symbols in one_char_symbol.  Fix bug of initializing
888         one_char_symbol.
889
890         * draw.c (compose_glyph_string): Don't handle
891         ignore_formatting_char here.  Include formatting characters in the
892         range processed by a FTL.
893         (layout_glyph_string): Handle ignore_formatting_char here.
894
895 2004-03-12  Kenichi Handa  <handa@m17n.org>
896
897         * input-gui.c (win_create_ic): Enable bidi in status control.
898
899         * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
900
901 2004-03-09  Kenichi Handa  <handa@m17n.org>
902
903         * input.c (load_input_method): If title is not specified, use the
904         input method name as title.
905
906         * m17n-X.c (get_color): Make it static.
907         (xim_create_ic, xim_destroy_ic, x_error_handler)
908         (x_io_error_handler): Likewise.
909
910 2004-03-01  Kenichi Handa  <handa@m17n.org>
911
912         * Version 1.0 released.
913
914 \f
915 Copyright (C) 2003, 2004
916   National Institute of Advanced Industrial Science and Technology (AIST)
917   Registration Number H15PRO112
918
919 This file is part of the m17n library.
920
921 The m17n library is free software; you can redistribute it and/or
922 modify it under the terms of the GNU Lesser General Public License
923 as published by the Free Software Foundation; either version 2.1 of
924 the License, or (at your option) any later version.
925
926 The m17n library is distributed in the hope that it will be useful,
927 but WITHOUT ANY WARRANTY; without even the implied warranty of
928 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
929 Lesser General Public License for more details.
930
931 You should have received a copy of the GNU Lesser General Public
932 License along with the m17n library; if not, write to the Free
933 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
934 02111-1307, USA.