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