]> git.lyx.org Git - features.git/commitdiff
Allow Dia diagrams as external insets.
authorPavel Sanda <sanda@lyx.org>
Tue, 16 Dec 2008 16:07:07 +0000 (16:07 +0000)
committerPavel Sanda <sanda@lyx.org>
Tue, 16 Dec 2008 16:07:07 +0000 (16:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27899 a592a061-630c-0410-9148-cb99ea01b6c8

lib/configure.py
lib/external_templates

index 84bbdaf70993983310278c4527c2ff47269f135b..454f9aaa3ea8b4543c4a6ef21d03407f5993804e 100644 (file)
@@ -255,6 +255,9 @@ def checkFormatEntries(dtl_tools):
     checkViewer('a FIG viewer and editor', ['xfig', 'jfig3-itext.jar', 'jfig3.jar'],
         rc_entry = [r'\Format fig        fig     FIG                    "" "%%"        "%%"    "vector"'])
     #
+    checkViewer('a Dia viewer and editor', ['dia'],
+        rc_entry = [r'\Format dia        dia     DIA                    "" "%%"        "%%"    "vector"'])
+    #
     checkViewer('a Grace viewer and editor', ['xmgrace'],
         rc_entry = [r'\Format agr        agr     Grace                  "" "%%"        "%%"    "vector"'])
     #
@@ -284,6 +287,7 @@ def checkFormatEntries(dtl_tools):
 \Format docbook    sgml    DocBook                B  ""        "%%"    "document"
 \Format docbook-xml xml   "Docbook (XML)"         "" ""        "%%"    "document"
 \Format dot        dot    "Graphviz Dot"          "" ""        "%%"    "vector"
+\Format dia        dia    "Dia"                   "" "" "%%"    "vector"
 \Format platex     tex    "LaTeX (pLaTeX)"        "" "" "%%"    "document"
 \Format literate   nw      NoWeb                  N  ""        "%%"    "document"
 \Format lilypond   ly     "LilyPond music"        "" ""        "%%"    "vector"
@@ -503,6 +507,12 @@ def checkConverterEntries():
     checkProg('a Dot -> PDF converter', ['dot -Tpdf $$i -o $$o'],
         rc_entry = [ r'\converter dot        pdf        "%%"   ""'])
     #
+    checkProg('a Dia -> PNG converter', ['dia -e $$o -t png $$i'],
+        rc_entry = [ r'\converter dia        png        "%%"   ""'])
+    #
+    checkProg('a Dia -> EPS converter', ['dia -e $$o -t eps $$i'],
+        rc_entry = [ r'\converter dia        eps        "%%"   ""'])
+    #
     #
     path, lilypond = checkProg('a LilyPond -> EPS/PDF/PNG converter', ['lilypond'])
     if (lilypond != ''):
index d064b2f4d3a165b40fb8a0ddcda3606812f7c253..86ac7ec151c14e82e2b9fd0c5326957792ed0826 100644 (file)
@@ -328,3 +328,58 @@ Template Date
                UpdateResult "$$Tempname"
        FormatEnd
 TemplateEnd
+
+Template Dia
+       GuiName "Dia: $$AbsOrRelPathParent$$Basename"
+       HelpText
+               Dia diagram.
+       HelpTextEnd
+       InputFormat dia
+       FileFilter "*.dia"
+       AutomaticProduction true
+       # LyX has hard-coded support for these transformations
+       Transform Rotate
+       Transform Resize
+       Transform Clip
+       Transform Extra
+       Preview InstantPreview
+       Format LaTeX
+               TransformOption Rotate RotationLatexOption
+               TransformOption Resize ResizeLatexOption
+               TransformOption Clip   ClipLatexOption
+               TransformOption Extra  ExtraOption
+               Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
+               # This string is what is output to the LaTeX file.
+               Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
+               UpdateFormat eps
+               UpdateResult "$$AbsPath$$Basename.eps"
+               Requirement "graphicx"
+               ReferencedFile latex "$$AbsPath$$Basename.eps"
+               ReferencedFile dvi   "$$AbsPath$$Basename.eps"
+       FormatEnd
+       Format PDFLaTeX
+               TransformOption Rotate RotationLatexOption
+               TransformOption Resize ResizeLatexOption
+               TransformOption Clip   ClipLatexOption
+               TransformOption Extra  ExtraOption
+               Option Arg "[$$Extra,$$Rotate,$$Resize,$$Clip]"
+               Product "\\includegraphics$$Arg{$$AbsOrRelPathMaster$$Basename}"
+               UpdateFormat pdf
+               UpdateResult "$$AbsPath$$Basename.pdf"
+               Requirement "graphicx"
+               ReferencedFile pdflatex "$$AbsPath$$Basename.pdf"
+       FormatEnd
+       Format Ascii
+               Product "$$Contents(\"$$AbsPath$$Basename.asc\")"
+               UpdateFormat asciiimage
+               UpdateResult "$$AbsPath$$Basename.asc"
+       FormatEnd
+       Format DocBook
+               Product "<graphic fileref=\"$$AbsOrRelPathMaster$$Basename.eps\"></graphic>"
+               UpdateFormat eps
+               UpdateResult "$$AbsPath$$Basename.eps"
+               ReferencedFile docbook     "$$AbsPath$$Basename.eps"
+               ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
+       FormatEnd
+TemplateEnd
+