2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
31 Format(string const & n, string const & e, string const & p,
33 name(n), extension(e), prettyname(p), shortcut(s) {};
49 Command(Format const * f, Format const * t, string const & c)
50 : from(f), to(t), command(c),
51 latex(false), original_dir(false), need_aux(false) {}
58 /// The converter is latex or its derivatives
60 /// Do we need to run the converter in the original directory?
62 /// This converter needs the .aux files
64 /// If the converter put the result in a directory, then result_dir
65 /// is the name of the directory
67 /// If the converter put the result in a directory, then result_file
68 /// is the name of the main file in that directory
70 /// Command to convert the program output to a LaTeX log file format
72 /// Backends in which the converter is not used
73 std::vector<string> disable;
75 /// Used by the BFS algorithm
77 /// Used by the BFS algorithm
78 std::vector<Command>::iterator previous;
84 Format const * format;
90 FormatPair(Format const * f1, Format const * f2, string c)
91 : format(f1), from(f2), command(c) {}
99 void Add(string const & name);
102 void Add(string const & name, string const & extension,
103 string const & prettyname, string const & shortcut);
106 void SetViewer(string const & name, string const & command);
109 bool View(Buffer const * buffer, string const & filename,
110 string const & format_name);
113 Format * GetFormat(string const & name);
116 string const PrettyName(string const & name);
119 string const Extension(string const & name);
123 std::map<string, Format> formats;
131 void Add(string const & from, string const & to,
132 string const & command, string const & flags);
137 std::vector<FormatPair> const
138 GetReachable(string const & from, string const & stop_format,
142 bool IsReachable(string const & from, string const & to);
145 bool Convert(Buffer const * buffer,
146 string const & from_file, string const & to_file_base,
147 string const & from_format, string const & to_format,
148 string const & using_format, string & to_file);
151 bool Convert(Buffer const * buffer,
152 string const & from_file, string const & to_file_base,
153 string const & from_format, string const & to_format,
154 string const & using_format = string());
157 string const SplitFormat(string const & str, string & format);
160 string const dvi_papersize(Buffer const * buffer);
163 string const dvips_options(Buffer const * buffer);
170 bool scanLog(Buffer const * buffer, string const & command,
171 string const & filename);
174 bool runLaTeX(Buffer const * buffer, string const & command);
177 std::vector<Command> commands;
180 string latex_command;