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