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