public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* About Insight's GUI , please help me ~
@ 2004-02-04  1:03 Feng Li
  2004-02-04 15:53 ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Feng Li @ 2004-02-04  1:03 UTC (permalink / raw)
  To: insight

  How do you do.
   I am a software engineer in China, I had gotten a project about Insight, I have to make Insight's GUI can show Chinese or other wide characters, not only menu but also the source code in the view. I have not any ideas, but I am very love Linux, it likes a family that we can make it better together. 
   I really need your help, thank you very much.

   --------------------☆-------------------
   |大連松下通信軟件工程有限公司(DLMSE)    |
   | 技術部  馮 黎                      |
   | 電話  :+86(411)476-1771(内線243)     |      
   | FAX   :+86(411)476-1773              |
   | E-mail:fengli@dlmse.panasonic.com.cn |
   -----------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: About Insight's GUI , please help me ~
  2004-02-04  1:03 About Insight's GUI , please help me ~ Feng Li
@ 2004-02-04 15:53 ` Keith Seitz
       [not found]   ` <004d01c3eb84$f8ad8e40$4048c20a@dlmse.local>
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2004-02-04 15:53 UTC (permalink / raw)
  To: Feng Li; +Cc: insight

On Tue, 2004-02-03 at 17:05, Feng Li wrote:
>  I have to make Insight's GUI can show Chinese or other wide characters, not only menu but also the source code in the view. I have not any ideas, but I am very love Linux, it likes a family that we can make it better together. 

You're going to run into several difficulties. While it is possible for
Insight to display wide characters (since Tk does), much of the Insight
code is written using strings instead of Tk's utf drivers. Although
tedious, this could be pretty easily fixed.

Insight's user messages (window features, many dialogs, etc) could also
be fixed to use a message catalog, one for each language. [These are the
messages that the GUI code itself outputs to the user.]

The real problem is gdb. Although some work has been done to get gdb to
use a message catalog, it is by no means complete, and, in fact, may
never be complete without some very non-trivial work. Gdb does things
like (output variable types & values, e.g.):
	printf_unfiltered ("There was a problem with breakpoint ");
	printf_unfiltered ("%d", num);
	printf_unfiltered (".");
	
This would require massive amounts of effort to clean up properly.

All in all, it can be done. My belief: the real work is in gdb.

Keith


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: About Insight's GUI , please help me ~
       [not found]   ` <004d01c3eb84$f8ad8e40$4048c20a@dlmse.local>
@ 2004-02-05 15:12     ` Keith Seitz
  2004-02-05 16:06       ` Ian Roxborough
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2004-02-05 15:12 UTC (permalink / raw)
  To: Feng Li; +Cc: insight

On Wed, 2004-02-04 at 17:11, Feng Li wrote:
>    Thanks a lot for your help, and I have one more question, that is
> how can I show wide characters (EUC,GB2312,not UTF8)in the Insight
> source view? The source view can show UTF8 codes, but can not show
> EUC(GB2312,BIG5,etc.), how to let the source view to show
> EUC(GB2312,BIG5,etc.), which file I will modify? This is my first time
> to use Linux and Insight, maybe my question is a little laughably,
> please understand me, thanks.

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.

Ultimately, you are attempting to get a Tk text widget to fill with a
multi-byte font. I believe that all you need to do is choose an
appropriate font and stuff content into the widget. For more information
on Tk, go to www.tcl.tk.

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.

- modify gdb_loadfile in src/gdb/gdbtk/generic/gdbtk-cmds.c to handle
multi-byte characters

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: About Insight's GUI , please help me ~
  2004-02-05 15:12     ` Keith Seitz
@ 2004-02-05 16:06       ` Ian Roxborough
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Roxborough @ 2004-02-05 16:06 UTC (permalink / raw)
  To: insight

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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-05 16:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-04  1:03 About Insight's GUI , please help me ~ Feng Li
2004-02-04 15:53 ` Keith Seitz
     [not found]   ` <004d01c3eb84$f8ad8e40$4048c20a@dlmse.local>
2004-02-05 15:12     ` Keith Seitz
2004-02-05 16:06       ` Ian Roxborough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).