This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: About Insight's GUI , please help me ~


On 05 Feb 2004 07:17:41 -0800
Keith Seitz <keiths@redhat.com> wrote:

> On Wed, 2004-02-04 at 17:11, Feng Li wrote:
>
> My experience with mulit-byte character fonts with Tk is pretty limited,
> but I am certain that Tk can handle it. As I recall, we had a version of
> SourceNavigator that ran in Japanese, so it must be possible.

As far as I know it still does (of course I don't use this feature
a lot).  It should be able to display text or comments that are in
any multi-byte language (once the encoding is set correctly) in a
source file.
 
> You will have to modify two things:
> 
> - global/fixed: This is the default font. It is defined in
> src/libgui/library/looknfeel.tcl. This is the default font used by all
> the widgets in insight. You should be able to set it to a standard
> system font by adding/changing default font values in
> src/gdb/gdbtk/library/prefs.tcl.

Also set the encoding for any streams (fconfigure <fd> -encoding ...)
to what ever encoding is required to read the multi-byte character set.
 
> - modify gdb_loadfile in src/gdb/gdbtk/generic/gdbtk-cmds.c to handle
> multi-byte characters

I'm not that formilar with gdb internals, but it may be relatively simple
to get some crude support to help it "not notice" that some parts of the
source code where using multi-byte characters.  It may even work without
modification, but some features (like reporting an error at a certain
character on a line) would be broken.

GDB is probably far more complicated than I imagine, but it might be as
simple as changing any code that calculates a string length by counting
bytes, to call the appropriate get_string_length function.  This may
involve linking gdb to some other library (maybe tcl) to get the
appropriate string length calculation function.  Of course it may involve
more work, such as using Tcl's file open, command and such.  Looking at
Source-Navigator's parsers il8n work would give a good idea of how much
would really need to be changed.

Ian.

> You _may_ also have to modify gdb to do this, since insight relies on
> gdb's line tables in the symbol table for source window content. (See
> gdb_loadfile for more on this.)
> 
> I think this should be enough to get the source window to display
> multi-byte characters, but I wouldn't bet on it. Like I said, my
> experience with internationalization of Tk applications is very limited.
> 
> Keith
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]