#include "tex2any.h"
#include "tex2rtf.h"
#include "rtfutils.h"
+#include "symbols.h"
#if (defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)) && !defined(NO_GUI)
#include "tex2rtf.xpm"
#endif
-const float versionNo = 2.0;
+const float versionNo = TEX2RTF_VERSION_NUMBER;
TexChunk *currentMember = NULL;
bool startedSections = FALSE;
bool Go(void);
void ShowOptions(void);
-#ifdef NO_GUI
+char wxTex2RTFBuffer[1500];
-#if wxUSE_GUI || !defined(__UNIX__)
-// wxBase for Unix does not have wxBuffer
-extern
-#endif
-char *wxBuffer; // we must init it, otherwise tex2rtf will crash
+#ifdef NO_GUI
int main(int argc, char **argv)
#else
}
#ifdef NO_GUI
- wxBuffer = new char[1500];
- // this is done in wxApp, but NO_GUI version doesn't call it :-(
-
if (!InputFile || !OutputFile)
{
- cout << "Tex2RTF: input or output file is missing.\n";
+ wxSTD cout << "Tex2RTF: input or output file is missing.\n";
ShowOptions();
exit(1);
}
if (InputFile)
{
- sprintf(buf, "Tex2RTF [%s]", FileNameFromPath(InputFile));
+ sprintf(buf, "Tex2RTF [%s]", wxFileNameFromPath(InputFile));
frame->SetTitle(buf);
}
frame->SetMenuBar(menuBar);
frame->textWindow = new wxTextCtrl(frame, -1, "", wxPoint(-1, -1), wxSize(-1, -1), wxTE_READONLY|wxTE_MULTILINE);
- (*frame->textWindow) << "Welcome to Julian Smart's LaTeX to RTF converter.\n";
+ (*frame->textWindow) << "Welcome to Tex2RTF.\n";
// ShowOptions();
#if wxUSE_HELP
// Return the main frame window
return TRUE;
#else
- delete[] wxBuffer;
return FALSE;
#endif
}
char *platform = "";
#endif
#endif
- sprintf(buf, "Tex2RTF Version %.2f%s\nLaTeX to RTF, WinHelp, HTML and wxHelp Conversion\n\n(c) Julian Smart 1999", versionNo, platform);
+ sprintf(buf, "Tex2RTF Version %.2f%s\nLaTeX to RTF, WinHelp, and HTML Conversion\n\n(c) Julian Smart, George Tasker and others, 1999-2002", versionNo, platform);
wxMessageBox(buf, "About Tex2RTF");
}
if (InputFile && OutputFile)
{
- if (!FileExists(InputFile))
+ if (!wxFileExists(InputFile))
{
OnError("Cannot open input file!");
TexCleanUp();
errorCount++;
#ifdef NO_GUI
- cerr << "Error: " << msg << "\n";
- cerr.flush();
+ wxSTD cerr << "Error: " << msg << "\n";
+ wxSTD cerr.flush();
#else
if (isInteractive && frame)
(*frame->textWindow) << "Error: " << msg << "\n";
else
#ifdef __UNIX__
{
- cerr << "Error: " << msg << "\n";
- cerr.flush();
+ wxSTD cerr << "Error: " << msg << "\n";
+ wxSTD cerr.flush();
}
#endif
#ifdef __WXMSW__
- wxError(msg);
+ wxLogError(msg);
#endif
Tex2RTFYield(TRUE);
#endif // NO_GUI
void OnInform(const char *msg)
{
#ifdef NO_GUI
- cout << msg << "\n";
- cout.flush();
+ wxSTD cout << msg << "\n";
+ wxSTD cout.flush();
#else
if (isInteractive && frame)
(*frame->textWindow) << msg << "\n";
else
#ifdef __WXMSW__
{
- cout << msg << "\n";
- cout.flush();
+ wxSTD cout << msg << "\n";
+ wxSTD cout.flush();
}
#endif
#ifdef __WXMSW__