The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit a98f7ad02d8874a2fdf60abd71345a46d9d5c0a5
Author: Georg Baum <b...@lyx.org>
Date:   Mon Dec 31 17:17:45 2012 +0100

    Fine tune image generation

diff --git a/development/tools/generate_symbols_images.py 
b/development/tools/generate_symbols_images.py
index 1ba21f8..7787e5d 100644
--- a/development/tools/generate_symbols_images.py
+++ b/development/tools/generate_symbols_images.py
@@ -41,7 +41,8 @@ def getlist(lyxexe, lyxfile):
     regexp = re.compile(r'.*: read symbol \'(\S+)\s+inset:\s+(\S+)')
     # These insets are more complex than simply symbols, so the images need to
     # be created manually
-    skipinsets = ['big', 'font', 'matrix', 'mbox', 'oldfont', 'ref', 'space']
+    skipinsets = ['big', 'font', 'lyxblacktext', 'matrix', 'mbox', 'oldfont', \
+                  'ref', 'split', 'space', 'style']
     symbols = []
     for line in stderr.split('\n'):
         m = regexp.match(line)
@@ -52,17 +53,33 @@ def getlist(lyxexe, lyxfile):
     return symbols
 
 
-def createimage(name, path, template, lyxexe, tempdir):
+def getreplacements(filename):
+    replacements = {}
+    replacements['|'] = 'vert'
+    replacements['/'] = 'slash'
+    replacements['\\'] = 'backslash'
+    replacements['*'] = 'ast'
+    replacements['AA'] = 'textrm_AA'
+    replacements['O'] = 'textrm_O'
+    cppfile = open(filename, 'rt')
+    regexp = re.compile(r'.*"([^"]+)",\s*"([^"]+)"')
+    found = False
+    for line in cppfile.readlines():
+        if found:
+            m = regexp.match(line)
+            if m:
+                replacements[m.group(1)] = m.group(2)
+            else:
+                return replacements
+        elif line.find('PngMap sorted_png_map') == 0:
+            found = True
+
+
+def createimage(name, path, template, lyxexe, tempdir, replacements):
     """ Create the image file for symbol name in path. """
 
-    if name == '|':
-        filename = 'vert'
-    elif name == '/':
-        filename = 'slash'
-    elif name == '\\':
-        filename = 'backslash'
-    elif name == '*':
-        filename = 'ast'
+    if name in replacements.keys():
+        filename = replacements[name]
     elif name.startswith('lyx'):
         print 'Skipping ' + name
         return
@@ -121,13 +138,15 @@ def main(argv):
     if len(argv) == 3:
         (base, ext) = os.path.splitext(argv[0])
         symbols = getlist(argv[1], base)
+        cppfile = os.path.join(os.path.dirname(base), 
'../../src/frontends/qt4/GuiApplication.cpp')
+        replacements = getreplacements(cppfile)
         lyxtemplate = base + '.lyx'
         templatefile = open(base + '.lyx', 'rt')
         template = templatefile.read()
         templatefile.close()
         tempdir = tempfile.mkdtemp()
         for i in symbols:
-            createimage(i, argv[2], template, argv[1], tempdir)
+            createimage(i, argv[2], template, argv[1], tempdir, replacements)
         shutil.rmtree(tempdir)
     else:
         error(usage(argv[0]))
diff --git a/src/frontends/qt4/GuiApplication.cpp 
b/src/frontends/qt4/GuiApplication.cpp
index a2b44e6..07f3af2 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -234,18 +234,33 @@ private:
 
 // this must be sorted alphabetically
 // Upper case comes before lower case
