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