On 10 Aug 1999 20:24:36 +0200, Lars Gullik Bj°nnes wrote:

>"Arnd Hanses" <[EMAIL PROTECTED]> writes:
>
>| Well, as nice as LyX-programming is, first of all I need a program to
>| write, not to hack with :). So my enthusiasm for 1.1.x was at first a
>| bit limited. But who knows...
>
>Well you know, I don't know how large patches I will allow in 1,0,x
>series... and it already seems that some of your patch will never be
>included in 1,0,x.
>
>       Lgb

As far I can see, I will be able to boil down my patches mostly to some
very small and obvious pre-processor macros (thus throwing out many
#ifdefs).

Once you've got the idea, all this turns out to be very simple! 

The actual code will then mainly consist in a few lines (all in all
less than 20 lines of added C++) that go into os2-defines.h or
os2_support.C or whereever you like them to see.

This is the idea:

Jean-Marc proposed a CleanupPath() fn to posixify a bit naughty
pathnames and get a cleaner code base.

I used it in filetools.C and (in one occasion) in lyx_main.C and put it
into 

                os2-defines.h :

-------------------
[...]

#if defined(_LYX_MAIN_C) || defined(_FILETOOLS_C)
#include "LString.h"

        //An internal helper to better handle DOS-style paths
inline static LString CleanupPath(LString const &path);

/* SMiyata: This should fix searchpath bug. */
        inline static 
LString CleanupPath(LString const &path) 
{
       LString temppath( lowercase(path) );
       temppath.subst('\\', '/');
       return temppath;
       return path;
}

#endif /* _FILETOOLS_C */
#endif /* _OS2_DEFINES_H */
        
---------------

                filetools.C:

---------------
#define _FILETOOLS_C    // to include CleanupPath (AHanses)

#include <config.h>

[...]

#ifndef _OS2_DEFINES_H
#define CleanupPath(p) p // Have POSIX-paths; don't clean (AHanses)
#endif
---------------------


Basta! That's all the magic, let's cut out 10 or so #ifdef __EMX__, but
make LyX behave as though they would stay in the code.

If things are too complicated, they are not well designed. I'll have no
problems, if you reject dubious or overly complicated stuff.

Greets,

        Arnd

Reply via email to