+// Please don't change the formatting, this list is parsed by
+// development/tools/generate_symbols_images.py.
 PngMap sorted_png_map[] = {
        { "Arrownot", "arrownot2"},
+       { "Arrowvert", "arrowvert2"},
+       { "Bowtie", "bowtie2" },
+       { "Box", "box2" },
        { "Bumpeq", "bumpeq2" },
        { "Cap", "cap2" },
+       { "Circle", "circle2" },
+       { "Colonapprox", "colonapprox2" },
+       { "Coloneq", "coloneq2" },
+       { "Coloneqq", "coloneqq2" },
+       { "Colonsim", "colonsim2" },
        { "Cup", "cup2" },
        { "Delta", "delta2" },
        { "Diamond", "diamond2" },
+       { "Doteq", "doteq2" },
        { "Downarrow", "downarrow2" },
+       { "Eqcolon", "eqcolon2" },
+       { "Eqqcolon", "eqqcolon2" },
        { "Gamma", "gamma2" },
+       { "LHD", "lhd2" },
        { "Lambda", "lambda2" },
        { "Lbag", "lbag2"},
        { "Leftarrow", "leftarrow2" },
+       { "Leftcircle", "leftcircle2" },
        { "Leftrightarrow", "leftrightarrow2" },
        { "Longarrownot", "longarrownot2"},
        { "Longleftarrow", "longleftarrow2" },
@@ -261,12 +276,16 @@ PngMap sorted_png_map[] = {
        { "Phi", "phi2" },
        { "Pi", "pi2" },
        { "Psi", "psi2" },
+       { "RHD", "rhd2" },
        { "Rbag", "rbag2"},
        { "Rightarrow", "rightarrow2" },
+       { "Rightcircle", "rightcircle2" },
        { "Sigma", "sigma2" },
+       { "Square", "square2" },
        { "Subset", "subset2" },
        { "Supset", "supset2" },
        { "Theta", "theta2" },
+       { "Thorn", "thorn2" },
        { "Uparrow", "uparrow2" },
        { "Updownarrow", "updownarrow2" },
        { "Upsilon", "upsilon2" },
@@ -277,12 +296,25 @@ PngMap sorted_png_map[] = {
        { "nLeftrightarrow", "nleftrightarrow2" },
        { "nRightarrow", "nrightarrow2" },
        { "nVDash", "nvdash3" },
+       { "nVdash", "nvdash4" },
        { "nvDash", "nvdash2" },
        { "textrm \\AA", "textrm_AA"},
        { "textrm \\O", "textrm_O"},
-       { "vDash", "vdash2" }
+       { "vDash", "vdash2" },
+       { "varDelta", "vardelta2" },
+       { "varGamma", "vargamma2" },
+       { "varLambda", "varlambda2" },
+       { "varOmega", "varomega2" },
+       { "varPhi", "varphi2" },
+       { "varPi", "varpi2" },
+       { "varPsi", "varpsi2" },
+       { "varSigma", "varsigma2" },
+       { "varTheta", "vartheta2" },
+       { "varUpsilon", "varupsilon2" },
+       { "varXi", "varxi2" }
 };
 
+
 size_t const nr_sorted_png_map = sizeof(sorted_png_map) / sizeof(PngMap);
 
 

commit 9c33bddffa22c30497dc935c4a51a74ba9146613
Author: Georg Baum <b...@lyx.org>
Date:   Sun Dec 30 23:08:22 2012 +0100

    Let tex2lyx really produce format 458.

diff --git a/src/tex2lyx/test/CJK.lyx.lyx b/src/tex2lyx/test/CJK.lyx.lyx
index 3af9680..43ece81 100644
--- a/src/tex2lyx/test/CJK.lyx.lyx
+++ b/src/tex2lyx/test/CJK.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
diff --git a/src/tex2lyx/test/CJKutf8.lyx.lyx b/src/tex2lyx/test/CJKutf8.lyx.lyx
index 1472ff2..d79f60f 100644
--- a/src/tex2lyx/test/CJKutf8.lyx.lyx
+++ b/src/tex2lyx/test/CJKutf8.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
diff --git a/src/tex2lyx/test/Dummy Document.lyx b/src/tex2lyx/test/Dummy 
Document.lyx
index b610a88..37f658c 100644
--- a/src/tex2lyx/test/Dummy Document.lyx       
+++ b/src/tex2lyx/test/Dummy Document.lyx       
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
diff --git a/src/tex2lyx/test/DummyDocument.lyx 
b/src/tex2lyx/test/DummyDocument.lyx
index 38d6bc3..9b39116 100644
--- a/src/tex2lyx/test/DummyDocument.lyx
+++ b/src/tex2lyx/test/DummyDocument.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
diff --git a/src/tex2lyx/test/Dummy~Document.lyx 
b/src/tex2lyx/test/Dummy~Document.lyx
index 51ea560..12bcb19 100644
--- a/src/tex2lyx/test/Dummy~Document.lyx
+++ b/src/tex2lyx/test/Dummy~Document.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
diff --git a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx 
b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
index 2a41e69..b756a74 100644
--- a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
+++ b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx 
b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
index 1f63c36..d9a36a9 100644
--- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
+++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
diff --git a/src/tex2lyx/test/test-insets.lyx.lyx 
b/src/tex2lyx/test/test-insets.lyx.lyx
index 93d6526..a7bb689 100644
--- a/src/tex2lyx/test/test-insets.lyx.lyx
+++ b/src/tex2lyx/test/test-insets.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
@@ -1345,7 +1345,7 @@ kill
 \end_inset
 
  
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 
@@ -1426,7 +1426,7 @@ Second
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 
@@ -3338,7 +3338,7 @@ LyX
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 A long table
@@ -3363,7 +3363,7 @@ A long table
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 A long table -- continued
@@ -4348,7 +4348,7 @@ status open
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 
diff --git a/src/tex2lyx/test/test-modules.lyx.lyx 
b/src/tex2lyx/test/test-modules.lyx.lyx
index 8f33002..4895c7a 100644
--- a/src/tex2lyx/test/test-modules.lyx.lyx
+++ b/src/tex2lyx/test/test-modules.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass amsart
diff --git a/src/tex2lyx/test/test-structure.lyx.lyx 
b/src/tex2lyx/test/test-structure.lyx.lyx
index a7b04b3..11ec5d2 100644
--- a/src/tex2lyx/test/test-structure.lyx.lyx
+++ b/src/tex2lyx/test/test-structure.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
@@ -244,7 +244,7 @@ status open
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
  
@@ -278,7 +278,7 @@ status open
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 
@@ -322,7 +322,7 @@ status open
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 rotated table, spanning all columns
@@ -431,7 +431,7 @@ fdgsdfdh
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 test1
@@ -468,7 +468,7 @@ fdgs
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 test2
@@ -500,7 +500,7 @@ status open
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 fdg
@@ -556,7 +556,7 @@ status open
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 lkälöä
@@ -580,7 +580,7 @@ klöä
 \end_layout
 
 \begin_layout Plain Layout
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 ölkälö
@@ -627,7 +627,7 @@ u%re 1
 \end_layout
 
 \begin_layout Plain Layout
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 te%st
@@ -662,7 +662,7 @@ subfigure 2ö
 \end_layout
 
 \begin_layout Plain Layout
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 
@@ -698,7 +698,7 @@ subfigure 3
 
 \begin_layout Standard
 
-\begin_inset Caption
+\begin_inset Caption Standard
 
 \begin_layout Standard
 figure caption
diff --git a/src/tex2lyx/test/test.lyx.lyx b/src/tex2lyx/test/test.lyx.lyx
index a9bb1ec..44d58d5 100644
--- a/src/tex2lyx/test/test.lyx.lyx
+++ b/src/tex2lyx/test/test.lyx.lyx
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.1.0dev
-\lyxformat 457
+\lyxformat 458
 \begin_document
 \begin_header
 \textclass article
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index cdf2740..5df8ef2 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -2786,7 +2786,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, 
bool outer,
                        p.skip_spaces();
                        context.check_layout(os);
                        p.skip_spaces();
-                       begin_inset(os, "Caption\n");
+                       begin_inset(os, "Caption Standard\n");
                        Context newcontext(true, context.textclass, 0, 0, 
context.font);
                        newcontext.check_layout(os);
                        // FIXME InsetArgument is now properly implemented in 
InsetLayout
@@ -2838,7 +2838,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, 
bool outer,
                                        // we must make sure that the caption 
gets a \begin_layout
                                        os << "\n\\begin_layout Plain Layout";
                                        p.skip_spaces();
-                                       begin_inset(os, "Caption\n");
+                                       begin_inset(os, "Caption Standard\n");
                                        Context newcontext(true, 
context.textclass,
                                                           0, 0, context.font);
                                        newcontext.check_layout(os);

-----------------------------------------------------------------------

Summary of changes:
 development/tools/generate_symbols_images.py       |   41 ++++++++++++++-----
 src/frontends/qt4/GuiApplication.cpp               |   34 ++++++++++++++++-
 src/tex2lyx/test/CJK.lyx.lyx                       |    2 +-
 src/tex2lyx/test/CJKutf8.lyx.lyx                   |    2 +-
 src/tex2lyx/test/Dummy Document.lyx                |    2 +-
 src/tex2lyx/test/DummyDocument.lyx                 |    2 +-
 src/tex2lyx/test/Dummy~Document.lyx                |    2 +-
 src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx         |    2 +-
 .../test/box-color-size-space-align.lyx.lyx        |    2 +-
 src/tex2lyx/test/test-insets.lyx.lyx               |   12 +++---
 src/tex2lyx/test/test-modules.lyx.lyx              |    2 +-
 src/tex2lyx/test/test-structure.lyx.lyx            |   24 ++++++------
 src/tex2lyx/test/test.lyx.lyx                      |    2 +-
 src/tex2lyx/text.cpp                               |    4 +-
 14 files changed, 92 insertions(+), 41 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to