Hello!
Wouldn't it be cleaner to fix Lyx , so that lyxstring
is used explicitly in Lyx code?
Therefore, Lyx will use lyxstring, and Gnome will use string.

It is easy to add conversion routines too.

For ANSI conforming compilers, lyxstring could be 
a typedef to string, and conversions just return the
string back.

This is somewhat the reverse of the current code, where
string is typedef to lyxstring.

MST

Quoting r. Marko Vendelin ([EMAIL PROTECTED]) "GTK/Gnome frontend elementary support":
> 
> Hi!
> 
> the attached patch together with additional files included into the
> .tar.gz archive adds elementary support for GTK/Gnome frontend: configure
> scripts, Gtk/Gnome initialization, Gnome event loop processing, and
> Copyright dialog box implementation.
> 
> It should be easy to use this code on the platform with good STL string
> implementation. In such case you need standard gtk, gnome, libsigc++ ,
> gtk-- and gnome-- libraries.
> 
> On my platform (redhat linux 6.1, egcs 1.1.2) LyX uses LyX string class
> instead of STL string. To use gtk-- and gnome-- with LyX I recompiled
> these libraries after replacing "#include <string>" by "#include
> "LString.h"" in the source files of the libraries. To make our life easier
> I've written two small scripts that patch gtk-- and gnome-- libraries and
> compile them. Please note that running these scripts is DANGEROUS since it
> may change your source files. The following are instructions for getting
> Gtk/Gnome frontend running in the platforms that lack good STL string
> implementation (it worked on my platform):
> 
> * install Gtk, Gnome, and libsigc++
> 
> * download gtkmm-1.2.1.tar.gz and gnomemm-1.1.10.tar.gz from
>   http://gtkmm.sourceforge.net/download.html (click "sourceforge download
>   area" on this page)
> 
> * create a new directory and copy gtkmm-1.2.1.tar.gz,
>   gnomemm-1.1.10.tar.gz, lyxgtk.sh, and str2lyxstr.sh
>   to this directory (lyxgtk.sh and str2lyxstr.sh are attached to this
>   e-mail)
> 
> * cd to this directory
> 
> * read and edit script lyxgtk.sh (set source and install directories)
> 
> * run script lyxgtk.sh
> 
> * include directory with installed new gtk and gnome libs to PATH and
>   LD_LIBRARY_PATH as first directories (subdirs bin and lib,
>   respectively).
> 
> * cd to lyx source directory
> 
> * run autogen.sh
> 
> * run configure with the following options:
>       --with-frontend=gtk --without-included-libsigc --disable-sigctest 
>         --with-gnomemm-config-path=NEW_GNOMEMM_LIB/lib/gnomemmConf.sh 
>--disable-gtkmmtest
> 
> * run make
> 
> Please note, that compiled Gtk--/Gnome-- libraries are usable only with
> LyX.
> 
> Finally, to make configure script working I had to disable
> AC_LANG_CPLUSPLUS in configure.in (line 66). Otherwise gnome configuration
> scripts were not working properly. It will be very nice if someone with
> good knowledge of configure.in magic would take a look on this problem.
> 
> Regards,
> 
> Marko

> #!/bin/bash
> 
> # This script is DANGEROUS! It replaces 
> # "#include <string>" with "#include "LString.h"" in the files in 
> # current directory (recursively!). This can change YOUR source files. 
> # Use it at your own risk.
> 
> FILELISTCC=`rgrep -r -l "#include <string>" . | grep "\.cc"` 
> FILELISTH=`rgrep -r -l "#include <string>" . | grep "\.h"` 
> FILELISTGEN=`rgrep -r -l "#include <string>" . | grep "\.gen_"` 
> 
> for i in $FILELISTCC $FILELISTH $FILELISTGEN; do
>     cat $i | sed -e 's/#include <string>/#include "LString.h"/g' > .tmpfile
>     mv .tmpfile $i
> done

> #!/bin/bash
> 
> # This script is DANGEROUS! It uses script srt2lyxstr.sh to replace 
> # "#include <string>" with "#include "LString.h"". This can change YOUR source files.
> # Use it at your own risk.
> 
> # extracting GNOME-- and GTK--
> tar zxvf gnomemm-1.1.10.tar.gz
> tar zxvf gtkmm-1.2.1.tar.gz
> 
> # Please specify the directories with GTK--, GNOME--, LyX source, and the directory 
> # to which new GTK--/GNOME-- libraries should be installed.
> GTKMMDIR=/home/users/markov/cpp-files/lyx/lyx-gtk/gtkmm-1.2.1
> GNOMEMMDIR=/home/users/markov/cpp-files/lyx/lyx-gtk/gnomemm-1.1.10
> LIBINSTALLDIR=/home/users/markov/cpp-files/lyx/lyx-gtk/root
> LYXDIR=/home/users/markov/cpp-files/lyx/lyx-devel
> 
> # Please note that script creates temporary directory $GTKMMDIR/../.tmpdir . 
> # Change the script if this is not acceptable for you.
> 
> mkdir $LIBINSTALLDIR
> 
> export MAKE="make"
> 
> export CXXFLAGS="-DUSE_INCLUDED_STRING -I$LYXDIR/src"
> 
> CURRDIR=`pwd`
> STR2LYXSTR=$CURRDIR/str2lyxstr.sh
> 
> # gtkmm
> 
> cd $GTKMMDIR
> ./configure --prefix=$LIBINSTALLDIR 
> echo -e "all: \ninstall: \n" > gdk--/tests/Makefile
> mv src/gtkmmproc ../.tmpdir
> $STR2LYXSTR
> mv ../.tmpdir src/gtkmmproc
> 
> make
> make install
> 
> cd $CURRDIR
> 
> # gnomemm
> 
> export PATH=$LIBINSTALLDIR/bin:$PATH
> 
> cd $GNOMEMMDIR
> ./configure --prefix=$LIBINSTALLDIR --disable-gtkmmtest 
> 
> $STR2LYXSTR
> 
> make
> make install
> cp src/gnomemmConf.sh $LIBINSTALLDIR/lib
> 
> cd $CURRDIR
> 
> 




-- 
This message content is not part of Intel's views or affairs
Michael S. Tsirkin
    >   Four things are to be strengthened: Torah,and good deeds,
    >   prayer and one's good manners (Berachoth)

Reply via email to