On Wednesday 22 January 2003 5:05 pm, John Levon wrote: > On Wed, Jan 22, 2003 at 04:49:06PM +0000, Angus Leeming wrote: > > So, whilst we should change lyxfont to not need X11/forms.h, it's > > probably reasonable to change the name of PreviewLoader::Status and not > > expect it to be insulated from the outside world by namespace grfx. > > Shame, but there we are. > > Why ? lyxfont should not have anything to do with X. There should be no > X headers outside of frontends/frontend.
Indeed. Han, I have had a go at implementing my suggestions. The attached patch should be functionaly equivalent to yours but is 30kB smaller ;-) It fixes the Status->Statue problem by moving getXFontset out of lyxfont.h and into xforms/xfont_metrics.h which is where I think it should really go. It defines a lyx::char_type and a lyx::unsigned_char_type in support/types.h and uses them. It gets rid of Paragraph::wchar_type entirely. Instead, Paragraph::value_type is defined in terms of lyx::char_type. The one place I have not applied this is in support/textutils.h where there is a change from unsigned char -> wchar_t. I'm not sure if it is safe to use lyx::unsigned_char_type in these routines. There are still lots of places that could be cleaned up. In particular, I'm sure we could do something similar in buffer.C. Even if all these small #ifdef I18N blocks cannot be removed, (bet they can ;-), your use of wchar_t * xyz = new ...; appears unsafe. Why did you not use a wstring? Anyway, I hope this helps. The resulting executable starts fine, but of course I do not have the necessary fonts (or knowledge) to use it to write anything other than english. Best regards, Angus
CJK-LyX-1.3.0pre2-patch2.bz2
Description: BZip2 compressed data