]> git.lyx.org Git - features.git/commitdiff
pass_thru
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 17 Jul 2001 09:41:34 +0000 (09:41 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 17 Jul 2001 09:41:34 +0000 (09:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2262 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/layouts/literate-scrap.inc
po/POTFILES.in
src/ChangeLog
src/layout.C
src/layout.h
src/mathed/formulabase.C
src/paragraph_pimpl.C

index 2d998ecd2f6bddb08080dc19e959b3063fbe7d18..1d48e0a5658358b7bd95a834ed4bed18b200531e 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-12  Kayvan A. Sylvan  <kayvan@camel.internal.sylvan.com>
+
+       * layouts/literate-scrap.inc: Added PassThru tag
+
 2001-07-13  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * bind/*.bind: do the same correctly for all files :)
index 96ebde0abec25c457e86b667aed13cc8d4e17a3c..e7ecaac03a9171218b6e5c37153d4b1d201a3df1 100644 (file)
@@ -22,13 +22,14 @@ Style Scrap
   Align                 Left
   AlignPossible         Block,Left
   FreeSpacing           1
+  PassThru              1
   LabelType             Static
 
   LabelFont
     Color               magenta
   EndFont
   TextFont
-    Latex               Latex
+    Color               latex
     Family              Typewriter
   EndFont
 
index 911758d3cf575ab0d05ff9c254cc14896f442f6f..12d1d92b86720a43523d5ad08849639ae0662db0 100644 (file)
@@ -9,7 +9,6 @@ src/converter.C
 src/CutAndPaste.C
 src/debug.C
 src/exporter.C
-src/ext_l10n.h
 src/figure_form.C
 src/figureForm.C
 src/FontLoader.C
index d29299500ebe9127fb011ea18aec5449946b2a65..fe7f8bbbbd8c5e60137ebe5a3e23bb8bb4b5ff7b 100644 (file)
        * sp_form.[Ch]: removed
        * spellchecker.[Ch]: removed
 
+2001-07-12  Kayvan A. Sylvan  <kayvan@camel.internal.sylvan.com>
+
+       * paragraph_pimpl.C (simpleTeXBlanks): Simply return if pass_thru
+       is set.
+       (simpleTeXSpecialChars): Simply print the input character without
+       any special translation if pass_thru is set.
+
+       * layout.h: Added bool pass_thru to layout class for being able to
+       implement pass through of a paragraph for Literate Programming.
+       
+       * layout.C: add LT_PASS_THRU to LayoutTags enum.
+       * layout.C (LyXLayout): set pass_thru to flase in constructor.
+       * layout.C (Read): add "passthru" to list of layout tags and add
+       code to set the pass_thru boolean when it is read.
+
 2001-07-12  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * trans_decl.h: remove allowed from KmodInfo
index 44e05f66a0865a26e8c9ec3d4b753fb816a33a2e..27efc567d46a80a833a3523a67c4f1122cc99b45 100644 (file)
@@ -70,6 +70,7 @@ enum LayoutTags {
        //LT_FIRST_COUNTER,
        LT_FONT, 
        LT_FREE_SPACING, 
+       LT_PASS_THRU,
        //LT_HEADINGS,
        LT_ITEMSEP, 
        LT_KEEPEMPTY, 
@@ -133,6 +134,7 @@ LyXLayout::LyXLayout ()
        fill_bottom = false;
        newline_allowed = true;
        free_spacing = false;
+       pass_thru = false;
 }
 
 
@@ -174,6 +176,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                { "parindent",                  LT_PARINDENT },
                { "parsep",                     LT_PARSEP },
                { "parskip",                    LT_PARSKIP },
+               { "passthru",                   LT_PASS_THRU },
                { "preamble",                   LT_PREAMBLE },
                { "rightmargin",                LT_RIGHTMARGIN },
                { "spacing",                    LT_SPACING },
@@ -392,6 +395,11 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                                free_spacing = lexrc.GetInteger();
                        break;
 
+               case LT_PASS_THRU:      // Allow for pass thru.
+                       if (lexrc.next())
+                               pass_thru = lexrc.GetInteger();
+                       break;
+
                case LT_SPACING: // setspace.sty
                        readSpacing(lexrc);
                        break;
index 6ef20a9934545ebf48b676e772723fe51720f885..55c15a8fd57d67cb01b3c7e83d3c27122dc0934d 100644 (file)
@@ -321,6 +321,10 @@ public:
 
        ///
        bool free_spacing;
+
+       ///
+       bool pass_thru;
+
        /** true when the fragile commands in the paragraph need to be
            \protect'ed. */
        bool needprotect;
index 97fd2d0de37fa38bf0e470450ce4c0212e189416..8142bd875c946682d96586aac62c6989f61d6f0e 100644 (file)
@@ -858,7 +858,10 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
        default:
                if ((action == -1 || action == LFUN_SELFINSERT) && !arg.empty()) {
                        unsigned char c = arg[0];
-                       //lyxerr << "char: '" << c << "'  int: " << int(c) << endl;
+
+                       lyxerr << "Action: " << action << endl;
+                       
+                       lyxerr << "char: '" << c << "'  int: " << int(c) << endl;
                        //owner_->getIntl()->getTrans().TranslateAndInsert(c, lt);      
                        //lyxerr << "trans: '" << c << "'  int: " << int(c) << endl;
                        bv->lockedInsetStoreUndo(Undo::INSERT);
index 27de45d0ae55505813e54fb461c49575856579e7..182d1165d8d0ef30ff42ea336bdcc7fceae94236 100644 (file)
@@ -208,6 +208,7 @@ void Paragraph::Pimpl::simpleTeXBlanks(std::ostream & os, TexRow & texrow,
                                       int & column, LyXFont const & font,
                                       LyXLayout const & style)
 {
+       if (style.pass_thru) return;
        if (column > tex_code_break_column
            && i 
            && getChar(i - 1) != ' '
@@ -266,6 +267,10 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                                             int & column,
                                             Paragraph::value_type const c)
 {
+       if (style.pass_thru) {
+               if (c != '\0') os << c;
+               return;
+       }
        // Two major modes:  LaTeX or plain
        // Handle here those cases common to both modes
        // and then split to handle the two modes separately.